diff options
author | Todd Poynor | 2013-01-08 20:46:41 -0600 |
---|---|---|
committer | Arve Hjønnevåg | 2013-02-19 19:56:21 -0600 |
commit | 25b1c244dedc8cc744fd1186cb8c3cca558a73e8 (patch) | |
tree | 0e31bd660056e41ebaa2dd62c507dcb7b2b41dd0 | |
parent | b77f73a7fe67db8845e5d175414199a0fc4b2111 (diff) | |
download | kernel-common-25b1c244dedc8cc744fd1186cb8c3cca558a73e8.tar.gz kernel-common-25b1c244dedc8cc744fd1186cb8c3cca558a73e8.tar.xz kernel-common-25b1c244dedc8cc744fd1186cb8c3cca558a73e8.zip |
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.c | 76 |
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 { | |||
47 | struct device *dev; | 47 | struct device *dev; |
48 | 48 | ||
49 | struct power_supply psy_bat; | 49 | struct power_supply psy_bat; |
50 | struct power_supply psy_usb; | ||
51 | struct power_supply psy_ac; | ||
52 | 50 | ||
53 | struct wake_lock monitor_wake_lock; | 51 | struct wake_lock monitor_wake_lock; |
54 | struct wake_lock charger_wake_lock; | 52 | struct wake_lock charger_wake_lock; |
@@ -74,10 +72,6 @@ struct android_bat_data { | |||
74 | struct dentry *debugfs_entry; | 72 | struct dentry *debugfs_entry; |
75 | }; | 73 | }; |
76 | 74 | ||
77 | static char *supply_list[] = { | ||
78 | "android-battery", | ||
79 | }; | ||
80 | |||
81 | static enum power_supply_property android_battery_props[] = { | 75 | static enum power_supply_property android_battery_props[] = { |
82 | POWER_SUPPLY_PROP_STATUS, | 76 | POWER_SUPPLY_PROP_STATUS, |
83 | POWER_SUPPLY_PROP_HEALTH, | 77 | POWER_SUPPLY_PROP_HEALTH, |
@@ -90,10 +84,6 @@ static enum power_supply_property android_battery_props[] = { | |||
90 | POWER_SUPPLY_PROP_CURRENT_NOW, | 84 | POWER_SUPPLY_PROP_CURRENT_NOW, |
91 | }; | 85 | }; |
92 | 86 | ||
93 | static enum power_supply_property android_power_props[] = { | ||
94 | POWER_SUPPLY_PROP_ONLINE, | ||
95 | }; | ||
96 | |||
97 | static DEFINE_MUTEX(android_bat_state_lock); | 87 | static DEFINE_MUTEX(android_bat_state_lock); |
98 | 88 | ||
99 | static void android_bat_update_data(struct android_bat_data *battery); | 89 | 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, | |||
163 | return 0; | 153 | return 0; |
164 | } | 154 | } |
165 | 155 | ||
166 | static int android_usb_get_property(struct power_supply *ps, | ||
167 | enum power_supply_property psp, | ||
168 | union power_supply_propval *val) | ||
169 | { | ||
170 | struct android_bat_data *battery = container_of(ps, | ||
171 | struct android_bat_data, psy_usb); | ||
172 | |||
173 | if (psp != POWER_SUPPLY_PROP_ONLINE) | ||
174 | return -EINVAL; | ||
175 | |||
176 | val->intval = (battery->charge_source == CHARGE_SOURCE_USB); | ||
177 | |||
178 | return 0; | ||
179 | } | ||
180 | |||
181 | static int android_ac_get_property(struct power_supply *ps, | ||
182 | enum power_supply_property psp, | ||
183 | union power_supply_propval *val) | ||
184 | { | ||
185 | struct android_bat_data *battery = container_of(ps, | ||
186 | struct android_bat_data, psy_ac); | ||
187 | |||
188 | if (psp != POWER_SUPPLY_PROP_ONLINE) | ||
189 | return -EINVAL; | ||
190 | |||
191 | val->intval = (battery->charge_source == CHARGE_SOURCE_AC); | ||
192 | |||
193 | return 0; | ||
194 | } | ||
195 | |||
196 | static void android_bat_get_temp(struct android_bat_data *battery) | 156 | static void android_bat_get_temp(struct android_bat_data *battery) |
197 | { | 157 | { |
198 | int batt_temp = 42; /* 4.2C */ | 158 | int batt_temp = 42; /* 4.2C */ |
@@ -439,8 +399,6 @@ static void android_bat_charger_work(struct work_struct *work) | |||
439 | 399 | ||
440 | mutex_unlock(&android_bat_state_lock); | 400 | mutex_unlock(&android_bat_state_lock); |
441 | wake_lock_timeout(&battery->charger_wake_lock, HZ * 2); | 401 | wake_lock_timeout(&battery->charger_wake_lock, HZ * 2); |
442 | power_supply_changed(&battery->psy_ac); | ||
443 | power_supply_changed(&battery->psy_usb); | ||
444 | } | 402 | } |
445 | 403 | ||
446 | 404 | ||
@@ -601,22 +559,6 @@ static int android_bat_probe(struct platform_device *pdev) | |||
601 | battery->psy_bat.num_properties = ARRAY_SIZE(android_battery_props), | 559 | battery->psy_bat.num_properties = ARRAY_SIZE(android_battery_props), |
602 | battery->psy_bat.get_property = android_bat_get_property, | 560 | battery->psy_bat.get_property = android_bat_get_property, |
603 | 561 | ||
604 | battery->psy_usb.name = "android-usb", | ||
605 | battery->psy_usb.type = POWER_SUPPLY_TYPE_USB, | ||
606 | battery->psy_usb.supplied_to = supply_list, | ||
607 | battery->psy_usb.num_supplicants = ARRAY_SIZE(supply_list), | ||
608 | battery->psy_usb.properties = android_power_props, | ||
609 | battery->psy_usb.num_properties = ARRAY_SIZE(android_power_props), | ||
610 | battery->psy_usb.get_property = android_usb_get_property, | ||
611 | |||
612 | battery->psy_ac.name = "android-ac", | ||
613 | battery->psy_ac.type = POWER_SUPPLY_TYPE_MAINS, | ||
614 | battery->psy_ac.supplied_to = supply_list, | ||
615 | battery->psy_ac.num_supplicants = ARRAY_SIZE(supply_list), | ||
616 | battery->psy_ac.properties = android_power_props, | ||
617 | battery->psy_ac.num_properties = ARRAY_SIZE(android_power_props), | ||
618 | battery->psy_ac.get_property = android_ac_get_property; | ||
619 | |||
620 | battery->batt_vcell = -1; | 562 | battery->batt_vcell = -1; |
621 | battery->batt_soc = -1; | 563 | battery->batt_soc = -1; |
622 | 564 | ||
@@ -632,20 +574,6 @@ static int android_bat_probe(struct platform_device *pdev) | |||
632 | goto err_psy_bat_reg; | 574 | goto err_psy_bat_reg; |
633 | } | 575 | } |
634 | 576 | ||
635 | ret = power_supply_register(&pdev->dev, &battery->psy_usb); | ||
636 | if (ret) { | ||
637 | dev_err(battery->dev, "%s: failed to register psy_usb\n", | ||
638 | __func__); | ||
639 | goto err_psy_usb_reg; | ||
640 | } | ||
641 | |||
642 | ret = power_supply_register(&pdev->dev, &battery->psy_ac); | ||
643 | if (ret) { | ||
644 | dev_err(battery->dev, "%s: failed to register psy_ac\n", | ||
645 | __func__); | ||
646 | goto err_psy_ac_reg; | ||
647 | } | ||
648 | |||
649 | battery->monitor_wqueue = | 577 | battery->monitor_wqueue = |
650 | alloc_workqueue(dev_name(&pdev->dev), WQ_FREEZABLE, 1); | 578 | alloc_workqueue(dev_name(&pdev->dev), WQ_FREEZABLE, 1); |
651 | if (!battery->monitor_wqueue) { | 579 | if (!battery->monitor_wqueue) { |
@@ -686,10 +614,6 @@ static int android_bat_probe(struct platform_device *pdev) | |||
686 | return 0; | 614 | return 0; |
687 | 615 | ||
688 | err_wq: | 616 | err_wq: |
689 | power_supply_unregister(&battery->psy_ac); | ||
690 | err_psy_ac_reg: | ||
691 | power_supply_unregister(&battery->psy_usb); | ||
692 | err_psy_usb_reg: | ||
693 | power_supply_unregister(&battery->psy_bat); | 617 | power_supply_unregister(&battery->psy_bat); |
694 | err_psy_bat_reg: | 618 | err_psy_bat_reg: |
695 | wake_lock_destroy(&battery->monitor_wake_lock); | 619 | wake_lock_destroy(&battery->monitor_wake_lock); |