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 2204FC636CC for ; Mon, 20 Feb 2023 09:57:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 02B678582C; Mon, 20 Feb 2023 10:57:53 +0100 (CET) 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="kfDvhJX9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1CC57857B1; Mon, 20 Feb 2023 10:55:16 +0100 (CET) Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) (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 61E7485938 for ; Mon, 20 Feb 2023 10:54:57 +0100 (CET) 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-ed1-x532.google.com with SMTP id g1so2042247edz.7 for ; Mon, 20 Feb 2023 01:54:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=2J2VjlMOK6LhD0HhkPTCObeRz5WPpfm2zdnsOFnIub8=; b=kfDvhJX956NdD/IigTQduz0BV2QV/C2sj6sU3awYSbo7A5KUSMtF0buD0zMhQt128T iimoWirbeHPqU1yY1pxAjVl0CseGmuOlFHuxNwKcGP7hYQ4H7zUMLi3e0/qwr02LpAKr uXhPrqA0AdKJJFLY9FmdOVuATyNe/hMZ74dAVkaCenigjrXgqVNvM4dxuOLljjpqrsUf 2IWNDV3haZM8A9IC/3hKSHN7rhG6l6kLwL7Ivey+LbJN9dyUuqNiz1N30odYlYPo8eM4 XJGIC5KnY5KhlAE6x5pQ5ePCruM2G+ATbR1DtyY0LCXn6UODbDOx9Mg3Y+MqGpew4YpK A9og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=2J2VjlMOK6LhD0HhkPTCObeRz5WPpfm2zdnsOFnIub8=; b=umBz5YKak+l1qouLitiGrRv/EIyzISp2XqfOa9zaSMZ7u3fu8oZHEiyKY2TegbG78c K6foQ24lVkHtDiPSsr4hAoW/hWBzkw6GVpa9t0uorT2zaJjOZ3HEtrE0PBcFUVRvHXq8 LJ/BZd/S7RmDtyMCNJMq7doN8TU6zDuRXXLzXZ6MNzJjm8g4dY5Uq7whfprRzdMSLKi+ Fhm89bca9Q4itduVIk80Asr3TrpvbpVJsMhxfVB1a2QBqghyW0btUre4MhI8pvcb+qQ2 17Epo3sJpVlneEwoNQ+H/uRVHkLRzEpsV2HS2HxOaBgprXkgOhwZfA2+O12NpZoF1A8A QOLg== X-Gm-Message-State: AO0yUKUD6tcleGxWXbf9qxzSRQbOcerYNv0FEEiUfIdEUAdI4lAX45Cw KIFRN4po7KqBOzTZRjh1UeTtz8yHfq0= X-Google-Smtp-Source: AK7set+pjL4NTkTeXPH0NfeTyiLRiQjdyN2L+n4rMkfgFUK85nWLQrznrvdVn1FQkyIEuJ7fCPt3Qw== X-Received: by 2002:a17:907:a0d5:b0:8b8:c06e:52d8 with SMTP id hw21-20020a170907a0d500b008b8c06e52d8mr12136289ejc.36.1676886897017; Mon, 20 Feb 2023 01:54:57 -0800 (PST) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id bk7-20020a170906b0c700b008cd37aff603sm1636536ejb.164.2023.02.20.01.54.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 01:54:56 -0800 (PST) From: Svyatoslav Ryhel To: Tom Warren , Anatolij Gustschin , Simon Glass , Svyatoslav Ryhel , Marcel Ziswiler , Thierry Reding , Maxim Schwalm , Dmitry Osipenko Cc: u-boot@lists.denx.de Subject: [PATCH v1 11/11] simple_panel: support simple MIPI DSI panels Date: Mon, 20 Feb 2023 11:54:25 +0200 Message-Id: <20230220095425.6198-12-clamor95@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230220095425.6198-1-clamor95@gmail.com> References: <20230220095425.6198-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.6 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: 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