OSDN Git Service

backlight: lp855x: Add support ACPI enumeration
authorHans de Goede <hdegoede@redhat.com>
Tue, 2 Nov 2021 22:55:04 +0000 (23:55 +0100)
committerLee Jones <lee.jones@linaro.org>
Wed, 22 Dec 2021 11:14:14 +0000 (11:14 +0000)
commit6202b5de73cfb0d83245b8ea834017183ec67885
tree6a2a873a2a186ec31b753cf95a6f3e5add099094
parent92add941b6be185e511a7564bf68963fa1633d53
backlight: lp855x: Add support ACPI enumeration

The Xiaomi Mi Pad 2 tablet uses an ACPI enumerated LP8556 backlight
controller for its LCD-panel, with a Xiaomi specific ACPI HID of
"XMCC0001", add support for this.

Note the new "if (id)" check also fixes a NULL pointer deref when a user
tries to manually bind the driver from sysfs.

When CONFIG_ACPI is disabled acpi_match_device() will always return NULL,
so the lp855x_parse_acpi() call will get optimized away.

Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211102225504.18920-3-hdegoede@redhat.com
drivers/video/backlight/lp855x_bl.c