From patchwork Fri Feb 1 17:28:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Chmiel?= X-Patchwork-Id: 10793433 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BA6BD14E1 for ; Fri, 1 Feb 2019 17:33:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A41B63289F for ; Fri, 1 Feb 2019 17:33:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9862C328C5; Fri, 1 Feb 2019 17:33:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 517D13289F for ; Fri, 1 Feb 2019 17:33:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A8CAE6E2F9; Fri, 1 Feb 2019 17:33:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 419F46E2E4 for ; Fri, 1 Feb 2019 17:29:01 +0000 (UTC) Received: by mail-lj1-x242.google.com with SMTP id t9-v6so6484577ljh.6 for ; Fri, 01 Feb 2019 09:29:01 -0800 (PST) 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=rxLhzGYwH6iCkIpFvsbVMsVL7rqrkLHnqOAjKH+gy/g=; b=kmxDYZ7HA2fezE5ODtx4NK71eO5wJc2A5LBuq1R7E50RLQUpCf/3wq4KKSi8wALIND YSMdd7bkpZQVj51xas+jzF/jY3l2MbdmDjJ7SIL4Au+ldTavSHT18pDihegvjCAqrE6c CcIJtaZihd4ExcJdZClU57Tno4382cPIfvJRunRTSpkutaxwDT+lM2beNMKBEvjS5ICd JPYhQmvsPIkyqssWtahVEzl9MuhAy6JIuiBaDCRkNjSX/tZRF/QG/NsmR7CWsDkvb1/I x7G5A1xX7btBb+oHULES18KK/IvQF8jh6OIHALvyDu/mat3eo6ZitWLwvF/W//0a9W59 dPGw== X-Gm-Message-State: AJcUukcgDgjeZVSfAQqunvSQxDxw8ft7FCRvtk/xQ1CwlbFOfrWz9n8t cw0CjTSE+LW3Iv+VVQpLIp4= X-Google-Smtp-Source: AHgI3IaOENda8+/Kg4OybHkKQPXjlK1ABygIIBgN32PRI14s+7pRljLk55Sr/8U8R1ngbNMSrSI6UQ== X-Received: by 2002:a2e:9181:: with SMTP id f1-v6mr25411768ljg.64.1549042139569; Fri, 01 Feb 2019 09:28:59 -0800 (PST) Received: from localhost.localdomain ([2a02:a315:5445:5300:b0fa:39a8:9559:1b76]) by smtp.googlemail.com with ESMTPSA id u21-v6sm1388796lju.46.2019.02.01.09.28.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Feb 2019 09:28:58 -0800 (PST) From: =?utf-8?q?Pawe=C5=82_Chmiel?= To: thierry.reding@gmail.com Subject: [PATCH v2 1/2] dt-bindings: drm: panel: Add Samsung s6e63m0 panel documentation Date: Fri, 1 Feb 2019 18:28:51 +0100 Message-Id: <20190201172852.4944-1-pawel.mikolaj.chmiel@gmail.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 01 Feb 2019 17:33:04 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, airlied@linux.ie, Jonathan Bakker , linux-kernel@vger.kernel.org, krzk@kernel.org, robh+dt@kernel.org, dri-devel@lists.freedesktop.org, =?utf-8?q?Pawe=C5=82_Chmiel?= , m.szyprowski@samsung.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Jonathan Bakker This commit adds documentation for Samsung s6e63m0 AMOLED LCD panel driver. Signed-off-by: Jonathan Bakker Signed-off-by: Paweł Chmiel --- Changes from v1: - Add missing subject prefix - Rename reset-gpio to reset-gpios - Add link to spi properites documentation. They're required for driver to work - Removed delay properties, which are now hardcoded in driver - Removed display timings, which are now hardcoded in driver --- .../display/panel/samsung,s6e63m0.txt | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt diff --git a/Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt b/Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt new file mode 100644 index 000000000000..9fb9ebeef8e4 --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.txt @@ -0,0 +1,33 @@ +Samsung s6e63m0 AMOLED LCD panel + +Required properties: + - compatible: "samsung,s6e63m0" + - reset-gpios: GPIO spec for reset pin + - vdd3-supply: VDD regulator + - vci-supply: VCI regulator + +The panel must obey rules for SPI slave device specified in document [1]. + +The device node can contain one 'port' child node with one child +'endpoint' node, according to the bindings defined in [2]. This +node should describe panel's video bus. + +[1]: Documentation/devicetree/bindings/spi/spi-bus.txt +[2]: Documentation/devicetree/bindings/media/video-interfaces.txt + +Example: + + s6e63m0: display@0 { + compatible = "samsung,s6e63m0"; + reg = <0>; + reset-gpio = <&mp05 5 1>; + vdd3-supply = <&ldo12_reg>; + vci-supply = <&ldo11_reg>; + spi-max-frequency = <1200000>; + + port { + lcd_ep: endpoint { + remote-endpoint = <&fimd_ep>; + }; + }; + }; From patchwork Fri Feb 1 17:28:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Chmiel?= X-Patchwork-Id: 10793435 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 304196C2 for ; Fri, 1 Feb 2019 17:33:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1928028B18 for ; Fri, 1 Feb 2019 17:33:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D40C328C5; Fri, 1 Feb 2019 17:33:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CCBED28B18 for ; Fri, 1 Feb 2019 17:33:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9B3BC6EEC4; Fri, 1 Feb 2019 17:33:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 391C26E2E4 for ; Fri, 1 Feb 2019 17:29:03 +0000 (UTC) Received: by mail-lj1-x244.google.com with SMTP id l15-v6so6455918lja.9 for ; Fri, 01 Feb 2019 09:29:03 -0800 (PST) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=BXx5ppy3Cxa8ue+r2iDJAtbQ20DIPseQM6vRxnwyhkg=; b=hHlXgEI92Alpm70TRHHjJYQMASx09nsEft6QeJEK3TlngDtG/rZnHhyG326aZj+Ot/ iAzUczdOcnNbu2DrjFWi8qU6CwYYvL6V0+0ULPvjJqkCtzAVqrFtzz0tNV/GHH5G2z7k gJtZ4VjvOlHvYdWYTiLG9DAFB7XgPtI+Q6x70v37V98KZJaPtDp15+t10OjUkYUlHZmI qCJ0izNwrr1y6JHzxlTPJsb5JHbJBoelfUubj/SamaZ0RNU02PBsP2DLIFT2IQ2cdJna w6w0w6FTDF9fGu1XBIwebvlBbVLbkvLF9+YhBtQa8lwSA5cu/CY0OglCUhhLygEUvq+w uecg== X-Gm-Message-State: AJcUukcBKNV4PI0Iz3BXFGzsSVXJd1rRQMLj++VcSDQpYKp0UjOGC84t yo5PKycquY9fTkHpJ0FaS/Y= X-Google-Smtp-Source: ALg8bN6ZynyMbQceWex5AXcXdYDJF8lt54o+D1j3eJuseazSc+ozWRsQ1YRnpFG4w5MmUHPJBADbmw== X-Received: by 2002:a2e:5418:: with SMTP id i24-v6mr32337104ljb.51.1549042141184; Fri, 01 Feb 2019 09:29:01 -0800 (PST) Received: from localhost.localdomain ([2a02:a315:5445:5300:b0fa:39a8:9559:1b76]) by smtp.googlemail.com with ESMTPSA id u21-v6sm1388796lju.46.2019.02.01.09.28.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Feb 2019 09:29:00 -0800 (PST) From: =?utf-8?q?Pawe=C5=82_Chmiel?= To: thierry.reding@gmail.com Subject: [PATCH v2 2/2] drm/panel: Add driver for Samsung S6E63M0 panel Date: Fri, 1 Feb 2019 18:28:52 +0100 Message-Id: <20190201172852.4944-2-pawel.mikolaj.chmiel@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190201172852.4944-1-pawel.mikolaj.chmiel@gmail.com> References: <20190201172852.4944-1-pawel.mikolaj.chmiel@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 01 Feb 2019 17:33:04 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, airlied@linux.ie, linux-kernel@vger.kernel.org, krzk@kernel.org, robh+dt@kernel.org, dri-devel@lists.freedesktop.org, =?utf-8?q?Pawe=C5=82_Chmiel?= , m.szyprowski@samsung.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch adds Samsung S6E63M0 AMOLED LCD panel driver, connected over spi. It's based on already removed, non dt s6e63m0 driver and panel-samsung-ld9040. It can be found for example in some of Samsung Aries based phones. Signed-off-by: Paweł Chmiel Reviewed-by: Sam Ravnborg --- Changes from v1: - Correct order of Kconfig/Makefile entry - Fix SPDX tag, so it matches value of MODULE_LICENSE - Remove inclusion of drmP.h - Fix code formatting - Use DRM_DEV_ERROR/DEBUG - Extract hardcoded values - Remove possibility to change gamma through sysfs, leaving only one gamma table values - Fix reset_gpio handling, so it'll be asserted in power_on and deasserted in power_off. Also do it before turning voltage on. - Disable backlight and enter sleep mode in disable callback. Previously it was done in unprepare - Enable display and backlight in enable callback. Previously it was done in prepare - Hardcode display timings and delays. Previously they were readed from device tree - We're using SPDX, so we don't need to have license body - Use MIPI_DCS_EXIT_SLEEP_MODE and MIPI_DCS_SET_DISPLAY_ON - Rename MAX_GAMMA_LEVEL to NUM_GAMMA_LEVELS - Ommit get_brightness callback - Use backlight_enable/disable API, like it's done in other panel drivers (for example panel-simple) - Make set_brightness called only from backlight api, like it's done in other panel drivers (for example panel-simple). - Reset gpio should be set to GPIOD_OUT_HIGH. It's declared as active low in device tree - Don't call power_off in remove callback --- drivers/gpu/drm/panel/Kconfig | 7 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 517 ++++++++++++++++++ 3 files changed, 525 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-samsung-s6e63m0.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 3f3537719beb..be05ed5218eb 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -158,6 +158,13 @@ config DRM_PANEL_SAMSUNG_S6E63J0X03 depends on BACKLIGHT_CLASS_DEVICE select VIDEOMODE_HELPERS +config DRM_PANEL_SAMSUNG_S6E63M0 + tristate "Samsung S6E63M0 RGB/SPI panel" + depends on OF + depends on SPI + depends on BACKLIGHT_CLASS_DEVICE + select VIDEOMODE_HELPERS + config DRM_PANEL_SAMSUNG_S6E8AA0 tristate "Samsung S6E8AA0 DSI video mode panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 4396658a7996..4507a2d253ac 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -16,6 +16,7 @@ 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 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) += panel-samsung-s6e63j0x03.o +obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0) += panel-samsung-s6e63m0.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) += panel-seiko-43wvf1g.o obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c new file mode 100644 index 000000000000..7658bd993088 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c @@ -0,0 +1,517 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * S6E63M0 AMOLED LCD drm_panel driver. + * + * Copyright (C) 2019 Paweł Chmiel + * Derived from drivers/gpu/drm/panel-samsung-ld9040.c + * + * Andrzej Hajda + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include