3525e04791ced61a392f0dfb2dbcfaec6ef6e770
[sfrench/cifs-2.6.git] / drivers / video / backlight / pwm_bl.c
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * Simple PWM based backlight control, board code has to setup
4  * 1) pin configuration so PWM waveforms can output
5  * 2) platform_data being correctly configured
6  */
7
8 #include <linux/delay.h>
9 #include <linux/gpio/consumer.h>
10 #include <linux/gpio.h>
11 #include <linux/module.h>
12 #include <linux/kernel.h>
13 #include <linux/init.h>
14 #include <linux/platform_device.h>
15 #include <linux/fb.h>
16 #include <linux/backlight.h>
17 #include <linux/err.h>
18 #include <linux/pwm.h>
19 #include <linux/pwm_backlight.h>
20 #include <linux/regulator/consumer.h>
21 #include <linux/slab.h>
22
23 struct pwm_bl_data {
24         struct pwm_device       *pwm;
25         struct device           *dev;
26         unsigned int            lth_brightness;
27         unsigned int            *levels;
28         bool                    enabled;
29         struct regulator        *power_supply;
30         struct gpio_desc        *enable_gpio;
31         unsigned int            scale;
32         bool                    legacy;
33         unsigned int            post_pwm_on_delay;
34         unsigned int            pwm_off_delay;
35         int                     (*notify)(struct device *,
36                                           int brightness);
37         void                    (*notify_after)(struct device *,
38                                         int brightness);
39         int                     (*check_fb)(struct device *, struct fb_info *);
40         void                    (*exit)(struct device *);
41 };
42
43 static void pwm_backlight_power_on(struct pwm_bl_data *pb)
44 {
45         struct pwm_state state;
46         int err;
47
48         pwm_get_state(pb->pwm, &state);
49         if (pb->enabled)
50                 return;
51
52         err = regulator_enable(pb->power_supply);
53         if (err < 0)
54                 dev_err(pb->dev, "failed to enable power supply\n");
55
56         state.enabled = true;
57         pwm_apply_state(pb->pwm, &state);
58
59         if (pb->post_pwm_on_delay)
60                 msleep(pb->post_pwm_on_delay);
61
62         if (pb->enable_gpio)
63                 gpiod_set_value_cansleep(pb->enable_gpio, 1);
64
65         pb->enabled = true;
66 }
67
68 static void pwm_backlight_power_off(struct pwm_bl_data *pb)
69 {
70         struct pwm_state state;
71
72         pwm_get_state(pb->pwm, &state);
73         if (!pb->enabled)
74                 return;
75
76         if (pb->enable_gpio)
77                 gpiod_set_value_cansleep(pb->enable_gpio, 0);
78
79         if (pb->pwm_off_delay)
80                 msleep(pb->pwm_off_delay);
81
82         state.enabled = false;
83         state.duty_cycle = 0;
84         pwm_apply_state(pb->pwm, &state);
85
86         regulator_disable(pb->power_supply);
87         pb->enabled = false;
88 }
89
90 static int compute_duty_cycle(struct pwm_bl_data *pb, int brightness)
91 {
92         unsigned int lth = pb->lth_brightness;
93         struct pwm_state state;
94         u64 duty_cycle;
95
96         pwm_get_state(pb->pwm, &state);
97
98         if (pb->levels)
99                 duty_cycle = pb->levels[brightness];
100         else
101                 duty_cycle = brightness;
102
103         duty_cycle *= state.period - lth;
104         do_div(duty_cycle, pb->scale);
105
106         return duty_cycle + lth;
107 }
108
109 static int pwm_backlight_update_status(struct backlight_device *bl)
110 {
111         struct pwm_bl_data *pb = bl_get_data(bl);
112         int brightness = bl->props.brightness;
113         struct pwm_state state;
114
115         if (bl->props.power != FB_BLANK_UNBLANK ||
116             bl->props.fb_blank != FB_BLANK_UNBLANK ||
117             bl->props.state & BL_CORE_FBBLANK)
118                 brightness = 0;
119
120         if (pb->notify)
121                 brightness = pb->notify(pb->dev, brightness);
122
123         if (brightness > 0) {
124                 pwm_get_state(pb->pwm, &state);
125                 state.duty_cycle = compute_duty_cycle(pb, brightness);
126                 pwm_apply_state(pb->pwm, &state);
127                 pwm_backlight_power_on(pb);
128         } else {
129                 pwm_backlight_power_off(pb);
130         }
131
132         if (pb->notify_after)
133                 pb->notify_after(pb->dev, brightness);
134
135         return 0;
136 }
137
138 static int pwm_backlight_check_fb(struct backlight_device *bl,
139                                   struct fb_info *info)
140 {
141         struct pwm_bl_data *pb = bl_get_data(bl);
142
143         return !pb->check_fb || pb->check_fb(pb->dev, info);
144 }
145
146 static const struct backlight_ops pwm_backlight_ops = {
147         .update_status  = pwm_backlight_update_status,
148         .check_fb       = pwm_backlight_check_fb,
149 };
150
151 #ifdef CONFIG_OF
152 #define PWM_LUMINANCE_SCALE     10000 /* luminance scale */
153
154 /*
155  * CIE lightness to PWM conversion.
156  *
157  * The CIE 1931 lightness formula is what actually describes how we perceive
158  * light:
159  *          Y = (L* / 903.3)           if L* ≤ 8
160  *          Y = ((L* + 16) / 116)^3    if L* > 8
161  *
162  * Where Y is the luminance, the amount of light coming out of the screen, and
163  * is a number between 0.0 and 1.0; and L* is the lightness, how bright a human
164  * perceives the screen to be, and is a number between 0 and 100.
165  *
166  * The following function does the fixed point maths needed to implement the
167  * above formula.
168  */
169 static u64 cie1931(unsigned int lightness, unsigned int scale)
170 {
171         u64 retval;
172
173         /*
174          * @lightness is given as a number between 0 and 1, expressed
175          * as a fixed-point number in scale @scale. Convert to a
176          * percentage, still expressed as a fixed-point number, so the
177          * above formulas can be applied.
178          */
179         lightness *= 100;
180         if (lightness <= (8 * scale)) {
181                 retval = DIV_ROUND_CLOSEST_ULL(lightness * 10, 9033);
182         } else {
183                 retval = int_pow((lightness + (16 * scale)) / 116, 3);
184                 retval = DIV_ROUND_CLOSEST_ULL(retval, (scale * scale));
185         }
186
187         return retval;
188 }
189
190 /*
191  * Create a default correction table for PWM values to create linear brightness
192  * for LED based backlights using the CIE1931 algorithm.
193  */
194 static
195 int pwm_backlight_brightness_default(struct device *dev,
196                                      struct platform_pwm_backlight_data *data,
197                                      unsigned int period)
198 {
199         unsigned int i;
200         u64 retval;
201
202         /*
203          * Once we have 4096 levels there's little point going much higher...
204          * neither interactive sliders nor animation benefits from having
205          * more values in the table.
206          */
207         data->max_brightness =
208                 min((int)DIV_ROUND_UP(period, fls(period)), 4096);
209
210         data->levels = devm_kcalloc(dev, data->max_brightness,
211                                     sizeof(*data->levels), GFP_KERNEL);
212         if (!data->levels)
213                 return -ENOMEM;
214
215         /* Fill the table using the cie1931 algorithm */
216         for (i = 0; i < data->max_brightness; i++) {
217                 retval = cie1931((i * PWM_LUMINANCE_SCALE) /
218                                  data->max_brightness, PWM_LUMINANCE_SCALE) *
219                                  period;
220                 retval = DIV_ROUND_CLOSEST_ULL(retval, PWM_LUMINANCE_SCALE);
221                 if (retval > UINT_MAX)
222                         return -EINVAL;
223                 data->levels[i] = (unsigned int)retval;
224         }
225
226         data->dft_brightness = data->max_brightness / 2;
227         data->max_brightness--;
228
229         return 0;
230 }
231
232 static int pwm_backlight_parse_dt(struct device *dev,
233                                   struct platform_pwm_backlight_data *data)
234 {
235         struct device_node *node = dev->of_node;
236         unsigned int num_levels = 0;
237         unsigned int levels_count;
238         unsigned int num_steps = 0;
239         struct property *prop;
240         unsigned int *table;
241         int length;
242         u32 value;
243         int ret;
244
245         if (!node)
246                 return -ENODEV;
247
248         memset(data, 0, sizeof(*data));
249
250         /*
251          * These values are optional and set as 0 by default, the out values
252          * are modified only if a valid u32 value can be decoded.
253          */
254         of_property_read_u32(node, "post-pwm-on-delay-ms",
255                              &data->post_pwm_on_delay);
256         of_property_read_u32(node, "pwm-off-delay-ms", &data->pwm_off_delay);
257
258         data->enable_gpio = -EINVAL;
259
260         /*
261          * Determine the number of brightness levels, if this property is not
262          * set a default table of brightness levels will be used.
263          */
264         prop = of_find_property(node, "brightness-levels", &length);
265         if (!prop)
266                 return 0;
267
268         data->max_brightness = length / sizeof(u32);
269
270         /* read brightness levels from DT property */
271         if (data->max_brightness > 0) {
272                 size_t size = sizeof(*data->levels) * data->max_brightness;
273                 unsigned int i, j, n = 0;
274
275                 data->levels = devm_kzalloc(dev, size, GFP_KERNEL);
276                 if (!data->levels)
277                         return -ENOMEM;
278
279                 ret = of_property_read_u32_array(node, "brightness-levels",
280                                                  data->levels,
281                                                  data->max_brightness);
282                 if (ret < 0)
283                         return ret;
284
285                 ret = of_property_read_u32(node, "default-brightness-level",
286                                            &value);
287                 if (ret < 0)
288                         return ret;
289
290                 data->dft_brightness = value;
291
292                 /*
293                  * This property is optional, if is set enables linear
294                  * interpolation between each of the values of brightness levels
295                  * and creates a new pre-computed table.
296                  */
297                 of_property_read_u32(node, "num-interpolated-steps",
298                                      &num_steps);
299
300                 /*
301                  * Make sure that there is at least two entries in the
302                  * brightness-levels table, otherwise we can't interpolate
303                  * between two points.
304                  */
305                 if (num_steps) {
306                         if (data->max_brightness < 2) {
307                                 dev_err(dev, "can't interpolate\n");
308                                 return -EINVAL;
309                         }
310
311                         /*
312                          * Recalculate the number of brightness levels, now
313                          * taking in consideration the number of interpolated
314                          * steps between two levels.
315                          */
316                         for (i = 0; i < data->max_brightness - 1; i++) {
317                                 if ((data->levels[i + 1] - data->levels[i]) /
318                                    num_steps)
319                                         num_levels += num_steps;
320                                 else
321                                         num_levels++;
322                         }
323                         num_levels++;
324                         dev_dbg(dev, "new number of brightness levels: %d\n",
325                                 num_levels);
326
327                         /*
328                          * Create a new table of brightness levels with all the
329                          * interpolated steps.
330                          */
331                         size = sizeof(*table) * num_levels;
332                         table = devm_kzalloc(dev, size, GFP_KERNEL);
333                         if (!table)
334                                 return -ENOMEM;
335
336                         /* Fill the interpolated table. */
337                         levels_count = 0;
338                         for (i = 0; i < data->max_brightness - 1; i++) {
339                                 value = data->levels[i];
340                                 n = (data->levels[i + 1] - value) / num_steps;
341                                 if (n > 0) {
342                                         for (j = 0; j < num_steps; j++) {
343                                                 table[levels_count] = value;
344                                                 value += n;
345                                                 levels_count++;
346                                         }
347                                 } else {
348                                         table[levels_count] = data->levels[i];
349                                         levels_count++;
350                                 }
351                         }
352                         table[levels_count] = data->levels[i];
353
354                         /*
355                          * As we use interpolation lets remove current
356                          * brightness levels table and replace for the
357                          * new interpolated table.
358                          */
359                         devm_kfree(dev, data->levels);
360                         data->levels = table;
361
362                         /*
363                          * Reassign max_brightness value to the new total number
364                          * of brightness levels.
365                          */
366                         data->max_brightness = num_levels;
367                 }
368
369                 data->max_brightness--;
370         }
371
372         return 0;
373 }
374
375 static const struct of_device_id pwm_backlight_of_match[] = {
376         { .compatible = "pwm-backlight" },
377         { }
378 };
379
380 MODULE_DEVICE_TABLE(of, pwm_backlight_of_match);
381 #else
382 static int pwm_backlight_parse_dt(struct device *dev,
383                                   struct platform_pwm_backlight_data *data)
384 {
385         return -ENODEV;
386 }
387
388 static
389 int pwm_backlight_brightness_default(struct device *dev,
390                                      struct platform_pwm_backlight_data *data,
391                                      unsigned int period)
392 {
393         return -ENODEV;
394 }
395 #endif
396
397 static bool pwm_backlight_is_linear(struct platform_pwm_backlight_data *data)
398 {
399         unsigned int nlevels = data->max_brightness + 1;
400         unsigned int min_val = data->levels[0];
401         unsigned int max_val = data->levels[nlevels - 1];
402         /*
403          * Multiplying by 128 means that even in pathological cases such
404          * as (max_val - min_val) == nlevels the error at max_val is less
405          * than 1%.
406          */
407         unsigned int slope = (128 * (max_val - min_val)) / nlevels;
408         unsigned int margin = (max_val - min_val) / 20; /* 5% */
409         int i;
410
411         for (i = 1; i < nlevels; i++) {
412                 unsigned int linear_value = min_val + ((i * slope) / 128);
413                 unsigned int delta = abs(linear_value - data->levels[i]);
414
415                 if (delta > margin)
416                         return false;
417         }
418
419         return true;
420 }
421
422 static int pwm_backlight_initial_power_state(const struct pwm_bl_data *pb)
423 {
424         struct device_node *node = pb->dev->of_node;
425
426         /* Not booted with device tree or no phandle link to the node */
427         if (!node || !node->phandle)
428                 return FB_BLANK_UNBLANK;
429
430         /*
431          * If the driver is probed from the device tree and there is a
432          * phandle link pointing to the backlight node, it is safe to
433          * assume that another driver will enable the backlight at the
434          * appropriate time. Therefore, if it is disabled, keep it so.
435          */
436
437         /* if the enable GPIO is disabled, do not enable the backlight */
438         if (pb->enable_gpio && gpiod_get_value_cansleep(pb->enable_gpio) == 0)
439                 return FB_BLANK_POWERDOWN;
440
441         /* The regulator is disabled, do not enable the backlight */
442         if (!regulator_is_enabled(pb->power_supply))
443                 return FB_BLANK_POWERDOWN;
444
445         /* The PWM is disabled, keep it like this */
446         if (!pwm_is_enabled(pb->pwm))
447                 return FB_BLANK_POWERDOWN;
448
449         return FB_BLANK_UNBLANK;
450 }
451
452 static int pwm_backlight_probe(struct platform_device *pdev)
453 {
454         struct platform_pwm_backlight_data *data = dev_get_platdata(&pdev->dev);
455         struct platform_pwm_backlight_data defdata;
456         struct backlight_properties props;
457         struct backlight_device *bl;
458         struct device_node *node = pdev->dev.of_node;
459         struct pwm_bl_data *pb;
460         struct pwm_state state;
461         unsigned int i;
462         int ret;
463
464         if (!data) {
465                 ret = pwm_backlight_parse_dt(&pdev->dev, &defdata);
466                 if (ret < 0) {
467                         dev_err(&pdev->dev, "failed to find platform data\n");
468                         return ret;
469                 }
470
471                 data = &defdata;
472         }
473
474         if (data->init) {
475                 ret = data->init(&pdev->dev);
476                 if (ret < 0)
477                         return ret;
478         }
479
480         pb = devm_kzalloc(&pdev->dev, sizeof(*pb), GFP_KERNEL);
481         if (!pb) {
482                 ret = -ENOMEM;
483                 goto err_alloc;
484         }
485
486         pb->notify = data->notify;
487         pb->notify_after = data->notify_after;
488         pb->check_fb = data->check_fb;
489         pb->exit = data->exit;
490         pb->dev = &pdev->dev;
491         pb->enabled = false;
492         pb->post_pwm_on_delay = data->post_pwm_on_delay;
493         pb->pwm_off_delay = data->pwm_off_delay;
494
495         pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable",
496                                                   GPIOD_ASIS);
497         if (IS_ERR(pb->enable_gpio)) {
498                 ret = PTR_ERR(pb->enable_gpio);
499                 goto err_alloc;
500         }
501
502         /*
503          * Compatibility fallback for drivers still using the integer GPIO
504          * platform data. Must go away soon.
505          */
506         if (!pb->enable_gpio && gpio_is_valid(data->enable_gpio)) {
507                 ret = devm_gpio_request_one(&pdev->dev, data->enable_gpio,
508                                             GPIOF_OUT_INIT_HIGH, "enable");
509                 if (ret < 0) {
510                         dev_err(&pdev->dev, "failed to request GPIO#%d: %d\n",
511                                 data->enable_gpio, ret);
512                         goto err_alloc;
513                 }
514
515                 pb->enable_gpio = gpio_to_desc(data->enable_gpio);
516         }
517
518         /*
519          * If the GPIO is not known to be already configured as output, that
520          * is, if gpiod_get_direction returns either 1 or -EINVAL, change the
521          * direction to output and set the GPIO as active.
522          * Do not force the GPIO to active when it was already output as it
523          * could cause backlight flickering or we would enable the backlight too
524          * early. Leave the decision of the initial backlight state for later.
525          */
526         if (pb->enable_gpio &&
527             gpiod_get_direction(pb->enable_gpio) != 0)
528                 gpiod_direction_output(pb->enable_gpio, 1);
529
530         pb->power_supply = devm_regulator_get(&pdev->dev, "power");
531         if (IS_ERR(pb->power_supply)) {
532                 ret = PTR_ERR(pb->power_supply);
533                 goto err_alloc;
534         }
535
536         pb->pwm = devm_pwm_get(&pdev->dev, NULL);
537         if (IS_ERR(pb->pwm) && PTR_ERR(pb->pwm) != -EPROBE_DEFER && !node) {
538                 dev_err(&pdev->dev, "unable to request PWM, trying legacy API\n");
539                 pb->legacy = true;
540                 pb->pwm = pwm_request(data->pwm_id, "pwm-backlight");
541         }
542
543         if (IS_ERR(pb->pwm)) {
544                 ret = PTR_ERR(pb->pwm);
545                 if (ret != -EPROBE_DEFER)
546                         dev_err(&pdev->dev, "unable to request PWM\n");
547                 goto err_alloc;
548         }
549
550         dev_dbg(&pdev->dev, "got pwm for backlight\n");
551
552         /* Sync up PWM state. */
553         pwm_init_state(pb->pwm, &state);
554
555         /*
556          * The DT case will set the pwm_period_ns field to 0 and store the
557          * period, parsed from the DT, in the PWM device. For the non-DT case,
558          * set the period from platform data if it has not already been set
559          * via the PWM lookup table.
560          */
561         if (!state.period && (data->pwm_period_ns > 0))
562                 state.period = data->pwm_period_ns;
563
564         ret = pwm_apply_state(pb->pwm, &state);
565         if (ret) {
566                 dev_err(&pdev->dev, "failed to apply initial PWM state: %d\n",
567                         ret);
568                 goto err_alloc;
569         }
570
571         memset(&props, 0, sizeof(struct backlight_properties));
572
573         if (data->levels) {
574                 pb->levels = data->levels;
575
576                 /*
577                  * For the DT case, only when brightness levels is defined
578                  * data->levels is filled. For the non-DT case, data->levels
579                  * can come from platform data, however is not usual.
580                  */
581                 for (i = 0; i <= data->max_brightness; i++)
582                         if (data->levels[i] > pb->scale)
583                                 pb->scale = data->levels[i];
584
585                 if (pwm_backlight_is_linear(data))
586                         props.scale = BACKLIGHT_SCALE_LINEAR;
587                 else
588                         props.scale = BACKLIGHT_SCALE_NON_LINEAR;
589         } else if (!data->max_brightness) {
590                 /*
591                  * If no brightness levels are provided and max_brightness is
592                  * not set, use the default brightness table. For the DT case,
593                  * max_brightness is set to 0 when brightness levels is not
594                  * specified. For the non-DT case, max_brightness is usually
595                  * set to some value.
596                  */
597
598                 /* Get the PWM period (in nanoseconds) */
599                 pwm_get_state(pb->pwm, &state);
600
601                 ret = pwm_backlight_brightness_default(&pdev->dev, data,
602                                                        state.period);
603                 if (ret < 0) {
604                         dev_err(&pdev->dev,
605                                 "failed to setup default brightness table\n");
606                         goto err_alloc;
607                 }
608
609                 for (i = 0; i <= data->max_brightness; i++) {
610                         if (data->levels[i] > pb->scale)
611                                 pb->scale = data->levels[i];
612
613                         pb->levels = data->levels;
614                 }
615
616                 props.scale = BACKLIGHT_SCALE_NON_LINEAR;
617         } else {
618                 /*
619                  * That only happens for the non-DT case, where platform data
620                  * sets the max_brightness value.
621                  */
622                 pb->scale = data->max_brightness;
623         }
624
625         pb->lth_brightness = data->lth_brightness * (state.period / pb->scale);
626
627         props.type = BACKLIGHT_RAW;
628         props.max_brightness = data->max_brightness;
629         bl = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, pb,
630                                        &pwm_backlight_ops, &props);
631         if (IS_ERR(bl)) {
632                 dev_err(&pdev->dev, "failed to register backlight\n");
633                 ret = PTR_ERR(bl);
634                 if (pb->legacy)
635                         pwm_free(pb->pwm);
636                 goto err_alloc;
637         }
638
639         if (data->dft_brightness > data->max_brightness) {
640                 dev_warn(&pdev->dev,
641                          "invalid default brightness level: %u, using %u\n",
642                          data->dft_brightness, data->max_brightness);
643                 data->dft_brightness = data->max_brightness;
644         }
645
646         bl->props.brightness = data->dft_brightness;
647         bl->props.power = pwm_backlight_initial_power_state(pb);
648         backlight_update_status(bl);
649
650         platform_set_drvdata(pdev, bl);
651         return 0;
652
653 err_alloc:
654         if (data->exit)
655                 data->exit(&pdev->dev);
656         return ret;
657 }
658
659 static int pwm_backlight_remove(struct platform_device *pdev)
660 {
661         struct backlight_device *bl = platform_get_drvdata(pdev);
662         struct pwm_bl_data *pb = bl_get_data(bl);
663
664         backlight_device_unregister(bl);
665         pwm_backlight_power_off(pb);
666
667         if (pb->exit)
668                 pb->exit(&pdev->dev);
669         if (pb->legacy)
670                 pwm_free(pb->pwm);
671
672         return 0;
673 }
674
675 static void pwm_backlight_shutdown(struct platform_device *pdev)
676 {
677         struct backlight_device *bl = platform_get_drvdata(pdev);
678         struct pwm_bl_data *pb = bl_get_data(bl);
679
680         pwm_backlight_power_off(pb);
681 }
682
683 #ifdef CONFIG_PM_SLEEP
684 static int pwm_backlight_suspend(struct device *dev)
685 {
686         struct backlight_device *bl = dev_get_drvdata(dev);
687         struct pwm_bl_data *pb = bl_get_data(bl);
688
689         if (pb->notify)
690                 pb->notify(pb->dev, 0);
691
692         pwm_backlight_power_off(pb);
693
694         if (pb->notify_after)
695                 pb->notify_after(pb->dev, 0);
696
697         return 0;
698 }
699
700 static int pwm_backlight_resume(struct device *dev)
701 {
702         struct backlight_device *bl = dev_get_drvdata(dev);
703
704         backlight_update_status(bl);
705
706         return 0;
707 }
708 #endif
709
710 static const struct dev_pm_ops pwm_backlight_pm_ops = {
711 #ifdef CONFIG_PM_SLEEP
712         .suspend = pwm_backlight_suspend,
713         .resume = pwm_backlight_resume,
714         .poweroff = pwm_backlight_suspend,
715         .restore = pwm_backlight_resume,
716 #endif
717 };
718
719 static struct platform_driver pwm_backlight_driver = {
720         .driver         = {
721                 .name           = "pwm-backlight",
722                 .pm             = &pwm_backlight_pm_ops,
723                 .of_match_table = of_match_ptr(pwm_backlight_of_match),
724         },
725         .probe          = pwm_backlight_probe,
726         .remove         = pwm_backlight_remove,
727         .shutdown       = pwm_backlight_shutdown,
728 };
729
730 module_platform_driver(pwm_backlight_driver);
731
732 MODULE_DESCRIPTION("PWM based Backlight Driver");
733 MODULE_LICENSE("GPL v2");
734 MODULE_ALIAS("platform:pwm-backlight");