diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2013-12-06 22:22:18 -0800 |
---|---|---|
committer | Bryan Wu <cooloney@gmail.com> | 2014-01-27 17:28:49 -0800 |
commit | 01a7a063e8cf4bc09af2c02d28c12f3d72bf9649 (patch) | |
tree | 203bc7e800afe602eca8ff4edbbab02643f3c4fd /drivers | |
parent | 33ca15325ff371be7f20be7534f5aa5b6a00b558 (diff) |
leds: leds-mc13783: Remove duplicate field in platform data
LED platform data are overwhelmed by excessive field "max_cur"
which just replicates few bits of "led_control" field.
This patch removes this field and adds a definition for the
current settings in the header.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/leds/leds-mc13783.c | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/drivers/leds/leds-mc13783.c b/drivers/leds/leds-mc13783.c index fa9b439323b..ec704f2ab70 100644 --- a/drivers/leds/leds-mc13783.c +++ b/drivers/leds/leds-mc13783.c @@ -132,75 +132,6 @@ static void mc13xxx_led_set(struct led_classdev *led_cdev, schedule_work(&led->work); } -static int __init mc13xxx_led_setup(struct mc13xxx_led *led, int max_current) -{ - int shift, mask, reg, ret, bank; - - switch (led->id) { - case MC13783_LED_MD: - reg = MC13XXX_REG_LED_CONTROL(2); - shift = 0; - mask = 0x07; - break; - case MC13783_LED_AD: - reg = MC13XXX_REG_LED_CONTROL(2); - shift = 3; - mask = 0x07; - break; - case MC13783_LED_KP: - reg = MC13XXX_REG_LED_CONTROL(2); - shift = 6; - mask = 0x07; - break; - case MC13783_LED_R1: - case MC13783_LED_G1: - case MC13783_LED_B1: - case MC13783_LED_R2: - case MC13783_LED_G2: - case MC13783_LED_B2: - case MC13783_LED_R3: - case MC13783_LED_G3: - case MC13783_LED_B3: - bank = (led->id - MC13783_LED_R1) / 3; - reg = MC13XXX_REG_LED_CONTROL(3) + bank; - shift = ((led->id - MC13783_LED_R1) - bank * 3) * 2; - mask = 0x03; - break; - case MC13892_LED_MD: - reg = MC13XXX_REG_LED_CONTROL(0); - shift = 9; - mask = 0x07; - break; - case MC13892_LED_AD: - reg = MC13XXX_REG_LED_CONTROL(0); - shift = 21; - mask = 0x07; - break; - case MC13892_LED_KP: - reg = MC13XXX_REG_LED_CONTROL(1); - shift = 9; - mask = 0x07; - break; - case MC13892_LED_R: - case MC13892_LED_G: - case MC13892_LED_B: - bank = (led->id - MC13892_LED_R) / 2; - reg = MC13XXX_REG_LED_CONTROL(2) + bank; - shift = ((led->id - MC13892_LED_R) - bank * 2) * 12 + 9; - mask = 0x07; - break; - default: - BUG(); - } - - mc13xxx_lock(led->master); - ret = mc13xxx_reg_rmw(led->master, reg, mask << shift, - max_current << shift); - mc13xxx_unlock(led->master); - - return ret; -} - static int __init mc13xxx_led_probe(struct platform_device *pdev) { struct mc13xxx_leds_platform_data *pdata = dev_get_platdata(&pdev->dev); @@ -250,14 +181,12 @@ static int __init mc13xxx_led_probe(struct platform_device *pdev) for (i = 0; i < num_leds; i++) { const char *name, *trig; - char max_current; ret = -EINVAL; id = pdata->led[i].id; name = pdata->led[i].name; trig = pdata->led[i].default_trigger; - max_current = pdata->led[i].max_current; if ((id > devtype->led_max) || (id < devtype->led_min)) { dev_err(&pdev->dev, "Invalid ID %i\n", id); @@ -280,11 +209,6 @@ static int __init mc13xxx_led_probe(struct platform_device *pdev) INIT_WORK(&leds->led[i].work, mc13xxx_led_work); - ret = mc13xxx_led_setup(&leds->led[i], max_current); - if (ret) { - dev_err(&pdev->dev, "Unable to setup LED %i\n", id); - break; - } ret = led_classdev_register(pdev->dev.parent, &leds->led[i].cdev); if (ret) { |