• Kim, Milo's avatar
    leds-lm3530: support pwm input mode · bb982009
    Kim, Milo authored
    * add 'struct lm3530_pwm_data' in the platform data
      The pwm data is the platform specific functions which generate the pwm.
      The pwm data is only valid when brightness is pwm input mode.
      Functions should be implemented by the pwm driver.
      pwm_set_intensity() : set duty of pwm.
      pwm_get_intensity() : get current the brightness.
    
    * brightness control by pwm
      If the control mode is pwm, then brightness is changed by the duty of
      pwm=.  So pwm platform function should be called in lm3530_brightness_set().
    
    * do not update brightness register when pwm input mode
      In pwm input mode, brightness register is not used.
      If any value is updated in this register, then the led will be off.
    
    * when input mode is changed, set duty of pwm to 0 if unnecessary.
    Signed-off-by: default avatarMilo(Woogyom) Kim <milo.kim@ti.com>
    Cc: Linus Walleij <linus.walleij@linaro.org>
    Cc: Richard Purdie <rpurdie@rpsys.net>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    bb982009
leds-lm3530.c 12.6 KB