Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp3517734ima; Mon, 4 Feb 2019 00:15:40 -0800 (PST) X-Google-Smtp-Source: ALg8bN4Mj9b1xyc3db3gP8W1Affq/SedM72ZU4CneTdARioM2jjtL+gKTavR6tV8XLX3T26XOQic X-Received: by 2002:a62:7042:: with SMTP id l63mr52212276pfc.89.1549268140461; Mon, 04 Feb 2019 00:15:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549268140; cv=none; d=google.com; s=arc-20160816; b=g45VrI0+PhpkPfC0k4JKvno/ys78+dA37LDABBOKHYNWWS+FE6lHK6Utans/zNfulm clKmGupuELbVBs9/kn4bx5mzg3J1F+3KCZ7AKbPp/NaMZkxojog8dtqxLOS+HuGRNlrp W6xqr+CM5wdhJ9GF48FmW1gSWyh6AyXULq9JroCJrSG4otokrGrQFy+Kohlmj7feGdB1 c6o3CFmg2x9S2d03Xas1FZXx7nIlT9M2OuQUExzx0GXEDcGMDG2M7V4Xi/gmbf9tuBeE 3Sx9MSMCYr3KnV+jFKqFiVFIWiJpPZp2Vv9uaRP1OyAAD2l2p3Bk8NGXxN44GTKojj6Z WhPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:cc:references:to:subject:dkim-signature; bh=oSczJSEU8cgvVbdCCsgC+AEOnCIS3rQD8g2sIZ6BFYk=; b=udhGB1srP47dRPb5dx1urEScZGK7fyQJ4abQy1gAOxvpL0xqtcg7JXGrPXAfVlsKL+ byDiUod7a0jbhZVMMX51l/WJZ4e0vuj0DdmVbWpULrp7BJqCLs5ySdfiUNLqvwZ2nvbz y93QsGPBnhX9oYXEWMyDVIKBKRDUC1te8KrpkCwo11sKmPINviZ5JZcbm7kiYX/GwKCo oOCSR+58t53z5897GS6gYY0QD68kwK9jTo/LBz+uV8bNh+fZ9IpUwHa62w+IedczY8AH Ld+1YowDrY5yFPChDmd/eegVkp+POMjtLByot5Zd3Xs3ea8v6VYvZuQ01ngf8nYoBIGL AALw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=urgFJKgO; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5si4774926pgw.155.2019.02.04.00.15.24; Mon, 04 Feb 2019 00:15:40 -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=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=urgFJKgO; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728230AbfBDIOU (ORCPT + 99 others); Mon, 4 Feb 2019 03:14:20 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:44630 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726795AbfBDIOT (ORCPT ); Mon, 4 Feb 2019 03:14:19 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x148DpsZ066056; Mon, 4 Feb 2019 02:13:51 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1549268031; bh=oSczJSEU8cgvVbdCCsgC+AEOnCIS3rQD8g2sIZ6BFYk=; h=Subject:To:References:CC:From:Date:In-Reply-To; b=urgFJKgO4Q+uoxjAcIIDNoVNEZmpmVTyRhGBB+UVjGHtdhfOJewW5Qxf7gBX7p6fz bYkWQbCeVcRlZZivdPGhaDWOMS9nUYxgtZ098OVhGNbzYqprJJhzajdvO2k2otVpBw UxRpTVwWmDDY35MsLq9QGQROTNqZHiztCvypkxrI= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x148DoqV070920 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 4 Feb 2019 02:13:51 -0600 Received: from DLEE111.ent.ti.com (157.170.170.22) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 4 Feb 2019 02:13:49 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 4 Feb 2019 02:13:49 -0600 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id x148DlQv019771; Mon, 4 Feb 2019 02:13:47 -0600 Subject: Re: [PATCH 1/2] drm/omap: panel-tpo-td028ttec1: add backlight support To: Andreas Kemnade References: <20190119182131.9341-1-andreas@kemnade.info> <20190119182131.9341-2-andreas@kemnade.info> CC: , , , , , , , , , From: Tomi Valkeinen Message-ID: <9eb955aa-3a87-7f25-21ce-c177b67de522@ti.com> Date: Mon, 4 Feb 2019 10:13:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190119182131.9341-2-andreas@kemnade.info> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 19/01/2019 20:21, Andreas Kemnade wrote: > 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 Extra words above, or maybe some are missing... > 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); > + Is there a reason for moving the ddata alloc here, instead of keeping it where it was? > 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; > This leaves an extra empty line here. > dev_set_drvdata(&spi->dev, ddata); > Tomi -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki