15 #include <linux/module.h>
16 #include <linux/kernel.h>
24 #include <linux/slab.h>
38 unsigned int max = led_dat->
cdev.max_brightness;
41 if (brightness == 0) {
66 for (i = 0; i < pdata->
num_leds; i++) {
67 cur_led = &pdata->
leds[
i];
68 led_dat = &leds_data[
i];
72 if (IS_ERR(led_dat->
pwm)) {
73 ret = PTR_ERR(led_dat->
pwm);
74 dev_err(&pdev->
dev,
"unable to request PWM %d\n",
83 led_dat->
cdev.brightness_set = led_pwm_set;
95 platform_set_drvdata(pdev, leds_data);
101 for (i = i - 1; i >= 0; i--) {
116 leds_data = platform_get_drvdata(pdev);
118 for (i = 0; i < pdata->
num_leds; i++) {
127 .probe = led_pwm_probe,