Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp3641281ima; Mon, 4 Feb 2019 02:39:05 -0800 (PST) X-Google-Smtp-Source: ALg8bN6LJF8E+A2POXqQ0d3VBSS4TkgcjJKXI+Ar+VWVcgCxla6YvEIAXTyV07yK8g+Dic3yWSqP X-Received: by 2002:a17:902:161:: with SMTP id 88mr52255864plb.306.1549276745771; Mon, 04 Feb 2019 02:39:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549276745; cv=none; d=google.com; s=arc-20160816; b=V1rZZKq0rlRZHRDPncMWz1jCo+vOiOdPLg2+mDXFz5Ej3Q1w+oXCD2aqLmMsY5Ef2b 70piafPxPDiFbHwbNd1UybTuYaFqHoDHj8j/Iy3/MlfL2lzDcyQq2DFhNTW0iwcMFRqO 2Ch92PemhyMyqNlvSpQTCpKk0ITjG0K/zgy9oWiIVYS3Th+Tehl1XhcHvvd3VC5ZNYV5 1pUTa1DJ99Gp0tAl+6eKETIdEzDzECjCnRBrgAkauFHyPhKxW5d5bEmineFiyyJVsb9c 8hM602FA8NvxD/Y9WU20xor+8fCIGfNvN3tKDdAMBtdyXtCyz7dYij84H+01J54KVS1g aVZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:dkim-signature; bh=U5Tcz1V1mKiC9mjYK8RLXHs/vjcu9h1r93D6aB0pwac=; b=v2GFueIXVcfys+lVzMGPSXW52LeBC2aHZoRSIKND+QHWWNlGtMum25t5xlVO+QR/EV YEwpUsOL5QU1fJ10FRXlJGUKU2vx9knAhi58c+c//o/1JGSTEah4GI6Vg0fFtBIy0zW2 Y1gsIm9k/JH/x/YF83ppgdtDQpyOe2CUFireZ2dhc0uhpNNXxDmXMsbwBoCC5eoJuy84 i4CuLQbTXZYQvKpr3GmYqIVMefHrGTwxbN1f/96ocKn4p/d/lqf6S7ZPuqMhmr7pgRiG vfIiWfe6kkLIZLvVljzUI2R0/P4aGuXdJelMIIdZvRMVrYVUoeY1+Tyt0OTgSYD9MsPT MJ4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kemnade.info header.s=20180802 header.b="G8rw+/nr"; 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 x24si15447848plr.379.2019.02.04.02.38.39; Mon, 04 Feb 2019 02:39:05 -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="G8rw+/nr"; 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 S1728646AbfBDKYi (ORCPT + 99 others); Mon, 4 Feb 2019 05:24:38 -0500 Received: from mail.andi.de1.cc ([85.214.239.24]:52952 "EHLO h2641619.stratoserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726928AbfBDKYh (ORCPT ); Mon, 4 Feb 2019 05:24:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20180802; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: 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=U5Tcz1V1mKiC9mjYK8RLXHs/vjcu9h1r93D6aB0pwac=; b=G8rw+/nr2hk36eA2MDdKPZ/7V rbAXwthVpgaSFGvUOH7bZR5k8AmIcv+kLXwn8OO/kAO40naAZCOyq9QwxkasPwiyzVesadmmJv99t fSgTDIX6kD3034sn0JZxkRQDsIUoxIkpfJrrRItygZ7n2/yhIBOTaa64DhBtHUYA3ZeYk=; Received: from [46.183.103.8] (helo=localhost) by h2641619.stratoserver.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gqbQR-0004yD-CC; Mon, 04 Feb 2019 11:24:28 +0100 Received: from [::1] (helo=localhost) by localhost with esmtp (Exim 4.89) (envelope-from ) id 1gqbQG-0003xp-S0; Mon, 04 Feb 2019 11:24:17 +0100 Date: Mon, 4 Feb 2019 11:23:03 +0100 From: Andreas Kemnade To: Tomi Valkeinen Cc: , , , , , , , , , Subject: Re: [PATCH 1/2] drm/omap: panel-tpo-td028ttec1: add backlight support Message-ID: <20190204112222.5c988278@kemnade.info> In-Reply-To: <9eb955aa-3a87-7f25-21ce-c177b67de522@ti.com> References: <20190119182131.9341-1-andreas@kemnade.info> <20190119182131.9341-2-andreas@kemnade.info> <9eb955aa-3a87-7f25-21ce-c177b67de522@ti.com> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; i686-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/op.iO1w_idDgiQjsMkvIqb1"; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Sig_/op.iO1w_idDgiQjsMkvIqb1 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi, On Mon, 4 Feb 2019 10:13:46 +0200 Tomi Valkeinen wrote: > Hi, >=20 > 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= =20 >=20 > Extra words above, or maybe some are missing... >=20 oops,=20 This panel has a backlight, so fetch it from devicetree using the properties as documented in panel-common.txt. It is implemented the same way as in=20 panel-dpi.c > > panel-dpi.c > > This ensures the backlight is also disabled when the display is > > turned off like when doing xset dpms force off. > >=20 > > Signed-off-by: Andreas Kemnade > > --- > > .../gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c | 18 ++++++++++= +++++--- > > 1 file changed, 15 insertions(+), 3 deletions(-) > >=20 > > 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 { > > =20 > > struct videomode vm; > > =20 > > + struct backlight_device *backlight; > > + > > struct spi_device *spi_dev; > > }; > > =20 > > @@ -268,6 +270,8 @@ static int td028ttec1_panel_enable(struct omap_dss_= device *dssdev) > > =20 > > r |=3D jbt_ret_write_0(ddata, JBT_REG_DISPLAY_ON); > > =20 > > + backlight_enable(ddata->backlight); > > + > > dssdev->state =3D OMAP_DSS_DISPLAY_ACTIVE; > > =20 > > transfer_err: > > @@ -283,6 +287,8 @@ static void td028ttec1_panel_disable(struct omap_ds= s_device *dssdev) > > if (!omapdss_device_is_enabled(dssdev)) > > return; > > =20 > > + backlight_disable(ddata->backlight); > > + > > dev_dbg(dssdev->dev, "td028ttec1_panel_disable()\n"); > > =20 > > jbt_ret_write_0(ddata, JBT_REG_DISPLAY_OFF); > > @@ -321,6 +327,15 @@ static int td028ttec1_panel_probe(struct spi_devic= e *spi) > > =20 > > dev_dbg(&spi->dev, "%s\n", __func__); > > =20 > > + ddata =3D devm_kzalloc(&spi->dev, sizeof(*ddata), GFP_KERNEL); > > + if (ddata =3D=3D NULL) > > + return -ENOMEM; > > + > > + ddata->backlight =3D devm_of_find_backlight(&spi->dev); > > + > > + if (IS_ERR(ddata->backlight)) > > + return PTR_ERR(ddata->backlight); > > + =20 >=20 > Is there a reason for moving the ddata alloc here, instead of keeping it > where it was? >=20 Well, I was just unsure if the spi_setup needs to be undone on error, so I moved things around. But the kzalloc() error check would face the same prob= lem and other error checks further on, too. So I can rather keep it as is. I will send a v2. Regards, Andreas --Sig_/op.iO1w_idDgiQjsMkvIqb1 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEPIWxmAFyOaBcwCpFl4jFM1s/ye8FAlxYEocACgkQl4jFM1s/ ye+pqBAAjH6A2KEwJpPsiP9ewsTwodRrc8YaGq9vFjzepOrlip3si6Vqj/FdKg+w eqIsh1JDjLL8NAJ4ytoj+rhV7dKpF+T7bHrN+BZ8JbeCrvQ/UnoILWWGGrd+6/2b iYhI81yOgPswORZ9i5vU1HduRpYR2mG+1RTFzgemFAMH1tI8+r/S2LyEAhlca46s PGKjAzmFXJJ9MDtACEfcT5gR6yLKX4AMtaW/eejnEN7OmVLPMdEV0HUKS+NNy7sI ZsvDBttiBu4JpqNjoAoymd6X8tC4kaHJrOvmxFKs6iGs9KqndGCSWJicSOL9Sy11 aUoqJ3rnXPHBmMtu5tiPE5lORcj9SPP3btEA3pKbJ2v6LP5jzBBq4iKaayNK7hxk 3St9QzFQ7R+363L8Pc1uZPMUpdN9p6dfzrXT39lzr3TeajWxVlQiSA3qJyxQtypw OaUo4WNFdx7Zy9Xq2qkzPy60jV4Y8w45u5UOU7hB3qa/K9EqCww/6Vtk2QgwBGJY nAMXR1MR7bhZaNKRDyLwHL6WIWiHhg83J2b5psBczsjTe7qMMM5v/A89SdHHMNTj VWqq5mYmWtnxehOl7++XoNpHZUpnOzPnG13px86F/EsSqi2BTbzjlDYyMOvEIZxF WpQ0vwd7K6k4rjQREZEyc1j4yTW8zi2l2LGf2obTOrN7K8AjMQ4= =WOAo -----END PGP SIGNATURE----- --Sig_/op.iO1w_idDgiQjsMkvIqb1--