aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Jander <david@protonic.nl>2011-08-24 09:28:20 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2011-10-24 08:09:12 -0400
commitf3ca07824f309474b308d859c9a2cc871c6c5ab8 (patch)
treeb5efd9dad5b9a1a567dc615ea40855535c02cc11
parent2b247d06c6148bfe34a431431064f5553b17f0cc (diff)
leds: Convert mc13783 driver to mc13xxx MFD
mc13xxx is the more general API and most of the mc13783_... functions are going to die. Signed-off-by: David Jander <david@protonic.nl> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--drivers/leds/leds-mc13783.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/leds/leds-mc13783.c b/drivers/leds/leds-mc13783.c
index f369e56d6547..cf71764ff44c 100644
--- a/drivers/leds/leds-mc13783.c
+++ b/drivers/leds/leds-mc13783.c
@@ -21,13 +21,13 @@
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/leds.h> 22#include <linux/leds.h>
23#include <linux/workqueue.h> 23#include <linux/workqueue.h>
24#include <linux/mfd/mc13783.h> 24#include <linux/mfd/mc13xxx.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26 26
27struct mc13783_led { 27struct mc13783_led {
28 struct led_classdev cdev; 28 struct led_classdev cdev;
29 struct work_struct work; 29 struct work_struct work;
30 struct mc13783 *master; 30 struct mc13xxx *master;
31 enum led_brightness new_brightness; 31 enum led_brightness new_brightness;
32 int id; 32 int id;
33}; 33};
@@ -111,11 +111,11 @@ static void mc13783_led_work(struct work_struct *work)
111 break; 111 break;
112 } 112 }
113 113
114 mc13783_lock(led->master); 114 mc13xxx_lock(led->master);
115 115
116 mc13783_reg_rmw(led->master, reg, mask, value); 116 mc13xxx_reg_rmw(led->master, reg, mask, value);
117 117
118 mc13783_unlock(led->master); 118 mc13xxx_unlock(led->master);
119} 119}
120 120
121static void mc13783_led_set(struct led_classdev *led_cdev, 121static void mc13783_led_set(struct led_classdev *led_cdev,
@@ -172,23 +172,23 @@ static int __devinit mc13783_led_setup(struct mc13783_led *led, int max_current)
172 break; 172 break;
173 } 173 }
174 174
175 mc13783_lock(led->master); 175 mc13xxx_lock(led->master);
176 176
177 ret = mc13783_reg_rmw(led->master, reg, mask << shift, 177 ret = mc13xxx_reg_rmw(led->master, reg, mask << shift,
178 value << shift); 178 value << shift);
179 179
180 mc13783_unlock(led->master); 180 mc13xxx_unlock(led->master);
181 return ret; 181 return ret;
182} 182}
183 183
184static int __devinit mc13783_leds_prepare(struct platform_device *pdev) 184static int __devinit mc13783_leds_prepare(struct platform_device *pdev)
185{ 185{
186 struct mc13783_leds_platform_data *pdata = dev_get_platdata(&pdev->dev); 186 struct mc13783_leds_platform_data *pdata = dev_get_platdata(&pdev->dev);
187 struct mc13783 *dev = dev_get_drvdata(pdev->dev.parent); 187 struct mc13xxx *dev = dev_get_drvdata(pdev->dev.parent);
188 int ret = 0; 188 int ret = 0;
189 int reg = 0; 189 int reg = 0;
190 190
191 mc13783_lock(dev); 191 mc13xxx_lock(dev);
192 192
193 if (pdata->flags & MC13783_LED_TC1HALF) 193 if (pdata->flags & MC13783_LED_TC1HALF)
194 reg |= MC13783_LED_C1_TC1HALF_BIT; 194 reg |= MC13783_LED_C1_TC1HALF_BIT;
@@ -196,7 +196,7 @@ static int __devinit mc13783_leds_prepare(struct platform_device *pdev)
196 if (pdata->flags & MC13783_LED_SLEWLIMTC) 196 if (pdata->flags & MC13783_LED_SLEWLIMTC)
197 reg |= MC13783_LED_Cx_SLEWLIM_BIT; 197 reg |= MC13783_LED_Cx_SLEWLIM_BIT;
198 198
199 ret = mc13783_reg_write(dev, MC13783_REG_LED_CONTROL_1, reg); 199 ret = mc13xxx_reg_write(dev, MC13783_REG_LED_CONTROL_1, reg);
200 if (ret) 200 if (ret)
201 goto out; 201 goto out;
202 202
@@ -206,7 +206,7 @@ static int __devinit mc13783_leds_prepare(struct platform_device *pdev)
206 if (pdata->flags & MC13783_LED_SLEWLIMBL) 206 if (pdata->flags & MC13783_LED_SLEWLIMBL)
207 reg |= MC13783_LED_Cx_SLEWLIM_BIT; 207 reg |= MC13783_LED_Cx_SLEWLIM_BIT;
208 208
209 ret = mc13783_reg_write(dev, MC13783_REG_LED_CONTROL_2, reg); 209 ret = mc13xxx_reg_write(dev, MC13783_REG_LED_CONTROL_2, reg);
210 if (ret) 210 if (ret)
211 goto out; 211 goto out;
212 212
@@ -216,7 +216,7 @@ static int __devinit mc13783_leds_prepare(struct platform_device *pdev)
216 if (pdata->flags & MC13783_LED_TRIODE_TC1) 216 if (pdata->flags & MC13783_LED_TRIODE_TC1)
217 reg |= MC13783_LED_Cx_TRIODE_TC_BIT; 217 reg |= MC13783_LED_Cx_TRIODE_TC_BIT;
218 218
219 ret = mc13783_reg_write(dev, MC13783_REG_LED_CONTROL_3, reg); 219 ret = mc13xxx_reg_write(dev, MC13783_REG_LED_CONTROL_3, reg);
220 if (ret) 220 if (ret)
221 goto out; 221 goto out;
222 222
@@ -226,7 +226,7 @@ static int __devinit mc13783_leds_prepare(struct platform_device *pdev)
226 if (pdata->flags & MC13783_LED_TRIODE_TC2) 226 if (pdata->flags & MC13783_LED_TRIODE_TC2)
227 reg |= MC13783_LED_Cx_TRIODE_TC_BIT; 227 reg |= MC13783_LED_Cx_TRIODE_TC_BIT;
228 228
229 ret = mc13783_reg_write(dev, MC13783_REG_LED_CONTROL_4, reg); 229 ret = mc13xxx_reg_write(dev, MC13783_REG_LED_CONTROL_4, reg);
230 if (ret) 230 if (ret)
231 goto out; 231 goto out;
232 232
@@ -236,7 +236,7 @@ static int __devinit mc13783_leds_prepare(struct platform_device *pdev)
236 if (pdata->flags & MC13783_LED_TRIODE_TC3) 236 if (pdata->flags & MC13783_LED_TRIODE_TC3)
237 reg |= MC13783_LED_Cx_TRIODE_TC_BIT; 237 reg |= MC13783_LED_Cx_TRIODE_TC_BIT;
238 238
239 ret = mc13783_reg_write(dev, MC13783_REG_LED_CONTROL_5, reg); 239 ret = mc13xxx_reg_write(dev, MC13783_REG_LED_CONTROL_5, reg);
240 if (ret) 240 if (ret)
241 goto out; 241 goto out;
242 242
@@ -255,10 +255,10 @@ static int __devinit mc13783_leds_prepare(struct platform_device *pdev)
255 reg |= (pdata->abref & MC13783_LED_C0_ABREF_MASK) << 255 reg |= (pdata->abref & MC13783_LED_C0_ABREF_MASK) <<
256 MC13783_LED_C0_ABREF; 256 MC13783_LED_C0_ABREF;
257 257
258 ret = mc13783_reg_write(dev, MC13783_REG_LED_CONTROL_0, reg); 258 ret = mc13xxx_reg_write(dev, MC13783_REG_LED_CONTROL_0, reg);
259 259
260out: 260out:
261 mc13783_unlock(dev); 261 mc13xxx_unlock(dev);
262 return ret; 262 return ret;
263} 263}
264 264
@@ -353,7 +353,7 @@ static int __devexit mc13783_led_remove(struct platform_device *pdev)
353{ 353{
354 struct mc13783_leds_platform_data *pdata = dev_get_platdata(&pdev->dev); 354 struct mc13783_leds_platform_data *pdata = dev_get_platdata(&pdev->dev);
355 struct mc13783_led *led = platform_get_drvdata(pdev); 355 struct mc13783_led *led = platform_get_drvdata(pdev);
356 struct mc13783 *dev = dev_get_drvdata(pdev->dev.parent); 356 struct mc13xxx *dev = dev_get_drvdata(pdev->dev.parent);
357 int i; 357 int i;
358 358
359 for (i = 0; i < pdata->num_leds; i++) { 359 for (i = 0; i < pdata->num_leds; i++) {
@@ -361,16 +361,16 @@ static int __devexit mc13783_led_remove(struct platform_device *pdev)
361 cancel_work_sync(&led[i].work); 361 cancel_work_sync(&led[i].work);
362 } 362 }
363 363
364 mc13783_lock(dev); 364 mc13xxx_lock(dev);
365 365
366 mc13783_reg_write(dev, MC13783_REG_LED_CONTROL_0, 0); 366 mc13xxx_reg_write(dev, MC13783_REG_LED_CONTROL_0, 0);
367 mc13783_reg_write(dev, MC13783_REG_LED_CONTROL_1, 0); 367 mc13xxx_reg_write(dev, MC13783_REG_LED_CONTROL_1, 0);
368 mc13783_reg_write(dev, MC13783_REG_LED_CONTROL_2, 0); 368 mc13xxx_reg_write(dev, MC13783_REG_LED_CONTROL_2, 0);
369 mc13783_reg_write(dev, MC13783_REG_LED_CONTROL_3, 0); 369 mc13xxx_reg_write(dev, MC13783_REG_LED_CONTROL_3, 0);
370 mc13783_reg_write(dev, MC13783_REG_LED_CONTROL_4, 0); 370 mc13xxx_reg_write(dev, MC13783_REG_LED_CONTROL_4, 0);
371 mc13783_reg_write(dev, MC13783_REG_LED_CONTROL_5, 0); 371 mc13xxx_reg_write(dev, MC13783_REG_LED_CONTROL_5, 0);
372 372
373 mc13783_unlock(dev); 373 mc13xxx_unlock(dev);
374 374
375 kfree(led); 375 kfree(led);
376 return 0; 376 return 0;