From patchwork Sat Aug 7 13:31:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markuss Broks X-Patchwork-Id: 493739 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C126DC4320A for ; Sat, 7 Aug 2021 13:31:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A019F610FB for ; Sat, 7 Aug 2021 13:31:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232301AbhHGNbo (ORCPT ); Sat, 7 Aug 2021 09:31:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232299AbhHGNbn (ORCPT ); Sat, 7 Aug 2021 09:31:43 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80863C0613CF; Sat, 7 Aug 2021 06:31:25 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id z4so14875011wrv.11; Sat, 07 Aug 2021 06:31:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kk2TIJBnBsHrY0AgCcZBpUvM/otmEEmZg6Qy6Fa8m0w=; b=mcZnW5oS+yRq1JQFhADJdjJ+Qm3qDs+lxYg17QHokll9uTbhTK//RiWJo+aHcMksu+ 8VWX31qHEedTdcshDWsou2q6xut1GrDetkPpVyphRKnjLbb/I04knHy4Pu2ufVmNjcJN zG9mx5k03gNJuzyK/p6y9/pwc7hP2a9k21pUsMavxza9N+OctSkQ4jDsL4KxkxoPm3K+ koBlnyHfNzIrHqN6AQTfroHl9viudqj6hl56/CnhtHFVohrA9CG0jkHruMaRfyGbliPa eOjKI6OM3Q5R0jNQHktDE2168ug8DN+ZbUDwXkxejOEbQb/XNuaxkJ/2wDyZWiHUPlGx YICA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kk2TIJBnBsHrY0AgCcZBpUvM/otmEEmZg6Qy6Fa8m0w=; b=F+8/AtFY0ksCtCY1IPl2d/NTLKpoOlZoz1qmkLO4Lny1EFvmr2/ICOXDn8/gs1QsGA OS03xvW2ynFDoKQ/615PVzkF9e3BFfPI1feShkLjM8gOI3FHLgKV6Jm67OdJUDh6e/KG 41NaF+grNqC4IDqQLNjQVVaGaNLSzvahpSXpaWhofwmuOFVjU69uQzTYGVvQutc1QnTF ji6fSxZBenKvM6vD6YKfgG2FNZysWebnYIDDu8A6C+z5T59dIcZSkaIX2gi0pvlBksGS PjAm5fdseMvHwaE7CnjEF0pl6BP/JShhcbnFPom3N/srI62pAc4CjE2YbifAdGArrsJw 4uGw== X-Gm-Message-State: AOAM533Cp1JAeUxd9wnT6hIECFIb86k6Xd/y4ZlhGyVEhaw+rWxoA2SN k4A1YBS7SKlOj1fST26Kxo/UE0NxIIFSS9ht X-Google-Smtp-Source: ABdhPJyKb3aiwWpDg94pDY+FHs78zd+4PsHG9ofn+rnRt8EnDFCf7TEcA3wtFnsf47dGAKd0uJodnw== X-Received: by 2002:adf:cf07:: with SMTP id o7mr15662037wrj.216.1628343084070; Sat, 07 Aug 2021 06:31:24 -0700 (PDT) Received: from nergzd-desktop.localdomain ([62.122.67.26]) by smtp.gmail.com with ESMTPSA id x12sm13254454wrt.35.2021.08.07.06.31.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Aug 2021 06:31:23 -0700 (PDT) From: Markuss Broks To: linux-kernel@vger.kernel.org Cc: thierry.reding@gmail.com, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linus.walleij@linaro.org, phone-devel@vger.kernel.org, Markuss Broks Subject: [PATCH v2 1/2] drm/panel: Add DT bindings for Samsung S6D27A1 display panel Date: Sat, 7 Aug 2021 16:31:10 +0300 Message-Id: <20210807133111.5935-2-markuss.broks@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210807133111.5935-1-markuss.broks@gmail.com> References: <20210807133111.5935-1-markuss.broks@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This adds device-tree bindings for the Samsung S6D27A1 RGB DPI display panel. Signed-off-by: Markuss Broks v1 -> v2: changed additionalProperties to unevaluatedProperties; added vci-supply and vccio-supply as required; Reviewed-by: Rob Herring --- .../display/panel/samsung,s6d27a1.yaml | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/samsung,s6d27a1.yaml diff --git a/Documentation/devicetree/bindings/display/panel/samsung,s6d27a1.yaml b/Documentation/devicetree/bindings/display/panel/samsung,s6d27a1.yaml new file mode 100644 index 0000000000..26e3c820a2 --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/samsung,s6d27a1.yaml @@ -0,0 +1,98 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/samsung,s6d27a1.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Samsung S6D27A1 display panel + +description: The S6D27A1 is a 480x800 DPI display panel from Samsung Mobile + Displays (SMD). The panel must obey the rules for a SPI slave device + as specified in spi/spi-controller.yaml + +maintainers: + - Markuss Broks + +allOf: + - $ref: panel-common.yaml# + +properties: + compatible: + const: samsung,s6d27a1 + + reg: true + + interrupts: + description: provides an optional ESD (electrostatic discharge) + interrupt that signals abnormalities in the display hardware. + This can also be raised for other reasons like erroneous + configuration. + maxItems: 1 + + reset-gpios: true + + vci-supply: + description: regulator that supplies the VCI analog voltage + usually around 3.0 V + + vccio-supply: + description: regulator that supplies the VCCIO voltage usually + around 1.8 V + + backlight: true + + spi-cpha: true + + spi-cpol: true + + spi-max-frequency: + maximum: 1200000 + + port: true + +required: + - compatible + - reg + - vci-supply + - vccio-supply + - spi-cpha + - spi-cpol + - port + +unevaluatedProperties: false + +examples: + - | + #include + #include + + spi { + compatible = "spi-gpio"; + sck-gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + miso-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio 2 GPIO_ACTIVE_HIGH>; + cs-gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; + num-chipselects = <1>; + #address-cells = <1>; + #size-cells = <0>; + panel@0 { + compatible = "samsung,s6d27a1"; + spi-max-frequency = <1200000>; + spi-cpha; + spi-cpol; + reg = <0>; + vci-supply = <&lcd_3v0_reg>; + vccio-supply = <&lcd_1v8_reg>; + reset-gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + interrupt-parent = <&gpio>; + interrupts = <5 IRQ_TYPE_EDGE_RISING>; + + port { + panel_in: endpoint { + remote-endpoint = <&display_out>; + }; + }; + }; + }; + +... From patchwork Sat Aug 7 13:31:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markuss Broks X-Patchwork-Id: 493437 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06CD0C432BE for ; Sat, 7 Aug 2021 13:31:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E033D60EC0 for ; Sat, 7 Aug 2021 13:31:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232339AbhHGNbr (ORCPT ); Sat, 7 Aug 2021 09:31:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232300AbhHGNbp (ORCPT ); Sat, 7 Aug 2021 09:31:45 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AB4DC0613CF; Sat, 7 Aug 2021 06:31:27 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id o1-20020a05600c5101b02902e676fe1f04so625777wms.1; Sat, 07 Aug 2021 06:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LiOrxwAHkdxfg8HfRNMyQLy98TsOKpCMJN7iwKcTkc4=; b=cb7UTgDVLFRFsvyvM+fDrCR18753WvEFglxprEWJ9H3muoKQ24dwWERa5KCKGji0Z7 DGKHgW6bYHB07fSmDvaiofNBDsIgYyrJfqAT4S06bkPePurh7fP/pGSjFBKsv4/RFCOf 4WcCqeBAtC3tRaGkW22Bj0lJf5ttxpE0g2PHUKDwiVSQs+vB2fT9xkGMUaA78c+okPOn PJUpQ9mqRSpCJVPr+AxZP4tl3ZApDSSP2d+1f1Nh9M08cKO2fdpQoJl7P977tKwtkQPh pZui0SFd3ZCi+xaSNaTtrR5vHEH7skRqKzZBlk2SPzxcdVPUMfq6zs+wnZU6fibQm8dn iwaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LiOrxwAHkdxfg8HfRNMyQLy98TsOKpCMJN7iwKcTkc4=; b=geNBT29cpxfLcMr1JBfPi6/sXAjwNPHxGSJgDV+NSzr1d2dvW7eyEEwG//pdFbrzUz I9q4mSzkIWGO5Os1BvP/rvgPxEK1z3Xs/FoGYvUKw3dhcy9u7U2L1lN0kRTChVcYvD4p zCda+EqIJMnM1cGlnVkwd7FItnh8YCb4kmT7z6nofcqL3lbrpG4GU+40hqB8gs7HJZtt Zwd/JEEYU0IAcVzfLczkgrw4sDKT4nfUjyHj0QcNA2uB5Ft/3lICG+zSi0lNDMiKYogj m+HaGnlDOhj0CiiklqkfPFA9R4gT/TgDjnW17lP9zqqxJOnImHCFA81l9usLdmIxtWv5 1dUw== X-Gm-Message-State: AOAM530KaxxbMPU8upIETvfuqLCtWoqifhyu6hMkkZgLlqoVUhVdDVKd RQBwR5lzJYSlFxgIjHxpQXtvjsMIgbUvA/wN X-Google-Smtp-Source: ABdhPJw0tTthkQyHiF2W/mgV2Kge0fqMW+SRjL8mV4CWfnFd9bFxXsTKBouhT39l4iM55bGHn38lvw== X-Received: by 2002:a7b:c083:: with SMTP id r3mr8241822wmh.65.1628343085639; Sat, 07 Aug 2021 06:31:25 -0700 (PDT) Received: from nergzd-desktop.localdomain ([62.122.67.26]) by smtp.gmail.com with ESMTPSA id x12sm13254454wrt.35.2021.08.07.06.31.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Aug 2021 06:31:25 -0700 (PDT) From: Markuss Broks To: linux-kernel@vger.kernel.org Cc: thierry.reding@gmail.com, airlied@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linus.walleij@linaro.org, phone-devel@vger.kernel.org, Markuss Broks Subject: [PATCH v2 2/2] drm/panel: s6d27a1: Add driver for Samsung S6D27A1 display panel Date: Sat, 7 Aug 2021 16:31:11 +0300 Message-Id: <20210807133111.5935-3-markuss.broks@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210807133111.5935-1-markuss.broks@gmail.com> References: <20210807133111.5935-1-markuss.broks@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This adds a driver for Samsung S6D27A1 display controller and panel. This panel is found in the Samsung GT-I8160 mobile phone, and possibly some other mobile phones. This display needs manufacturer commands to configure it; the commands used in this driver were taken from downstream driver by Gareth Phillips; sadly, there is almost no documentation on what they actually do. This driver re-uses the DBI infrastructure to communicate with the display. This driver is heavily based on WideChips WS2401 display controller driver by Linus Walleij and on other panel drivers for reference. Signed-off-by: Markuss Broks v2 -> v3: fixed checkpatch warnings - not sure about MAINTAINERS, should I put my name up there? v3 -> v4: - add a MAINTAINERS entry; - drop s6d27a1_command macro; use mipi_dbi_command directly; - dropped "panel initialized" dev_dbg message; - add drm_panel_of_backlight call to handle backlight on panel turn on/off; - reorder drm_mipi_dbi and drm_modes headers: I think they should be in alphabetic order? --- MAINTAINERS | 6 + drivers/gpu/drm/panel/Kconfig | 11 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-samsung-s6d27a1.c | 320 ++++++++++++++++++ 4 files changed, 338 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-samsung-s6d27a1.c diff --git a/MAINTAINERS b/MAINTAINERS index 851255b71c..c363209130 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5962,6 +5962,12 @@ T: git git://anongit.freedesktop.org/drm/drm-misc F: Documentation/devicetree/bindings/display/panel/samsung,lms397kf04.yaml F: drivers/gpu/drm/panel/panel-samsung-db7430.c +DRM DRIVER FOR SAMSUNG S6D27A1 PANELS +M: Markuss Broks +S: Maintained +F: Documentation/devicetree/bindings/display/panel/samsung,s6d27a1.yaml +F: driver/gpu/drm/panel/panel-samsung-s6d27a1.c + DRM DRIVER FOR SITRONIX ST7703 PANELS M: Guido Günther R: Purism Kernel Team diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index beb581b96e..0b37849413 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -392,6 +392,17 @@ config DRM_PANEL_SAMSUNG_S6D16D0 depends on DRM_MIPI_DSI select VIDEOMODE_HELPERS +config DRM_PANEL_SAMSUNG_S6D27A1 + tristate "Samsung S6D27A1 DPI panel driver" + depends on OF && SPI && GPIOLIB + select DRM_MIPI_DBI + help + Say Y here if you want to enable support for the Samsung + S6D27A1 DPI 480x800 panel. + + This panel can be found in Samsung Galaxy Ace 2 + GT-I8160 mobile phone. + config DRM_PANEL_SAMSUNG_S6E3HA2 tristate "Samsung S6E3HA2 DSI video mode panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index c8132050bc..60c0149fc5 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -39,6 +39,7 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_ATNA33XC20) += panel-samsung-atna33xc20.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_DB7430) += panel-samsung-db7430.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D16D0) += panel-samsung-s6d16d0.o +obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D27A1) += panel-samsung-s6d27a1.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2) += panel-samsung-s6e3ha2.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0) += panel-samsung-s6e63m0.o diff --git a/drivers/gpu/drm/panel/panel-samsung-s6d27a1.c b/drivers/gpu/drm/panel/panel-samsung-s6d27a1.c new file mode 100644 index 0000000000..2dfcf48f2b --- /dev/null +++ b/drivers/gpu/drm/panel/panel-samsung-s6d27a1.c @@ -0,0 +1,320 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Panel driver for the Samsung S6D27A1 480x800 DPI RGB panel. + * Found in the Samsung Galaxy Ace 2 GT-I8160 mobile phone. + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include