Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EF74BC7619A for ; Mon, 27 Mar 2023 08:16:08 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 818258609B; Mon, 27 Mar 2023 10:14:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PWurZzNz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 88F1786093; Mon, 27 Mar 2023 10:13:01 +0200 (CEST) Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0813C8609F for ; Mon, 27 Mar 2023 10:12:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=clamor95@gmail.com Received: by mail-lj1-x234.google.com with SMTP id by8so7951041ljb.12 for ; Mon, 27 Mar 2023 01:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679904750; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Bx48cZIh4sBlTswEfqv/Z7eZAHmsEoH/0IdIM61/DYU=; b=PWurZzNzebn+NY04yzBxFviOPbtJvAf207FHd+H0VNEi+RwOI/+qB7z6EH4KS9Q+IX W2WyaI3dufC0JMMhxopcaP3OR1uo6SOV5iOPMm3AO2adP8h/rJyLMxTJXB9zAPsNd+n9 /ety1WdPsRy3HwuG9DJOV/I/QBkvdULU76cJRprlj5LGUzkS8hV3e743LoqOvYhVVb+M b2uGxQ2DXoujwjykHmexlsiPUvCKcglFpwwTfo6L00P76lQ1tutXEl9fRj1R6v+m4yuu JFTLELFE63EqOvjbKGFKBaBlQASbbuQM9qs9Z2fP+DAEzqjYGTnME+z933MJjeOtTqAZ b7Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679904750; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Bx48cZIh4sBlTswEfqv/Z7eZAHmsEoH/0IdIM61/DYU=; b=A54Ly3SMSytvr+zq/oqYaemhj/TgXumMJLDDg8cXtQbqxIScv/fl1YK7wx7clFfU1m KzdA9OTiv/pZCnbs/27Umy13+YRXQv7LaVaPk7xLrR58rbMMvh98VUgG1XIw3hw/ShIU eH8g+2aB/H7ZVIvhL7PPPI4NDfvP//mTrXev1Ge/mzu6edwpYrYwkryOPvNC0tFQ3pnH JsHdXLDEP6uf9lZfMEyUxThLbu5IyfV0/JQ57fldc1Ghoor8HvoeGDs7A8Kmhd42BocZ GNNoha7vj2NuOdENcMSGiSwtEEB6NMRMeH3fo3OFU92dXZOa9vS2qFj7ypMccn8aLzP/ at7Q== X-Gm-Message-State: AAQBX9fpeFKFJYPF54HpyNKmhPRWoXpp0P+coSwh63ed/j3Jk0kn+ptP iKJhTXlZCbZhH2RcLGtrktA= X-Google-Smtp-Source: AKy350Y1eN0ZFPvMMr2Sgqu6Kej3ypIM1O87KlFkhhgOskrVWG2u2mHWCQ33JFFK0TlG7mgt9oydaQ== X-Received: by 2002:a2e:99c6:0:b0:29b:d29d:c781 with SMTP id l6-20020a2e99c6000000b0029bd29dc781mr3846496ljj.19.1679904750105; Mon, 27 Mar 2023 01:12:30 -0700 (PDT) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id z2-20020a2e8402000000b002a32238ea10sm1460263ljg.53.2023.03.27.01.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 01:12:29 -0700 (PDT) From: Svyatoslav Ryhel To: Tom Warren , Anatolij Gustschin , Simon Glass , Svyatoslav Ryhel , Marcel Ziswiler , Thierry Reding , Maxim Schwalm , Dmitry Osipenko , Nicolas Chauvet Cc: u-boot@lists.denx.de Subject: [PATCH v3 11/11] simple_panel: support simple MIPI DSI panels Date: Mon, 27 Mar 2023 11:11:50 +0300 Message-Id: <20230327081150.4585-12-clamor95@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230327081150.4585-1-clamor95@gmail.com> References: <20230327081150.4585-1-clamor95@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Re-use simple panel driver for MIPI DSI panels which do not require additional DSI commands for setup. Tested-by: Robert Eckelmann # ASUS TF101 T20 Tested-by: Nicolas Chauvet # Paz00 Tested-by: Andreas Westman Dorcsak # ASUS TF700T T30 Signed-off-by: Svyatoslav Ryhel --- drivers/video/simple_panel.c | 37 ++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/drivers/video/simple_panel.c b/drivers/video/simple_panel.c index 5a8262669a..81fcafb9f5 100644 --- a/drivers/video/simple_panel.c +++ b/drivers/video/simple_panel.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -18,6 +19,19 @@ struct simple_panel_priv { struct gpio_desc enable; }; +/* List of supported DSI panels */ +enum { + PANEL_NON_DSI, + PANASONIC_VVX10F004B00, +}; + +static const struct mipi_dsi_panel_plat panasonic_vvx10f004b00 = { + .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | + MIPI_DSI_CLOCK_NON_CONTINUOUS, + .format = MIPI_DSI_FMT_RGB888, + .lanes = 4, +}; + static int simple_panel_enable_backlight(struct udevice *dev) { struct simple_panel_priv *priv = dev_get_priv(dev); @@ -96,6 +110,8 @@ static int simple_panel_of_to_plat(struct udevice *dev) static int simple_panel_probe(struct udevice *dev) { struct simple_panel_priv *priv = dev_get_priv(dev); + struct mipi_dsi_panel_plat *plat = dev_get_plat(dev); + const u32 dsi_data = dev_get_driver_data(dev); int ret; if (IS_ENABLED(CONFIG_DM_REGULATOR) && priv->reg) { @@ -105,6 +121,16 @@ static int simple_panel_probe(struct udevice *dev) return ret; } + switch (dsi_data) { + case PANASONIC_VVX10F004B00: + memcpy(plat, &panasonic_vvx10f004b00, + sizeof(panasonic_vvx10f004b00)); + break; + case PANEL_NON_DSI: + default: + break; + } + return 0; } @@ -123,15 +149,18 @@ static const struct udevice_id simple_panel_ids[] = { { .compatible = "lg,lb070wv8" }, { .compatible = "sharp,lq123p1jx31" }, { .compatible = "boe,nv101wxmn51" }, + { .compatible = "panasonic,vvx10f004b00", + .data = PANASONIC_VVX10F004B00 }, { } }; U_BOOT_DRIVER(simple_panel) = { - .name = "simple_panel", - .id = UCLASS_PANEL, - .of_match = simple_panel_ids, - .ops = &simple_panel_ops, + .name = "simple_panel", + .id = UCLASS_PANEL, + .of_match = simple_panel_ids, + .ops = &simple_panel_ops, .of_to_plat = simple_panel_of_to_plat, .probe = simple_panel_probe, .priv_auto = sizeof(struct simple_panel_priv), + .plat_auto = sizeof(struct mipi_dsi_panel_plat), }; -- 2.37.2