From patchwork Mon May 31 10:28:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 450489 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp699239jao; Mon, 31 May 2021 03:30:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+O/+Pk5QCYcfPmDY2Om2ZMyqJlIvNt/Ko+w77JHqoobQAEvs+MISZA5IlxeNVhENQ2ugc X-Received: by 2002:aa7:8202:0:b029:2d8:c24d:841d with SMTP id k2-20020aa782020000b02902d8c24d841dmr16329484pfi.57.1622457047528; Mon, 31 May 2021 03:30:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622457047; cv=none; d=google.com; s=arc-20160816; b=oy5FQVsiQKZB4w/N58h39EoNitxRXs6lqnVaKaPezHq0EQIk7KXDwtGYgyx0Dvg8oe 2Ln5AMu3LYXDvetmX7ekZfkAFRrspZ7Jrdh11zXQXh5E1Pl0PfjdLT+ejR1k1An40mKI ETmS690fzBxUP02UFi3xRWcNKWkvDoHpW/M1Gd516ms/v4N6h4H6Af0y+NEKf5e0CsaQ rw9T1SeyVpJiRsZNl2UyjkAxj+HV5FbHYpsZJGiK5oKO28UYMbPgJn6y7EpeRqauWnsB E/tToHmWmyqI9iMn7sdcBwodmrvrf5edI69dEMwIF4Oj7mGacCwGBvgZvwlfvfXK6PIK XVDw== 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=gx9e8uC2cFWgRG+UVJhRCSuLf6NH9t31W3jQE8zoP2c=; b=lfu8uB2j7FhM+iF+hZCUjXnaV7VmLJuMU80+So+Y2fPtEANwS1hR0TDHX5IqpQnN1z eG77FcZIJhsmD/nWjv3yHEGAIK0p+/cl1auDTkH43R/fOjUC64z4PAi0VL94cmwe3AEs AydLzSFqHcFLvS8xG40VFBStjDrZjCnsBp688SzJ354j8S4IfA5qIVs2tC7LsV8xNcmK 3xsi+EUsx7FVURXBkGOXYEI2F/+EO/uP9hoH4J/9p39PzqPc28xSiIls8bPwVQWzPvI1 1nbP+xCxQrHzaMMVQPohEQhxuu1ENkIKdQbhfI+VKWKrJ9skmXFrrkd7Waqvz/u4xunR AV9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Cer3kJPM; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 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. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id d16si15987434pgh.568.2021.05.31.03.30.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 03:30:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Cer3kJPM; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 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 BA0E26E061; Mon, 31 May 2021 10:30:44 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by gabe.freedesktop.org (Postfix) with ESMTPS id A903B6E061 for ; Mon, 31 May 2021 10:30:43 +0000 (UTC) Received: by mail-lj1-x22b.google.com with SMTP id o8so14455300ljp.0 for ; Mon, 31 May 2021 03:30:43 -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=gx9e8uC2cFWgRG+UVJhRCSuLf6NH9t31W3jQE8zoP2c=; b=Cer3kJPMpT7mkeCgL5H1FJT9n3h16SxZdKI8GTXEUEXd1M2n9gDOCjQXmG8zChSlr9 tbB+3JJKek3PqnBNZoCgaa88A2JMea6gpNU91moN7nr4gz0YW1fMvkDTJZxUcM+Vn/6R efW+Mj1rJgap7yWLoruCpix6EeDUpMQ3jV3VCeTq7ZXb4Y33exSb2CcwT/YGyV4tP6bF i309voGBoZmdUpKlvg6336YOrGGWEdkbWgKwrR6HTbTHzOjBsmTvwqWv5yih+q9KQcJ9 Vbv1P4P8n9x5kcwmwUDLQLELYE1EjqnMs7VpO76YPcQuMY+hTiUUBgnkQ6x27r6wCg9G JgkA== 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=gx9e8uC2cFWgRG+UVJhRCSuLf6NH9t31W3jQE8zoP2c=; b=JWnqu5mSLQR5lAanWf9My99ZHeQObxyifwrsvRKmDmVUOu9pQIR2Dwze7pI37E4Krz gflve6umw/9m1hTE8/LSach3/DwtL5zV4JbUWpGmCamD1Fhc08shfnS7qkxXrwzA7X/U olSYdQy55TF8+KSFQMf1u1Dp/8YdETaUT+FLS0j6W/xhHzGHvsWjPkxCNL0RPBivFBJW Q9gimZv0xVTUhP7al6fYgpJWJCfTugzbdQrfjSwFpy4+lYxjo5qEdKVkYdDWKQM6ByG6 ykTmCxk9uLZ2PFsYH+Uj5y3mSCHBvNRtlqYVB2h3f1UMmFGCPz4fZzZNJQ64T37NpMZg tLGg== X-Gm-Message-State: AOAM533YUwnShQdylieVg+519899cMKQVWmGoywlmmlOIj6nH3Fx0y0W /BktnmaIc9CmuzaEiFiFIE1u8w== X-Received: by 2002:a2e:bc24:: with SMTP id b36mr16392468ljf.35.1622457041882; Mon, 31 May 2021 03:30:41 -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 u12sm1298596lfc.75.2021.05.31.03.30.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 03:30:41 -0700 (PDT) From: Linus Walleij To: Thierry Reding , Sam Ravnborg , dri-devel@lists.freedesktop.org Subject: [PATCH v2] drm/panel: db7430: Add driver for Samsung DB7430 Date: Mon, 31 May 2021 12:28:38 +0200 Message-Id: <20210531102838.2423918-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: 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. Cc: Doug Anderson Signed-off-by: Linus Walleij --- 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 | 9 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-samsung-db7430.c | 395 +++++++++++++++++++ 4 files changed, 412 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-samsung-db7430.c -- 2.31.1 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..e72e1c069456 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -342,6 +342,15 @@ 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 + 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..e951aa133925 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-samsung-db7430.c @@ -0,0 +1,395 @@ +// 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