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 <redacted>
---
drivers/video/backlight/backlight.c | 17 +++++++++++++++++
include/linux/backlight.h | 10 ++++++++++
2 files changed, 27 insertions(+)
From: Jingoo Han <hidden> Date: 2012-11-15 01:30:20
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 <redacted>
CC'ed Andrew Morton
Hi Thierry Reding,
The patch itself looks good.
Could you explain when this API is used?
Thank you.
Best regards,
Jingoo Han
1.8.0
--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, Nov 15, 2012 at 10:30:11AM +0900, Jingoo Han wrote:
On Friday, November 09, 2012 11:05 PM Thierry Reding wrote
quoted
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 <redacted>
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
From: Jingoo Han <hidden> Date: 2012-11-15 08:58:40
On Thursday, November 15, 2012 3:52 PM Thierry Reding wrote
On Thu, Nov 15, 2012 at 10:30:11AM +0900, Jingoo Han wrote:
quoted
On Friday, November 09, 2012 11:05 PM Thierry Reding wrote
quoted
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 <redacted>
CC'ed Andrew Morton
Yes, the backlight subsystem isn't very well maintained, so I should
have added Andrew in the first place. Thanks.
quoted
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.
OK, I see how this API can be called.
AS you mentioned, it will allow Tegra DRM driver to use
the backlight driver.
Acked-by: Jingoo Han <redacted>
Best regards,
Jingoo Han
On Thu, Nov 15, 2012 at 05:58:35PM +0900, Jingoo Han wrote:
On Thursday, November 15, 2012 3:52 PM Thierry Reding wrote
quoted
On Thu, Nov 15, 2012 at 10:30:11AM +0900, Jingoo Han wrote:
quoted
On Friday, November 09, 2012 11:05 PM Thierry Reding wrote
quoted
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 <redacted>
CC'ed Andrew Morton
Yes, the backlight subsystem isn't very well maintained, so I should
have added Andrew in the first place. Thanks.
quoted
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.
OK, I see how this API can be called.
AS you mentioned, it will allow Tegra DRM driver to use
the backlight driver.
Acked-by: Jingoo Han <redacted>
Andrew,
any chance we could still get this in for the 3.8 merge window?
Thierry
From: Andrew Morton <akpm@linux-foundation.org> Date: 2012-11-16 21:16:48
On Fri, 9 Nov 2012 15:04:38 +0100
Thierry Reding [off-list ref] wrote:
quoted hunk
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 <redacted>
---
drivers/video/backlight/backlight.c | 17 +++++++++++++++++
include/linux/backlight.h | 10 ++++++++++
2 files changed, 27 insertions(+)
It's a global, exported-to-modules function. We should document such
major interfaces. Unless they are dead trivial, but I don't think this
one is that simple. The semantics of the return value could be
explained, and callers should be told that of_find_backlight_by_node()
took a ref on the returned device, and that they need to run
put_device(retval->dev), if retval was not NULL.
And anything else which might be useful.
On Fri, Nov 16, 2012 at 01:16:45PM -0800, Andrew Morton wrote:
quoted hunk
On Fri, 9 Nov 2012 15:04:38 +0100
Thierry Reding [off-list ref] wrote:
quoted
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 <redacted>
---
drivers/video/backlight/backlight.c | 17 +++++++++++++++++
include/linux/backlight.h | 10 ++++++++++
2 files changed, 27 insertions(+)
It's a global, exported-to-modules function. We should document such
major interfaces. Unless they are dead trivial, but I don't think this
one is that simple. The semantics of the return value could be
explained, and callers should be told that of_find_backlight_by_node()
took a ref on the returned device, and that they need to run
put_device(retval->dev), if retval was not NULL.
And anything else which might be useful.
Yes, I should have thought about that. I'll add some proper kerneldoc
and repost.
Thanks for reviewing,
Thierry