From patchwork Tue Feb 5 06:38:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Kemnade X-Patchwork-Id: 10796983 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 875991805 for ; Tue, 5 Feb 2019 08:05:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79C332AED7 for ; Tue, 5 Feb 2019 08:05:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E5632AF18; Tue, 5 Feb 2019 08:05:09 +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,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 29AA82AED7 for ; Tue, 5 Feb 2019 08:05:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C541C6E655; Tue, 5 Feb 2019 08:04:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from h2641619.stratoserver.net (mail.andi.de1.cc [IPv6:2a01:238:43f3:0:615b:ee97:1f81:cbf2]) by gabe.freedesktop.org (Postfix) with ESMTPS id 14D2B6E0EC for ; Tue, 5 Feb 2019 06:38:31 +0000 (UTC) Received: from hsvpn34.hotsplots.net ([176.74.57.181] helo=localhost) by h2641619.stratoserver.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gquNF-0005Aa-Lo; Tue, 05 Feb 2019 07:38:25 +0100 Received: from andi by localhost with local (Exim 4.89) (envelope-from ) id 1gquNE-0003sm-EL; Tue, 05 Feb 2019 07:38:24 +0100 From: Andreas Kemnade To: tomi.valkeinen@ti.com, airlied@linux.ie, daniel@ffwll.ch, laurent.pinchart@ideasonboard.com, sre@kernel.org, dri-devel@lists.freedesktop.org, robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org Subject: [PATCH v2 1/2] drm/omap: panel-tpo-td028ttec1: add backlight support Date: Tue, 5 Feb 2019 07:38:12 +0100 Message-Id: <20190205063813.14873-2-andreas@kemnade.info> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190205063813.14873-1-andreas@kemnade.info> References: <20190205063813.14873-1-andreas@kemnade.info> X-Mailman-Approved-At: Tue, 05 Feb 2019 08:04:34 +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: Andreas Kemnade MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This panel has a backlight, so fetch it from devicetree using the corresponding property as documented in panel-common.txt. It is implemented the same way as in panel-dpi.c This ensures the backlight is also disabled when the display is turned off like when doing xset dpms force off. Signed-off-by: Andreas Kemnade Reviewed-by: Laurent Pinchart --- Changes in v2: - do not reorder initialisation - fix commit message drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c index 7ddc8c574a61..1db8740f3c21 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c @@ -35,6 +35,8 @@ struct panel_drv_data { struct videomode vm; + struct backlight_device *backlight; + struct spi_device *spi_dev; }; @@ -268,6 +270,8 @@ static int td028ttec1_panel_enable(struct omap_dss_device *dssdev) r |= jbt_ret_write_0(ddata, JBT_REG_DISPLAY_ON); + backlight_enable(ddata->backlight); + dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; transfer_err: @@ -283,6 +287,8 @@ static void td028ttec1_panel_disable(struct omap_dss_device *dssdev) if (!omapdss_device_is_enabled(dssdev)) return; + backlight_disable(ddata->backlight); + dev_dbg(dssdev->dev, "td028ttec1_panel_disable()\n"); jbt_ret_write_0(ddata, JBT_REG_DISPLAY_OFF); @@ -334,6 +340,10 @@ static int td028ttec1_panel_probe(struct spi_device *spi) if (ddata == NULL) return -ENOMEM; + ddata->backlight = devm_of_find_backlight(&spi->dev); + if (IS_ERR(ddata->backlight)) + return PTR_ERR(ddata->backlight); + dev_set_drvdata(&spi->dev, ddata); ddata->spi_dev = spi; From patchwork Tue Feb 5 06:38:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Kemnade X-Patchwork-Id: 10796979 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 8F21C1805 for ; Tue, 5 Feb 2019 08:04:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EE912AED7 for ; Tue, 5 Feb 2019 08:04:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 725262AF18; Tue, 5 Feb 2019 08:04:59 +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,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 E2BC92AED7 for ; Tue, 5 Feb 2019 08:04:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A4E976E652; Tue, 5 Feb 2019 08:04:36 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from h2641619.stratoserver.net (mail.andi.de1.cc [IPv6:2a01:238:43f3:0:615b:ee97:1f81:cbf2]) by gabe.freedesktop.org (Postfix) with ESMTPS id 199106E16B for ; Tue, 5 Feb 2019 06:38:31 +0000 (UTC) Received: from hsvpn34.hotsplots.net ([176.74.57.181] helo=localhost) by h2641619.stratoserver.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gquNG-0005Ad-Gc; Tue, 05 Feb 2019 07:38:26 +0100 Received: from andi by localhost with local (Exim 4.89) (envelope-from ) id 1gquNF-0003sp-Fr; Tue, 05 Feb 2019 07:38:25 +0100 From: Andreas Kemnade To: tomi.valkeinen@ti.com, airlied@linux.ie, daniel@ffwll.ch, laurent.pinchart@ideasonboard.com, sre@kernel.org, dri-devel@lists.freedesktop.org, robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org Subject: [PATCH v2 2/2] dt-bindings: panel: td028ttec1: add backlight property Date: Tue, 5 Feb 2019 07:38:13 +0100 Message-Id: <20190205063813.14873-3-andreas@kemnade.info> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190205063813.14873-1-andreas@kemnade.info> References: <20190205063813.14873-1-andreas@kemnade.info> X-Mailman-Approved-At: Tue, 05 Feb 2019 08:04:34 +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: Andreas Kemnade MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This adds an additional backlight property as described in panel-common.txt Signed-off-by: Andreas Kemnade Reviewed-by: Laurent Pinchart Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/display/panel/tpo,td028ttec1.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/tpo,td028ttec1.txt b/Documentation/devicetree/bindings/display/panel/tpo,td028ttec1.txt index ed34253d9fb1..898e06ecf4ef 100644 --- a/Documentation/devicetree/bindings/display/panel/tpo,td028ttec1.txt +++ b/Documentation/devicetree/bindings/display/panel/tpo,td028ttec1.txt @@ -6,6 +6,7 @@ Required properties: Optional properties: - label: a symbolic name for the panel +- backlight: phandle of the backlight device Required nodes: - Video port for DPI input @@ -21,6 +22,7 @@ lcd-panel: td028ttec1@0 { spi-cpha; label = "lcd"; + backlight = <&backlight>; port { lcd_in: endpoint { remote-endpoint = <&dpi_out>;