leds-lm3556.txt 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. Kernel driver for lm3556
  2. ========================
  3. *Texas Instrument:
  4. 1.5 A Synchronous Boost LED Flash Driver w/ High-Side Current Source
  5. * Datasheet: http://www.national.com/ds/LM/LM3556.pdf
  6. Authors:
  7. Daniel Jeong
  8. Contact:Daniel Jeong(daniel.jeong-at-ti.com, gshark.jeong-at-gmail.com)
  9. Description
  10. -----------
  11. There are 3 functions in LM3556, Flash, Torch and Indicator.
  12. FLASH MODE
  13. In Flash Mode, the LED current source(LED) provides 16 target current levels
  14. from 93.75 mA to 1500 mA.The Flash currents are adjusted via the CURRENT
  15. CONTROL REGISTER(0x09).Flash mode is activated by the ENABLE REGISTER(0x0A),
  16. or by pulling the STROBE pin HIGH.
  17. LM3556 Flash can be controlled through sys/class/leds/flash/brightness file
  18. * if STROBE pin is enabled, below example control brightness only, and
  19. ON / OFF will be controlled by STROBE pin.
  20. Flash Example:
  21. OFF : #echo 0 > sys/class/leds/flash/brightness
  22. 93.75 mA: #echo 1 > sys/class/leds/flash/brightness
  23. ... .....
  24. 1500 mA: #echo 16 > sys/class/leds/flash/brightness
  25. TORCH MODE
  26. In Torch Mode, the current source(LED) is programmed via the CURRENT CONTROL
  27. REGISTER(0x09).Torch Mode is activated by the ENABLE REGISTER(0x0A) or by the
  28. hardware TORCH input.
  29. LM3556 torch can be controlled through sys/class/leds/torch/brightness file.
  30. * if TORCH pin is enabled, below example control brightness only,
  31. and ON / OFF will be controlled by TORCH pin.
  32. Torch Example:
  33. OFF : #echo 0 > sys/class/leds/torch/brightness
  34. 46.88 mA: #echo 1 > sys/class/leds/torch/brightness
  35. ... .....
  36. 375 mA : #echo 8 > sys/class/leds/torch/brightness
  37. INDICATOR MODE
  38. Indicator pattern can be set through sys/class/leds/indicator/pattern file,
  39. and 4 patterns are pre-defined in indicator_pattern array.
  40. According to N-lank, Pulse time and N Period values, different pattern wiill
  41. be generated.If you want new patterns for your own device, change
  42. indicator_pattern array with your own values and INDIC_PATTERN_SIZE.
  43. Please refer datasheet for more detail about N-Blank, Pulse time and N Period.
  44. Indicator pattern example:
  45. pattern 0: #echo 0 > sys/class/leds/indicator/pattern
  46. ....
  47. pattern 3: #echo 3 > sys/class/leds/indicator/pattern
  48. Indicator brightness can be controlled through
  49. sys/class/leds/indicator/brightness file.
  50. Example:
  51. OFF : #echo 0 > sys/class/leds/indicator/brightness
  52. 5.86 mA : #echo 1 > sys/class/leds/indicator/brightness
  53. ........
  54. 46.875mA : #echo 8 > sys/class/leds/indicator/brightness
  55. Notes
  56. -----
  57. Driver expects it is registered using the i2c_board_info mechanism.
  58. To register the chip at address 0x63 on specific adapter, set the platform data
  59. according to include/linux/platform_data/leds-lm3556.h, set the i2c board info
  60. Example:
  61. static struct i2c_board_info board_i2c_ch4[] __initdata = {
  62. {
  63. I2C_BOARD_INFO(LM3556_NAME, 0x63),
  64. .platform_data = &lm3556_pdata,
  65. },
  66. };
  67. and register it in the platform init function
  68. Example:
  69. board_register_i2c_bus(4, 400,
  70. board_i2c_ch4, ARRAY_SIZE(board_i2c_ch4));