diff options
author | Kim, Milo <Milo.Kim@ti.com> | 2012-03-23 18:02:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 19:58:34 -0400 |
commit | 3b49aacd0e56d5bf1b511f6554f17cd65eb8da64 (patch) | |
tree | 22da84acf260e760e68006afa03346342a518f84 /include/linux/leds-lp5521.h | |
parent | 5ae4e8a77dc82afcfe8460168ec0b94f4b79a54a (diff) |
drivers/leds/leds-lp5521.c: add 'update_config' in the lp5521_platform_data
The value of CONFIG register(Addr 08h) is configurable. For supporting
this feature, update_config is added in the platform data. If
'update_config' is not defined, the default value is 'LP5521_PWRSAVE_EN |
LP5521_CP_MODE_AUTO | LP5521_R_TO_BATT'.
To define CONFIG register in the platform data, the bit definitions were
mo= ved to the header file.
Documentation updated : description about 'update_config' and example.
Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Cc: Arun MURTHY <arun.murthy@stericsson.com>
Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/leds-lp5521.h')
-rw-r--r-- | include/linux/leds-lp5521.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/leds-lp5521.h b/include/linux/leds-lp5521.h index e675b8d4c7bf..e9ab583cac36 100644 --- a/include/linux/leds-lp5521.h +++ b/include/linux/leds-lp5521.h | |||
@@ -36,6 +36,18 @@ struct lp5521_led_config { | |||
36 | #define LP5521_CLOCK_INT 1 | 36 | #define LP5521_CLOCK_INT 1 |
37 | #define LP5521_CLOCK_EXT 2 | 37 | #define LP5521_CLOCK_EXT 2 |
38 | 38 | ||
39 | /* Bits in CONFIG register */ | ||
40 | #define LP5521_PWM_HF 0x40 /* PWM: 0 = 256Hz, 1 = 558Hz */ | ||
41 | #define LP5521_PWRSAVE_EN 0x20 /* 1 = Power save mode */ | ||
42 | #define LP5521_CP_MODE_OFF 0 /* Charge pump (CP) off */ | ||
43 | #define LP5521_CP_MODE_BYPASS 8 /* CP forced to bypass mode */ | ||
44 | #define LP5521_CP_MODE_1X5 0x10 /* CP forced to 1.5x mode */ | ||
45 | #define LP5521_CP_MODE_AUTO 0x18 /* Automatic mode selection */ | ||
46 | #define LP5521_R_TO_BATT 4 /* R out: 0 = CP, 1 = Vbat */ | ||
47 | #define LP5521_CLK_SRC_EXT 0 /* Ext-clk source (CLK_32K) */ | ||
48 | #define LP5521_CLK_INT 1 /* Internal clock */ | ||
49 | #define LP5521_CLK_AUTO 2 /* Automatic clock selection */ | ||
50 | |||
39 | struct lp5521_platform_data { | 51 | struct lp5521_platform_data { |
40 | struct lp5521_led_config *led_config; | 52 | struct lp5521_led_config *led_config; |
41 | u8 num_channels; | 53 | u8 num_channels; |
@@ -44,6 +56,7 @@ struct lp5521_platform_data { | |||
44 | void (*release_resources)(void); | 56 | void (*release_resources)(void); |
45 | void (*enable)(bool state); | 57 | void (*enable)(bool state); |
46 | const char *label; | 58 | const char *label; |
59 | u8 update_config; | ||
47 | }; | 60 | }; |
48 | 61 | ||
49 | #endif /* __LINUX_LP5521_H */ | 62 | #endif /* __LINUX_LP5521_H */ |