20 #include <linux/hid.h>
32 return data->lcd_brightness;
41 if (!report || report->
maxfield != 1 || report->
field[0]->report_count != 1)
44 data->lcd_brightness = bdev->
props.brightness & 0x0ff;
45 data->lcd_power = bdev->
props.power;
50 spin_unlock_irqrestore(&data->
lock, flags);
60 .update_status = picolcd_set_brightness,
61 .get_brightness = picolcd_get_brightness,
62 .check_fb = picolcd_check_bl_fb,
72 if (report->
maxfield != 1 || report->
field[0]->report_count != 1 ||
73 report->
field[0]->report_size != 8) {
74 dev_err(dev,
"unsupported BRIGHTNESS report");
78 memset(&props, 0,
sizeof(props));
82 &picolcd_blops, &props);
84 dev_err(dev,
"failed to register backlight\n");
87 bdev->
props.brightness = 0xff;
88 data->lcd_brightness = 0xff;
89 data->backlight = bdev;
90 picolcd_set_brightness(bdev);
98 data->backlight =
NULL;
105 if (!data->backlight)
107 return picolcd_set_brightness(data->backlight);
111 void picolcd_suspend_backlight(
struct picolcd_data *data)
113 int bl_power = data->lcd_power;
114 if (!data->backlight)
118 picolcd_set_brightness(data->backlight);
119 data->lcd_power = data->backlight->props.power = bl_power;