linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@avionic-design.de>
To: Jingoo Han <jg1.han@samsung.com>
Cc: 'Andrew Morton' <akpm@linux-foundation.org>,
	'Richard Purdie' <rpurdie@rpsys.net>,
	'Florian Tobias Schandinat' <FlorianSchandinat@gmx.de>,
	linux-fbdev@vger.kernel.org, devicetree-discuss@lists.ozlabs.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] backlight: Add of_find_backlight_by_node() function
Date: Thu, 15 Nov 2012 06:51:40 +0000	[thread overview]
Message-ID: <20121115065140.GA21208@avionic-0098.mockup.avionic-design.de> (raw)
In-Reply-To: <004201cdc2d0$c1920210$44b60630$%han@samsung.com>

[-- Attachment #1: Type: text/plain, Size: 1254 bytes --]

On Thu, Nov 15, 2012 at 10:30:11AM +0900, Jingoo Han wrote:
> On Friday, November 09, 2012 11:05 PM Thierry Reding wrote
> > 
> > This function finds the struct backlight_device for a given device tree
> > node. A dummy function is provided so that it safely compiles out if OF
> > support is disabled.
> > 
> > Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
> 
> CC'ed Andrew Morton

Yes, the backlight subsystem isn't very well maintained, so I should
have added Andrew in the first place. Thanks.

> 
> Hi Thierry Reding,
> 
> The patch itself looks good.
> Could you explain when this API is used?
> Thank you.

I use this for the upcoming Tegra DRM driver in order to hook up the
backlight with the DRM driver via DT to allow switching off the
backlight when the corresponding DRM output is switched of using DPMS.
Basically what you have is something like this in the device tree:

	display {
		...

		backlight = <&backlight>;

		...
	}

Then you call something along these lines:

	np = of_parse_phandle(display, "backlight", 0);
	if (np) {
		backlight = of_find_backlight_by_node(np);
		of_node_put(np);
	}

And then use the standard backlight API on the returned pointer.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-11-15  6:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-07 22:08 [PATCH] backlight: Add of_find_backlight_by_node() function Thierry Reding
2012-11-09 14:04 ` Thierry Reding
2012-11-15  1:30   ` Jingoo Han
2012-11-15  6:51     ` Thierry Reding [this message]
2012-11-15  8:58       ` Jingoo Han
2012-11-16 20:56         ` Thierry Reding
2012-11-16 21:16   ` Andrew Morton
2012-11-16 21:34     ` Thierry Reding
2012-11-15 16:24 ` Grant Likely

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=20121115065140.GA21208@avionic-0098.mockup.avionic-design.de \
    --to=thierry.reding@avionic-design.de \
    --cc=FlorianSchandinat@gmx.de \
    --cc=akpm@linux-foundation.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=jg1.han@samsung.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).