From e3e8d1c93f9e6b766424b05f23f2416f22a0329d Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 28 Feb 2010 12:47:49 +0100 Subject: Driver for Zipit Z2 battery chip This patch adds driver for Zipit Z2 battery chip called AER915. No details are known about the chip. The chip is available through I2C bus at address 0x55 and it's register 0x02 contains battery voltage. Signed-off-by: Marek Vasut Signed-off-by: Anton Vorontsov --- include/linux/z2_battery.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 include/linux/z2_battery.h (limited to 'include') diff --git a/include/linux/z2_battery.h b/include/linux/z2_battery.h new file mode 100644 index 0000000..7b97504 --- /dev/null +++ b/include/linux/z2_battery.h @@ -0,0 +1,17 @@ +#ifndef _LINUX_Z2_BATTERY_H +#define _LINUX_Z2_BATTERY_H + +struct z2_battery_info { + int batt_I2C_bus; + int batt_I2C_addr; + int batt_I2C_reg; + int charge_gpio; + int min_voltage; + int max_voltage; + int batt_div; + int batt_mult; + int batt_tech; + char *batt_name; +}; + +#endif -- cgit v1.1 From a3bcbbee83f55cbaec9b2ad748e7300c7feb2192 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Mon, 12 Apr 2010 23:33:22 +0200 Subject: pda_power: Add function callbacks for suspend and resume Add function prototypes for power management events so they can be handled and used by platform implementations. Signed-off-by: Daniel Mack Cc: Dmitry Baryshkov Cc: David Woodhouse Signed-off-by: Anton Vorontsov --- include/linux/pda_power.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/pda_power.h b/include/linux/pda_power.h index d4cf7a2..c9e4d81 100644 --- a/include/linux/pda_power.h +++ b/include/linux/pda_power.h @@ -24,6 +24,8 @@ struct pda_power_pdata { int (*is_usb_online)(void); void (*set_charge)(int flags); void (*exit)(struct device *dev); + int (*suspend)(pm_message_t state); + int (*resume)(void); char **supplied_to; size_t num_supplicants; -- cgit v1.1 From 9b9ade6b612e562c4a5bd02ef38cc32e10f3f9ba Mon Sep 17 00:00:00 2001 From: Yulia Vilensky Date: Mon, 26 Apr 2010 14:05:25 +0300 Subject: ds2782_battery: Add support for ds2786 battery gas gauge Signed-off-by: Yulia Vilensky Signed-off-by: Mike Rapoport Signed-off-by: Anton Vorontsov --- include/linux/ds2782_battery.h | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 include/linux/ds2782_battery.h (limited to 'include') diff --git a/include/linux/ds2782_battery.h b/include/linux/ds2782_battery.h new file mode 100644 index 0000000..b4e281f --- /dev/null +++ b/include/linux/ds2782_battery.h @@ -0,0 +1,8 @@ +#ifndef __LINUX_DS2782_BATTERY_H +#define __LINUX_DS2782_BATTERY_H + +struct ds278x_platform_data { + int rsns; +}; + +#endif -- cgit v1.1 From 5f487cd34f4337f9bc27ca19da72a39d1b0a0ab4 Mon Sep 17 00:00:00 2001 From: Anton Vorontsov Date: Tue, 18 May 2010 21:49:51 +0200 Subject: power_supply: Use attribute groups This fixes a race between power supply device and initial attributes creation, plus makes it possible to implement writable properties. [Daniel Mack - removed superflous return statement and dropped .mode attribute from POWER_SUPPLY_ATTR] Suggested-by: Greg KH Suggested-by: Kay Sievers Signed-off-by: Anton Vorontsov Tested-by: Daniel Mack --- include/linux/power_supply.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index ebd2b8f..c5f73a3 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -114,6 +114,7 @@ enum power_supply_property { POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG, POWER_SUPPLY_PROP_TIME_TO_FULL_NOW, POWER_SUPPLY_PROP_TIME_TO_FULL_AVG, + POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */ /* Properties of type `const char *' */ POWER_SUPPLY_PROP_MODEL_NAME, POWER_SUPPLY_PROP_MANUFACTURER, -- cgit v1.1 From 0011d2d4a5f7bb5666dcfb9f9b3dbdb084ab98f1 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Tue, 18 May 2010 21:49:52 +0200 Subject: power_supply: Add support for writeable properties This patch adds support for writeable power supply properties and exposes them as writeable to sysfs. A power supply implementation must implement two new function calls in order to use that feature: int set_property(struct power_supply *psy, enum power_supply_property psp, const union power_supply_propval *val); int property_is_writeable(struct power_supply *psy, enum power_supply_property psp); Signed-off-by: Daniel Mack Cc: David Woodhouse Cc: Alexey Starikovskiy Cc: Len Brown Cc: Mark Brown Cc: Matt Reimer Cc: Evgeniy Polyakov Cc: Tejun Heo Signed-off-by: Anton Vorontsov --- include/linux/power_supply.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index c5f73a3..30083a8 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -145,6 +145,11 @@ struct power_supply { int (*get_property)(struct power_supply *psy, enum power_supply_property psp, union power_supply_propval *val); + int (*set_property)(struct power_supply *psy, + enum power_supply_property psp, + const union power_supply_propval *val); + int (*property_is_writeable)(struct power_supply *psy, + enum power_supply_property psp); void (*external_power_changed)(struct power_supply *psy); void (*set_charged)(struct power_supply *psy); -- cgit v1.1