15 #include <linux/kernel.h>
21 #include <linux/slab.h>
22 #include <linux/module.h>
24 #define DA9030_WLED_CONTROL 0x25
25 #define DA9030_WLED_CP_EN (1 << 6)
26 #define DA9030_WLED_TRIM(x) ((x) & 0x7)
28 #define DA9034_WLED_CONTROL1 0x3C
29 #define DA9034_WLED_CONTROL2 0x3D
30 #define DA9034_WLED_ISET(x) ((x) & 0x1f)
32 #define DA9034_WLED_BOOST_EN (1 << 5)
34 #define DA9030_MAX_BRIGHTNESS 7
35 #define DA9034_MAX_BRIGHTNESS 0x7f
83 int brightness = bl->
props.brightness;
91 return da903x_backlight_set(bl, brightness);
101 .update_status = da903x_backlight_update_status,
102 .get_brightness = da903x_backlight_get_brightness,
125 dev_err(&pdev->
dev,
"invalid backlight device ID(%d)\n",
139 memset(&props, 0,
sizeof(props));
143 &da903x_backlight_ops, &props);
145 dev_err(&pdev->
dev,
"failed to register backlight\n");
151 platform_set_drvdata(pdev, bl);
152 backlight_update_status(bl);
165 static int da903x_backlight_suspend(
struct device *dev)
169 return da903x_backlight_set(bl, 0);
172 static int da903x_backlight_resume(
struct device *dev)
177 backlight_update_status(bl);
181 static const struct dev_pm_ops da903x_backlight_pm_ops = {
182 .
suspend = da903x_backlight_suspend,
183 .resume = da903x_backlight_resume,
189 .name =
"da903x-backlight",
192 .pm = &da903x_backlight_pm_ops,
195 .probe = da903x_backlight_probe,
196 .remove = da903x_backlight_remove,