13 #include <linux/kernel.h>
16 #include <linux/slab.h>
18 #include <linux/i2c.h>
21 #include <linux/module.h>
23 #define MAX_BRIGHTNESS (0xFF)
24 #define MIN_BRIGHTNESS (0)
26 #define CURRENT_BITMASK (0x1F << 1)
75 backlight_power_set(chip, data->
port, 1);
114 backlight_power_set(chip, data->
port, 0);
116 dev_dbg(chip->
dev,
"set brightness %d\n", value);
120 dev_dbg(chip->
dev,
"set brightness %d failure with return "
121 "value:%d\n", value, ret);
127 int brightness = bl->
props.brightness;
138 return pm860x_backlight_set(bl, brightness);
159 .update_status = pm860x_backlight_update_status,
160 .get_brightness = pm860x_backlight_get_brightness,
174 dev_err(&pdev->
dev,
"failed to find backlights node\n");
178 if (!of_node_cmp(np->name, name)) {
179 of_property_read_u32(np,
"marvell,88pm860x-iset",
182 of_property_read_u32(np,
"marvell,88pm860x-pwm",
190 #define pm860x_backlight_dt_init(x, y, z) (-1)
210 dev_err(&pdev->
dev,
"No REG resource for duty cycle\n");
217 dev_err(&pdev->
dev,
"No REG resorce for always on\n");
224 dev_err(&pdev->
dev,
"No REG resource for current\n");
248 &pm860x_backlight_ops, &props);
250 dev_err(&pdev->
dev,
"failed to register backlight\n");
255 platform_set_drvdata(pdev, bl);
258 ret = pm860x_backlight_get_brightness(bl);
262 backlight_update_status(bl);
281 .name =
"88pm860x-backlight",
284 .probe = pm860x_backlight_probe,
285 .remove = pm860x_backlight_remove,