Samsung LTV350QV LCD driver
Subsystems (2)
PATCH 1/1 Samsung LTV350QV LCD driver
This patch adds support for powering on and off the Samsung LTV350QV LCD panel via SPI. The driver responds to framebuffer power management, it powers off the panel on reboot/halt/poweroff, and it can also be controlled through sysfs. The panel is powered up when the module is loaded and off when the module is unloaded.
---
This driver is necessary to see any output from the newly merged atmel_lcdfb driver on ATSTK1000 boards. Therefore I would really like to see this driver merged before 2.6.22. I do realize it's late in the release cycle, so no hard feelings if you don't think it's appropriate.
The driver has been included in Atmel's AVR32 Linux BSP for a while, but I've recently cleaned it up to use symbolic constants instead of hardcoded voodoo magic (we received additional documentation from Samsung recently that allowed me to do this.)
This version also fixes a longstanding bug where the driver wrote to the wrong registers, causing the gamma registers and the PWRCTL2 register to end up with the wrong values.
drivers/video/backlight/Kconfig | 38 ++++-- drivers/video/backlight/Makefile | 2 + drivers/video/backlight/ltv350qv.c | 309 ++++++++++++++++++++++++++++++++++++ drivers/video/backlight/ltv350qv.h | 95 +++++++++++ 4 files changed, 434 insertions(+), 10 deletions(-)
drivers/video/backlight/Kconfig +28 -10
@@ -8,26 +8,44 @@ menuconfig BACKLIGHT_LCD_SUPPORT Enable this to be able to choose the drivers for controlling the backlight and the LCD panel on some platforms, for example on PDAs. -config BACKLIGHT_CLASS_DEVICE - tristate "Lowlevel Backlight controls" +# +# LCD +# +config LCD_CLASS_DEVICE + tristate "Lowlevel LCD controls" depends on BACKLIGHT_LCD_SUPPORT default m help - This framework adds support for low-level control of the LCD - backlight. This includes support for brightness and power. + This framework adds support for low-level control of LCD. + Some framebuffer devices connect to platform-specific LCD modules + in order to have a platform-specific way to control the flat panel + (contrast and applying power to the LCD (not to the backlight!)). To have support for your specific LCD panel you will have to select the proper drivers which depend on this option. -config LCD_CLASS_DEVICE - tristate "Lowlevel LCD controls" +config LCD_LTV350QV + tristate "Samsung LTV350QV LCD Panel" + depends on LCD_CLASS_DEVICE && SPI_MASTER + default n + help + If you have a Samsung LTV350QV LCD panel, say y to include a + power control driver for it. The panel starts up in power + off state, so you need this driver in order to see any + output. + + The LTV350QV panel is present on all ATSTK1000 boards. + +# +# Backlight +# +config BACKLIGHT_CLASS_DEVICE + tristate "Lowlevel Backlight controls" depends on BACKLIGHT_LCD_SUPPORT default m help - This framework adds support for low-level control of LCD. - Some framebuffer devices connect to platform-specific LCD modules - in order to have a platform-specific way to control the flat panel - (contrast and applying power to the LCD (not to the backlight!)). + This framework adds support for low-level control of the LCD + backlight. This includes support for brightness and power. To have support for your specific LCD panel you will have to select the proper drivers which depend on this option.
drivers/video/backlight/Makefile +2 -0
@@ -1,6 +1,8 @@ # Backlight & LCD drivers obj-$(CONFIG_LCD_CLASS_DEVICE) += lcd.o +obj-$(CONFIG_LCD_LTV350QV) += ltv350qv.o + obj-$(CONFIG_BACKLIGHT_CLASS_DEVICE) += backlight.o obj-$(CONFIG_BACKLIGHT_CORGI) += corgi_bl.o obj-$(CONFIG_BACKLIGHT_HP680) += hp680_bl.o
drivers/video/backlight/ltv350qv.c new file +309 -0
309 lines not on this page · raw message
drivers/video/backlight/ltv350qv.h new file +95 -0
95 lines not on this page · raw message
Signature · 1 line
1.4.4.4
Quoted 7 lines · Haavard Skinnemoen
This patch adds support for powering on and off the Samsung LTV350QV LCD panel via SPI. The driver responds to framebuffer power management, it powers off the panel on reboot/halt/poweroff, and it can also be controlled through sysfs. The panel is powered up when the module is loaded and off when the module is unloaded.
Signed-off-by Haavard Skinnemoen <[email protected]>
The LCD class device bits look fine to me. The only change I'd request is not to change the order of things in drivers/video/backlight/Kconfig. If you do want to reword one of those entries (which is what I think you wanted to do), send it as a separate patch please.
David, any objections to the SPI bits?
Richard
Quoted 7 lines · Richard Purdie
Quoted 6 lines · Haavard Skinnemoen
This patch adds support for powering on and off the Samsung LTV350QV LCD panel via SPI. The driver responds to framebuffer power management, it powers off the panel on reboot/halt/poweroff, and it can also be controlled through sysfs. The panel is powered up when the module is loaded and off when the module is unloaded.
Quoted 6 lines
Quoted 1 line
Signed-off-by Haavard Skinnemoen <[email protected]>The LCD class device bits look fine to me. The only change I'd request is not to change the order of things in
drivers/video/backlight/Kconfig. If you do want to reword one of those entries (which is what I think you wanted to do), send it as a separate patch please.
One significant issue was screwed up sequencing causing tools like 'xconfig' to display things wrong. Appended is a patch fixing just that goof.
Quoted 1 line
David, any objections to the SPI bits?
They seemed fine to me, other than the write_reg() macro having an embedded 'goto' ... explicitly against the Documentation/CodingStyle guidelines. ("Chapter 12", point 1 = "macros that affect code flow".)
I like seeing more of the SPI drivers go upstream. ;)
- Dave
Quoted 3 lines
Richard
====== CUT HERE
Switch the order of LCD_CLASS_DEVICE and BACKLIGHT_CLASS_DEVICE, so that it's possible to insert LCD devices without borking the dependency displays of xconfig and other config tools.
--- drivers/video/backlight/Kconfig | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-)
drivers/video/backlight/Kconfig +16 -10
@@ -8,26 +8,32 @@ menuconfig BACKLIGHT_LCD_SUPPORT Enable this to be able to choose the drivers for controlling the backlight and the LCD panel on some platforms, for example on PDAs. -config BACKLIGHT_CLASS_DEVICE - tristate "Lowlevel Backlight controls" +# +# LCD +# +config LCD_CLASS_DEVICE + tristate "Lowlevel LCD controls" depends on BACKLIGHT_LCD_SUPPORT default m help - This framework adds support for low-level control of the LCD - backlight. This includes support for brightness and power. + This framework adds support for low-level control of LCD. + Some framebuffer devices connect to platform-specific LCD modules + in order to have a platform-specific way to control the flat panel + (contrast and applying power to the LCD (not to the backlight!)). To have support for your specific LCD panel you will have to select the proper drivers which depend on this option. -config LCD_CLASS_DEVICE - tristate "Lowlevel LCD controls" +# +# Backlight +# +config BACKLIGHT_CLASS_DEVICE + tristate "Lowlevel Backlight controls" depends on BACKLIGHT_LCD_SUPPORT default m help - This framework adds support for low-level control of LCD. - Some framebuffer devices connect to platform-specific LCD modules - in order to have a platform-specific way to control the flat panel - (contrast and applying power to the LCD (not to the backlight!)). + This framework adds support for low-level control of the LCD + backlight. This includes support for brightness and power. To have support for your specific LCD panel you will have to select the proper drivers which depend on this option.
Quoted 9 lines · David Brownell
Quoted 4 lines · Richard Purdie
The LCD class device bits look fine to me. The only change I'd request is not to change the order of things in
drivers/video/backlight/Kconfig. If you do want to reword one of those entries (which is what I think you wanted to do), send it as a separate patch please.One significant issue was screwed up sequencing causing tools like 'xconfig' to display things wrong. Appended is a patch fixing just that goof.
Put it like that, applied, thanks. :)
(http://git.o-hand.com/?p=linux-rpurdie-backlight;a=shortlog;h=for-mm)
Quoted 6 lines
Quoted 1 line
David, any objections to the SPI bits?
They seemed fine to me, other than the
write_reg()macro having an embedded 'goto' ... explicitly against theDocumentation/CodingStyleguidelines. ("Chapter 12", point 1 = "macros that affect code flow".)
Yes, even if it will make the code more ugly in a way, I think it needs to be changed...
Quoted 1 line
I like seeing more of the SPI drivers go upstream. ;)
;)
Cheers,
Richard
PATCH v2 1/1 Samsung LTV350QV LCD driver
This patch adds support for powering on and off the Samsung LTV350QV LCD panel via SPI. The driver responds to framebuffer power management, it powers off the panel on reboot/halt/poweroff, and it can also be controlled through sysfs. The panel is powered up when the module is loaded and off when the module is unloaded.
---
I agree that the write_reg() macro with embedded goto is ugly, so I've removed it. I've also added some code that tries to recover by powering down the display if the power-on sequence fails halfway through.
The driver has been rebased onto
http://git.o-hand.com/?p=linux-rpurdie-backlight;a=shortlog;h=for-mm
so it should apply nicely on top of David's Kconfig patch.
drivers/video/backlight/Kconfig | 12 ++ drivers/video/backlight/Makefile | 2 + drivers/video/backlight/ltv350qv.c | 340 ++++++++++++++++++++++++++++++++++++ drivers/video/backlight/ltv350qv.h | 95 ++++++++++ 4 files changed, 449 insertions(+), 0 deletions(-)
drivers/video/backlight/Kconfig +12 -0
@@ -24,6 +24,18 @@ config LCD_CLASS_DEVICE To have support for your specific LCD panel you will have to select the proper drivers which depend on this option. +config LCD_LTV350QV + tristate "Samsung LTV350QV LCD Panel" + depends on LCD_CLASS_DEVICE && SPI_MASTER + default n + help + If you have a Samsung LTV350QV LCD panel, say y to include a + power control driver for it. The panel starts up in power + off state, so you need this driver in order to see any + output. + + The LTV350QV panel is present on all ATSTK1000 boards. + # # Backlight #
drivers/video/backlight/Makefile +2 -0
@@ -1,6 +1,8 @@ # Backlight & LCD drivers obj-$(CONFIG_LCD_CLASS_DEVICE) += lcd.o +obj-$(CONFIG_LCD_LTV350QV) += ltv350qv.o + obj-$(CONFIG_BACKLIGHT_CLASS_DEVICE) += backlight.o obj-$(CONFIG_BACKLIGHT_CORGI) += corgi_bl.o obj-$(CONFIG_BACKLIGHT_HP680) += hp680_bl.o
drivers/video/backlight/ltv350qv.c new file +340 -0
340 lines not on this page · raw message
drivers/video/backlight/ltv350qv.h new file +95 -0
95 lines not on this page · raw message
Signature · 1 line
1.4.4.4