summaryrefslogtreecommitdiffstats
path: root/drivers/power/supply/samsung-sdi-battery.h
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2022-02-26 00:28:00 +0100
committerSebastian Reichel <sre@kernel.org>2022-03-04 22:20:18 +0100
commitc8aee3f41cb84a9ac3b6b5ba2e92cda6cf50d0a0 (patch)
tree9fa6f2f4855f97d6942e385e690da365ef138bcd /drivers/power/supply/samsung-sdi-battery.h
parentpower: supply: ab8500_fg: Use VBAT-to-Ri if possible (diff)
downloadlinux-c8aee3f41cb84a9ac3b6b5ba2e92cda6cf50d0a0.tar.xz
linux-c8aee3f41cb84a9ac3b6b5ba2e92cda6cf50d0a0.zip
power: supply: Static data for Samsung batteries
If we detect a Samsung SDI battery, we return a static struct power_supply_battery_info and avoid looking further. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power/supply/samsung-sdi-battery.h')
-rw-r--r--drivers/power/supply/samsung-sdi-battery.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/power/supply/samsung-sdi-battery.h b/drivers/power/supply/samsung-sdi-battery.h
new file mode 100644
index 000000000000..365ab6e85b26
--- /dev/null
+++ b/drivers/power/supply/samsung-sdi-battery.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#if IS_ENABLED(CONFIG_BATTERY_SAMSUNG_SDI)
+extern int samsung_sdi_battery_get_info(struct device *dev,
+ const char *compatible,
+ struct power_supply_battery_info **info);
+#else
+static inline int samsung_sdi_battery_get_info(struct device *dev,
+ const char *compatible,
+ struct power_supply_battery_info **info)
+{
+ return -ENODEV;
+}
+#endif