diff options
author | Donggeun Kim <dg77.kim@samsung.com> | 2011-12-14 04:23:55 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-01-08 18:37:41 -0500 |
commit | f6dd2db940a1a0c6b9f7112109115c8243ba752b (patch) | |
tree | 0134500204ff28847d1bf30dcc8c52a62487a665 | |
parent | 1e351a95b6fda20e16b64a698bae505765080308 (diff) |
mfd: Add platform data and devices for MAX8997 LED control
MAX8997 device does not support LED control function of it.
To enable MAX8997-LED driver, platform data and devices for LED are updated.
Signed-off-by: Donggeun Kim <dg77.kim@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r-- | drivers/mfd/max8997.c | 3 | ||||
-rw-r--r-- | include/linux/mfd/max8997.h | 25 |
2 files changed, 26 insertions, 2 deletions
diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c index 5be53ae9b61c..cb83a7ab53e7 100644 --- a/drivers/mfd/max8997.c +++ b/drivers/mfd/max8997.c | |||
@@ -43,7 +43,8 @@ static struct mfd_cell max8997_devs[] = { | |||
43 | { .name = "max8997-battery", }, | 43 | { .name = "max8997-battery", }, |
44 | { .name = "max8997-haptic", }, | 44 | { .name = "max8997-haptic", }, |
45 | { .name = "max8997-muic", }, | 45 | { .name = "max8997-muic", }, |
46 | { .name = "max8997-flash", }, | 46 | { .name = "max8997-led", .id = 1 }, |
47 | { .name = "max8997-led", .id = 2 }, | ||
47 | }; | 48 | }; |
48 | 49 | ||
49 | int max8997_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest) | 50 | int max8997_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest) |
diff --git a/include/linux/mfd/max8997.h b/include/linux/mfd/max8997.h index 49d2a0bfd7fe..fff590521e50 100644 --- a/include/linux/mfd/max8997.h +++ b/include/linux/mfd/max8997.h | |||
@@ -131,6 +131,28 @@ struct max8997_muic_platform_data { | |||
131 | int num_init_data; | 131 | int num_init_data; |
132 | }; | 132 | }; |
133 | 133 | ||
134 | enum max8997_led_mode { | ||
135 | MAX8997_NONE, | ||
136 | MAX8997_FLASH_MODE, | ||
137 | MAX8997_MOVIE_MODE, | ||
138 | MAX8997_FLASH_PIN_CONTROL_MODE, | ||
139 | MAX8997_MOVIE_PIN_CONTROL_MODE, | ||
140 | }; | ||
141 | |||
142 | /** | ||
143 | * struct max8997_led_platform_data | ||
144 | * The number of LED devices for MAX8997 is two | ||
145 | * @mode: LED mode for each LED device | ||
146 | * @brightness: initial brightness for each LED device | ||
147 | * range: | ||
148 | * [0 - 31]: MAX8997_FLASH_MODE and MAX8997_FLASH_PIN_CONTROL_MODE | ||
149 | * [0 - 15]: MAX8997_MOVIE_MODE and MAX8997_MOVIE_PIN_CONTROL_MODE | ||
150 | */ | ||
151 | struct max8997_led_platform_data { | ||
152 | enum max8997_led_mode mode[2]; | ||
153 | u8 brightness[2]; | ||
154 | }; | ||
155 | |||
134 | struct max8997_platform_data { | 156 | struct max8997_platform_data { |
135 | /* IRQ */ | 157 | /* IRQ */ |
136 | int irq_base; | 158 | int irq_base; |
@@ -172,7 +194,8 @@ struct max8997_platform_data { | |||
172 | 194 | ||
173 | /* HAPTIC: Not implemented */ | 195 | /* HAPTIC: Not implemented */ |
174 | /* RTC: Not implemented */ | 196 | /* RTC: Not implemented */ |
175 | /* Flash: Not implemented */ | 197 | /* ---- LED ---- */ |
198 | struct max8997_led_platform_data *led_pdata; | ||
176 | }; | 199 | }; |
177 | 200 | ||
178 | #endif /* __LINUX_MFD_MAX8998_H */ | 201 | #endif /* __LINUX_MFD_MAX8998_H */ |