/* * Set the preferred backlight interface type based on DMI info. * This function allows DMI blacklists to be implemented by external * platform drivers instead of putting a big blacklist in video_detect.c */ void acpi_video_set_dmi_backlight_type(enum acpi_backlight_type type) { acpi_backlight_dmi = type; /* Remove acpi-video backlight interface if it is no longer desired */ if (acpi_video_get_backlight_type() != acpi_backlight_video) acpi_video_unregister_backlight(); }
static int acpi_video_backlight_notify(struct notifier_block *nb, unsigned long val, void *bd) { struct backlight_device *backlight = bd; /* A raw bl registering may change video -> native */ if (backlight->props.type == BACKLIGHT_RAW && val == BACKLIGHT_REGISTERED && acpi_video_get_backlight_type() != acpi_backlight_video) acpi_video_unregister_backlight(); return NOTIFY_OK; }
/* This uses a workqueue to avoid various locking ordering issues */ static void acpi_video_backlight_notify_work(struct work_struct *work) { if (acpi_video_get_backlight_type() != acpi_backlight_video) acpi_video_unregister_backlight(); }