From patchwork Thu Jun 24 22:44:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 466368 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp884377jao; Thu, 24 Jun 2021 15:47:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8ZfZ3SjS6O/hbTdxWm7n64swLBpg4eqh5MkstD8j4BPLBKheQMOnR9Blw/sf8MNFNtZPR X-Received: by 2002:a05:6a00:18a0:b029:307:56d2:43c5 with SMTP id x32-20020a056a0018a0b029030756d243c5mr7427522pfh.41.1624574831096; Thu, 24 Jun 2021 15:47:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624574831; cv=none; d=google.com; s=arc-20160816; b=bqO+BMX1S4nhLUytptVXRtuYGzEuBljB8Q+PgCnYIazStIWJzOM3AgeZvss6sHFwuM lvyfU1CoKHEuO4b9EYkSog4klcFGHdjdhfJVIByRMZqH+zEBmx1aq8zWufY5T4YcHeMP n56kfjbdje33seoIGU72X68Iy4nFm2hFrXy4xlzxH+QgjRoV5GpODhP4S3DxNm9dL756 B9Q7IfBzlqpk/sGagCog6VSXMsAYYF5PuGuRluHLTZTUD7U1p8no2Araw+tmTPvSH44O OReGPB/ezNkjnE+WJKt1QytyesUy7w/wuIAU9h8QmfANJZ6m4B0b+aPd2HxUMrCbHJYC D54Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :delivered-to; bh=i4dvRXIGa3XnHtxkrv5kX8z4dsXDtAlvxqX0HycKbyo=; b=h94Eo0u5O/QKG777f8DKPIrCv4IQ4XZipBRFz7uUhJUL4y7RWehdbHJMJtbE2Z5wyR KtaIJMWjAbl7p3XgdPejfPojuEcy33liiwvuRv2mN6THL8rizCSkgsX6d0DQd00G9zAz 8tO2QEjNRXkXocp09Nhljaw7B1ujk0CxJFUPHVGFzTROKPUM6RR0x60SnyhrP0R1zYJa Q22jyQsCcOuSOGBskNSim/96pE3Rm//+D+PBIiFiqe8+PVs5uYSUskdu2ve3CeMHWLAS fsiw6CtYbgrRHdDsm2SlQhQLkyvGgLAkBEPy4tl4VkchKGS9BPsJ7PPwq6xMvhoZy+Wk vTdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tODqIHAO; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id q7si4011789pgb.70.2021.06.24.15.47.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jun 2021 15:47:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tODqIHAO; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 914D36E0C6; Thu, 24 Jun 2021 22:47:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by gabe.freedesktop.org (Postfix) with ESMTPS id A83566E0C6 for ; Thu, 24 Jun 2021 22:47:06 +0000 (UTC) Received: by mail-lj1-x22f.google.com with SMTP id u2so4653763ljo.1 for ; Thu, 24 Jun 2021 15:47:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=i4dvRXIGa3XnHtxkrv5kX8z4dsXDtAlvxqX0HycKbyo=; b=tODqIHAOYM/leDijOqBHhC6+Y1avJ978lXEF7x6hyxL+4vu3LpmHpy+iKWHg0UohVh Pn94OtIkobnmWWP9UmpHS0EYT9sy2YW1FnRnaoKZDGz2EbtpTx5uKiXxclvrdNqwOprM sUvu70+MWKmZW6r4ERT+DFeb27bJLGwdtHU/Zem4ZLY2sUDI1EskxPvufhCmV1L1MEPZ Kxz3ChmFMdS0BuGBERjRf0QqlspwEKpFlq50V1Kn/fTo1NtDzValRKtbHRSRRsTAUELq 4MEiRdED8Z8NPvKz3anPWvC1+3f6hfDv/xcPhCVD7m1/qy/V+1pqVbF3wZHEKh87QNJF YT1Q== 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=i4dvRXIGa3XnHtxkrv5kX8z4dsXDtAlvxqX0HycKbyo=; b=n1mjK1G6bvLXmxp9PrfEZ5e69L+JZLFUCuyxtvfaUnbeEinAFci3n48X2GYgaGiBvE 7aC6FfpPcWvMJKjH/AcTcbp7lIJUMwPIsKIQ3DO/EfnoC3Q56iRGQz2LmKJtWt8ldgIU IVRvEjM90Iu9zfI1JohasW+sDibJ2ENxyKMFShJjCZXKMC8+0ExkqwJjiqYc/VKqI389 wnuDpDDNg6f7pyAHB5YFYD0Ti+cfXCuB5LOQtqVpxS6KANDzDxugt+/vB5oE2lmYYAu7 RElJFVD7Pse6QRYLmCiGOOF+yYCL6FRz6XNSa+Nl/hNUE1tjhMcSuAEKsDeOdBzt/dAM Lyew== X-Gm-Message-State: AOAM532dD532iFzuA+6ouCRyTWczT1qQaWmzkA8pSQ7EYL3VAB8SfI2s ZbDY8YzvQnWTBbjT/wyiR8m0Rw== X-Received: by 2002:a05:651c:210b:: with SMTP id a11mr5569593ljq.240.1624574825016; Thu, 24 Jun 2021 15:47:05 -0700 (PDT) Received: from localhost.localdomain (c-fdcc225c.014-348-6c756e10.bbcust.telenor.se. [92.34.204.253]) by smtp.gmail.com with ESMTPSA id n27sm344120lfq.198.2021.06.24.15.47.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jun 2021 15:47:04 -0700 (PDT) From: Linus Walleij To: Thierry Reding , Sam Ravnborg , dri-devel@lists.freedesktop.org Subject: [PATCH] drm/panel: ws2401: Add driver for WideChips WS2401 Date: Fri, 25 Jun 2021 00:44:58 +0200 Message-Id: <20210624224458.2486701-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: phone-devel@vger.kernel.org, Douglas Anderson , =?utf-8?q?Noralf_Tr=C3=B8nnes?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This adds a driver for panels based on the WideChips WS2401 display controller. This display controller is used in the Samsung LMS380KF01 display found in the Samsung GT-I8160 (Codina) mobile phone and possibly others. As is common with Samsung displays manufacturer commands are necessary to configure the display to a working state. The display optionally supports internal backlight control, but can also use an external backlight. This driver re-uses the DBI infrastructure to communicate with the display. Cc: phone-devel@vger.kernel.org Cc: Douglas Anderson Cc: Noralf Trønnes Signed-off-by: Linus Walleij --- MAINTAINERS | 7 + drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile | 1 + .../gpu/drm/panel/panel-widechips-ws2401.c | 404 ++++++++++++++++++ 4 files changed, 421 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-widechips-ws2401.c -- 2.31.1 diff --git a/MAINTAINERS b/MAINTAINERS index bd7aff0c120f..8bfa89f61220 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5946,6 +5946,13 @@ S: Maintained T: git git://anongit.freedesktop.org/drm/drm-misc F: drivers/gpu/drm/vboxvideo/ +DRM DRIVER FOR WIDECHIPS WS2401 PANELS +M: Linus Walleij +S: Maintained +T: git git://anongit.freedesktop.org/drm/drm-misc +F: Documentation/devicetree/bindings/display/panel/samsung,lms380kf01.yaml +F: drivers/gpu/drm/panel/panel-widechips-ws2401.c + DRM DRIVER FOR VMWARE VIRTUAL GPU M: "VMware Graphics" M: Roland Scheidegger diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 4894913936e9..f4fe1dba9912 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -552,6 +552,15 @@ config DRM_PANEL_VISIONOX_RM69299 Say Y here if you want to enable support for Visionox RM69299 DSI Video Mode panel. +config DRM_PANEL_WIDECHIPS_WS2401 + tristate "Widechips WS2401 DPI panel driver" + depends on OF && SPI && GPIOLIB + depends on BACKLIGHT_CLASS_DEVICE + select DRM_MIPI_DBI + help + Say Y here if you want to enable support for the Widechips + WS2401 DPI 480x800 display controller. + config DRM_PANEL_XINPENG_XPP055C272 tristate "Xinpeng XPP055C272 panel driver" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index cae4d976c069..d94c27df17aa 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -58,4 +58,5 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o +obj-$(CONFIG_DRM_PANEL_WIDECHIPS_WS2401) += panel-widechips-ws2401.o obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o diff --git a/drivers/gpu/drm/panel/panel-widechips-ws2401.c b/drivers/gpu/drm/panel/panel-widechips-ws2401.c new file mode 100644 index 000000000000..d15870301174 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-widechips-ws2401.c @@ -0,0 +1,404 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Panel driver for the WideChips WS2401 480x800 DPI RGB panel, used in + * the Samsung Mobile Display (SMD) LMS380KF01. + * Found in the Samsung Galaxy Ace 2 GT-I8160 mobile phone. + * Linus Walleij + * Inspired by code and know-how in the vendor driver by Gareth Phillips. + */ +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include