Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4484648imu; Sat, 19 Jan 2019 10:25:24 -0800 (PST) X-Google-Smtp-Source: ALg8bN7FdpHFDhx5/ZIg3e0GIZugHfqEd8F40msFncRFSPCSGfzAkhLmea1MLKSbfICt9NJ3AOWZ X-Received: by 2002:a62:f907:: with SMTP id o7mr23789271pfh.244.1547922324522; Sat, 19 Jan 2019 10:25:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547922324; cv=none; d=google.com; s=arc-20160816; b=OrI0yAPbfmPzinhC0ncxClHLI7ZtY1p118h9VTGAgA3IPpsT3Qq9RSrTbWLIuTU4BJ gTNne/vxKJKmigIkiI3YcKY16O+PSDnq6nCYA9pwDI9pHrtIBLVUlGYS5OGMnRjUBjHF UJpetgRtLU81byza8nKwfHCIjMDfl9taz0355pXBm/xUGdRUbdsZgYDYDS4GL19ZjaqY sqaQ2tmSQADLIe/+DjMMYPbKnu5JZldPNSZWXfeHgED45l6HEKDq2sOferZ9IE1hpasD R/rbElqV3EtvoNvxg/vDznSKuicy2Oi4pioQEXA4P0YqRxImYb6YuUXYAO0d4Pu83ouD 8RiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=Oq8pbeodEGapo8/OP8tFkoTtqrzNU++EUaZZseNpc5k=; b=nDoyzUphre8R7pyZjS4Go98eVuHJSLSXVW3qwKos3M3tFM3uJIFjCUaUG3P2P9USbH 2+0p8tX9whew4TB51E6rCkzeKuqouwp9QHMNCBZ9yyPVSkgtpZ+zDQt8OzbmiJy13dCJ vGay54AmSLeW5pqkOlnxIpcXGEe+0SBlIpLjFtObpgb5BYX8BH8cw9V08H4VonY3aSLn /NDmqTd7X6OiGr7ZFCHbEjo1lfEVP2O+KCQQjdxXnRypHGP7NY+6XDC+6tNMHeZZKJpe hTwBwqR3kfniv5DKPki90i5fAvpHYgpLzlpikLognZ/+bH4I4Dq4WnRDXExsmhBDZgXV gOsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kemnade.info header.s=20180802 header.b=Nwjm6K6E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si7423920plr.355.2019.01.19.10.24.57; Sat, 19 Jan 2019 10:25:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@kemnade.info header.s=20180802 header.b=Nwjm6K6E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729110AbfASSVw (ORCPT + 99 others); Sat, 19 Jan 2019 13:21:52 -0500 Received: from mail.andi.de1.cc ([85.214.239.24]:35042 "EHLO h2641619.stratoserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728937AbfASSVv (ORCPT ); Sat, 19 Jan 2019 13:21:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20180802; h=References:In-Reply-To:Message-Id:Date:Subject: Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Oq8pbeodEGapo8/OP8tFkoTtqrzNU++EUaZZseNpc5k=; b=Nwjm6K6E/QhFkjAkUwngfyiEQ ZZXudGlhodfrpEVbaH9z6hBwE4a0dx98hN+2TqMiMV+f6kqPL1EzxXxZ2kOSDTT0S89y8MrCdpjL4 KtQYaLsc/QY6QGOh2+60EotssY5tnsIinktmYk9xqAIS08s7vpJ11mL2nd6Mtzg1v827s=; Received: from p200300ccfbfb41001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:cc:fbfb:4100:1a3d:a2ff:febf:d33a] helo=aktux) by h2641619.stratoserver.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gkvFU-0002M8-MY; Sat, 19 Jan 2019 19:21:40 +0100 Received: from andi by aktux with local (Exim 4.89) (envelope-from ) id 1gkvFT-0002Sz-PD; Sat, 19 Jan 2019 19:21:39 +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 Cc: Andreas Kemnade Subject: [PATCH 1/2] drm/omap: panel-tpo-td028ttec1: add backlight support Date: Sat, 19 Jan 2019 19:21:30 +0100 Message-Id: <20190119182131.9341-2-andreas@kemnade.info> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190119182131.9341-1-andreas@kemnade.info> References: <20190119182131.9341-1-andreas@kemnade.info> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This panel has a backlight, so fetch it from devicetree using the 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 --- .../gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c index 7ddc8c574a61..f326ba9dcf62 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); @@ -321,6 +327,15 @@ static int td028ttec1_panel_probe(struct spi_device *spi) dev_dbg(&spi->dev, "%s\n", __func__); + ddata = devm_kzalloc(&spi->dev, sizeof(*ddata), GFP_KERNEL); + if (ddata == NULL) + return -ENOMEM; + + ddata->backlight = devm_of_find_backlight(&spi->dev); + + if (IS_ERR(ddata->backlight)) + return PTR_ERR(ddata->backlight); + spi->bits_per_word = 9; spi->mode = SPI_MODE_3; @@ -330,9 +345,6 @@ static int td028ttec1_panel_probe(struct spi_device *spi) return r; } - ddata = devm_kzalloc(&spi->dev, sizeof(*ddata), GFP_KERNEL); - if (ddata == NULL) - return -ENOMEM; dev_set_drvdata(&spi->dev, ddata); -- 2.11.0