mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
backlight: Allow properties to be passed at registration
Values such as max_brightness should be set before backlights are registered, but the current API doesn't allow that. Add a parameter to backlight_device_register and update drivers to ensure that they set this correctly. Signed-off-by: Matthew Garrett <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
This commit is contained in:
parent
57e148b6a9
commit
a19a6ee6ca
49 changed files with 271 additions and 151 deletions
|
|
@ -202,6 +202,7 @@ static void appledisplay_work(struct work_struct *work)
|
|||
static int appledisplay_probe(struct usb_interface *iface,
|
||||
const struct usb_device_id *id)
|
||||
{
|
||||
struct backlight_properties props;
|
||||
struct appledisplay *pdata;
|
||||
struct usb_device *udev = interface_to_usbdev(iface);
|
||||
struct usb_host_interface *iface_desc;
|
||||
|
|
@ -279,16 +280,16 @@ static int appledisplay_probe(struct usb_interface *iface,
|
|||
/* Register backlight device */
|
||||
snprintf(bl_name, sizeof(bl_name), "appledisplay%d",
|
||||
atomic_inc_return(&count_displays) - 1);
|
||||
memset(&props, 0, sizeof(struct backlight_properties));
|
||||
props.max_brightness = 0xff;
|
||||
pdata->bd = backlight_device_register(bl_name, NULL, pdata,
|
||||
&appledisplay_bl_data);
|
||||
&appledisplay_bl_data, &props);
|
||||
if (IS_ERR(pdata->bd)) {
|
||||
dev_err(&iface->dev, "Backlight registration failed\n");
|
||||
retval = PTR_ERR(pdata->bd);
|
||||
goto error;
|
||||
}
|
||||
|
||||
pdata->bd->props.max_brightness = 0xff;
|
||||
|
||||
/* Try to get brightness */
|
||||
brightness = appledisplay_bl_get_brightness(pdata->bd);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue