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: 12343321 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=-21.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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=ham 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 601A3C49EA5 for ; Thu, 24 Jun 2021 22:47:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 16206613AD for ; Thu, 24 Jun 2021 22:47:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16206613AD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.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) 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-Google-Smtp-Source: ABdhPJw4acXsC6/mzFk2rAep5f4QJbJHT7KdsPMtIdkvgxlQnVUTgh1sXnQyigXflePJoBc6cil3wA== 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 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