Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2613342pxy; Tue, 3 Aug 2021 10:28:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEod9x+eC2bdn1KoHaDUMgAYaOWMQY3f6zrRZTZhyyyOtifujSin+7nf1syDE34tKaTdih X-Received: by 2002:a17:906:5aca:: with SMTP id x10mr22235417ejs.414.1628011730572; Tue, 03 Aug 2021 10:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628011730; cv=none; d=google.com; s=arc-20160816; b=DqopmGSk7nsyitvN6f1r7nzOr4EfFSeoL6lav/TPQRlnvfh/2xxc5OJPwHjLNLxByv Mn3Qo1yCfr0wCgn++wauCHhjQOHP6PIlzKmqvjCoOvlMCYIK5VqPKrW/aDLSaY8rFdQf c8Zjfppcftr10ZTzYVpNp5K4itVrBmIG9eoKYxishKJIQnKOy3G1D5DzvWBeqA+D4p/m FJJdAXODJcitvLLmG7PW6aM4/g+AWcSDwBGZyrMLgWGp7ommVRjoCJ60lH+FBoHfr1jO LKOT06nSsqeBogPV0mHI67sY80KTtHIapW3XRDXkowL2DIuQszwDaNvlWEmo3KyaZ/7X 3l5g== 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=mXaWfCBJ15QkkxOL37ql3IzMIyK5Ar2gtetOmCZgwyA=; b=trZ9IT0eRzgLIMLEO6kY8GY8q0XnwGxae1PPOY3FtHh32CNJrWDTzedZHoljFh6LSa SREz6+mfheiFVZGarEmd3PG9D4jZZhHhUchQh2XjcOIh9y2LVbNstgc39bRwEH8mKZ06 9D2h7D2sDQOADwZ2cR7xyX9oDtkp/RovG+92mTQoWmosJNkyw3bAY38KylCrUvVIK8Ce plcRzNDob4IrK8XzwUOdFo+0GwwiPOOY6RtO/ib4yNqHHkwnOi7w9ewNhhMnrIv7hEqu tosP7d5BZpCAvRa164K+A+FFn7weSKqZryfhL661db+JiTW0NjSGWhP6zUyh9NETueVZ frYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KWMW7mCY; 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 l3si16007942ejd.407.2021.08.03.10.28.26; Tue, 03 Aug 2021 10:28:50 -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=KWMW7mCY; 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 S238208AbhHCRZ5 (ORCPT + 99 others); Tue, 3 Aug 2021 13:25:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238173AbhHCRZz (ORCPT ); Tue, 3 Aug 2021 13:25:55 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8E65C061757; Tue, 3 Aug 2021 10:25:42 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id x8so27679670lfe.3; Tue, 03 Aug 2021 10:25:42 -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=mXaWfCBJ15QkkxOL37ql3IzMIyK5Ar2gtetOmCZgwyA=; b=KWMW7mCYEw1voGvv4a+mwkTa09OVWeawTceZ/yFz2Z5f8F8RvD07gJ03MY7vc2Hux3 un15tOYhrLvMQKk8VqxSqoVHWNxU85Qwg8Z2Tg2t+EFDe59oFyWZUNxte3qK1wpwyq4N hb0Q7le1VxFi22b4Ps42pB+AzKCCe0hLiyS//sfStWga1fBcVqO0LD6Fb15DlmyK8fLc uFBmQ8Ip0BuriyTyRdDzAodlF8ptgfQlkQy+tFeAQNfLjZ5gLDrtkgAc2OKfrTdSMUjP tksxrHyTFUu0vrIZ5r+4HGWRm4OVtP/1oA2XPGiALuA2TCVSElwLdI/POVMcLMPqRop0 t/bA== 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=mXaWfCBJ15QkkxOL37ql3IzMIyK5Ar2gtetOmCZgwyA=; b=oNNMfY7fwOqadCjwjq7H3zSc+ZKAK+mGMuQTjx02OH9YaiWu65kyV9eYt7VGNYzL2o HsLp6VrpRX7p/p8+NL/+8JBXIG2MMnyIWEvCliJGoCNSzqmfnxs6nezmnPSraWVMNUBy BdwNsuAWY78AQZJp950BAh7ZWLygs95fPtXPau+V7BUdW44Dow7McmxErF36LGQ2uQ/k SA4adMR2bWDqzsDD7UC+PKQK3tjHFdwHjfTTnSA0mMhVQZrq7z1qeoq9kPqSFwFzSa0h VPwd6jbjMkplL9flarT86F2ODvb2ctNoswJYlbJlnnNzv8LZo+Pdl+1IiCqAzH+4DXNe 4VVQ== X-Gm-Message-State: AOAM531YjDYizB3bJefgP5dvYAq8y8LBZVr6pSWMa4yl7+NqIgj/9kZV YjOruVh401b+ejyCpYx2Y/Q42yGkXPBwFbqm6GQYSA== X-Received: by 2002:ac2:484c:: with SMTP id 12mr8732399lfy.31.1628011541066; Tue, 03 Aug 2021 10:25:41 -0700 (PDT) Received: from nergzd-desktop.localdomain ([62.122.67.26]) by smtp.gmail.com with ESMTPSA id g11sm1147618ljl.139.2021.08.03.10.25.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 10:25:40 -0700 (PDT) From: Markuss Broks To: linux-kernel@vger.kernel.org Cc: linus.walleij@linaro.org, phone-devel@vger.kernel.org, Markuss Broks , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org Subject: [PATCH v2] drm/panel: s6d27a1: Add driver for Samsung S6D27A1 display panel Date: Tue, 3 Aug 2021 20:24:50 +0300 Message-Id: <20210803172458.10971-1-markuss.broks@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 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 to a working state; 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 --- drivers/gpu/drm/panel/Kconfig | 8 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-samsung-s6d27a1.c | 323 ++++++++++++++++++ 3 files changed, 332 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-samsung-s6d27a1.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index f4fe1dba99..21007b2032 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -348,6 +348,14 @@ 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. + 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 d94c27df17..d2a6fe81e9 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -35,6 +35,7 @@ obj-$(CONFIG_DRM_PANEL_RAYDIUM_RM68200) += panel-raydium-rm68200.o obj-$(CONFIG_DRM_PANEL_RONBO_RB070D30) += panel-ronbo-rb070d30.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..073454349d --- /dev/null +++ b/drivers/gpu/drm/panel/panel-samsung-s6d27a1.c @@ -0,0 +1,323 @@ +// 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