leds-lm3556.rst 3.0 KB

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