diff options
| author | Greg Hackmann <ghackmann@google.com> | 2016-02-26 18:45:30 +0000 |
|---|---|---|
| committer | Amit Pundir <amit.pundir@linaro.org> | 2016-12-01 15:18:44 +0530 |
| commit | 8e5837d271b381c2d3a5b4880ab31331d851f90c (patch) | |
| tree | c8e05fc622bd14630e1a55fdd15546b18251e3fb | |
| parent | 8d8394ca6f6e60cf03a1a4b016a130df506beeb1 (diff) | |
BACKPORT: power: goldfish_battery: add devicetree bindings
Add device tree bindings to the Goldfish virtual platform battery drivers.
Signed-off-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Jin Qian <jinqian@android.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
(cherry picked from commit 65d687a7b7d6f27e4306fe8cc8a1ca66a1a760f6)
Change-Id: If947ea3341ff0cb713c56e14d18d51a3f5912b64
| -rw-r--r-- | Documentation/devicetree/bindings/goldfish/battery.txt | 17 | ||||
| -rw-r--r-- | drivers/power/goldfish_battery.c | 9 |
2 files changed, 25 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/goldfish/battery.txt b/Documentation/devicetree/bindings/goldfish/battery.txt new file mode 100644 index 000000000000..4fb613933214 --- /dev/null +++ b/Documentation/devicetree/bindings/goldfish/battery.txt @@ -0,0 +1,17 @@ +Android Goldfish Battery + +Android goldfish battery device generated by android emulator. + +Required properties: + +- compatible : should contain "google,goldfish-battery" to match emulator +- reg : <registers mapping> +- interrupts : <interrupt mapping> + +Example: + + goldfish_battery@9020000 { + compatible = "google,goldfish-battery"; + reg = <0x9020000 0x1000>; + interrupts = <0x3>; + }; diff --git a/drivers/power/goldfish_battery.c b/drivers/power/goldfish_battery.c index a50bb988c69a..7510796e190c 100644 --- a/drivers/power/goldfish_battery.c +++ b/drivers/power/goldfish_battery.c @@ -227,11 +227,18 @@ static int goldfish_battery_remove(struct platform_device *pdev) return 0; } +static const struct of_device_id goldfish_battery_of_match[] = { + { .compatible = "google,goldfish-battery", }, + {}, +}; +MODULE_DEVICE_TABLE(of, goldfish_battery_of_match); + static struct platform_driver goldfish_battery_device = { .probe = goldfish_battery_probe, .remove = goldfish_battery_remove, .driver = { - .name = "goldfish-battery" + .name = "goldfish-battery", + .of_match_table = goldfish_battery_of_match, } }; module_platform_driver(goldfish_battery_device); |
