aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/power
diff options
context:
space:
mode:
authorPhil Reid <preid@electromag.com.au>2016-09-01 03:50:52 -0400
committerSebastian Reichel <sre@kernel.org>2016-09-01 10:06:14 -0400
commit3b5dd3a49496220b35af83c96e3d2ff5716550ae (patch)
tree31b06b095bcfd1920da2759c1db89c3fe46f33d0 /include/linux/power
parent528e3504123d0281c613b83ca46aaf2dd7c3f45e (diff)
power: supply: sbs-battery: Use gpio_desc and sleeping calls for battery detect
Switch to using new gpio_desc interface and devm gpio get calls to automatically manage gpio resource. Use gpiod_get_value which handles active high / low calls. If gpio_detect is set then force loading of the driver as it is reasonable to assume that the battery may not be present. Update the is_present flag immediately in the IRQ. Remove legacy gpio specification from platform data. Signed-off-by: Phil Reid <preid@electromag.com.au> Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'include/linux/power')
-rw-r--r--include/linux/power/sbs-battery.h4
1 files changed, 0 insertions, 4 deletions
diff --git a/include/linux/power/sbs-battery.h b/include/linux/power/sbs-battery.h
index 2b0a9d9ff57e..811f1a0c00cb 100644
--- a/include/linux/power/sbs-battery.h
+++ b/include/linux/power/sbs-battery.h
@@ -26,15 +26,11 @@
26 26
27/** 27/**
28 * struct sbs_platform_data - platform data for sbs devices 28 * struct sbs_platform_data - platform data for sbs devices
29 * @battery_detect: GPIO which is used to detect battery presence
30 * @battery_detect_present: gpio state when battery is present (0 / 1)
31 * @i2c_retry_count: # of times to retry on i2c IO failure 29 * @i2c_retry_count: # of times to retry on i2c IO failure
32 * @poll_retry_count: # of times to retry looking for new status after 30 * @poll_retry_count: # of times to retry looking for new status after
33 * external change notification 31 * external change notification
34 */ 32 */
35struct sbs_platform_data { 33struct sbs_platform_data {
36 int battery_detect;
37 int battery_detect_present;
38 int i2c_retry_count; 34 int i2c_retry_count;
39 int poll_retry_count; 35 int poll_retry_count;
40}; 36};