From patchwork Thu Jun 10 13:25:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 457854 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp471549jae; Thu, 10 Jun 2021 06:27:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzA6Jq9Ca7I612TtouW4U5f6rjCzlCm1nJyfTquOOv/xR2cCH7HxJxIw2/f3CQkOroiseK0 X-Received: by 2002:a17:902:dac3:b029:105:66fc:8ed7 with SMTP id q3-20020a170902dac3b029010566fc8ed7mr4893760plx.6.1623331632427; Thu, 10 Jun 2021 06:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623331632; cv=none; d=google.com; s=arc-20160816; b=OQcFejqkZnIIZUAfcXfiAdGoHkYEjVbagCTdkQk7hZN+Tt1TBp2v1idUksfRR5KhEd zZRjlb7POYyGZx7zaFSXJyRspCPnKVwQoA1OOm4uOKTd3w9b3U6JuQ9Oy0s3K0R8Y+JA ModMQvQ0vuaxF+R1QHIqYX+n5vHR8ElXzL5EOcy5MWYGLpDsmBop03ZzDFMDvvQRQtv2 WLmfvVXo5KtF84F+L1e8KM6beVgv1WDCWIOxnp0IP9IdliRqei3XX4n4OxS4MUjj2s0P FNK5HXQPGZ74wqrh6YruZXwZSu/MOY+pL7O1aJmV/BWQXGotXsDqcXsYozdDejuihy8S z7cg== 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=T4QEP3A/eh2Lcpmaz1OafJAywMZLP55ZdFmXuQCmgJs=; b=xyWC0UStTsa3xh7Wsy+7Uu5d2JC9UePo8eDtiu8RKTiom2E6PSpmQdMRo8Ac3nwnK4 mIEPlL0Hw9vyjxL5uTFC2i5W2T7lYQXFXK4t1MVNL0JKKtw+Y9dZrZD5WaHEB1O8B6AZ PdJeQYNvFvjGhQ0069t6PBLY4Zv9sIdOcGg4ZvDHzYSQdDnuKu5SziBWIHG65l7ILpDp SBmJ+m3zkQfnxv+wN8Zc6R35FBpxm3UgAV2ik8bpOwnRIpJRuvniQEAqk6axxBtIr+3G UVcC/QECBSKCqz73oVnmoVP40+u1Y8KDYUGa5FW+KDUT8GpBo70jmzdVEOD/5BeESAVs iY7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=j85ZuZ8o; 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 s3si3417659pji.154.2021.06.10.06.27.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jun 2021 06:27:12 -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=j85ZuZ8o; 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 3529D6ED11; Thu, 10 Jun 2021 13:27:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 99FE66ED11 for ; Thu, 10 Jun 2021 13:27:07 +0000 (UTC) Received: by mail-lf1-x12d.google.com with SMTP id n12so3240538lft.10 for ; Thu, 10 Jun 2021 06:27:07 -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=T4QEP3A/eh2Lcpmaz1OafJAywMZLP55ZdFmXuQCmgJs=; b=j85ZuZ8o/iLl6QOnU4pD9Xd+HUaJI9o/pe1PDQYr1j2iRSwZxtDP3U5SXquaJCRCXc XBIylVZX46UtBAjL1rTOhRyeXffSEka3SlhUkQm0kYbcspu9cSw7zWjB1IYHeWf0v3nh uyJuD7Dl+xULZa58Ond8h082veY7u7xBUK8kz1badBCHTHamU4siPkQUu89ZWcpu4t22 bCbqoX0Jp+SdJnppXGE9uZ7sexXsr/CkZMzhkjSVPW0ylaFACqb+ZyfSB9sYW7niBJWX gNQqYqALm6BwNL0AYNJjBFrFvT01HL4rZH/550xNiYuNcJ9v3ox4CS07ZjndspQpUSAN 2TpA== 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=T4QEP3A/eh2Lcpmaz1OafJAywMZLP55ZdFmXuQCmgJs=; b=CCfrpw0SBEpqUQo4vbWkc1mc6SjyzAEAvfhtTIujVQEBVSQu2Y+SSlmUuSqQFCYYR6 foVJtQlz5lJjELSv4cKamYM75ypuX6VoRS21LWTi6L7d9X9KqXrhjDCp1cSRPgBMvDjG oCVtFkLmAbturyKPabQ9k5ecMytV6fXdZApAH2OpfsdcoXf8U6PsW92XTNqxwTWxEex9 eIhRjy/qGKa5JPCzVOxNhK6A9g9vFeQMbcTORywI5fe+2kgt8o2wGX4Fz3MJw8+FDNcD Ocj+WXlaWUCfNgbsiSo+RYHYcBCFEKH7VXt8QOSLor3yI3b5pQ6mOQy1Yms4t+6wO4Vg SecQ== X-Gm-Message-State: AOAM532O9cYJaiRRx5lNoTuuI2ypD0W5fN5gPWFFOT3CtlKeN6nIUm1/ O4euIsUzpIRd/RNgcdI6Tw8S6Q== X-Received: by 2002:a05:6512:3602:: with SMTP id f2mr1974028lfs.14.1623331625913; Thu, 10 Jun 2021 06:27: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 x1sm337957ljm.132.2021.06.10.06.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jun 2021 06:27:05 -0700 (PDT) From: Linus Walleij To: Thierry Reding , Sam Ravnborg , dri-devel@lists.freedesktop.org Subject: [PATCH v4] drm/panel: db7430: Add driver for Samsung DB7430 Date: Thu, 10 Jun 2021 15:25:01 +0200 Message-Id: <20210610132501.315086-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: Paul Cercueil , =?utf-8?q?Noralf_Tr=C3=B8nnes?= , Doug Anderson Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This adds a new driver for the Samsung DB7430 DPI display controller as controlled over SPI. Right now the only panel product we know that is using this display controller is the LMS397KF04 but there may be more. This is the first regular panel driver making use of the MIPI DBI helper library. The DBI "device" portions can not be used because that code assumes the use of a single regulator and specific timings around the reset pulse that do not match the DB7430 datasheet. Cc: Noralf Trønnes Cc: Paul Cercueil Cc: Doug Anderson Signed-off-by: Linus Walleij --- ChangeLog v3->v4: - Managed to make use of the in-kernel DBI support to conjure and send 9bit DBI SPI messages. - This cuts out a bit of overhead. - Deeper integration with the DBI library is not done, as assumes too much about the device, such as being used as a stand-alone framebuffer (this device is not). ChangeLog v2->v3: - Fix some minor comments and formatting. - Print an error if the DCS sequence write fails. - Set BPC (bits per color) to 8 on the display_info. Some drivers may need this. ChangeLog v1->v2: - Rename driver and variables with the db7430_* prefix instead of lms397kf04 as there may be more display products out there using this display controller. Also change Kconfig symbol. - Push doc comments together on one line where possible. - Rename DB7430_MANUFACTURER_CMD to DB7430_ACCESS_PROT_OFF - Return error from regulator_bulk_disable() down to db7430_unprepare() and propagate. - Use usleep_range(1000, 5000) instead of msleep(1) - Shorten prepare/unprepare callbacks by more compact code. - Use devm_err_probe() and provide proper probe errors all the way through the probe() function. --- MAINTAINERS | 7 + drivers/gpu/drm/panel/Kconfig | 10 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-samsung-db7430.c | 354 +++++++++++++++++++ 4 files changed, 372 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-samsung-db7430.c -- 2.31.1 Acked-by: Noralf Trønnes diff --git a/MAINTAINERS b/MAINTAINERS index bd7aff0c120f..6ff4777b1018 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5857,6 +5857,13 @@ S: Maintained F: Documentation/devicetree/bindings/display/panel/raydium,rm67191.yaml F: drivers/gpu/drm/panel/panel-raydium-rm67191.c +DRM DRIVER FOR SAMSUNG DB7430 PANELS +M: Linus Walleij +S: Maintained +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 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 4894913936e9..6d1b90f4f2bb 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -342,6 +342,16 @@ config DRM_PANEL_RONBO_RB070D30 Say Y here if you want to enable support for Ronbo Electronics RB070D30 1024x600 DSI panel. +config DRM_PANEL_SAMSUNG_DB7430 + tristate "Samsung DB7430-based DPI panels" + 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 Samsung + DB7430 DPI display controller used in such devices as the + LMS397KF04 480x800 DPI panel. + config DRM_PANEL_SAMSUNG_S6D16D0 tristate "Samsung S6D16D0 DSI video mode panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index cae4d976c069..a350e0990d17 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -33,6 +33,7 @@ obj-$(CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN) += panel-raspberrypi-touchscreen obj-$(CONFIG_DRM_PANEL_RAYDIUM_RM67191) += panel-raydium-rm67191.o 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_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_S6E3HA2) += panel-samsung-s6e3ha2.o diff --git a/drivers/gpu/drm/panel/panel-samsung-db7430.c b/drivers/gpu/drm/panel/panel-samsung-db7430.c new file mode 100644 index 000000000000..c11b3da65896 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-samsung-db7430.c @@ -0,0 +1,354 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Panel driver for the Samsung LMS397KF04 480x800 DPI RGB panel. + * According to the data sheet the display controller is called DB7430. + * Found in the Samsung Galaxy Beam GT-I8350 mobile phone. + * Linus Walleij + */ +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include