Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2332930pxy; Tue, 3 Aug 2021 03:59:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwURF9wvWpQvb077g5SAIz32ZkqRh+b8AkfDqz+XxVTwvkYryeiJeJXU2kYxsorNXmQRzcx X-Received: by 2002:aa7:cdcc:: with SMTP id h12mr24598376edw.39.1627988369073; Tue, 03 Aug 2021 03:59:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627988369; cv=none; d=google.com; s=arc-20160816; b=zCZFoCfKR7q5CiHI8wmf1lvyxiG/36JmkEac0RNzHO32VvnW2nDAiI3F2HKXXeoXBx SzD9yIH7vD4zm0IjDDDZYRXx5IB2OwTEFP2x7dOpwDMzlMEK1iVR26eJLjMm8qGFrpyT ETQYhWmNWvhW1Ux03RWwZMJHOCj21zDTprpx0ZuHS4vXdLWDREHGgTKbuXoxIYqxyYqg UM45IYHgmFNbBT5Ln5+g383EMsCS3EogTQwG5Bjko9QDFBnri9KdpzfQ6kt9LXOG/nL8 X0PoPe4HrQWWJU5Ix/7OUJfSzwdf1Ie43uPo8xuI7/ArNFnTyLK+oBOR/w/NI2h7mhLM gukQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=2KXoDmkCLy0mtIQV8YEk8GnrTc8AcGvkB/pIX44UiII=; b=Y8O2MTRH72e4CPu35HSHnc7l0CoL4jusUyo8u7TUu3nDQpkfIC1SzdGKGG/ztgpa2/ YKsNQ2jpVVy9mOmGhEHqnLqox0cd+TU+ZSkEEGRPLjfALx4hTOlztRPKXtZveD0QHuqR ZpCVrc0bxQU0MBQWS2VI3OE9lG1VAXtZ/XAcjoNcYmOmQZ5sipXeKs/CZapc6WklVcbe 1DSBxDVA8HtuV1z444FwqPpnn9gYjaOvpCn9YjiFh19Fx48bBeJaCgOq66Fv0uMKz6+y MJx4pv4HBG8k7N0aiXWUvOygnyQeKvvCyYgtl/m6ATTUO2st6FXXAiDmgo9TM6so6CrH Seyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=s4yF3mnI; 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 p1si12090962ejm.169.2021.08.03.03.59.03; Tue, 03 Aug 2021 03:59:29 -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=s4yF3mnI; 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 S235398AbhHCKzL (ORCPT + 99 others); Tue, 3 Aug 2021 06:55:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234904AbhHCKzK (ORCPT ); Tue, 3 Aug 2021 06:55:10 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84254C061757; Tue, 3 Aug 2021 03:54:59 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id h14so38985090lfv.7; Tue, 03 Aug 2021 03:54:59 -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:mime-version :content-transfer-encoding; bh=2KXoDmkCLy0mtIQV8YEk8GnrTc8AcGvkB/pIX44UiII=; b=s4yF3mnIh0RL5KmUYYq24h3pLph3YZbj1gPyWqm4zVuxOWCNWpCoFuIEyrZsLwQ1Nb 532qFhGKH+82BDDc+eSur6zrCII+gDVC31Hdi4ek3lSsgPcgVnuZdmsP8RMam/XuGsPA iaCCCSVuQ7edhUM7JegfRnq60ND5h+9lvlJaA1c6fTpB2uqRNher8IdS5/BmqC4l5M+V kkgaaJ0i0W7YXv5zFdbCfIeeq/O8J3MYLJDtswk7eY+rWR/Z56u/VTfH6mlxwpqsShV6 Rv+/g0jUPpEAm8iZngoQz5X7fIQy4iDC7v7q5l6b/IprK8OHSWLnF+rG9IwOEcXFUr1w SHGw== 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:mime-version :content-transfer-encoding; bh=2KXoDmkCLy0mtIQV8YEk8GnrTc8AcGvkB/pIX44UiII=; b=MYf0NGLOdQrhLRaafWLMf9VpF6lqlMrHOBkwMfOGJEkjfwyzU9ugVwKzQT44D6ne2j R6xZOnexRCE3MUVuajPig3ez23Hpc3hEIwAKRhI68r2awOOVhFgDvor3apClQV1GhsvA SyrHEBwfEilAAA2B6N7SGKhSSSvM8S3Lq4pMSUQDYegylK5CzmpPBpVFxZlobS1nVuX5 MR8oP6CAhV2lj50IFjL3lUmtofmH9Q4oxAHxXlAtUBPqF5xRNTLp2icjbWSg5NXeW9ir 0vpoL5yRGjhFkcP36T1WFs0NcEH8iSu1cie3+oLh7h3Zb3/C08WMEoCWO6wYi3jD6OMq Cqfg== X-Gm-Message-State: AOAM530uXaUavN3T7Gfto81G0ds/YJloyAjohe62RcaeW5QOtcLBh94Q AjNh2wrcc1IEJ/AjfSqwnFdHtFif+w0ee5cIyCkH6w== X-Received: by 2002:a05:6512:3b2a:: with SMTP id f42mr266677lfv.63.1627988097709; Tue, 03 Aug 2021 03:54:57 -0700 (PDT) Received: from nergzd-desktop.localdomain ([62.122.67.26]) by smtp.gmail.com with ESMTPSA id a6sm1337576lfs.160.2021.08.03.03.54.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 03:54:57 -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] drm/panel: s6d27a1: Add driver for Samsung S6D27A1 display panel Date: Tue, 3 Aug 2021 16:54:18 +0300 Message-Id: <20210803135419.26495-1-markuss.broks@gmail.com> X-Mailer: git-send-email 2.32.0 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 manufactrer 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 | 342 ++++++++++++++++++ 3 files changed, 351 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..86cf8d316b --- /dev/null +++ b/drivers/gpu/drm/panel/panel-samsung-s6d27a1.c @@ -0,0 +1,342 @@ +// 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 + +#include