All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Andreas Kemnade <andreas@kemnade.info>
Cc: <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: Re: [PATCH 1/2] drm/omap: panel-tpo-td028ttec1: add backlight support
Date: Mon, 4 Feb 2019 10:13:46 +0200	[thread overview]
Message-ID: <9eb955aa-3a87-7f25-21ce-c177b67de522@ti.com> (raw)
In-Reply-To: <20190119182131.9341-2-andreas@kemnade.info>

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 <andreas@kemnade.info>
> ---
>  .../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

WARNING: multiple messages have this Message-ID (diff)
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Andreas Kemnade <andreas@kemnade.info>
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
	airlied@linux.ie, sre@kernel.org,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	robh+dt@kernel.org, laurent.pinchart@ideasonboard.com,
	letux-kernel@openphoenux.org
Subject: Re: [PATCH 1/2] drm/omap: panel-tpo-td028ttec1: add backlight support
Date: Mon, 4 Feb 2019 10:13:46 +0200	[thread overview]
Message-ID: <9eb955aa-3a87-7f25-21ce-c177b67de522@ti.com> (raw)
In-Reply-To: <20190119182131.9341-2-andreas@kemnade.info>

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 <andreas@kemnade.info>
> ---
>  .../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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-02-04  8:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-19 18:21 [PATCH 0/2] drm/omap: panel-tpo-td028ttec1: add backlight support Andreas Kemnade
2019-01-19 18:21 ` [PATCH 1/2] " Andreas Kemnade
2019-02-04  8:13   ` Tomi Valkeinen [this message]
2019-02-04  8:13     ` Tomi Valkeinen
2019-02-04 10:23     ` Andreas Kemnade
2019-02-04 10:23       ` Andreas Kemnade
2019-01-19 18:21 ` [PATCH 2/2] dt-bindings: panel: td028ttec1: add backlight property Andreas Kemnade
2019-02-01 11:33 ` [PATCH 0/2] drm/omap: panel-tpo-td028ttec1: add backlight support Andreas Kemnade

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9eb955aa-3a87-7f25-21ce-c177b67de522@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=airlied@linux.ie \
    --cc=andreas@kemnade.info \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=letux-kernel@openphoenux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.