backlight support for sh_mobile_lcdcfb
cover backlight support for sh_mobile_lcdcfb
These patches add initial support for per-channel GPIO-controlled backlights to the sh_mobile_lcdcfb driver. A backlight device for the ecovec24 board is also provided.
Backlight support is directly integrated into the lcdcfb driver, because external usage seems unlikely and this facilitates integration with the fb backlight support. However, it should be be easy to split it into another driver if needed.
This series should be considered a first draft, since some points could probably be improved. In particular, the gpio is not acquired by the driver since board support code (at least for ecovec24) request it during early setup and do not seem to release it.
Alexandre Courbot (2):
fbdev: sh_mobile_lcdcfb: add backlight support
sh: mach-ecovec24: support for main lcd backlight
arch/sh/boards/mach-ecovec24/setup.c | 6 +++ drivers/video/Kconfig | 1 + drivers/video/sh_mobile_lcdcfb.c | 73 ++++++++++++++++++++++++++++++++++ drivers/video/sh_mobile_lcdcfb.h | 2 + include/video/sh_mobile_lcdc.h | 7 +++ 5 files changed, 89 insertions(+), 0 deletions(-)
Signature · 1 line
1.7.4
Hi Alexandre,
Quoted 1 line · Alexandre Courbot
These patches add initial support for per-channel GPIO-controlled backlights to the
sh_mobile_lcdcfbdriver. A backlight device for the ecovec24 board is also provided.
Thanks for your patches. They look surprisingly clean and nice!
The patches are mainly concerned with the Ecovec24 board - which makes sense since that's the board you have - and you've done a good job splitting out the code into driver changes and board specific stuff.
I'd like to use the driver portion of your code on other platforms, but for that to work your code needs to be updated to fit other boards as well. Mainly, not all boards control their back light with GPIO pins. For instance, have a look at linux-2.6 git commit 170c7ab58f41c526c54e9dd04044857d5d73f9e6.
Please think about how to rework the code to allow both GPIO pins and other types of back light control. I would simply go with some board callbacks, but perhaps there is some overlap with the existing ones.
Cheers,
/ magnus
Hi Magnus, thanks for your feedback!
Quoted 5 lines
I'd like to use the driver portion of your code on other platforms, but for that to work your code needs to be updated to fit other boards as well. Mainly, not all boards control their back light with GPIO pins. For instance, have a look at linux-2.6 git commit
170c7ab58f41c526c54e9dd04044857d5d73f9e6.
Indeed, I overlooked the board_cfg struct. We could have additional backlight intensity get/set callbacks there that would mostly work like the generic_bl driver.
Quoted 3 lines
Please think about how to rework the code to allow both GPIO pins and other types of back light control. I would simply go with some board callbacks, but perhaps there is some overlap with the existing ones.
display_on and display_off callbacks currently control the backlight, but they also turn power off when it is possible (for instance on ap325rxa). So they could probably not be replaced by backlight intensity settings alone. However, since backlight control will be transferred to the LCDC driver, it should be removed from these callbacks once the backlight device is used for the sake of consistency.
I will try and come with a new patch sometime tomorrow!
Alex.