Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp1297519pxt; Sat, 7 Aug 2021 06:33:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzt77u11z+POn+1sRbP9kM1w4IiZ05bcqDyEPIb2aFSzMP8wEZWnPIqyeT89T4xVI3xNK37 X-Received: by 2002:a05:6e02:1d89:: with SMTP id h9mr61552ila.46.1628343223916; Sat, 07 Aug 2021 06:33:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628343223; cv=none; d=google.com; s=arc-20160816; b=MiUiBgaiVdp+MfnFcVmXbUeeiUvpYA18a83ySBMEJRCLLaexToMyAR3KvVrgSiCLdZ /vmljeLLgVfC9gUvla/HOnr5TsXnUwPqQUzbwM4xAdpq1vE0meiqtKAYuxNcEIaZ0iBx ifx977um2Os1lJ0Q412t2P7vb8+8AWwgH+xAXU/gdmoExoIXP8PnTOJPyI7XHmj/JYN9 nJ9D4AaSppcHgUQc6qXaNldjSM4CDEdex+fFntL2/l2wQrqvF975xu2Fy4Bz5KRjlvee ba5y0jXNBtk8D2cAz0mmIMjem/j8fzOo7DxbT/r88pXzODLYkrTtWDWl9rR9WWGlFcO3 l+fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LiOrxwAHkdxfg8HfRNMyQLy98TsOKpCMJN7iwKcTkc4=; b=IFVzdhn7jqJVixCXJrsaEIfupwdfakgLdekPGvXZovs2cQ9tTWKsg6iCvCc85r9nDJ UJ1FN4lHT92+2MoFbrM+Zgv37P8GvXPeC0g/pWc97DU58NZ+Ev9eRlsg6vxiQf0gCJHt 8/oTuAb3nH98kKONpXqm6WPmUIxw+yCQ3NN13xF4FODpVKF8Iq5GMQbVO0YnjYTLyIBa +47hrdBiSokg4ub1w7BR/2l9seG/9g+dC+hI8gBPF3o4Dgo1VLTeZdhPJAsy7VIWfGLI Iro+cZucfrxirZMyPHdPKMhK09MgVI6QLf9tvkuVkm17hPaahziRPf0E+rx5k/tKAErq dHRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cb7UTgDV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m43si1454499jav.124.2021.08.07.06.33.32; Sat, 07 Aug 2021 06:33:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cb7UTgDV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232359AbhHGNbs (ORCPT + 99 others); Sat, 7 Aug 2021 09:31:48 -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-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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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