diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2010-10-21 11:55:01 -0400 |
---|---|---|
committer | Anton Vorontsov <cbouatmailru@gmail.com> | 2010-11-18 08:56:17 -0500 |
commit | 5070437cd99511f69ae561f2ab417142a47a85ec (patch) | |
tree | 379dd2ab427ff33c09bee57f9d89726071b64137 /include/linux/power | |
parent | 8ec98fe0b4ffdedce4c1caa9fb3d550f52ad1c6b (diff) |
power_supply: Add gpio charger driver
This patch adds a simple driver for chargers indicating their online
status through a GPIO pin.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Diffstat (limited to 'include/linux/power')
-rw-r--r-- | include/linux/power/gpio-charger.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/include/linux/power/gpio-charger.h b/include/linux/power/gpio-charger.h new file mode 100644 index 000000000000..de1dfe09a03d --- /dev/null +++ b/include/linux/power/gpio-charger.h | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010, Lars-Peter Clausen <lars@metafoo.de> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License as published by the | ||
6 | * Free Software Foundation; either version 2 of the License, or (at your | ||
7 | * option) any later version. | ||
8 | * | ||
9 | * You should have received a copy of the GNU General Public License along | ||
10 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
11 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #ifndef __LINUX_POWER_GPIO_CHARGER_H__ | ||
16 | #define __LINUX_POWER_GPIO_CHARGER_H__ | ||
17 | |||
18 | #include <linux/power_supply.h> | ||
19 | #include <linux/types.h> | ||
20 | |||
21 | /** | ||
22 | * struct gpio_charger_platform_data - platform_data for gpio_charger devices | ||
23 | * @name: Name for the chargers power_supply device | ||
24 | * @type: Type of the charger | ||
25 | * @gpio: GPIO which is used to indicate the chargers status | ||
26 | * @gpio_active_low: Should be set to 1 if the GPIO is active low otherwise 0 | ||
27 | * @supplied_to: Array of battery names to which this chargers supplies power | ||
28 | * @num_supplicants: Number of entries in the supplied_to array | ||
29 | */ | ||
30 | struct gpio_charger_platform_data { | ||
31 | const char *name; | ||
32 | enum power_supply_type type; | ||
33 | |||
34 | int gpio; | ||
35 | int gpio_active_low; | ||
36 | |||
37 | char **supplied_to; | ||
38 | size_t num_supplicants; | ||
39 | }; | ||
40 | |||
41 | #endif | ||