Driver for TI tlc591xx 8/16 Channel i2c LED driver
Subsystems (2)
v6 cover Driver for TI tlc591xx 8/16 Channel i2c LED driver
This patchset is a driver for the TI tlc59116 16 Channel i2c LED driver and tlc59108 8 Channel i2c LED driver. This driver is used on the Belkin WRT1900AC access point and the C code is derived from code Belkin contributed to OpenWRT. However it has been extensively re-written, and a device tree binding added to replace platform data.
Since v5:
Hard code number of LEDs, rather than #define Moved common fields from led into priv
Moved reg_ledout into priv, removed helper functions Cache brightness to avoid race conditions tlc591xx_led_set -> tlc591xx_set_brightness
Be paranoid with of_match_device() and client->dev.of_node
Since v4:
Fix Oops on module unload reported by Vignesh R
Since v3:
Generalized and added support for tlc59108 brightness == 0 and brightness == LED_FULL disable PWM and used
fixed OFF/ON mode
Since v2:
Remove incorrect /* Mode register ? */ comment Parenthesis around the macro arguments Converted many signed variables into unsigned Saved an initialization
Since v1:
s/uint8_t/u8/g
Remove empty line
Removed #gpio-cells
Added select REGMAP_I2C
Sorted #includes into alphabetic order
Added missing MODULE_DEVICE_TABLE(of, ...)
Check return value of regmap_write()
Simplified tlc59116_set_mode()
Andrew Lunn (2):
leds: tlc59116: Document binding for the TI 16 Channel i2c LED driver
leds: tlc59116: Driver for the TI 16 Channel i2c LED driver
.../devicetree/bindings/leds/leds-tlc59116.txt | 41 ++++ drivers/leds/Kconfig | 7 + drivers/leds/Makefile | 1 + drivers/leds/leds-tlc59116.c | 253 +++++++++++++++++++++ 4 files changed, 302 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/leds-tlc59116.txt create mode 100644 drivers/leds/leds-tlc59116.c
Signature · 1 line
2.1.3
PATCH v6 1/2 leds: tlc591xx: Document binding for the TI 8/16 Channel i2c LED driver
Document the binding for the TLC591xx LED driver.
--- .../devicetree/bindings/leds/leds-tlc591xx.txt | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/leds-tlc591xx.txt
Documentation/devicetree/bindings/leds/leds-tlc591xx.txt new file +40 -0
@@ -0,0 +1,40 @@ +LEDs connected to tlc59116 or tlc59108 + +Required properties +- compatible: should be "ti,tlc59116" or "ti,tlc59108" +- #address-cells: must be 1 +- #size-cells: must be 0 +- reg: typically 0x68 + +Each led is represented as a sub-node of the ti,tlc59116. +See Documentation/devicetree/bindings/leds/common.txt + +LED sub-node properties: +- reg: number of LED line, 0 to 15 or 0 to 7 +- label: (optional) name of LED +- linux,default-trigger : (optional) + +Examples: + +tlc59116 at 68 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "ti,tlc59116"; + reg = <0x68>; + + wan at 0 { + label = "wrt1900ac:amber:wan"; + reg = <0x0>; + }; + + 2g at 2 { + label = "wrt1900ac:white:2g"; + reg = <0x2>; + }; + + alive at 9 { + label = "wrt1900ac:green:alive"; + reg = <0x9>; + linux,default_trigger = "heartbeat"; + }; +};
Signature · 1 line
2.1.4
PATCH v6 2/2 leds: tlc591xx: Driver for the TI 8/16 Channel i2c LED driver
In reply to Andrew LunnThe TLC59116 is an I2C bus controlled 16-channel LED driver. The TLC59108 is an I2C bus controlled 8-channel LED driver, which is very similar to the TLC59116. Each LED output has its own 8-bit fixed-frequency PWM controller to control the brightness of the LED. The LEDs can also be fixed off and on, making them suitable for use as GPOs.
This is based on a driver from Belkin, but has been extensively rewritten and extended to support both 08 and 16 versions.
--- drivers/leds/Kconfig | 8 ++ drivers/leds/Makefile | 1 + drivers/leds/leds-tlc591xx.c | 300 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 309 insertions(+) create mode 100644 drivers/leds/leds-tlc591xx.c
drivers/leds/Kconfig +8 -0
@@ -457,6 +457,14 @@ config LEDS_TCA6507 LED driver chips accessed via the I2C bus. Driver support brightness control and hardware-assisted blinking. +config LEDS_TLC591XX + tristate "LED driver for TLC59108 and TLC59116 controllers" + depends on LEDS_CLASS && I2C + select REGMAP_I2C + help + This option enables support for Texas Instruments TLC59108 + and TLC59116 LED controllers. + config LEDS_MAX8997 tristate "LED support for MAX8997 PMIC" depends on LEDS_CLASS && MFD_MAX8997
drivers/leds/Makefile +1 -0
@@ -30,6 +30,7 @@ obj-$(CONFIG_LEDS_LP8501) += leds-lp8501.o obj-$(CONFIG_LEDS_LP8788) += leds-lp8788.o obj-$(CONFIG_LEDS_LP8860) += leds-lp8860.o obj-$(CONFIG_LEDS_TCA6507) += leds-tca6507.o +obj-$(CONFIG_LEDS_TLC591XX) += leds-tlc591xx.o obj-$(CONFIG_LEDS_CLEVO_MAIL) += leds-clevo-mail.o obj-$(CONFIG_LEDS_IPAQ_MICRO) += leds-ipaq-micro.o obj-$(CONFIG_LEDS_HP6XX) += leds-hp6xx.o
drivers/leds/leds-tlc591xx.c new file +300 -0
300 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH v6 2/2 leds: tlc591xx: Driver for the TI 8/16 Channel i2c LED driver
Hi Andrew,
Quoted 7 lines · Andrew Lunn
The TLC59116 is an I2C bus controlled 16-channel LED driver. The TLC59108 is an I2C bus controlled 8-channel LED driver, which is very similar to the TLC59116. Each LED output has its own 8-bit fixed-frequency PWM controller to control the brightness of the LED. The LEDs can also be fixed off and on, making them suitable for use as GPOs.
Quoted 5 lines
This is based on a driver from Belkin, but has been extensively rewritten and extended to support both 08 and 16 versions.
Signed-off-by Andrew Lunn <[email protected]>Cc Matthew.Fatheree at belkin.com
I've tested the driver on the Mamba (WRT1900AC) and it has been integrated to OpenWrt trunk for a while now, and no issues has been reported by the community either.
Please feel free to add Tested-by: Imre Kaloz <[email protected]>.
Thanks,
Imre
v6 cover Driver for TI tlc591xx 8/16 Channel i2c LED driver
In reply to Andrew LunnQuoted 5 lines · Andrew Lunn
This patchset is a driver for the TI tlc59116 16 Channel i2c LED driver and tlc59108 8 Channel i2c LED driver. This driver is used on the Belkin WRT1900AC access point and the C code is derived from code Belkin contributed to OpenWRT. However it has been extensively re-written, and a device tree binding added to replace platform data.
Hi Bryan
Do you have any further comments on this driver? Are you likely to queue it up for the next merge window?
Thanks
Andrew
Quoted 51 lines
Cc Matthew.Fatheree at belkin.comSince v5:
Hard code number of LEDs, rather than #define Moved common fields from led into priv
Movedreg_ledoutinto priv, removed helper functions Cache brightness to avoid race conditionstlc591xx_led_set->tlc591xx_set_brightness
Be paranoid withof_match_device()andclient->dev.of_nodeSince v4:
Fix Oops on module unload reported by Vignesh RSince v3:
Generalized and added support for tlc59108 brightness == 0 and brightness ==LED_FULLdisable PWM and used
fixed OFF/ON modeSince v2:
Remove incorrect /* Mode register ? */ comment Parenthesis around the macro arguments Converted many signed variables into unsigned Saved an initializationSince v1:
s/uint8_t/u8/g
Remove empty line
Removed #gpio-cells
Added selectREGMAP_I2C
Sorted #includes into alphabetic order
Added missingMODULE_DEVICE_TABLE(of, ...)
Check return value ofregmap_write()
Simplifiedtlc59116_set_mode()Andrew Lunn (2):
leds: tlc59116: Document binding for the TI 16 Channel i2c LED driver
leds: tlc59116: Driver for the TI 16 Channel i2c LED driver.../devicetree/bindings/leds/leds-tlc59116.txt | 41 ++++ drivers/leds/Kconfig | 7 + drivers/leds/Makefile | 1 + drivers/leds/leds-tlc59116.c | 253 +++++++++++++++++++++ 4 files changed, 302 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/leds-tlc59116.txt create mode 100644 drivers/leds/leds-tlc59116.cSignature · 1 line
2.1.3
v6 cover Driver for TI tlc591xx 8/16 Channel i2c LED driver
Quoted 11 lines · Andrew Lunn
Quoted 5 lines · Andrew Lunn
This patchset is a driver for the TI tlc59116 16 Channel i2c LED driver and tlc59108 8 Channel i2c LED driver. This driver is used on the Belkin WRT1900AC access point and the C code is derived from code Belkin contributed to OpenWRT. However it has been extensively re-written, and a device tree binding added to replace platform data.
Hi Bryan
Do you have any further comments on this driver? Are you likely to queue it up for the next merge window?
Hi Andrew,
You didn't comment anything on my and Peter's questions on v5 thread about this being a PWM driver.
Tomi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150209/d8e8263b/attachment.sig>
v6 cover Driver for TI tlc591xx 8/16 Channel i2c LED driver
Quoted 10 lines · Tomi Valkeinen
Quoted 9 lines · Andrew Lunn
Quoted 5 lines · Andrew Lunn
This patchset is a driver for the TI tlc59116 16 Channel i2c LED driver and tlc59108 8 Channel i2c LED driver. This driver is used on the Belkin WRT1900AC access point and the C code is derived from code Belkin contributed to OpenWRT. However it has been extensively re-written, and a device tree binding added to replace platform data.
Hi Bryan
Quoted 7 lines
Quoted 2 lines
Do you have any further comments on this driver? Are you likely to queue it up for the next merge window?
Hi Andrew,
You didn't comment anything on my and Peter's questions on v5 thread about this being a PWM driver.
Hi Tomi
I don't comment, because it is not our decision to make any more. We have been around this argument many times, so we are not going to resolve it. The LED and PWM maintainers need to decide, not us.
Andrew
v6 cover Driver for TI tlc591xx 8/16 Channel i2c LED driver
Quoted 16 lines · Andrew Lunn
Quoted 15 lines · Tomi Valkeinen
Quoted 11 lines · Andrew Lunn
Quoted 5 lines · Andrew Lunn
This patchset is a driver for the TI tlc59116 16 Channel i2c LED driver and tlc59108 8 Channel i2c LED driver. This driver is used on the Belkin WRT1900AC access point and the C code is derived from code Belkin contributed to OpenWRT. However it has been extensively re-written, and a device tree binding added to replace platform data.
Hi Bryan
Do you have any further comments on this driver? Are you likely to queue it up for the next merge window?
Hi Andrew,
Quoted 8 lines
Quoted 2 lines
You didn't comment anything on my and Peter's questions on v5 thread about this being a PWM driver.
Hi Tomi
I don't comment, because it is not our decision to make any more. We have been around this argument many times, so we are not going to resolve it. The LED and PWM maintainers need to decide, not us.
Well, I wasn't asking for decisions. I asked what are the technical differences between the options. If this driver would be implemented as a PWM driver, and you'd use pwm-leds, how would that affect your use case?
If I'm not mistaken, the only argument so far you've given was that the device cannot implement the pwm_config() call correctly, but Peter argued that it doesn't matter, other PWM devices cannot do that either.
I want the driver to work for all the users, and as I'm not that familiar with leds and pwms I need to ask these questions.
Tomi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150209/fad2fcb2/attachment.sig>