From patchwork Thu Dec 21 11:02:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 122526 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp724678qgn; Thu, 21 Dec 2017 03:02:57 -0800 (PST) X-Google-Smtp-Source: ACJfBovBB1p0WQupyjPofBbQCq8m2TEZNXCu9q3N9EkJPfJgx0Vurx7SnwRPprZ/48YDXlnrh5ql X-Received: by 10.101.86.133 with SMTP id v5mr9083741pgs.266.1513854177442; Thu, 21 Dec 2017 03:02:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513854177; cv=none; d=google.com; s=arc-20160816; b=nsB5kcIo5zeIvgkGZoY7PqdZxccmCSwrACeUL5n0GWZFGcV/4ppoyczvcirkW6DQSR HLVS8b32CVV85rdhADv3K0AVLhQ9ZKW1KawMgBcRqwCLGA3ZbTsxGW0KBCPHTp6UAyAi WgZSmcTz5wXzZLgGjua1OIGiR90bpWNMHM7vNhgqMT5zYXn5OUmOP1Piwc0uT+XAWdK6 AAO8OGjo2agMCoTf6nyGPj579wntsttMWDt1KoavhL8qbas84lhpKczWaTXN0LSRUbk4 zx/N3URw1+Ybl8DAV4LGAm5DVnyXXjXehIT6SaxXmiARZJyEbiRDxMFjYxEn1C3vogc2 uKOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:references:in-reply-to :message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=PGPrlvJMowfoECLbU+owFsj6DbrmbEGgNWH06kQcALk=; b=eF3bYgxTz8JbMxAfRcqprQdUvUa1wOUhGgjBeOPHbxOPYlCziPE3X1rFIpuwJz7ifp cYFfdgaxiMt/qa41nXRSAjCOIcPujrZfr25CcvulzgOe3orAa6XhkZ1p8Gvi7RHhYNwZ RAUe0Zkckqo75yEq83IFnYU6tba+s1KDFwWwGSSzZeWTfsrb+I+e33dErVintaIHwcZy fn8L0kdqGaKLGJbIWB5CCGChgj4QYd13rmCvsV2txAt49j80G0tuJzo7emqa+DDkhPAJ iELbROphZr7yuS505nA3em7EoclxohpwO4eRKZRVa4lh3SsDvCv+wbwbSJa57UtzZFCN wcaQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id h12si13244994pgp.334.2017.12.21.03.02.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Dec 2017 03:02:57 -0800 (PST) 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; 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 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F79A6E600; Thu, 21 Dec 2017 11:02:55 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id B70B06E606 for ; Thu, 21 Dec 2017 11:02:54 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 69D6320993; Thu, 21 Dec 2017 12:02:53 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 3A31B206A6; Thu, 21 Dec 2017 12:02:43 +0100 (CET) From: Maxime Ripard To: Daniel Vetter , David Airlie , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v5 01/12] dt-bindings: panel: lvds: Document power-supply property Date: Thu, 21 Dec 2017 12:02:27 +0100 Message-Id: <0a6a3abcf1a6b7f0e66a81af8a44c5c0566ce06c.1513854122.git-series.maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Cc: Mark Rutland , Thomas Petazzoni , jernej.skrabec@siol.net, plaes@plaes.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Rob Herring , thierry.reding@gmail.com, Laurent Pinchart , linux-arm-kernel@lists.infradead.org, icenowy@aosc.io X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The power-supply property is used by a vast majority of panels, including panel-simple. Let's document it as a common property Reviewed-by: Rob Herring Signed-off-by: Maxime Ripard --- Documentation/devicetree/bindings/display/panel/panel-common.txt | 6 ++++++ Documentation/devicetree/bindings/display/panel/panel-lvds.txt | 1 + Documentation/devicetree/bindings/display/panel/simple-panel.txt | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/display/panel/panel-common.txt b/Documentation/devicetree/bindings/display/panel/panel-common.txt index ec52c472c845..125ea68052af 100644 --- a/Documentation/devicetree/bindings/display/panel/panel-common.txt +++ b/Documentation/devicetree/bindings/display/panel/panel-common.txt @@ -78,6 +78,12 @@ used for panels that implement compatible control signals. while active. Active high reset signals can be supported by inverting the GPIO specifier polarity flag. +Power +----- + +- power-supply: many display panels need an additional power supply in + order to be fully powered-up. For such panels, power-supply contains + a phandle to the regulator powering the panel. Backlight --------- diff --git a/Documentation/devicetree/bindings/display/panel/panel-lvds.txt b/Documentation/devicetree/bindings/display/panel/panel-lvds.txt index b938269f841e..250850a2150b 100644 --- a/Documentation/devicetree/bindings/display/panel/panel-lvds.txt +++ b/Documentation/devicetree/bindings/display/panel/panel-lvds.txt @@ -32,6 +32,7 @@ Optional properties: - label: See panel-common.txt. - gpios: See panel-common.txt. - backlight: See panel-common.txt. +- power-supply: See panel-common.txt. - data-mirror: If set, reverse the bit order described in the data mappings below on all data lanes, transmitting bits for slots 6 to 0 instead of 0 to 6. diff --git a/Documentation/devicetree/bindings/display/panel/simple-panel.txt b/Documentation/devicetree/bindings/display/panel/simple-panel.txt index 1341bbf4aa3d..16d8ff088b7d 100644 --- a/Documentation/devicetree/bindings/display/panel/simple-panel.txt +++ b/Documentation/devicetree/bindings/display/panel/simple-panel.txt @@ -1,7 +1,7 @@ Simple display panel Required properties: -- power-supply: regulator to provide the supply voltage +- power-supply: See panel-common.txt Optional properties: - ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing From patchwork Thu Dec 21 11:02:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 122533 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp725468qgn; Thu, 21 Dec 2017 03:03:37 -0800 (PST) X-Google-Smtp-Source: ACJfBotcx2B6UsrCyIgN0ftmZtBY2GX4IGLGB41trtk78i5enmoHSnxFAvZJup9Z2qYhakF1BLMX X-Received: by 10.98.209.75 with SMTP id t11mr10050850pfl.161.1513854216933; Thu, 21 Dec 2017 03:03:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513854216; cv=none; d=google.com; s=arc-20160816; b=lboCHhteQ7Wcyn4lBCod+8WnRCZb1kw+X+um7c9X6V1ghetc9mt0EINIlEC4cSm+Q7 jWkIyjoGe6RghL46CW5husFuN2+cDKbLbLfG/rZaZUeeSCHblAHrDnSvISaVjUu0ofmC DH74/Dexrd/VuMSwfy9dlfF4rbSN2ET4o1MiEGWz5dJv1OOmZY+bdwnY2Bq1p56zr/F3 R0ueKF8tYu2KLP4WvPuNLhO9ssCUjVdWcjEgfJG62x0BrMLh5+NO0WoGNf23549gT8XR SXxp8yezjFKg0D8zRPaCVhQIu0zIvYW9hPRpdtRvWLEivCXQmVrjsOiMGrOe5jjQa924 Tyiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:references:in-reply-to :message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=9k9SmHQGMnEn6X8ToPfkkxOR1OorG/UOt3sKZ6f/14Y=; b=X7qomW4CToyQRlY5xz/P94AGh9/3ro0esb+gwfbjbt+wgVAIfJqzescrykUXt2ukMC PHuiwnuJCuJsBaE+L8bDY1q5lC59o0EBCrQybRLRoCkf9rycxPSfcNxwmyaJ6axupH6q DWMYeYsiEpBViTlsE+ytl5X2acMYrplXBa+2Yoo3Gwb48itOiHTo5bZMLfB6R5zbyGT1 1b8LTgoZ+YNks+7Ptqyfaq1iNn/pXKA//Lh3ALon0VBrMHiw8Ep/r/48DIx6MBG/ydia nwFeaL0AWWANzyiu3zVwogfVHuPSHDIUiwrG5geCzw/ryOBsr0dIgNu+9jb/Z48JoaFe Mn1w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id m11si13424602pgp.256.2017.12.21.03.03.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Dec 2017 03:03:36 -0800 (PST) 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; 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 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C4876E620; Thu, 21 Dec 2017 11:03:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id B660D6E60F for ; Thu, 21 Dec 2017 11:03:03 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 72A3720700; Thu, 21 Dec 2017 12:03:02 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 9401820700; Thu, 21 Dec 2017 12:02:43 +0100 (CET) From: Maxime Ripard To: Daniel Vetter , David Airlie , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v5 02/12] drm/panel: lvds: Add support for the power-supply property Date: Thu, 21 Dec 2017 12:02:28 +0100 Message-Id: <0c0819bdf88fa948188df95e57a10820a8a4548d.1513854122.git-series.maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Cc: Mark Rutland , Thomas Petazzoni , jernej.skrabec@siol.net, plaes@plaes.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Rob Herring , thierry.reding@gmail.com, Laurent Pinchart , linux-arm-kernel@lists.infradead.org, icenowy@aosc.io X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" A significant number of panels need to power up a regulator in order to operate properly. Add support for the power-supply property to enable and disable such a regulator whenever needed. Reviewed-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard --- drivers/gpu/drm/panel/panel-lvds.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c index e2d57c01200b..57e38a9e7ab4 100644 --- a/drivers/gpu/drm/panel/panel-lvds.c +++ b/drivers/gpu/drm/panel/panel-lvds.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -39,6 +40,7 @@ struct panel_lvds { bool data_mirror; struct backlight_device *backlight; + struct regulator *supply; struct gpio_desc *enable_gpio; struct gpio_desc *reset_gpio; @@ -69,6 +71,9 @@ static int panel_lvds_unprepare(struct drm_panel *panel) if (lvds->enable_gpio) gpiod_set_value_cansleep(lvds->enable_gpio, 0); + if (lvds->supply) + regulator_disable(lvds->supply); + return 0; } @@ -76,6 +81,17 @@ static int panel_lvds_prepare(struct drm_panel *panel) { struct panel_lvds *lvds = to_panel_lvds(panel); + if (lvds->supply) { + int err; + + err = regulator_enable(lvds->supply); + if (err < 0) { + dev_err(lvds->dev, "failed to enable supply: %d\n", + err); + return err; + } + } + if (lvds->enable_gpio) gpiod_set_value_cansleep(lvds->enable_gpio, 1); @@ -196,6 +212,13 @@ static int panel_lvds_probe(struct platform_device *pdev) if (ret < 0) return ret; + lvds->supply = devm_regulator_get_optional(lvds->dev, "power"); + if (IS_ERR(lvds->supply)) { + ret = PTR_ERR(lvds->supply); + dev_err(lvds->dev, "failed to request regulator: %d\n", ret); + return ret; + } + /* Get GPIOs and backlight controller. */ lvds->enable_gpio = devm_gpiod_get_optional(lvds->dev, "enable", GPIOD_OUT_LOW); From patchwork Thu Dec 21 11:02:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 122532 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp725440qgn; Thu, 21 Dec 2017 03:03:35 -0800 (PST) X-Google-Smtp-Source: ACJfBosCjUkIo4FQzJkrNrV3ksdqpJ3UlpSMWInoQhKCEErKMcaykrQuc4pEwXq/egCjvQ6sjSyw X-Received: by 10.98.163.200 with SMTP id q69mr9965486pfl.21.1513854215348; Thu, 21 Dec 2017 03:03:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513854215; cv=none; d=google.com; s=arc-20160816; b=vP6Bo2qK4bgjWjQyP4szdFkMTUT/+zT1uDU/H9T+7Y82Ck9Ew/eT2gT+iuIFBrKE0H 6Qj+9Mx91vAo/NgkIu6v0OU6qfM2Q4CAIdoyUUcxnpfNws+9LeRc1rMUZDjRe+wDBtW4 QHWX3DRZjgFvtcJ8VrXooZFfHuvmWAwSpnRQdwk0eaXXb2aT2ehEbAVt21DrZY8+v1SJ WUdAGksXKrcrhtaI8pUpIikwSDhi67NghaGhnMp5CFp/OddCKBz7J5UJIrLne85vl2rK rq4UQJewrhHm6sp8QM1C1FABEPzeMenkuMZBx+6B57TST2D795zpwQNKGMmyBWLM0nAS EIGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:references:in-reply-to :message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=APzK59a5Q+LuWfWQcGPGdD1+2J96IuwfF1lLcYyAl5Q=; b=zAodLkXE3Ld5ABS9hELLDsFxMWBB/LButJJnsQPxM/7SO32K5m5IDDTJoGL7TNix8n 7df6NU7oueV4cAuQm873Y0dDzVkiM1T1S+LHUACNUQ+LTUiGRkcw+Hf2orUKadwlZkzQ Y/yklpnGs6DywoM+pqKLebsjNDLCbpVB5W0apRC4Yo0UmBZFX8avoHhBByoFctYWXDCP r17XTrcMMK79lpsJEzhPqeFn3Lbuj/rhnMVww3zCFHjKGlUo0wkuiwK/KVwzI7dWtEPc LCpwupTyUfraebr++GawrfNZ6DvOcIu+c8Q5+xzGe+uZpOkg4dOxji+uqHaGzJTE/Pif ELQw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id be1si12199296plb.48.2017.12.21.03.03.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Dec 2017 03:03:35 -0800 (PST) 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; 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 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 760496E60E; Thu, 21 Dec 2017 11:03:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id B4AF16E60E for ; Thu, 21 Dec 2017 11:03:03 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 7140B209CA; Thu, 21 Dec 2017 12:03:02 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id F1430207C8; Thu, 21 Dec 2017 12:02:43 +0100 (CET) From: Maxime Ripard To: Daniel Vetter , David Airlie , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v5 03/12] dt-bindings: display: sun4i-drm: Add LVDS properties Date: Thu, 21 Dec 2017 12:02:29 +0100 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Cc: Mark Rutland , Thomas Petazzoni , jernej.skrabec@siol.net, plaes@plaes.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Rob Herring , thierry.reding@gmail.com, Laurent Pinchart , linux-arm-kernel@lists.infradead.org, icenowy@aosc.io X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Some clocks and resets supposed to drive the LVDS logic in the display engine have been overlooked when the driver was first introduced. Add those additional resources to the binding, and we'll deal with the ABI stability in the code. Reviewed-by: Chen-Yu Tsai Reviewed-by: Rob Herring Signed-off-by: Maxime Ripard --- Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 9 +++++++- 1 file changed, 9 insertions(+) diff --git a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt index 50cc72ee1168..1e21cfaac9e2 100644 --- a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +++ b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt @@ -121,6 +121,15 @@ Required properties: On SoCs other than the A33 and V3s, there is one more clock required: - 'tcon-ch1': The clock driving the TCON channel 1 +On SoCs that support LVDS (all SoCs but the A13, H3, H5 and V3s), you +need one more reset line: + - 'lvds': The reset line driving the LVDS logic + +And on the SoCs newer than the A31 (sun6i and sun8i families), you +need one more clock line: + - 'lvds-alt': An alternative clock source, separate from the TCON channel 0 + clock, that can be used to drive the LVDS clock + DRC --- From patchwork Thu Dec 21 11:02:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 122537 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp726126qgn; Thu, 21 Dec 2017 03:04:10 -0800 (PST) X-Google-Smtp-Source: ACJfBoslP9zhBLvKGVcxifwmIDMMTzaJdEkGAOv/e/Z17hw7OFkcw7XwSGAGSFz8/LP5vnobmpXx X-Received: by 10.99.55.23 with SMTP id e23mr1807930pga.156.1513854250641; Thu, 21 Dec 2017 03:04:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513854250; cv=none; d=google.com; s=arc-20160816; b=qEQX6Tv58nqNDPxVB64s+qPcZITaYtXEDjlo4D84tmnT1nBz6gm+v1EPmX4TLEhIp4 IiKzt7bLEZBASm+O5wCBCYAZd8shyY9T39BI6GMvofHwaTSd/dsqUHEym1CUImFfiARe 0gN0Q6qjw5KV3RMZJ5yUfOJMoPtrlOidE72yt0b8RQWvSmxMAYnvjV1vtFNO60ZDSlV7 gOj+vhadyqOYIYe9E333Z2nUP4mgVQznb97Q4Oq+IKOaMa8mxmKQ5w8SpsXPkUuWlCR1 oY2UtoAXvNSufYSFr5geQ1kSeb5EYUwUcLk8qnf6hzvUJ6ubJ/1pZlo9xdew3FLU9fyt Imbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:references:in-reply-to :message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=7pzuPYkPzeqia9I/2Qq86oIfVyFcYSUvcYEXiflehmg=; b=XE7nHn6WOJo+TmMhJiUx1kuliLwmwsplevp+SJ64aHKpziURywJQrAs6MASLCMxlqN Ufpg5FbP8xdp14CRhumVoF6uLwEVIeKia7g8tsHkn7Dn3vITIk9gBwAojAV+XPvwRqZw vsYfiXUefbLJo33Si36NeEY1pTqnFYduUDgHjjmgHWgFy1q8cb/7/0JzrO96IRjs5omo Ldji9iSzB1TQ2Z8bxOs24NnyUbbook5f2wbULa7pnpfafCILZMbg9XpLyza/wjqjwkzR MkF6hx4rZR64m8PADsZLPNzds9ji/BiW7E1Dtmyd2JC2FDwoiDrvswHbQY8upTiCIz8X cT4Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id u84si7580269pgb.823.2017.12.21.03.04.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Dec 2017 03:04:10 -0800 (PST) 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; 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 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7850C6E623; Thu, 21 Dec 2017 11:03:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 0F8006E60E for ; Thu, 21 Dec 2017 11:03:04 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id C05B9209D3; Thu, 21 Dec 2017 12:03:02 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 5A298207CA; Thu, 21 Dec 2017 12:02:44 +0100 (CET) From: Maxime Ripard To: Daniel Vetter , David Airlie , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v5 04/12] dt-bindings: display: sun4i-drm: Add A83T pipeline Date: Thu, 21 Dec 2017 12:02:30 +0100 Message-Id: <2702a5c1d224af1c51743492ad1b917966f2ad43.1513854122.git-series.maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Cc: Mark Rutland , Thomas Petazzoni , jernej.skrabec@siol.net, plaes@plaes.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Rob Herring , thierry.reding@gmail.com, Laurent Pinchart , linux-arm-kernel@lists.infradead.org, icenowy@aosc.io X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The A83T has two video pipelines in parallel that looks quite similar to the other SoCs. The video planes are handled through a controller called the mixer, and the video signal is then passed to the timing controller (TCON). And while there is two instances of the mixers and TCONs, they have a significant number of differences. The TCONs are quite easy to deal with, one is supposed to generate TV (in the broader term, so including things like HDMI) signals, the other one LCD (so RGB, LVDS, DSI) signals. And while they are called TCON0 and TCON1 in the A83t datasheet, newer SoCs call them TCON-TV and TCON-LCD, which seems more appropriate. However, the mixers differ mostly by their capabilities, with some features being available only in the first one, or the number of planes they expose, but also through their register layout. And while the capabilities could be represented as properties, the register layout differences would need to express all the registers offsets as properties, which is usually quite bad. Especially since documentation on that hardware block is close to non-existant and we don't even have the list of all those registers in the first place. So let's call them mixer 0 and 1 in our compatibles, even though the name is pretty bad... At the moment, we only have tested the code on a board that has a single display output, so we're leaving the tcon-tv and mixer1 out. Reviewed-by: Rob Herring Reviewed-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard --- Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt index 1e21cfaac9e2..9f073af4c711 100644 --- a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +++ b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt @@ -93,6 +93,7 @@ Required properties: * allwinner,sun6i-a31s-tcon * allwinner,sun7i-a20-tcon * allwinner,sun8i-a33-tcon + * allwinner,sun8i-a83t-tcon-lcd * allwinner,sun8i-v3s-tcon - reg: base address and size of memory-mapped region - interrupts: interrupt associated to this IP @@ -225,6 +226,7 @@ supported. Required properties: - compatible: value must be one of: + * allwinner,sun8i-a83t-de2-mixer-0 * allwinner,sun8i-v3s-de2-mixer - reg: base address and size of the memory-mapped region. - clocks: phandles to the clocks feeding the mixer @@ -254,6 +256,7 @@ Required properties: * allwinner,sun6i-a31s-display-engine * allwinner,sun7i-a20-display-engine * allwinner,sun8i-a33-display-engine + * allwinner,sun8i-a83t-display-engine * allwinner,sun8i-v3s-display-engine - allwinner,pipelines: list of phandle to the display engine From patchwork Thu Dec 21 11:02:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 122536 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp725868qgn; Thu, 21 Dec 2017 03:03:58 -0800 (PST) X-Google-Smtp-Source: ACJfBouiWjeoMHvIVQqOne7eAf0z0c/8uIzIwd1YkOJS8zM281EX+6DN9m/HAHT/PV2f9krDLzNP X-Received: by 10.99.115.93 with SMTP id d29mr9335460pgn.345.1513854237977; Thu, 21 Dec 2017 03:03:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513854237; cv=none; d=google.com; s=arc-20160816; b=SmHwABPLH+f2bnITWhzbokXgS6p2oOK0dJ3DG2VSUcieRg2qOLBULhp11cwP/0wEG9 1OruYeI/+plwk+ffCJutbLYFsQQFjN6BHQEwVnri/PyDT6YIpkqbQqUTzL9Azai8+aT8 fGoYOdujOGdYk3m69VF1oyZhj0aWw144bqoRDDoKUpc6OtYOTo5G+iipTaNZ4ImCsUuq AAkvIH39hBGT88VHBZxPKsrr2C11ovWmf1MCIqFW8OPSOD2OciCueaz4OhruHeY/T1lW vXkZHVprD46uxTKQu9CMFXDCM7kbwKq5oleJzsSFFqCHA6J10qxBReF+XfeAHU5p3rgw Nytw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:references:in-reply-to :message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=KWlVKOuu1gqRCz9NLnJ9tNvLUPk0gFBV3kpSziG8DWc=; b=HqAf3WqmMXFLDvxgsZ7BBcuwcZS3AkAGr83HJydwEGk+PQgm1SKOjfvubSBCQ+IPPj cs5CyF6qK3DSNfxeodaI41JQpCeQdPh76fi9ZNh2okJouZCSJPQQjnHHxuLy+f1OcyHN a4eAj7ZYWKXa2lanrTqF3VmGjLWhArMSygRO1gjePd5x3lC8nvC01pz2+sQiFOVaig0b LESPLEKLiFcxrVzITjP5DmAsQLyU30HZJi38ck5FQF1/A1npAGCC46I0WdtpOZlqNL+M 0fNbhWxl6g5w8B45EdToI99deR9FsnfeLwUkM2MDcgciWR5pYQD8M4t8VaT3H6At5Qw1 /WwQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id x21si14829154pfa.129.2017.12.21.03.03.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Dec 2017 03:03:57 -0800 (PST) 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; 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 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 325876E616; Thu, 21 Dec 2017 11:03:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 1CC416E60F for ; Thu, 21 Dec 2017 11:03:04 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id C9D43209B1; Thu, 21 Dec 2017 12:03:02 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id B35A5207F3; Thu, 21 Dec 2017 12:02:44 +0100 (CET) From: Maxime Ripard To: Daniel Vetter , David Airlie , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v5 05/12] drm/sun4i: Force the mixer rate at 150MHz Date: Thu, 21 Dec 2017 12:02:31 +0100 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Cc: Mark Rutland , Thomas Petazzoni , jernej.skrabec@siol.net, plaes@plaes.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Rob Herring , thierry.reding@gmail.com, Laurent Pinchart , linux-arm-kernel@lists.infradead.org, icenowy@aosc.io X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" It seems like the mixer can only run properly when clocked at 150MHz. In order to have something more robust than simply a fire-and-forget assigned-clocks-rate, let's put that in the code. Reviewed-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun8i_mixer.c | 10 ++++++++++ drivers/gpu/drm/sun4i/sun8i_mixer.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c index 29ceeb016d72..3a610a87cbd2 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c @@ -398,6 +398,15 @@ static int sun8i_mixer_bind(struct device *dev, struct device *master, ret = PTR_ERR(mixer->mod_clk); goto err_disable_bus_clk; } + + /* + * It seems that we need to enforce that rate for whatever + * reason for the mixer to be functional. Make sure it's the + * case. + */ + if (mixer->cfg->mod_rate) + clk_set_rate(mixer->mod_clk, mixer->cfg->mod_rate); + clk_prepare_enable(mixer->mod_clk); list_add_tail(&mixer->engine.list, &drv->engine_list); @@ -474,6 +483,7 @@ static const struct sun8i_mixer_cfg sun8i_v3s_mixer_cfg = { .ui_num = 1, .scaler_mask = 0x3, .ccsc = 0, + .mod_rate = 150000000, }; static const struct of_device_id sun8i_mixer_of_table[] = { diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.h b/drivers/gpu/drm/sun4i/sun8i_mixer.h index bc58040a88f9..f34e70c42adf 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.h +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.h @@ -121,12 +121,15 @@ struct de2_fmt_info { * Set value to 0 if this is first mixer or second mixer with VEP support. * Set value to 1 if this is second mixer without VEP support. Other values * are invalid. + * @mod_rate: module clock rate that needs to be set in order to have + * a functional block. */ struct sun8i_mixer_cfg { int vi_num; int ui_num; int scaler_mask; int ccsc; + unsigned long mod_rate; }; struct sun8i_mixer { From patchwork Thu Dec 21 11:02:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 122534 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp725542qgn; Thu, 21 Dec 2017 03:03:41 -0800 (PST) X-Google-Smtp-Source: ACJfBosmccoU8gVvK0CuEA8EK+A6xz+rSBs70tNlHlCBk6jKeGJXILRUnJQHmUwXu+9MSvIPttxR X-Received: by 10.98.238.8 with SMTP id e8mr10094558pfi.23.1513854221556; Thu, 21 Dec 2017 03:03:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513854221; cv=none; d=google.com; s=arc-20160816; b=aBJFQhb0mXMBcY2nTDgrQhFFZZh3mDUju1vqajIpdf89BqYeT5Xacpz2WXGyPqbHlF qKf/ajZbeTreCOIUitCuquba/VVGtZe/FjgjIqM1yvfNgxMvTfh5Km/l9fGNLkFLGSr6 2f0A8y4yW7NZNYSz489cieCCGEaOidxzSo73pAOwrqpE9gYvlcPG8NiQSf/grJXaeSe8 oJ6wJbmaVMi7jKIawfvreoAYnFxGSZb+p0RBTzsrkeNXczXR2V/Pq1RfFXQdrfTlN/8h LFWoSE7lKlS9Hk2Xxk8mM2e/ZfvUbAvSVfmC83N7eGKBUxqFeos98PGgzZL7bZEpuTyV Y1zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:references:in-reply-to :message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=tkc3V9uuZFSHeVgYict9H2TCIk0JXykAG8dZMJYeZi8=; b=peqg6hVJK/pTa+4leaM2bwsgdIe2xmcCsPb7/Rhkqsfm9rkD60pglTgar+anD7cBiz h+S4VSWiHL+5auH8PeoOlUtnmWVnWukiZ7U1fW15CcGFnAMbrUlwBgmCCuLelFy0ynJs DRfjWHgnBydF79lhsYW3GNJKpu0Rw0UAF3tmwM/MDYNE564iJ07V3ZZ32kY5RJovABsy gvBhVAV9P/cE+MzjA7geV9LZNB5Go342CDhiYgeV8scrkqDSqi9AHJLYv4jYm/P5/s4h 8ZZD69HkeGkvpHszFukugkbsBO773DvyYWN+RCJtXZt+6d2Khd+HW/FY7shv5bdyt4jZ iavA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id w1si14477026plz.696.2017.12.21.03.03.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Dec 2017 03:03:41 -0800 (PST) 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; 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 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D4DE26E614; Thu, 21 Dec 2017 11:03:07 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 64E086E60F for ; Thu, 21 Dec 2017 11:03:04 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 23609209D9; Thu, 21 Dec 2017 12:03:03 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 19B7E2082F; Thu, 21 Dec 2017 12:02:45 +0100 (CET) From: Maxime Ripard To: Daniel Vetter , David Airlie , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v5 06/12] drm/sun4i: Create minimal multipliers and dividers Date: Thu, 21 Dec 2017 12:02:32 +0100 Message-Id: <92ff5881c8f8674056d34458b2f264cd48d4e136.1513854122.git-series.maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Cc: Mark Rutland , Thomas Petazzoni , jernej.skrabec@siol.net, plaes@plaes.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Rob Herring , thierry.reding@gmail.com, Laurent Pinchart , linux-arm-kernel@lists.infradead.org, icenowy@aosc.io X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The various outputs the TCON can provide have different constraints on the dotclock divider. Let's make them configurable by the various mode_set functions. Reviewed-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard --- drivers/gpu/drm/sun4i/sun4i_dotclock.c | 10 +++++++--- drivers/gpu/drm/sun4i/sun4i_tcon.c | 2 ++ drivers/gpu/drm/sun4i/sun4i_tcon.h | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_dotclock.c b/drivers/gpu/drm/sun4i/sun4i_dotclock.c index d401156490f3..023f39bda633 100644 --- a/drivers/gpu/drm/sun4i/sun4i_dotclock.c +++ b/drivers/gpu/drm/sun4i/sun4i_dotclock.c @@ -17,8 +17,9 @@ #include "sun4i_dotclock.h" struct sun4i_dclk { - struct clk_hw hw; - struct regmap *regmap; + struct clk_hw hw; + struct regmap *regmap; + struct sun4i_tcon *tcon; }; static inline struct sun4i_dclk *hw_to_dclk(struct clk_hw *hw) @@ -73,11 +74,13 @@ static unsigned long sun4i_dclk_recalc_rate(struct clk_hw *hw, static long sun4i_dclk_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *parent_rate) { + struct sun4i_dclk *dclk = hw_to_dclk(hw); + struct sun4i_tcon *tcon = dclk->tcon; unsigned long best_parent = 0; u8 best_div = 1; int i; - for (i = 6; i <= 127; i++) { + for (i = tcon->dclk_min_div; i <= tcon->dclk_max_div; i++) { unsigned long ideal = rate * i; unsigned long rounded; @@ -167,6 +170,7 @@ int sun4i_dclk_create(struct device *dev, struct sun4i_tcon *tcon) dclk = devm_kzalloc(dev, sizeof(*dclk), GFP_KERNEL); if (!dclk) return -ENOMEM; + dclk->tcon = tcon; init.name = clk_name; init.ops = &sun4i_dclk_ops; diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index ea056a3d2131..46e28ca1f676 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -177,6 +177,8 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon, u8 clk_delay; u32 val = 0; + tcon->dclk_min_div = 6; + tcon->dclk_max_div = 127; sun4i_tcon0_mode_set_common(tcon, mode); /* Adjust clock delay */ diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.h b/drivers/gpu/drm/sun4i/sun4i_tcon.h index 839266a38505..bd3ad7684870 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.h +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.h @@ -169,6 +169,8 @@ struct sun4i_tcon { /* Pixel clock */ struct clk *dclk; + u8 dclk_max_div; + u8 dclk_min_div; /* Reset control */ struct reset_control *lcd_rst; From patchwork Thu Dec 21 11:02:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 122528 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp724905qgn; Thu, 21 Dec 2017 03:03:07 -0800 (PST) X-Google-Smtp-Source: ACJfBoumvi+Dv2ALokEugzfDBciotSuvhFjMMJ4PaPvciCWApNxVmpkNBIrN/xRWx/leDEj/CfHQ X-Received: by 10.98.19.202 with SMTP id 71mr10121509pft.181.1513854187810; Thu, 21 Dec 2017 03:03:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513854187; cv=none; d=google.com; s=arc-20160816; b=N7Xws2D3nwL9+ySpGvy7R1TSFsMEf5PzxaRnPLSCXX4Ssd4A+VDPabap+4jmgZYtLB D+iqwRH9eiWL08RSDt8duiylyipIncN7TNJC4cRV7C3qeNixxLaBrJxPr5DJEtjebfs5 iSN/SkYjAE9GiT3VP+sA22QZ4JZmcjD6Y6vvEqVIV5RAFZ11aza5CrGLwgDVfdLBcgJ8 JXJbW5/EKVxIggPPI6x31+oXaDplYGcv/tVE89vB7Fs9XQSD74NYFC5Y7oNVvgY7tCBV fA84m2N+9vNqgeyTL1werF8sKuAmA+S8lYU+fDfM4r3DHkCFP99vJM0OPgpl9JSV02+A AfmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:references:in-reply-to :message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=whs27aOwaT2f9hmHLSiTIgSVcxWkBUI1xMIyPhvAzco=; b=eMQezIwpz7Kth84MiuVeBpbHBNfZZK8PEy+YG3AhB00nCmf6aTCc3bNX2QqFniz+J4 vgK8R5NYYJR1CYgd/Dhjyn0U5RPQ9YwXSPKv69eKjyZUfKVjd+yL0VJvkbGJc6srX/EZ zKb/b9zENsixE2d6PU1YMPdk/allwSGIOyQK9FrlEkkwh4Tzamwpd0RfPpE9zyqXHpIv 7B+95wbH4qeIwRJSz0Hd92FFobG0YXz2nfpPM9R+jM6W4MHetY/3lVpl0W0hZ6Dk2EK9 LGVSEkED0RwpNdPDcZN91sCwqWHqWifYx+zgivMpRT+Bj8GtGh2Rv6w/5YemkbdIxElc 72eQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id z8si14764866pfh.232.2017.12.21.03.03.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Dec 2017 03:03:07 -0800 (PST) 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; 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 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 25F166E610; Thu, 21 Dec 2017 11:03:06 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id C48226E611 for ; Thu, 21 Dec 2017 11:03:04 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 81441209E0; Thu, 21 Dec 2017 12:03:03 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 3737D20950; Thu, 21 Dec 2017 12:02:46 +0100 (CET) From: Maxime Ripard To: Daniel Vetter , David Airlie , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v5 09/12] ARM: dts: sun8i: a83t: Add display pipeline Date: Thu, 21 Dec 2017 12:02:35 +0100 Message-Id: <830777f54725de3cc6c4f179aac90c1df304e8bc.1513854122.git-series.maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Cc: Mark Rutland , Thomas Petazzoni , jernej.skrabec@siol.net, plaes@plaes.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Rob Herring , thierry.reding@gmail.com, Laurent Pinchart , linux-arm-kernel@lists.infradead.org, icenowy@aosc.io X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The display pipeline on the A83T is mainly composed of the mixers and TCONs, plus various encoders. Let's add the first mixer and TCON to the DTSI since the only board I have can use only the LVDS output on the first TCON. The other parts will be added eventually. Reviewed-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard --- arch/arm/boot/dts/sun8i-a83t.dtsi | 79 ++++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi index 19acae1b4089..e4db38c717d9 100644 --- a/arch/arm/boot/dts/sun8i-a83t.dtsi +++ b/arch/arm/boot/dts/sun8i-a83t.dtsi @@ -45,8 +45,10 @@ #include #include +#include #include #include +#include #include / { @@ -151,6 +153,12 @@ }; }; + de: display-engine { + compatible = "allwinner,sun8i-a83t-display-engine"; + allwinner,pipelines = <&mixer0>; + status = "disabled"; + }; + memory { reg = <0x40000000 0x80000000>; device_type = "memory"; @@ -162,6 +170,44 @@ #size-cells = <1>; ranges; + display_clocks: clock@1000000 { + compatible = "allwinner,sun8i-a83t-de2-clk"; + reg = <0x01000000 0x100000>; + clocks = <&ccu CLK_PLL_DE>, + <&ccu CLK_BUS_DE>; + clock-names = "mod", + "bus"; + resets = <&ccu RST_BUS_DE>; + #clock-cells = <1>; + #reset-cells = <1>; + }; + + mixer0: mixer@1100000 { + compatible = "allwinner,sun8i-a83t-de2-mixer-0"; + reg = <0x01100000 0x100000>; + clocks = <&display_clocks CLK_BUS_MIXER0>, + <&display_clocks CLK_MIXER0>; + clock-names = "bus", + "mod"; + resets = <&display_clocks RST_MIXER0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + mixer0_out: port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + mixer0_out_tcon0: endpoint@0 { + reg = <0>; + remote-endpoint = <&tcon0_in_mixer0>; + }; + }; + }; + }; + syscon: syscon@1c00000 { compatible = "allwinner,sun8i-a83t-system-controller", "syscon"; @@ -177,6 +223,39 @@ #dma-cells = <1>; }; + tcon0: lcd-controller@1c0c000 { + compatible = "allwinner,sun8i-a83t-tcon-lcd"; + reg = <0x01c0c000 0x1000>; + interrupts = ; + clocks = <&ccu CLK_BUS_TCON0>, <&ccu CLK_TCON0>; + clock-names = "ahb", "tcon-ch0"; + clock-output-names = "tcon-pixel-clock"; + resets = <&ccu RST_BUS_TCON0>, <&ccu RST_BUS_LVDS>; + reset-names = "lcd", "lvds"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + tcon0_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + tcon0_in_mixer0: endpoint@0 { + reg = <0>; + remote-endpoint = <&mixer0_out_tcon0>; + }; + }; + + tcon0_out: port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + }; + }; + mmc0: mmc@1c0f000 { compatible = "allwinner,sun8i-a83t-mmc", "allwinner,sun7i-a20-mmc"; From patchwork Thu Dec 21 11:02:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 122527 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp724790qgn; Thu, 21 Dec 2017 03:03:02 -0800 (PST) X-Google-Smtp-Source: ACJfBoth7wy6nNHsk23WZty4T1qDa3pfG5QSfQhZM+4+E5K58bGz3JUApspUlGBYDpKkkFXx2tsY X-Received: by 10.98.76.90 with SMTP id z87mr10267538pfa.194.1513854182035; Thu, 21 Dec 2017 03:03:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513854182; cv=none; d=google.com; s=arc-20160816; b=l5c0w1EfKng+q1aT1WrquQywQFfLMXc1uxj/vkTSbLYKzcLVmn40v6QruBLTE4XwqT m7GiLRwzWlGdoTgZ96qOgQ6FbxZn6nM+rblvdNB7lH38Jtc75H+BZlByndpHBUd5LcXD ukzNpjXaZPwFuwrS5x+tvosDtwsuqZefbReD2rncYa1Dv3DAq1gt5N2E24uwtnkWW2ft BKbGRQpkWdAT8lo04nhC4ga6uzMD1bXYn9QH26+WcxAlpF55fUEnLd7KVGGbZONL1Spn J2UZ0CkH4bm/0mQX7zkpGfoZsi/Zxbcsf0VJxk0xMndA1d9w1GBwY+Bq/n/OKa3Epy9y nFsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:references:in-reply-to :message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=0Q7/Xum7puKeJQC87x3vV2G3J9LY5JE7bLH/B4CMKlw=; b=aPYRXVlq8haeLMpPWMHaAejQNP6ReFH4jwLn68KAxQKzDcffJOgsDtnuBN4wwAz+q2 pcZhWwU90nBG55eyM5/Tdxb+Pew63/0mFPpbEF4HH4Fv2J4l2LO1XLXxBTHgnf7Uw38W 9rNsB11TeLzxUqkQ9hR8ak7kXJwqIhWBoWrcEBB59l+oQ9K6f1KATdaTes9UKPnB7r3t 8ZsYN35/E8tJtBt+mMoe+4BGn+xlN1DekyyATtYm9i+NHirPGudwQzIIUmntxLC40+iI sYXM/F/kVWuf1vErkNz6wAodDzffZ9oRD6HZBmNlCsVtguVL2SRcn62Y3mSpNf5tKN37 BDuA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id g1si3578417pgo.637.2017.12.21.03.03.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Dec 2017 03:03:02 -0800 (PST) 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; 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 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BC1176E609; Thu, 21 Dec 2017 11:02:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id AB0036E603 for ; Thu, 21 Dec 2017 11:02:54 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id AD3DC20981; Thu, 21 Dec 2017 12:02:52 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 7C1C020383; Thu, 21 Dec 2017 12:02:42 +0100 (CET) From: Maxime Ripard To: Daniel Vetter , David Airlie , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v5 10/12] ARM: dts: sun8i: a83t: Enable the PWM Date: Thu, 21 Dec 2017 12:02:36 +0100 Message-Id: <0660061a425cbe3ea6426f5271457d6dde9313f1.1513854122.git-series.maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Cc: Mark Rutland , Thomas Petazzoni , jernej.skrabec@siol.net, plaes@plaes.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Rob Herring , thierry.reding@gmail.com, Laurent Pinchart , linux-arm-kernel@lists.infradead.org, icenowy@aosc.io X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The A83T has the same PWM block than the H3. Add it to our DT. Reviewed-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard --- arch/arm/boot/dts/sun8i-a83t.dtsi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi b/arch/arm/boot/dts/sun8i-a83t.dtsi index e4db38c717d9..ae34d22d6d47 100644 --- a/arch/arm/boot/dts/sun8i-a83t.dtsi +++ b/arch/arm/boot/dts/sun8i-a83t.dtsi @@ -440,6 +440,11 @@ bias-pull-up; }; + pwm_pin: pwm-pin { + pins = "PD28"; + function = "pwm"; + }; + spdif_tx_pin: spdif-tx-pin { pins = "PE18"; function = "spdif"; @@ -497,6 +502,15 @@ status = "disabled"; }; + pwm: pwm@1c21400 { + compatible = "allwinner,sun8i-a83t-pwm", + "allwinner,sun8i-h3-pwm"; + reg = <0x01c21400 0x400>; + clocks = <&osc24M>; + #pwm-cells = <3>; + status = "disabled"; + }; + uart0: serial@1c28000 { compatible = "snps,dw-apb-uart"; reg = <0x01c28000 0x400>; From patchwork Thu Dec 21 11:02:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 122535 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp725592qgn; Thu, 21 Dec 2017 03:03:44 -0800 (PST) X-Google-Smtp-Source: ACJfBovGjL40ARoXq1+FIoZaIbBIc2mwG+cWOi5bR4/en6YYpDXSs5+WliPiHLf4TI5ze6NEc7Wf X-Received: by 10.159.244.12 with SMTP id x12mr10367997plr.312.1513854224468; Thu, 21 Dec 2017 03:03:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513854224; cv=none; d=google.com; s=arc-20160816; b=nvTD+7YTyxBNHleiVwnjAIZ6kMGzY/CTD2cKYQ1kCSwYncJu0fd7iwC2ZXu0fDlrm4 hfZsDsyxLvAZtWjQDyXoWjTkajL0HvXnvo8yTKUM1zvhdWGtFN1KOq8JIxcMjVGmPFqj 4aQF0aEu+W0e+fqE4N7oWblKnhkSx3J/dhVw2apGy23F/UGcbjkq6Aez+7/GCBIreW6k LXqUVRwl0TJ2V0SQg9wpo3Qvs+Nc8HATowlr0C+VHfdvVbUzsCiHGhlXEXuG/ZGR1WKl v2BAOtzR2PfDjtMwG5CExQr8rx8JSMvYiMKW3xcV2ryRfQIdmuFIixGvAZoPVq/Qx6rS PaUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:references:in-reply-to :message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=yOtOkkc6awb2NsC5bNUzcnUStPGdnuJt7GN2PktHH3E=; b=YZKi9LNMQ+WpqqyHaf1ipLSfvbxdDXklcpuvCyc/8OJgzJIDLJWxxNb/SB+vs5MMy8 cO94ofqYwwVuHJzw/sINwNe6inexacCI3WqIRMWxmjAWn9kjJhHmac620XPwa7j3ktpa K8oRjuV+mIkzSgFEW+Kt6rDpF5TXrOS/fLLolV+gUpaPdcLNVMU3/w1Vue014paS9u1N wZp6SNiUxGZWcrvj4YuP2fNsKFw9vgz86PPU1jnZwQHvf0pBCU2wxHo5qUiy+vWLf0mL kOt3jVKcNxcAw1/t5kwFQhBjmAHksTmITW6KD6yqDWc986ckPCNuEFVxSOh8VclJO5qH wrww== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id 5si14498361plt.371.2017.12.21.03.03.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Dec 2017 03:03:44 -0800 (PST) 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; 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 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9D3CB6E628; Thu, 21 Dec 2017 11:03:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id D35266E628 for ; Thu, 21 Dec 2017 11:03:13 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 8F845209EB; Thu, 21 Dec 2017 12:03:12 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 1F4D820956; Thu, 21 Dec 2017 12:02:47 +0100 (CET) From: Maxime Ripard To: Daniel Vetter , David Airlie , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v5 12/12] ARM: dts: sun8i: a711: Enable the LCD Date: Thu, 21 Dec 2017 12:02:38 +0100 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Cc: Mark Rutland , Thomas Petazzoni , jernej.skrabec@siol.net, plaes@plaes.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Rob Herring , thierry.reding@gmail.com, Laurent Pinchart , linux-arm-kernel@lists.infradead.org, icenowy@aosc.io X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The A711 has 1024x600 LVDS panel, with a PWM-based backlight. Add it to our DT. Reviewed-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard --- arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts | 61 ++++++++++++++++++++++++- 1 file changed, 61 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts index a021ee6da396..511fca491fe8 100644 --- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts +++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts @@ -45,6 +45,7 @@ #include "sun8i-a83t.dtsi" #include +#include / { model = "TBS A711 Tablet"; @@ -59,6 +60,44 @@ stdout-path = "serial0:115200n8"; }; + backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; + enable-gpios = <&pio 3 29 GPIO_ACTIVE_HIGH>; + + brightness-levels = <0 1 2 4 8 16 32 64 128 255>; + default-brightness-level = <9>; + }; + + panel { + compatible = "tbs,a711-panel", "panel-lvds"; + backlight = <&backlight>; + power-supply = <®_sw>; + + width-mm = <153>; + height-mm = <90>; + data-mapping = "vesa-24"; + + panel-timing { + /* 1024x600 @60Hz */ + clock-frequency = <52000000>; + hactive = <1024>; + vactive = <600>; + hsync-len = <20>; + hfront-porch = <180>; + hback-porch = <160>; + vfront-porch = <12>; + vback-porch = <23>; + vsync-len = <5>; + }; + + port { + panel_input: endpoint { + remote-endpoint = <&tcon0_out_lcd>; + }; + }; + }; + reg_vbat: reg-vbat { compatible = "regulator-fixed"; regulator-name = "vbat"; @@ -89,6 +128,10 @@ }; }; +&de { + status = "okay"; +}; + /* * An USB-2 hub is connected here, which also means we don't need to * enable the OHCI controller. @@ -142,6 +185,12 @@ status = "okay"; }; +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm_pin>; + status = "okay"; +}; + &r_rsb { status = "okay"; @@ -323,6 +372,18 @@ regulator-name = "vcc-lcd"; }; +&tcon0 { + pinctrl-names = "default"; + pinctrl-0 = <&lcd_lvds_pins>; +}; + +&tcon0_out { + tcon0_out_lcd: endpoint@0 { + reg = <0>; + remote-endpoint = <&panel_input>; + }; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pb_pins>;