backlight: Add TPS65217 WLED driver
PATCH v4 1/2 backlight: Add TPS65217 WLED driver
The TPS65217 chip contains a boost converter and current sinks which can be used to drive LEDs for use as backlights. Expose this functionality via the backlight API.
Tested on an AM335x based custom board with a single WLED string, using different values for ISEL and FDIM (though it would be hard to tell the difference except for the value in WLEDCTRL1). Both instantiation through the device tree and by passing platform data have been tested. Testing has been done with an Androidized 3.2 kernel from the rowboat project. Koen Kooi reported the driver to be working on a Beaglebone board with LCD3 cape
This patch is based on the mfd branch (20120924)
Changes since v3:
* split in two patches, one for the driver another for adding the mfd subdevice
* renamed variable "on" to "is_enabled" and changed type to boolean
--- drivers/video/backlight/Kconfig | 7 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/tps65217_bl.c | 352 +++++++++++++++++++++++++++++++++ include/linux/mfd/tps65217.h | 18 ++ 4 files changed, 378 insertions(+) create mode 100644 drivers/video/backlight/tps65217_bl.c
drivers/video/backlight/Kconfig +7 -0
@@ -373,6 +373,13 @@ config BACKLIGHT_PANDORA If you have a Pandora console, say Y to enable the backlight driver. +config BACKLIGHT_TPS65217 + tristate "TPS65217 Backlight" + depends on BACKLIGHT_CLASS_DEVICE && MFD_TPS65217 + help + If you have a Texas Instruments TPS65217 say Y to enable the + backlight driver. + endif # BACKLIGHT_CLASS_DEVICE endif # BACKLIGHT_LCD_SUPPORT
drivers/video/backlight/Makefile +1 -0
@@ -43,3 +43,4 @@ obj-$(CONFIG_BACKLIGHT_88PM860X) += 88pm860x_bl.o obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o obj-$(CONFIG_BACKLIGHT_AAT2870) += aat2870_bl.o obj-$(CONFIG_BACKLIGHT_OT200) += ot200_bl.o +obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o
drivers/video/backlight/tps65217_bl.c new file +352 -0
352 lines not on this page · raw message
include/linux/mfd/tps65217.h +18 -0
@@ -213,6 +213,23 @@ enum tps65217_regulator_id {/* Number of total regulators available */ #define TPS65217_NUM_REGULATOR (TPS65217_NUM_DCDC + TPS65217_NUM_LDO) +enum tps65217_bl_isel { +TPS65217_BL_ISET1 =1 , +TPS65217_BL_ISET2 , +}; + +enum tps65217_bl_fdim { +TPS65217_BL_FDIM_100HZ , +TPS65217_BL_FDIM_200HZ , +TPS65217_BL_FDIM_500HZ , +TPS65217_BL_FDIM_1000HZ , +}; + +struct tps65217_bl_pdata { +enum tps65217_bl_isel isel; +enum tps65217_bl_fdim fdim; +}; +/** * struct tps65217_board - packages regulator init data * @tps65217_regulator_data: regulator initialization values
@@ -222,6 +239,7 @@ enum tps65217_regulator_id {struct tps65217_board {struct regulator_init_data *tps65217_init_data[TPS65217_NUM_REGULATOR ];struct device_node *of_node[TPS65217_NUM_REGULATOR ]; +struct tps65217_bl_pdata *bl_pdata; };/**
Signature · 1 line
1.7.10
Samuel Ortiz
AppliedHi Matthias,
Quoted 19 lines · Matthias Kaehlcke
The TPS65217 chip contains a boost converter and current sinks which can be used to drive LEDs for use as backlights. Expose this functionality via the backlight API.
Tested on an AM335x based custom board with a single WLED string, using different values for ISEL and FDIM (though it would be hard to tell the difference except for the value in WLEDCTRL1). Both instantiation through the device tree and by passing platform data have been tested. Testing has been done with an Androidized 3.2 kernel from the rowboat project. Koen Kooi reported the driver to be working on a Beaglebone board with LCD3 cape
This patch is based on the mfd branch (20120924)
Changes since v3:
* split in two patches, one for the driver another for adding the mfd subdevice
* renamed variable "on" to "is_enabled" and changed type to boolean
Quoted 8 lines
Signed-off-by Matthias Kaehlcke <[email protected]>--- drivers/video/backlight/Kconfig | 7 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/tps65217_bl.c | 352 +++++++++++++++++++++++++++++++++ include/linux/mfd/tps65217.h | 18 ++ 4 files changed, 378 insertions(+) create mode 100644 drivers/video/backlight/tps65217_bl.c
Applied as well, although it could go through Richard's tree. Having his review would be nice anyway.
Cheers,
Samuel.
Signature · 2 lines
Intel Open Source Technology Centre http://oss.intel.com/