]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Add V2 of the LED driver for a single timer channel for the TPU hardware
authorMagnus Damm <damm@opensource.se>
Wed, 3 Aug 2011 00:53:01 +0000 (10:53 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 24 Aug 2011 05:24:19 +0000 (15:24 +1000)
commitff905b66148c20c7abbdd6bd91e61f45d13e874a
tree7b69eca0d6f3c2b1b1d68052c6df30586510212e
parentdbf41d5229c7a072c32aff66c640e6b45bddb3e3
Add V2 of the LED driver for a single timer channel for the TPU hardware
block commonly found in Renesas SoCs.

The driver has been written with optimal Power Management in mind, so to
save power the LED is driven as a regular GPIO pin in case of maximum
brightness and power off which allows the TPU hardware to be idle and
which in turn allows the clocks to be stopped and the power domain to be
turned off transparently.

Any other brightness level requires use of the TPU hardware in PWM mode.
TPU hardware device clocks and power are managed through Runtime PM.
System suspend and resume is known to be working - during suspend the LED
is set to off by the generic LED code.

The TPU hardware timer is equipeed with a 16-bit counter together with an
up-to-divide-by-64 prescaler which makes the hardware suitable for
brightness control.  Hardware blink is unsupported.

The LED PWM waveform has been verified with a Fluke 123 Scope meter on a
sh7372 Mackerel board.  Tested with experimental sh7372 A3SP power domain
patches.  Platform device bind/unbind tested ok.

V2 has been tested on the DS2 LED of the sh73a0-based AG5EVM.

Signed-off-by: Magnus Damm <damm@opensource.se>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/leds/Kconfig
drivers/leds/Makefile
drivers/leds/leds-renesas-tpu.c [new file with mode: 0644]
include/linux/leds-renesas-tpu.h [new file with mode: 0644]