aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2013-01-08 18:46:41 -0800
committerArve Hjønnevåg <arve@android.com>2013-04-29 14:43:21 -0700
commit170c8d38dee1b94838551f6113266a527b57a8cb (patch)
tree426b871e1b3ac18131d7cbbd438341eac2c4fc79
parent62dbaa4069bc7460be5b40d3b7e87e4225fa6f6c (diff)
downloadvexpress-lsk-170c8d38dee1b94838551f6113266a527b57a8cb.tar.gz
power: android-battery: remove ac and usb supplies
Should no longer need to fix up AC/USB online state via these. Change-Id: I48d2ef0fbefee58cb47eafc11d9a44759920df7a Signed-off-by: Todd Poynor <toddpoynor@google.com>
-rw-r--r--drivers/power/android_battery.c76
1 files changed, 0 insertions, 76 deletions
diff --git a/drivers/power/android_battery.c b/drivers/power/android_battery.c
index dbba090a51e..6e8b4054c8d 100644
--- a/drivers/power/android_battery.c
+++ b/drivers/power/android_battery.c
@@ -47,8 +47,6 @@ struct android_bat_data {
struct device *dev;
struct power_supply psy_bat;
- struct power_supply psy_usb;
- struct power_supply psy_ac;
struct wake_lock monitor_wake_lock;
struct wake_lock charger_wake_lock;
@@ -74,10 +72,6 @@ struct android_bat_data {
struct dentry *debugfs_entry;
};
-static char *supply_list[] = {
- "android-battery",
-};
-
static enum power_supply_property android_battery_props[] = {
POWER_SUPPLY_PROP_STATUS,
POWER_SUPPLY_PROP_HEALTH,
@@ -90,10 +84,6 @@ static enum power_supply_property android_battery_props[] = {
POWER_SUPPLY_PROP_CURRENT_NOW,
};
-static enum power_supply_property android_power_props[] = {
- POWER_SUPPLY_PROP_ONLINE,
-};
-
static DEFINE_MUTEX(android_bat_state_lock);
static void android_bat_update_data(struct android_bat_data *battery);
@@ -163,36 +153,6 @@ static int android_bat_get_property(struct power_supply *ps,
return 0;
}
-static int android_usb_get_property(struct power_supply *ps,
- enum power_supply_property psp,
- union power_supply_propval *val)
-{
- struct android_bat_data *battery = container_of(ps,
- struct android_bat_data, psy_usb);
-
- if (psp != POWER_SUPPLY_PROP_ONLINE)
- return -EINVAL;
-
- val->intval = (battery->charge_source == CHARGE_SOURCE_USB);
-
- return 0;
-}
-
-static int android_ac_get_property(struct power_supply *ps,
- enum power_supply_property psp,
- union power_supply_propval *val)
-{
- struct android_bat_data *battery = container_of(ps,
- struct android_bat_data, psy_ac);
-
- if (psp != POWER_SUPPLY_PROP_ONLINE)
- return -EINVAL;
-
- val->intval = (battery->charge_source == CHARGE_SOURCE_AC);
-
- return 0;
-}
-
static void android_bat_get_temp(struct android_bat_data *battery)
{
int batt_temp = 42; /* 4.2C */
@@ -439,8 +399,6 @@ static void android_bat_charger_work(struct work_struct *work)
mutex_unlock(&android_bat_state_lock);
wake_lock_timeout(&battery->charger_wake_lock, HZ * 2);
- power_supply_changed(&battery->psy_ac);
- power_supply_changed(&battery->psy_usb);
}
@@ -601,22 +559,6 @@ static int android_bat_probe(struct platform_device *pdev)
battery->psy_bat.num_properties = ARRAY_SIZE(android_battery_props),
battery->psy_bat.get_property = android_bat_get_property,
- battery->psy_usb.name = "android-usb",
- battery->psy_usb.type = POWER_SUPPLY_TYPE_USB,
- battery->psy_usb.supplied_to = supply_list,
- battery->psy_usb.num_supplicants = ARRAY_SIZE(supply_list),
- battery->psy_usb.properties = android_power_props,
- battery->psy_usb.num_properties = ARRAY_SIZE(android_power_props),
- battery->psy_usb.get_property = android_usb_get_property,
-
- battery->psy_ac.name = "android-ac",
- battery->psy_ac.type = POWER_SUPPLY_TYPE_MAINS,
- battery->psy_ac.supplied_to = supply_list,
- battery->psy_ac.num_supplicants = ARRAY_SIZE(supply_list),
- battery->psy_ac.properties = android_power_props,
- battery->psy_ac.num_properties = ARRAY_SIZE(android_power_props),
- battery->psy_ac.get_property = android_ac_get_property;
-
battery->batt_vcell = -1;
battery->batt_soc = -1;
@@ -632,20 +574,6 @@ static int android_bat_probe(struct platform_device *pdev)
goto err_psy_bat_reg;
}
- ret = power_supply_register(&pdev->dev, &battery->psy_usb);
- if (ret) {
- dev_err(battery->dev, "%s: failed to register psy_usb\n",
- __func__);
- goto err_psy_usb_reg;
- }
-
- ret = power_supply_register(&pdev->dev, &battery->psy_ac);
- if (ret) {
- dev_err(battery->dev, "%s: failed to register psy_ac\n",
- __func__);
- goto err_psy_ac_reg;
- }
-
battery->monitor_wqueue =
alloc_workqueue(dev_name(&pdev->dev), WQ_FREEZABLE, 1);
if (!battery->monitor_wqueue) {
@@ -686,10 +614,6 @@ static int android_bat_probe(struct platform_device *pdev)
return 0;
err_wq:
- power_supply_unregister(&battery->psy_ac);
-err_psy_ac_reg:
- power_supply_unregister(&battery->psy_usb);
-err_psy_usb_reg:
power_supply_unregister(&battery->psy_bat);
err_psy_bat_reg:
wake_lock_destroy(&battery->monitor_wake_lock);