Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / leds / leds-lm3533.c
blobb3edee7031931eae380a762f30d866ac3af36da3
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * leds-lm3533.c -- LM3533 LED driver
5 * Copyright (C) 2011-2012 Texas Instruments
7 * Author: Johan Hovold <jhovold@gmail.com>
8 */
10 #include <linux/module.h>
11 #include <linux/leds.h>
12 #include <linux/mfd/core.h>
13 #include <linux/mutex.h>
14 #include <linux/platform_device.h>
15 #include <linux/slab.h>
17 #include <linux/mfd/lm3533.h>
20 #define LM3533_LVCTRLBANK_MIN 2
21 #define LM3533_LVCTRLBANK_MAX 5
22 #define LM3533_LVCTRLBANK_COUNT 4
23 #define LM3533_RISEFALLTIME_MAX 7
24 #define LM3533_ALS_CHANNEL_LV_MIN 1
25 #define LM3533_ALS_CHANNEL_LV_MAX 2
27 #define LM3533_REG_CTRLBANK_BCONF_BASE 0x1b
28 #define LM3533_REG_PATTERN_ENABLE 0x28
29 #define LM3533_REG_PATTERN_LOW_TIME_BASE 0x71
30 #define LM3533_REG_PATTERN_HIGH_TIME_BASE 0x72
31 #define LM3533_REG_PATTERN_RISETIME_BASE 0x74
32 #define LM3533_REG_PATTERN_FALLTIME_BASE 0x75
34 #define LM3533_REG_PATTERN_STEP 0x10
36 #define LM3533_REG_CTRLBANK_BCONF_MAPPING_MASK 0x04
37 #define LM3533_REG_CTRLBANK_BCONF_ALS_EN_MASK 0x02
38 #define LM3533_REG_CTRLBANK_BCONF_ALS_CHANNEL_MASK 0x01
40 #define LM3533_LED_FLAG_PATTERN_ENABLE 1
43 struct lm3533_led {
44 struct lm3533 *lm3533;
45 struct lm3533_ctrlbank cb;
46 struct led_classdev cdev;
47 int id;
49 struct mutex mutex;
50 unsigned long flags;
54 static inline struct lm3533_led *to_lm3533_led(struct led_classdev *cdev)
56 return container_of(cdev, struct lm3533_led, cdev);
59 static inline int lm3533_led_get_ctrlbank_id(struct lm3533_led *led)
61 return led->id + 2;
64 static inline u8 lm3533_led_get_lv_reg(struct lm3533_led *led, u8 base)
66 return base + led->id;
69 static inline u8 lm3533_led_get_pattern(struct lm3533_led *led)
71 return led->id;
74 static inline u8 lm3533_led_get_pattern_reg(struct lm3533_led *led,
75 u8 base)
77 return base + lm3533_led_get_pattern(led) * LM3533_REG_PATTERN_STEP;
80 static int lm3533_led_pattern_enable(struct lm3533_led *led, int enable)
82 u8 mask;
83 u8 val;
84 int pattern;
85 int state;
86 int ret = 0;
88 dev_dbg(led->cdev.dev, "%s - %d\n", __func__, enable);
90 mutex_lock(&led->mutex);
92 state = test_bit(LM3533_LED_FLAG_PATTERN_ENABLE, &led->flags);
93 if ((enable && state) || (!enable && !state))
94 goto out;
96 pattern = lm3533_led_get_pattern(led);
97 mask = 1 << (2 * pattern);
99 if (enable)
100 val = mask;
101 else
102 val = 0;
104 ret = lm3533_update(led->lm3533, LM3533_REG_PATTERN_ENABLE, val, mask);
105 if (ret) {
106 dev_err(led->cdev.dev, "failed to enable pattern %d (%d)\n",
107 pattern, enable);
108 goto out;
111 __change_bit(LM3533_LED_FLAG_PATTERN_ENABLE, &led->flags);
112 out:
113 mutex_unlock(&led->mutex);
115 return ret;
118 static int lm3533_led_set(struct led_classdev *cdev,
119 enum led_brightness value)
121 struct lm3533_led *led = to_lm3533_led(cdev);
123 dev_dbg(led->cdev.dev, "%s - %d\n", __func__, value);
125 if (value == 0)
126 lm3533_led_pattern_enable(led, 0); /* disable blink */
128 return lm3533_ctrlbank_set_brightness(&led->cb, value);
131 static enum led_brightness lm3533_led_get(struct led_classdev *cdev)
133 struct lm3533_led *led = to_lm3533_led(cdev);
134 u8 val;
135 int ret;
137 ret = lm3533_ctrlbank_get_brightness(&led->cb, &val);
138 if (ret)
139 return ret;
141 dev_dbg(led->cdev.dev, "%s - %u\n", __func__, val);
143 return val;
146 /* Pattern generator defines (delays in us). */
147 #define LM3533_LED_DELAY1_VMIN 0x00
148 #define LM3533_LED_DELAY2_VMIN 0x3d
149 #define LM3533_LED_DELAY3_VMIN 0x80
151 #define LM3533_LED_DELAY1_VMAX (LM3533_LED_DELAY2_VMIN - 1)
152 #define LM3533_LED_DELAY2_VMAX (LM3533_LED_DELAY3_VMIN - 1)
153 #define LM3533_LED_DELAY3_VMAX 0xff
155 #define LM3533_LED_DELAY1_TMIN 16384U
156 #define LM3533_LED_DELAY2_TMIN 1130496U
157 #define LM3533_LED_DELAY3_TMIN 10305536U
159 #define LM3533_LED_DELAY1_TMAX 999424U
160 #define LM3533_LED_DELAY2_TMAX 9781248U
161 #define LM3533_LED_DELAY3_TMAX 76890112U
163 /* t_step = (t_max - t_min) / (v_max - v_min) */
164 #define LM3533_LED_DELAY1_TSTEP 16384
165 #define LM3533_LED_DELAY2_TSTEP 131072
166 #define LM3533_LED_DELAY3_TSTEP 524288
168 /* Delay limits for hardware accelerated blinking (in ms). */
169 #define LM3533_LED_DELAY_ON_MAX \
170 ((LM3533_LED_DELAY2_TMAX + LM3533_LED_DELAY2_TSTEP / 2) / 1000)
171 #define LM3533_LED_DELAY_OFF_MAX \
172 ((LM3533_LED_DELAY3_TMAX + LM3533_LED_DELAY3_TSTEP / 2) / 1000)
175 * Returns linear map of *t from [t_min,t_max] to [v_min,v_max] with a step
176 * size of t_step, where
178 * t_step = (t_max - t_min) / (v_max - v_min)
180 * and updates *t to reflect the mapped value.
182 static u8 time_to_val(unsigned *t, unsigned t_min, unsigned t_step,
183 u8 v_min, u8 v_max)
185 unsigned val;
187 val = (*t + t_step / 2 - t_min) / t_step + v_min;
189 *t = t_step * (val - v_min) + t_min;
191 return (u8)val;
195 * Returns time code corresponding to *delay (in ms) and updates *delay to
196 * reflect actual hardware delay.
198 * Hardware supports 256 discrete delay times, divided into three groups with
199 * the following ranges and step-sizes:
201 * [ 16, 999] [0x00, 0x3e] step 16 ms
202 * [ 1130, 9781] [0x3d, 0x7f] step 131 ms
203 * [10306, 76890] [0x80, 0xff] step 524 ms
205 * Note that delay group 3 is only available for delay_off.
207 static u8 lm3533_led_get_hw_delay(unsigned *delay)
209 unsigned t;
210 u8 val;
212 t = *delay * 1000;
214 if (t >= (LM3533_LED_DELAY2_TMAX + LM3533_LED_DELAY3_TMIN) / 2) {
215 t = clamp(t, LM3533_LED_DELAY3_TMIN, LM3533_LED_DELAY3_TMAX);
216 val = time_to_val(&t, LM3533_LED_DELAY3_TMIN,
217 LM3533_LED_DELAY3_TSTEP,
218 LM3533_LED_DELAY3_VMIN,
219 LM3533_LED_DELAY3_VMAX);
220 } else if (t >= (LM3533_LED_DELAY1_TMAX + LM3533_LED_DELAY2_TMIN) / 2) {
221 t = clamp(t, LM3533_LED_DELAY2_TMIN, LM3533_LED_DELAY2_TMAX);
222 val = time_to_val(&t, LM3533_LED_DELAY2_TMIN,
223 LM3533_LED_DELAY2_TSTEP,
224 LM3533_LED_DELAY2_VMIN,
225 LM3533_LED_DELAY2_VMAX);
226 } else {
227 t = clamp(t, LM3533_LED_DELAY1_TMIN, LM3533_LED_DELAY1_TMAX);
228 val = time_to_val(&t, LM3533_LED_DELAY1_TMIN,
229 LM3533_LED_DELAY1_TSTEP,
230 LM3533_LED_DELAY1_VMIN,
231 LM3533_LED_DELAY1_VMAX);
234 *delay = (t + 500) / 1000;
236 return val;
240 * Set delay register base to *delay (in ms) and update *delay to reflect
241 * actual hardware delay used.
243 static u8 lm3533_led_delay_set(struct lm3533_led *led, u8 base,
244 unsigned long *delay)
246 unsigned t;
247 u8 val;
248 u8 reg;
249 int ret;
251 t = (unsigned)*delay;
253 /* Delay group 3 is only available for low time (delay off). */
254 if (base != LM3533_REG_PATTERN_LOW_TIME_BASE)
255 t = min(t, LM3533_LED_DELAY2_TMAX / 1000);
257 val = lm3533_led_get_hw_delay(&t);
259 dev_dbg(led->cdev.dev, "%s - %lu: %u (0x%02x)\n", __func__,
260 *delay, t, val);
261 reg = lm3533_led_get_pattern_reg(led, base);
262 ret = lm3533_write(led->lm3533, reg, val);
263 if (ret)
264 dev_err(led->cdev.dev, "failed to set delay (%02x)\n", reg);
266 *delay = t;
268 return ret;
271 static int lm3533_led_delay_on_set(struct lm3533_led *led, unsigned long *t)
273 return lm3533_led_delay_set(led, LM3533_REG_PATTERN_HIGH_TIME_BASE, t);
276 static int lm3533_led_delay_off_set(struct lm3533_led *led, unsigned long *t)
278 return lm3533_led_delay_set(led, LM3533_REG_PATTERN_LOW_TIME_BASE, t);
281 static int lm3533_led_blink_set(struct led_classdev *cdev,
282 unsigned long *delay_on,
283 unsigned long *delay_off)
285 struct lm3533_led *led = to_lm3533_led(cdev);
286 int ret;
288 dev_dbg(led->cdev.dev, "%s - on = %lu, off = %lu\n", __func__,
289 *delay_on, *delay_off);
291 if (*delay_on > LM3533_LED_DELAY_ON_MAX ||
292 *delay_off > LM3533_LED_DELAY_OFF_MAX)
293 return -EINVAL;
295 if (*delay_on == 0 && *delay_off == 0) {
296 *delay_on = 500;
297 *delay_off = 500;
300 ret = lm3533_led_delay_on_set(led, delay_on);
301 if (ret)
302 return ret;
304 ret = lm3533_led_delay_off_set(led, delay_off);
305 if (ret)
306 return ret;
308 return lm3533_led_pattern_enable(led, 1);
311 static ssize_t show_id(struct device *dev,
312 struct device_attribute *attr, char *buf)
314 struct led_classdev *led_cdev = dev_get_drvdata(dev);
315 struct lm3533_led *led = to_lm3533_led(led_cdev);
317 return scnprintf(buf, PAGE_SIZE, "%d\n", led->id);
321 * Pattern generator rise/fall times:
323 * 0 - 2048 us (default)
324 * 1 - 262 ms
325 * 2 - 524 ms
326 * 3 - 1.049 s
327 * 4 - 2.097 s
328 * 5 - 4.194 s
329 * 6 - 8.389 s
330 * 7 - 16.78 s
332 static ssize_t show_risefalltime(struct device *dev,
333 struct device_attribute *attr,
334 char *buf, u8 base)
336 struct led_classdev *led_cdev = dev_get_drvdata(dev);
337 struct lm3533_led *led = to_lm3533_led(led_cdev);
338 ssize_t ret;
339 u8 reg;
340 u8 val;
342 reg = lm3533_led_get_pattern_reg(led, base);
343 ret = lm3533_read(led->lm3533, reg, &val);
344 if (ret)
345 return ret;
347 return scnprintf(buf, PAGE_SIZE, "%x\n", val);
350 static ssize_t show_risetime(struct device *dev,
351 struct device_attribute *attr, char *buf)
353 return show_risefalltime(dev, attr, buf,
354 LM3533_REG_PATTERN_RISETIME_BASE);
357 static ssize_t show_falltime(struct device *dev,
358 struct device_attribute *attr, char *buf)
360 return show_risefalltime(dev, attr, buf,
361 LM3533_REG_PATTERN_FALLTIME_BASE);
364 static ssize_t store_risefalltime(struct device *dev,
365 struct device_attribute *attr,
366 const char *buf, size_t len, u8 base)
368 struct led_classdev *led_cdev = dev_get_drvdata(dev);
369 struct lm3533_led *led = to_lm3533_led(led_cdev);
370 u8 val;
371 u8 reg;
372 int ret;
374 if (kstrtou8(buf, 0, &val) || val > LM3533_RISEFALLTIME_MAX)
375 return -EINVAL;
377 reg = lm3533_led_get_pattern_reg(led, base);
378 ret = lm3533_write(led->lm3533, reg, val);
379 if (ret)
380 return ret;
382 return len;
385 static ssize_t store_risetime(struct device *dev,
386 struct device_attribute *attr,
387 const char *buf, size_t len)
389 return store_risefalltime(dev, attr, buf, len,
390 LM3533_REG_PATTERN_RISETIME_BASE);
393 static ssize_t store_falltime(struct device *dev,
394 struct device_attribute *attr,
395 const char *buf, size_t len)
397 return store_risefalltime(dev, attr, buf, len,
398 LM3533_REG_PATTERN_FALLTIME_BASE);
401 static ssize_t show_als_channel(struct device *dev,
402 struct device_attribute *attr, char *buf)
404 struct led_classdev *led_cdev = dev_get_drvdata(dev);
405 struct lm3533_led *led = to_lm3533_led(led_cdev);
406 unsigned channel;
407 u8 reg;
408 u8 val;
409 int ret;
411 reg = lm3533_led_get_lv_reg(led, LM3533_REG_CTRLBANK_BCONF_BASE);
412 ret = lm3533_read(led->lm3533, reg, &val);
413 if (ret)
414 return ret;
416 channel = (val & LM3533_REG_CTRLBANK_BCONF_ALS_CHANNEL_MASK) + 1;
418 return scnprintf(buf, PAGE_SIZE, "%u\n", channel);
421 static ssize_t store_als_channel(struct device *dev,
422 struct device_attribute *attr,
423 const char *buf, size_t len)
425 struct led_classdev *led_cdev = dev_get_drvdata(dev);
426 struct lm3533_led *led = to_lm3533_led(led_cdev);
427 unsigned channel;
428 u8 reg;
429 u8 val;
430 u8 mask;
431 int ret;
433 if (kstrtouint(buf, 0, &channel))
434 return -EINVAL;
436 if (channel < LM3533_ALS_CHANNEL_LV_MIN ||
437 channel > LM3533_ALS_CHANNEL_LV_MAX)
438 return -EINVAL;
440 reg = lm3533_led_get_lv_reg(led, LM3533_REG_CTRLBANK_BCONF_BASE);
441 mask = LM3533_REG_CTRLBANK_BCONF_ALS_CHANNEL_MASK;
442 val = channel - 1;
444 ret = lm3533_update(led->lm3533, reg, val, mask);
445 if (ret)
446 return ret;
448 return len;
451 static ssize_t show_als_en(struct device *dev,
452 struct device_attribute *attr, char *buf)
454 struct led_classdev *led_cdev = dev_get_drvdata(dev);
455 struct lm3533_led *led = to_lm3533_led(led_cdev);
456 bool enable;
457 u8 reg;
458 u8 val;
459 int ret;
461 reg = lm3533_led_get_lv_reg(led, LM3533_REG_CTRLBANK_BCONF_BASE);
462 ret = lm3533_read(led->lm3533, reg, &val);
463 if (ret)
464 return ret;
466 enable = val & LM3533_REG_CTRLBANK_BCONF_ALS_EN_MASK;
468 return scnprintf(buf, PAGE_SIZE, "%d\n", enable);
471 static ssize_t store_als_en(struct device *dev,
472 struct device_attribute *attr,
473 const char *buf, size_t len)
475 struct led_classdev *led_cdev = dev_get_drvdata(dev);
476 struct lm3533_led *led = to_lm3533_led(led_cdev);
477 unsigned enable;
478 u8 reg;
479 u8 mask;
480 u8 val;
481 int ret;
483 if (kstrtouint(buf, 0, &enable))
484 return -EINVAL;
486 reg = lm3533_led_get_lv_reg(led, LM3533_REG_CTRLBANK_BCONF_BASE);
487 mask = LM3533_REG_CTRLBANK_BCONF_ALS_EN_MASK;
489 if (enable)
490 val = mask;
491 else
492 val = 0;
494 ret = lm3533_update(led->lm3533, reg, val, mask);
495 if (ret)
496 return ret;
498 return len;
501 static ssize_t show_linear(struct device *dev,
502 struct device_attribute *attr, char *buf)
504 struct led_classdev *led_cdev = dev_get_drvdata(dev);
505 struct lm3533_led *led = to_lm3533_led(led_cdev);
506 u8 reg;
507 u8 val;
508 int linear;
509 int ret;
511 reg = lm3533_led_get_lv_reg(led, LM3533_REG_CTRLBANK_BCONF_BASE);
512 ret = lm3533_read(led->lm3533, reg, &val);
513 if (ret)
514 return ret;
516 if (val & LM3533_REG_CTRLBANK_BCONF_MAPPING_MASK)
517 linear = 1;
518 else
519 linear = 0;
521 return scnprintf(buf, PAGE_SIZE, "%x\n", linear);
524 static ssize_t store_linear(struct device *dev,
525 struct device_attribute *attr,
526 const char *buf, size_t len)
528 struct led_classdev *led_cdev = dev_get_drvdata(dev);
529 struct lm3533_led *led = to_lm3533_led(led_cdev);
530 unsigned long linear;
531 u8 reg;
532 u8 mask;
533 u8 val;
534 int ret;
536 if (kstrtoul(buf, 0, &linear))
537 return -EINVAL;
539 reg = lm3533_led_get_lv_reg(led, LM3533_REG_CTRLBANK_BCONF_BASE);
540 mask = LM3533_REG_CTRLBANK_BCONF_MAPPING_MASK;
542 if (linear)
543 val = mask;
544 else
545 val = 0;
547 ret = lm3533_update(led->lm3533, reg, val, mask);
548 if (ret)
549 return ret;
551 return len;
554 static ssize_t show_pwm(struct device *dev,
555 struct device_attribute *attr,
556 char *buf)
558 struct led_classdev *led_cdev = dev_get_drvdata(dev);
559 struct lm3533_led *led = to_lm3533_led(led_cdev);
560 u8 val;
561 int ret;
563 ret = lm3533_ctrlbank_get_pwm(&led->cb, &val);
564 if (ret)
565 return ret;
567 return scnprintf(buf, PAGE_SIZE, "%u\n", val);
570 static ssize_t store_pwm(struct device *dev,
571 struct device_attribute *attr,
572 const char *buf, size_t len)
574 struct led_classdev *led_cdev = dev_get_drvdata(dev);
575 struct lm3533_led *led = to_lm3533_led(led_cdev);
576 u8 val;
577 int ret;
579 if (kstrtou8(buf, 0, &val))
580 return -EINVAL;
582 ret = lm3533_ctrlbank_set_pwm(&led->cb, val);
583 if (ret)
584 return ret;
586 return len;
589 static LM3533_ATTR_RW(als_channel);
590 static LM3533_ATTR_RW(als_en);
591 static LM3533_ATTR_RW(falltime);
592 static LM3533_ATTR_RO(id);
593 static LM3533_ATTR_RW(linear);
594 static LM3533_ATTR_RW(pwm);
595 static LM3533_ATTR_RW(risetime);
597 static struct attribute *lm3533_led_attributes[] = {
598 &dev_attr_als_channel.attr,
599 &dev_attr_als_en.attr,
600 &dev_attr_falltime.attr,
601 &dev_attr_id.attr,
602 &dev_attr_linear.attr,
603 &dev_attr_pwm.attr,
604 &dev_attr_risetime.attr,
605 NULL,
608 static umode_t lm3533_led_attr_is_visible(struct kobject *kobj,
609 struct attribute *attr, int n)
611 struct device *dev = container_of(kobj, struct device, kobj);
612 struct led_classdev *led_cdev = dev_get_drvdata(dev);
613 struct lm3533_led *led = to_lm3533_led(led_cdev);
614 umode_t mode = attr->mode;
616 if (attr == &dev_attr_als_channel.attr ||
617 attr == &dev_attr_als_en.attr) {
618 if (!led->lm3533->have_als)
619 mode = 0;
622 return mode;
625 static const struct attribute_group lm3533_led_attribute_group = {
626 .is_visible = lm3533_led_attr_is_visible,
627 .attrs = lm3533_led_attributes
630 static const struct attribute_group *lm3533_led_attribute_groups[] = {
631 &lm3533_led_attribute_group,
632 NULL
635 static int lm3533_led_setup(struct lm3533_led *led,
636 struct lm3533_led_platform_data *pdata)
638 int ret;
640 ret = lm3533_ctrlbank_set_max_current(&led->cb, pdata->max_current);
641 if (ret)
642 return ret;
644 return lm3533_ctrlbank_set_pwm(&led->cb, pdata->pwm);
647 static int lm3533_led_probe(struct platform_device *pdev)
649 struct lm3533 *lm3533;
650 struct lm3533_led_platform_data *pdata;
651 struct lm3533_led *led;
652 int ret;
654 dev_dbg(&pdev->dev, "%s\n", __func__);
656 lm3533 = dev_get_drvdata(pdev->dev.parent);
657 if (!lm3533)
658 return -EINVAL;
660 pdata = dev_get_platdata(&pdev->dev);
661 if (!pdata) {
662 dev_err(&pdev->dev, "no platform data\n");
663 return -EINVAL;
666 if (pdev->id < 0 || pdev->id >= LM3533_LVCTRLBANK_COUNT) {
667 dev_err(&pdev->dev, "illegal LED id %d\n", pdev->id);
668 return -EINVAL;
671 led = devm_kzalloc(&pdev->dev, sizeof(*led), GFP_KERNEL);
672 if (!led)
673 return -ENOMEM;
675 led->lm3533 = lm3533;
676 led->cdev.name = pdata->name;
677 led->cdev.default_trigger = pdata->default_trigger;
678 led->cdev.brightness_set_blocking = lm3533_led_set;
679 led->cdev.brightness_get = lm3533_led_get;
680 led->cdev.blink_set = lm3533_led_blink_set;
681 led->cdev.brightness = LED_OFF;
682 led->cdev.groups = lm3533_led_attribute_groups,
683 led->id = pdev->id;
685 mutex_init(&led->mutex);
687 /* The class framework makes a callback to get brightness during
688 * registration so use parent device (for error reporting) until
689 * registered.
691 led->cb.lm3533 = lm3533;
692 led->cb.id = lm3533_led_get_ctrlbank_id(led);
693 led->cb.dev = lm3533->dev;
695 platform_set_drvdata(pdev, led);
697 ret = led_classdev_register(pdev->dev.parent, &led->cdev);
698 if (ret) {
699 dev_err(&pdev->dev, "failed to register LED %d\n", pdev->id);
700 return ret;
703 led->cb.dev = led->cdev.dev;
705 ret = lm3533_led_setup(led, pdata);
706 if (ret)
707 goto err_deregister;
709 ret = lm3533_ctrlbank_enable(&led->cb);
710 if (ret)
711 goto err_deregister;
713 return 0;
715 err_deregister:
716 led_classdev_unregister(&led->cdev);
718 return ret;
721 static int lm3533_led_remove(struct platform_device *pdev)
723 struct lm3533_led *led = platform_get_drvdata(pdev);
725 dev_dbg(&pdev->dev, "%s\n", __func__);
727 lm3533_ctrlbank_disable(&led->cb);
728 led_classdev_unregister(&led->cdev);
730 return 0;
733 static void lm3533_led_shutdown(struct platform_device *pdev)
736 struct lm3533_led *led = platform_get_drvdata(pdev);
738 dev_dbg(&pdev->dev, "%s\n", __func__);
740 lm3533_ctrlbank_disable(&led->cb);
741 lm3533_led_set(&led->cdev, LED_OFF); /* disable blink */
744 static struct platform_driver lm3533_led_driver = {
745 .driver = {
746 .name = "lm3533-leds",
748 .probe = lm3533_led_probe,
749 .remove = lm3533_led_remove,
750 .shutdown = lm3533_led_shutdown,
752 module_platform_driver(lm3533_led_driver);
754 MODULE_AUTHOR("Johan Hovold <jhovold@gmail.com>");
755 MODULE_DESCRIPTION("LM3533 LED driver");
756 MODULE_LICENSE("GPL");
757 MODULE_ALIAS("platform:lm3533-leds");