staging/lustre: Get rid of cksum_type_t typedef
[linux/fpc-iii.git] / drivers / leds / leds-lm3533.c
blob196dcb5e6004a0a93972685b504ae281ed822d0e
1 /*
2 * leds-lm3533.c -- LM3533 LED driver
4 * Copyright (C) 2011-2012 Texas Instruments
6 * Author: Johan Hovold <jhovold@gmail.com>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
14 #include <linux/module.h>
15 #include <linux/leds.h>
16 #include <linux/mfd/core.h>
17 #include <linux/mutex.h>
18 #include <linux/platform_device.h>
19 #include <linux/slab.h>
21 #include <linux/mfd/lm3533.h>
24 #define LM3533_LVCTRLBANK_MIN 2
25 #define LM3533_LVCTRLBANK_MAX 5
26 #define LM3533_LVCTRLBANK_COUNT 4
27 #define LM3533_RISEFALLTIME_MAX 7
28 #define LM3533_ALS_CHANNEL_LV_MIN 1
29 #define LM3533_ALS_CHANNEL_LV_MAX 2
31 #define LM3533_REG_CTRLBANK_BCONF_BASE 0x1b
32 #define LM3533_REG_PATTERN_ENABLE 0x28
33 #define LM3533_REG_PATTERN_LOW_TIME_BASE 0x71
34 #define LM3533_REG_PATTERN_HIGH_TIME_BASE 0x72
35 #define LM3533_REG_PATTERN_RISETIME_BASE 0x74
36 #define LM3533_REG_PATTERN_FALLTIME_BASE 0x75
38 #define LM3533_REG_PATTERN_STEP 0x10
40 #define LM3533_REG_CTRLBANK_BCONF_MAPPING_MASK 0x04
41 #define LM3533_REG_CTRLBANK_BCONF_ALS_EN_MASK 0x02
42 #define LM3533_REG_CTRLBANK_BCONF_ALS_CHANNEL_MASK 0x01
44 #define LM3533_LED_FLAG_PATTERN_ENABLE 1
47 struct lm3533_led {
48 struct lm3533 *lm3533;
49 struct lm3533_ctrlbank cb;
50 struct led_classdev cdev;
51 int id;
53 struct mutex mutex;
54 unsigned long flags;
58 static inline struct lm3533_led *to_lm3533_led(struct led_classdev *cdev)
60 return container_of(cdev, struct lm3533_led, cdev);
63 static inline int lm3533_led_get_ctrlbank_id(struct lm3533_led *led)
65 return led->id + 2;
68 static inline u8 lm3533_led_get_lv_reg(struct lm3533_led *led, u8 base)
70 return base + led->id;
73 static inline u8 lm3533_led_get_pattern(struct lm3533_led *led)
75 return led->id;
78 static inline u8 lm3533_led_get_pattern_reg(struct lm3533_led *led,
79 u8 base)
81 return base + lm3533_led_get_pattern(led) * LM3533_REG_PATTERN_STEP;
84 static int lm3533_led_pattern_enable(struct lm3533_led *led, int enable)
86 u8 mask;
87 u8 val;
88 int pattern;
89 int state;
90 int ret = 0;
92 dev_dbg(led->cdev.dev, "%s - %d\n", __func__, enable);
94 mutex_lock(&led->mutex);
96 state = test_bit(LM3533_LED_FLAG_PATTERN_ENABLE, &led->flags);
97 if ((enable && state) || (!enable && !state))
98 goto out;
100 pattern = lm3533_led_get_pattern(led);
101 mask = 1 << (2 * pattern);
103 if (enable)
104 val = mask;
105 else
106 val = 0;
108 ret = lm3533_update(led->lm3533, LM3533_REG_PATTERN_ENABLE, val, mask);
109 if (ret) {
110 dev_err(led->cdev.dev, "failed to enable pattern %d (%d)\n",
111 pattern, enable);
112 goto out;
115 __change_bit(LM3533_LED_FLAG_PATTERN_ENABLE, &led->flags);
116 out:
117 mutex_unlock(&led->mutex);
119 return ret;
122 static int lm3533_led_set(struct led_classdev *cdev,
123 enum led_brightness value)
125 struct lm3533_led *led = to_lm3533_led(cdev);
127 dev_dbg(led->cdev.dev, "%s - %d\n", __func__, value);
129 if (value == 0)
130 lm3533_led_pattern_enable(led, 0); /* disable blink */
132 return lm3533_ctrlbank_set_brightness(&led->cb, value);
135 static enum led_brightness lm3533_led_get(struct led_classdev *cdev)
137 struct lm3533_led *led = to_lm3533_led(cdev);
138 u8 val;
139 int ret;
141 ret = lm3533_ctrlbank_get_brightness(&led->cb, &val);
142 if (ret)
143 return ret;
145 dev_dbg(led->cdev.dev, "%s - %u\n", __func__, val);
147 return val;
150 /* Pattern generator defines (delays in us). */
151 #define LM3533_LED_DELAY1_VMIN 0x00
152 #define LM3533_LED_DELAY2_VMIN 0x3d
153 #define LM3533_LED_DELAY3_VMIN 0x80
155 #define LM3533_LED_DELAY1_VMAX (LM3533_LED_DELAY2_VMIN - 1)
156 #define LM3533_LED_DELAY2_VMAX (LM3533_LED_DELAY3_VMIN - 1)
157 #define LM3533_LED_DELAY3_VMAX 0xff
159 #define LM3533_LED_DELAY1_TMIN 16384U
160 #define LM3533_LED_DELAY2_TMIN 1130496U
161 #define LM3533_LED_DELAY3_TMIN 10305536U
163 #define LM3533_LED_DELAY1_TMAX 999424U
164 #define LM3533_LED_DELAY2_TMAX 9781248U
165 #define LM3533_LED_DELAY3_TMAX 76890112U
167 /* t_step = (t_max - t_min) / (v_max - v_min) */
168 #define LM3533_LED_DELAY1_TSTEP 16384
169 #define LM3533_LED_DELAY2_TSTEP 131072
170 #define LM3533_LED_DELAY3_TSTEP 524288
172 /* Delay limits for hardware accelerated blinking (in ms). */
173 #define LM3533_LED_DELAY_ON_MAX \
174 ((LM3533_LED_DELAY2_TMAX + LM3533_LED_DELAY2_TSTEP / 2) / 1000)
175 #define LM3533_LED_DELAY_OFF_MAX \
176 ((LM3533_LED_DELAY3_TMAX + LM3533_LED_DELAY3_TSTEP / 2) / 1000)
179 * Returns linear map of *t from [t_min,t_max] to [v_min,v_max] with a step
180 * size of t_step, where
182 * t_step = (t_max - t_min) / (v_max - v_min)
184 * and updates *t to reflect the mapped value.
186 static u8 time_to_val(unsigned *t, unsigned t_min, unsigned t_step,
187 u8 v_min, u8 v_max)
189 unsigned val;
191 val = (*t + t_step / 2 - t_min) / t_step + v_min;
193 *t = t_step * (val - v_min) + t_min;
195 return (u8)val;
199 * Returns time code corresponding to *delay (in ms) and updates *delay to
200 * reflect actual hardware delay.
202 * Hardware supports 256 discrete delay times, divided into three groups with
203 * the following ranges and step-sizes:
205 * [ 16, 999] [0x00, 0x3e] step 16 ms
206 * [ 1130, 9781] [0x3d, 0x7f] step 131 ms
207 * [10306, 76890] [0x80, 0xff] step 524 ms
209 * Note that delay group 3 is only available for delay_off.
211 static u8 lm3533_led_get_hw_delay(unsigned *delay)
213 unsigned t;
214 u8 val;
216 t = *delay * 1000;
218 if (t >= (LM3533_LED_DELAY2_TMAX + LM3533_LED_DELAY3_TMIN) / 2) {
219 t = clamp(t, LM3533_LED_DELAY3_TMIN, LM3533_LED_DELAY3_TMAX);
220 val = time_to_val(&t, LM3533_LED_DELAY3_TMIN,
221 LM3533_LED_DELAY3_TSTEP,
222 LM3533_LED_DELAY3_VMIN,
223 LM3533_LED_DELAY3_VMAX);
224 } else if (t >= (LM3533_LED_DELAY1_TMAX + LM3533_LED_DELAY2_TMIN) / 2) {
225 t = clamp(t, LM3533_LED_DELAY2_TMIN, LM3533_LED_DELAY2_TMAX);
226 val = time_to_val(&t, LM3533_LED_DELAY2_TMIN,
227 LM3533_LED_DELAY2_TSTEP,
228 LM3533_LED_DELAY2_VMIN,
229 LM3533_LED_DELAY2_VMAX);
230 } else {
231 t = clamp(t, LM3533_LED_DELAY1_TMIN, LM3533_LED_DELAY1_TMAX);
232 val = time_to_val(&t, LM3533_LED_DELAY1_TMIN,
233 LM3533_LED_DELAY1_TSTEP,
234 LM3533_LED_DELAY1_VMIN,
235 LM3533_LED_DELAY1_VMAX);
238 *delay = (t + 500) / 1000;
240 return val;
244 * Set delay register base to *delay (in ms) and update *delay to reflect
245 * actual hardware delay used.
247 static u8 lm3533_led_delay_set(struct lm3533_led *led, u8 base,
248 unsigned long *delay)
250 unsigned t;
251 u8 val;
252 u8 reg;
253 int ret;
255 t = (unsigned)*delay;
257 /* Delay group 3 is only available for low time (delay off). */
258 if (base != LM3533_REG_PATTERN_LOW_TIME_BASE)
259 t = min(t, LM3533_LED_DELAY2_TMAX / 1000);
261 val = lm3533_led_get_hw_delay(&t);
263 dev_dbg(led->cdev.dev, "%s - %lu: %u (0x%02x)\n", __func__,
264 *delay, t, val);
265 reg = lm3533_led_get_pattern_reg(led, base);
266 ret = lm3533_write(led->lm3533, reg, val);
267 if (ret)
268 dev_err(led->cdev.dev, "failed to set delay (%02x)\n", reg);
270 *delay = t;
272 return ret;
275 static int lm3533_led_delay_on_set(struct lm3533_led *led, unsigned long *t)
277 return lm3533_led_delay_set(led, LM3533_REG_PATTERN_HIGH_TIME_BASE, t);
280 static int lm3533_led_delay_off_set(struct lm3533_led *led, unsigned long *t)
282 return lm3533_led_delay_set(led, LM3533_REG_PATTERN_LOW_TIME_BASE, t);
285 static int lm3533_led_blink_set(struct led_classdev *cdev,
286 unsigned long *delay_on,
287 unsigned long *delay_off)
289 struct lm3533_led *led = to_lm3533_led(cdev);
290 int ret;
292 dev_dbg(led->cdev.dev, "%s - on = %lu, off = %lu\n", __func__,
293 *delay_on, *delay_off);
295 if (*delay_on > LM3533_LED_DELAY_ON_MAX ||
296 *delay_off > LM3533_LED_DELAY_OFF_MAX)
297 return -EINVAL;
299 if (*delay_on == 0 && *delay_off == 0) {
300 *delay_on = 500;
301 *delay_off = 500;
304 ret = lm3533_led_delay_on_set(led, delay_on);
305 if (ret)
306 return ret;
308 ret = lm3533_led_delay_off_set(led, delay_off);
309 if (ret)
310 return ret;
312 return lm3533_led_pattern_enable(led, 1);
315 static ssize_t show_id(struct device *dev,
316 struct device_attribute *attr, char *buf)
318 struct led_classdev *led_cdev = dev_get_drvdata(dev);
319 struct lm3533_led *led = to_lm3533_led(led_cdev);
321 return scnprintf(buf, PAGE_SIZE, "%d\n", led->id);
325 * Pattern generator rise/fall times:
327 * 0 - 2048 us (default)
328 * 1 - 262 ms
329 * 2 - 524 ms
330 * 3 - 1.049 s
331 * 4 - 2.097 s
332 * 5 - 4.194 s
333 * 6 - 8.389 s
334 * 7 - 16.78 s
336 static ssize_t show_risefalltime(struct device *dev,
337 struct device_attribute *attr,
338 char *buf, u8 base)
340 struct led_classdev *led_cdev = dev_get_drvdata(dev);
341 struct lm3533_led *led = to_lm3533_led(led_cdev);
342 ssize_t ret;
343 u8 reg;
344 u8 val;
346 reg = lm3533_led_get_pattern_reg(led, base);
347 ret = lm3533_read(led->lm3533, reg, &val);
348 if (ret)
349 return ret;
351 return scnprintf(buf, PAGE_SIZE, "%x\n", val);
354 static ssize_t show_risetime(struct device *dev,
355 struct device_attribute *attr, char *buf)
357 return show_risefalltime(dev, attr, buf,
358 LM3533_REG_PATTERN_RISETIME_BASE);
361 static ssize_t show_falltime(struct device *dev,
362 struct device_attribute *attr, char *buf)
364 return show_risefalltime(dev, attr, buf,
365 LM3533_REG_PATTERN_FALLTIME_BASE);
368 static ssize_t store_risefalltime(struct device *dev,
369 struct device_attribute *attr,
370 const char *buf, size_t len, u8 base)
372 struct led_classdev *led_cdev = dev_get_drvdata(dev);
373 struct lm3533_led *led = to_lm3533_led(led_cdev);
374 u8 val;
375 u8 reg;
376 int ret;
378 if (kstrtou8(buf, 0, &val) || val > LM3533_RISEFALLTIME_MAX)
379 return -EINVAL;
381 reg = lm3533_led_get_pattern_reg(led, base);
382 ret = lm3533_write(led->lm3533, reg, val);
383 if (ret)
384 return ret;
386 return len;
389 static ssize_t store_risetime(struct device *dev,
390 struct device_attribute *attr,
391 const char *buf, size_t len)
393 return store_risefalltime(dev, attr, buf, len,
394 LM3533_REG_PATTERN_RISETIME_BASE);
397 static ssize_t store_falltime(struct device *dev,
398 struct device_attribute *attr,
399 const char *buf, size_t len)
401 return store_risefalltime(dev, attr, buf, len,
402 LM3533_REG_PATTERN_FALLTIME_BASE);
405 static ssize_t show_als_channel(struct device *dev,
406 struct device_attribute *attr, char *buf)
408 struct led_classdev *led_cdev = dev_get_drvdata(dev);
409 struct lm3533_led *led = to_lm3533_led(led_cdev);
410 unsigned channel;
411 u8 reg;
412 u8 val;
413 int ret;
415 reg = lm3533_led_get_lv_reg(led, LM3533_REG_CTRLBANK_BCONF_BASE);
416 ret = lm3533_read(led->lm3533, reg, &val);
417 if (ret)
418 return ret;
420 channel = (val & LM3533_REG_CTRLBANK_BCONF_ALS_CHANNEL_MASK) + 1;
422 return scnprintf(buf, PAGE_SIZE, "%u\n", channel);
425 static ssize_t store_als_channel(struct device *dev,
426 struct device_attribute *attr,
427 const char *buf, size_t len)
429 struct led_classdev *led_cdev = dev_get_drvdata(dev);
430 struct lm3533_led *led = to_lm3533_led(led_cdev);
431 unsigned channel;
432 u8 reg;
433 u8 val;
434 u8 mask;
435 int ret;
437 if (kstrtouint(buf, 0, &channel))
438 return -EINVAL;
440 if (channel < LM3533_ALS_CHANNEL_LV_MIN ||
441 channel > LM3533_ALS_CHANNEL_LV_MAX)
442 return -EINVAL;
444 reg = lm3533_led_get_lv_reg(led, LM3533_REG_CTRLBANK_BCONF_BASE);
445 mask = LM3533_REG_CTRLBANK_BCONF_ALS_CHANNEL_MASK;
446 val = channel - 1;
448 ret = lm3533_update(led->lm3533, reg, val, mask);
449 if (ret)
450 return ret;
452 return len;
455 static ssize_t show_als_en(struct device *dev,
456 struct device_attribute *attr, char *buf)
458 struct led_classdev *led_cdev = dev_get_drvdata(dev);
459 struct lm3533_led *led = to_lm3533_led(led_cdev);
460 bool enable;
461 u8 reg;
462 u8 val;
463 int ret;
465 reg = lm3533_led_get_lv_reg(led, LM3533_REG_CTRLBANK_BCONF_BASE);
466 ret = lm3533_read(led->lm3533, reg, &val);
467 if (ret)
468 return ret;
470 enable = val & LM3533_REG_CTRLBANK_BCONF_ALS_EN_MASK;
472 return scnprintf(buf, PAGE_SIZE, "%d\n", enable);
475 static ssize_t store_als_en(struct device *dev,
476 struct device_attribute *attr,
477 const char *buf, size_t len)
479 struct led_classdev *led_cdev = dev_get_drvdata(dev);
480 struct lm3533_led *led = to_lm3533_led(led_cdev);
481 unsigned enable;
482 u8 reg;
483 u8 mask;
484 u8 val;
485 int ret;
487 if (kstrtouint(buf, 0, &enable))
488 return -EINVAL;
490 reg = lm3533_led_get_lv_reg(led, LM3533_REG_CTRLBANK_BCONF_BASE);
491 mask = LM3533_REG_CTRLBANK_BCONF_ALS_EN_MASK;
493 if (enable)
494 val = mask;
495 else
496 val = 0;
498 ret = lm3533_update(led->lm3533, reg, val, mask);
499 if (ret)
500 return ret;
502 return len;
505 static ssize_t show_linear(struct device *dev,
506 struct device_attribute *attr, char *buf)
508 struct led_classdev *led_cdev = dev_get_drvdata(dev);
509 struct lm3533_led *led = to_lm3533_led(led_cdev);
510 u8 reg;
511 u8 val;
512 int linear;
513 int ret;
515 reg = lm3533_led_get_lv_reg(led, LM3533_REG_CTRLBANK_BCONF_BASE);
516 ret = lm3533_read(led->lm3533, reg, &val);
517 if (ret)
518 return ret;
520 if (val & LM3533_REG_CTRLBANK_BCONF_MAPPING_MASK)
521 linear = 1;
522 else
523 linear = 0;
525 return scnprintf(buf, PAGE_SIZE, "%x\n", linear);
528 static ssize_t store_linear(struct device *dev,
529 struct device_attribute *attr,
530 const char *buf, size_t len)
532 struct led_classdev *led_cdev = dev_get_drvdata(dev);
533 struct lm3533_led *led = to_lm3533_led(led_cdev);
534 unsigned long linear;
535 u8 reg;
536 u8 mask;
537 u8 val;
538 int ret;
540 if (kstrtoul(buf, 0, &linear))
541 return -EINVAL;
543 reg = lm3533_led_get_lv_reg(led, LM3533_REG_CTRLBANK_BCONF_BASE);
544 mask = LM3533_REG_CTRLBANK_BCONF_MAPPING_MASK;
546 if (linear)
547 val = mask;
548 else
549 val = 0;
551 ret = lm3533_update(led->lm3533, reg, val, mask);
552 if (ret)
553 return ret;
555 return len;
558 static ssize_t show_pwm(struct device *dev,
559 struct device_attribute *attr,
560 char *buf)
562 struct led_classdev *led_cdev = dev_get_drvdata(dev);
563 struct lm3533_led *led = to_lm3533_led(led_cdev);
564 u8 val;
565 int ret;
567 ret = lm3533_ctrlbank_get_pwm(&led->cb, &val);
568 if (ret)
569 return ret;
571 return scnprintf(buf, PAGE_SIZE, "%u\n", val);
574 static ssize_t store_pwm(struct device *dev,
575 struct device_attribute *attr,
576 const char *buf, size_t len)
578 struct led_classdev *led_cdev = dev_get_drvdata(dev);
579 struct lm3533_led *led = to_lm3533_led(led_cdev);
580 u8 val;
581 int ret;
583 if (kstrtou8(buf, 0, &val))
584 return -EINVAL;
586 ret = lm3533_ctrlbank_set_pwm(&led->cb, val);
587 if (ret)
588 return ret;
590 return len;
593 static LM3533_ATTR_RW(als_channel);
594 static LM3533_ATTR_RW(als_en);
595 static LM3533_ATTR_RW(falltime);
596 static LM3533_ATTR_RO(id);
597 static LM3533_ATTR_RW(linear);
598 static LM3533_ATTR_RW(pwm);
599 static LM3533_ATTR_RW(risetime);
601 static struct attribute *lm3533_led_attributes[] = {
602 &dev_attr_als_channel.attr,
603 &dev_attr_als_en.attr,
604 &dev_attr_falltime.attr,
605 &dev_attr_id.attr,
606 &dev_attr_linear.attr,
607 &dev_attr_pwm.attr,
608 &dev_attr_risetime.attr,
609 NULL,
612 static umode_t lm3533_led_attr_is_visible(struct kobject *kobj,
613 struct attribute *attr, int n)
615 struct device *dev = container_of(kobj, struct device, kobj);
616 struct led_classdev *led_cdev = dev_get_drvdata(dev);
617 struct lm3533_led *led = to_lm3533_led(led_cdev);
618 umode_t mode = attr->mode;
620 if (attr == &dev_attr_als_channel.attr ||
621 attr == &dev_attr_als_en.attr) {
622 if (!led->lm3533->have_als)
623 mode = 0;
626 return mode;
629 static struct attribute_group lm3533_led_attribute_group = {
630 .is_visible = lm3533_led_attr_is_visible,
631 .attrs = lm3533_led_attributes
634 static const struct attribute_group *lm3533_led_attribute_groups[] = {
635 &lm3533_led_attribute_group,
636 NULL
639 static int lm3533_led_setup(struct lm3533_led *led,
640 struct lm3533_led_platform_data *pdata)
642 int ret;
644 ret = lm3533_ctrlbank_set_max_current(&led->cb, pdata->max_current);
645 if (ret)
646 return ret;
648 return lm3533_ctrlbank_set_pwm(&led->cb, pdata->pwm);
651 static int lm3533_led_probe(struct platform_device *pdev)
653 struct lm3533 *lm3533;
654 struct lm3533_led_platform_data *pdata;
655 struct lm3533_led *led;
656 int ret;
658 dev_dbg(&pdev->dev, "%s\n", __func__);
660 lm3533 = dev_get_drvdata(pdev->dev.parent);
661 if (!lm3533)
662 return -EINVAL;
664 pdata = dev_get_platdata(&pdev->dev);
665 if (!pdata) {
666 dev_err(&pdev->dev, "no platform data\n");
667 return -EINVAL;
670 if (pdev->id < 0 || pdev->id >= LM3533_LVCTRLBANK_COUNT) {
671 dev_err(&pdev->dev, "illegal LED id %d\n", pdev->id);
672 return -EINVAL;
675 led = devm_kzalloc(&pdev->dev, sizeof(*led), GFP_KERNEL);
676 if (!led)
677 return -ENOMEM;
679 led->lm3533 = lm3533;
680 led->cdev.name = pdata->name;
681 led->cdev.default_trigger = pdata->default_trigger;
682 led->cdev.brightness_set_blocking = lm3533_led_set;
683 led->cdev.brightness_get = lm3533_led_get;
684 led->cdev.blink_set = lm3533_led_blink_set;
685 led->cdev.brightness = LED_OFF;
686 led->cdev.groups = lm3533_led_attribute_groups,
687 led->id = pdev->id;
689 mutex_init(&led->mutex);
691 /* The class framework makes a callback to get brightness during
692 * registration so use parent device (for error reporting) until
693 * registered.
695 led->cb.lm3533 = lm3533;
696 led->cb.id = lm3533_led_get_ctrlbank_id(led);
697 led->cb.dev = lm3533->dev;
699 platform_set_drvdata(pdev, led);
701 ret = led_classdev_register(pdev->dev.parent, &led->cdev);
702 if (ret) {
703 dev_err(&pdev->dev, "failed to register LED %d\n", pdev->id);
704 return ret;
707 led->cb.dev = led->cdev.dev;
709 ret = lm3533_led_setup(led, pdata);
710 if (ret)
711 goto err_unregister;
713 ret = lm3533_ctrlbank_enable(&led->cb);
714 if (ret)
715 goto err_unregister;
717 return 0;
719 err_unregister:
720 led_classdev_unregister(&led->cdev);
722 return ret;
725 static int lm3533_led_remove(struct platform_device *pdev)
727 struct lm3533_led *led = platform_get_drvdata(pdev);
729 dev_dbg(&pdev->dev, "%s\n", __func__);
731 lm3533_ctrlbank_disable(&led->cb);
732 led_classdev_unregister(&led->cdev);
734 return 0;
737 static void lm3533_led_shutdown(struct platform_device *pdev)
740 struct lm3533_led *led = platform_get_drvdata(pdev);
742 dev_dbg(&pdev->dev, "%s\n", __func__);
744 lm3533_ctrlbank_disable(&led->cb);
745 lm3533_led_set(&led->cdev, LED_OFF); /* disable blink */
748 static struct platform_driver lm3533_led_driver = {
749 .driver = {
750 .name = "lm3533-leds",
752 .probe = lm3533_led_probe,
753 .remove = lm3533_led_remove,
754 .shutdown = lm3533_led_shutdown,
756 module_platform_driver(lm3533_led_driver);
758 MODULE_AUTHOR("Johan Hovold <jhovold@gmail.com>");
759 MODULE_DESCRIPTION("LM3533 LED driver");
760 MODULE_LICENSE("GPL");
761 MODULE_ALIAS("platform:lm3533-leds");