[PATCH 2/2] goldfish: Enable ACPI-based enumeration for goldfish battery
From: Alan <hidden>
Date: 2016-02-26 18:46:19
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Yu Ning <redacted> Besides adding ACPI bindings to the goldfish battery driver, modify the ACPI driver to inform it that goldfish battery is a platform device. The latter step is necessary with kernel 3.16 or newer. Signed-off-by: Yu Ning <redacted> Signed-off-by: Jin Qian <redacted> Signed-off-by: Alan <redacted> --- drivers/power/goldfish_battery.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/drivers/power/goldfish_battery.c b/drivers/power/goldfish_battery.c
index 7510796..f5c525e 100644
--- a/drivers/power/goldfish_battery.c
+++ b/drivers/power/goldfish_battery.c@@ -24,6 +24,7 @@ #include <linux/pci.h> #include <linux/interrupt.h> #include <linux/io.h> +#include <linux/acpi.h> struct goldfish_battery_data { void __iomem *reg_base;
@@ -233,12 +234,19 @@ static const struct of_device_id goldfish_battery_of_match[] = { }; MODULE_DEVICE_TABLE(of, goldfish_battery_of_match); +static const struct acpi_device_id goldfish_battery_acpi_match[] = { + { "GFSH0001", 0 }, + { }, +}; +MODULE_DEVICE_TABLE(acpi, goldfish_battery_acpi_match); + static struct platform_driver goldfish_battery_device = { .probe = goldfish_battery_probe, .remove = goldfish_battery_remove, .driver = { .name = "goldfish-battery", .of_match_table = goldfish_battery_of_match, + .acpi_match_table = ACPI_PTR(goldfish_battery_acpi_match), } }; module_platform_driver(goldfish_battery_device);