All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Thompson <daniel.thompson@linaro.org>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: Jingoo Han <jingoohan1@gmail.com>,
	Lee Jones <lee.jones@linaro.org>,
	kernel@pengutronix.de, dri-devel@lists.freedesktop.org,
	patchwork-lst@pengutronix.de
Subject: Re: [PATCH v2] backlight: rave-sp: don't touch initial state and register with correct device
Date: Tue, 9 Jul 2019 10:32:34 +0100	[thread overview]
Message-ID: <20190709093234.a3mllxammtgngyrq@holly.lan> (raw)
In-Reply-To: <20190708124129.5664-1-l.stach@pengutronix.de>

On Mon, Jul 08, 2019 at 02:41:29PM +0200, Lucas Stach wrote:
> This way the backlight can be referenced through its device node and
> enabling/disabling can be managed through the panel driver.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>

Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>


> ---
>  drivers/video/backlight/rave-sp-backlight.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/video/backlight/rave-sp-backlight.c b/drivers/video/backlight/rave-sp-backlight.c
> index 462f14a1b19d..05b5f003a3d1 100644
> --- a/drivers/video/backlight/rave-sp-backlight.c
> +++ b/drivers/video/backlight/rave-sp-backlight.c
> @@ -48,14 +48,20 @@ static int rave_sp_backlight_probe(struct platform_device *pdev)
>  	struct device *dev = &pdev->dev;
>  	struct backlight_device *bd;
>  
> -	bd = devm_backlight_device_register(dev, pdev->name, dev->parent,
> +	bd = devm_backlight_device_register(dev, pdev->name, dev,
>  					    dev_get_drvdata(dev->parent),
>  					    &rave_sp_backlight_ops,
>  					    &rave_sp_backlight_props);
>  	if (IS_ERR(bd))
>  		return PTR_ERR(bd);
>  
> -	backlight_update_status(bd);
> +	/*
> +	 * If there is a phandle pointing to the device node we can
> +	 * assume that another device will manage the status changes.
> +	 * If not we make sure the backlight is in a consistent state.
> +	 */
> +	if (!dev->of_node->phandle)
> +		backlight_update_status(bd);
>  
>  	return 0;
>  }
> -- 
> 2.20.1
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-07-09  9:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-08 12:41 [PATCH v2] backlight: rave-sp: don't touch initial state and register with correct device Lucas Stach
2019-07-09  9:32 ` Daniel Thompson [this message]
2019-07-25 12:04 ` Lee Jones

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=20190709093234.a3mllxammtgngyrq@holly.lan \
    --to=daniel.thompson@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jingoohan1@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=lee.jones@linaro.org \
    --cc=patchwork-lst@pengutronix.de \
    /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.