Commit 6c50a08d authored by Linus Walleij's avatar Linus Walleij Committed by Sebastian Reichel

power: supply: ab8500: Drop external charger leftovers

Some leftover code for external chargers only used with
unreleased ASIC revisions and the header file for the
unsupported PM2301 was left behind in an earlier cleanup,
fix it by deleting the remnants.
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent e8b60d9c
...@@ -34,7 +34,6 @@ struct ux500_charger_ops { ...@@ -34,7 +34,6 @@ struct ux500_charger_ops {
* @max_out_volt_uv maximum output charger voltage in uV * @max_out_volt_uv maximum output charger voltage in uV
* @max_out_curr_ua maximum output charger current in uA * @max_out_curr_ua maximum output charger current in uA
* @enabled indicates if this charger is used or not * @enabled indicates if this charger is used or not
* @external external charger unit (pm2xxx)
*/ */
struct ux500_charger { struct ux500_charger {
struct power_supply *psy; struct power_supply *psy;
...@@ -43,9 +42,6 @@ struct ux500_charger { ...@@ -43,9 +42,6 @@ struct ux500_charger {
int max_out_curr_ua; int max_out_curr_ua;
int wdt_refresh; int wdt_refresh;
bool enabled; bool enabled;
bool external;
}; };
extern struct blocking_notifier_head charger_notifier_list;
#endif /* _AB8500_CHARGALG_H_ */ #endif /* _AB8500_CHARGALG_H_ */
...@@ -246,9 +246,6 @@ struct ab8500_chargalg { ...@@ -246,9 +246,6 @@ struct ab8500_chargalg {
struct kobject chargalg_kobject; struct kobject chargalg_kobject;
}; };
/*External charger prepare notifier*/
BLOCKING_NOTIFIER_HEAD(charger_notifier_list);
/* Main battery properties */ /* Main battery properties */
static enum power_supply_property ab8500_chargalg_props[] = { static enum power_supply_property ab8500_chargalg_props[] = {
POWER_SUPPLY_PROP_STATUS, POWER_SUPPLY_PROP_STATUS,
...@@ -343,8 +340,7 @@ static int ab8500_chargalg_check_charger_enable(struct ab8500_chargalg *di) ...@@ -343,8 +340,7 @@ static int ab8500_chargalg_check_charger_enable(struct ab8500_chargalg *di)
return di->usb_chg->ops.check_enable(di->usb_chg, return di->usb_chg->ops.check_enable(di->usb_chg,
bi->constant_charge_voltage_max_uv, bi->constant_charge_voltage_max_uv,
bi->constant_charge_current_max_ua); bi->constant_charge_current_max_ua);
} else if ((di->chg_info.charger_type & AC_CHG) && } else if (di->chg_info.charger_type & AC_CHG) {
!(di->ac_chg->external)) {
return di->ac_chg->ops.check_enable(di->ac_chg, return di->ac_chg->ops.check_enable(di->ac_chg,
bi->constant_charge_voltage_max_uv, bi->constant_charge_voltage_max_uv,
bi->constant_charge_current_max_ua); bi->constant_charge_current_max_ua);
...@@ -473,15 +469,6 @@ static int ab8500_chargalg_kick_watchdog(struct ab8500_chargalg *di) ...@@ -473,15 +469,6 @@ static int ab8500_chargalg_kick_watchdog(struct ab8500_chargalg *di)
/* Check if charger exists and kick watchdog if charging */ /* Check if charger exists and kick watchdog if charging */
if (di->ac_chg && di->ac_chg->ops.kick_wd && if (di->ac_chg && di->ac_chg->ops.kick_wd &&
di->chg_info.online_chg & AC_CHG) { di->chg_info.online_chg & AC_CHG) {
/*
* If AB charger watchdog expired, pm2xxx charging
* gets disabled. To be safe, kick both AB charger watchdog
* and pm2xxx watchdog.
*/
if (di->ac_chg->external &&
di->usb_chg && di->usb_chg->ops.kick_wd)
di->usb_chg->ops.kick_wd(di->usb_chg);
return di->ac_chg->ops.kick_wd(di->ac_chg); return di->ac_chg->ops.kick_wd(di->ac_chg);
} else if (di->usb_chg && di->usb_chg->ops.kick_wd && } else if (di->usb_chg && di->usb_chg->ops.kick_wd &&
di->chg_info.online_chg & USB_CHG) di->chg_info.online_chg & USB_CHG)
...@@ -517,14 +504,6 @@ static int ab8500_chargalg_ac_en(struct ab8500_chargalg *di, int enable, ...@@ -517,14 +504,6 @@ static int ab8500_chargalg_ac_en(struct ab8500_chargalg *di, int enable,
di->chg_info.ac_iset_ua = iset_ua; di->chg_info.ac_iset_ua = iset_ua;
di->chg_info.ac_vset_uv = vset_uv; di->chg_info.ac_vset_uv = vset_uv;
/* Enable external charger */
if (enable && di->ac_chg->external &&
!ab8500_chargalg_ex_ac_enable_toggle) {
blocking_notifier_call_chain(&charger_notifier_list,
0, di->dev);
ab8500_chargalg_ex_ac_enable_toggle++;
}
return di->ac_chg->ops.enable(di->ac_chg, enable, vset_uv, iset_ua); return di->ac_chg->ops.enable(di->ac_chg, enable, vset_uv, iset_ua);
} }
......
...@@ -1716,29 +1716,6 @@ static int ab8500_charger_usb_en(struct ux500_charger *charger, ...@@ -1716,29 +1716,6 @@ static int ab8500_charger_usb_en(struct ux500_charger *charger,
return ret; return ret;
} }
static int ab8500_external_charger_prepare(struct notifier_block *charger_nb,
unsigned long event, void *data)
{
int ret;
struct device *dev = data;
/*Toggle External charger control pin*/
ret = abx500_set_register_interruptible(dev, AB8500_SYS_CTRL1_BLOCK,
AB8500_SYS_CHARGER_CONTROL_REG,
EXTERNAL_CHARGER_DISABLE_REG_VAL);
if (ret < 0) {
dev_err(dev, "write reg failed %d\n", ret);
goto out;
}
ret = abx500_set_register_interruptible(dev, AB8500_SYS_CTRL1_BLOCK,
AB8500_SYS_CHARGER_CONTROL_REG,
EXTERNAL_CHARGER_ENABLE_REG_VAL);
if (ret < 0)
dev_err(dev, "Write reg failed %d\n", ret);
out:
return ret;
}
/** /**
* ab8500_charger_usb_check_enable() - enable usb charging * ab8500_charger_usb_check_enable() - enable usb charging
* @charger: pointer to the ux500_charger structure * @charger: pointer to the ux500_charger structure
...@@ -3316,10 +3293,6 @@ static int __maybe_unused ab8500_charger_suspend(struct device *dev) ...@@ -3316,10 +3293,6 @@ static int __maybe_unused ab8500_charger_suspend(struct device *dev)
return 0; return 0;
} }
static struct notifier_block charger_nb = {
.notifier_call = ab8500_external_charger_prepare,
};
static char *supply_interface[] = { static char *supply_interface[] = {
"ab8500_chargalg", "ab8500_chargalg",
"ab8500_fg", "ab8500_fg",
...@@ -3540,7 +3513,6 @@ static int ab8500_charger_probe(struct platform_device *pdev) ...@@ -3540,7 +3513,6 @@ static int ab8500_charger_probe(struct platform_device *pdev)
*/ */
if (!is_ab8505(di->parent)) if (!is_ab8505(di->parent))
di->ac_chg.enabled = true; di->ac_chg.enabled = true;
di->ac_chg.external = false;
/* USB supply */ /* USB supply */
/* ux500_charger sub-class */ /* ux500_charger sub-class */
...@@ -3553,7 +3525,6 @@ static int ab8500_charger_probe(struct platform_device *pdev) ...@@ -3553,7 +3525,6 @@ static int ab8500_charger_probe(struct platform_device *pdev)
di->usb_chg.max_out_curr_ua = di->usb_chg.max_out_curr_ua =
ab8500_charge_output_curr_map[ARRAY_SIZE(ab8500_charge_output_curr_map) - 1]; ab8500_charge_output_curr_map[ARRAY_SIZE(ab8500_charge_output_curr_map) - 1];
di->usb_chg.wdt_refresh = CHG_WD_INTERVAL; di->usb_chg.wdt_refresh = CHG_WD_INTERVAL;
di->usb_chg.external = false;
di->usb_state.usb_current_ua = -1; di->usb_state.usb_current_ua = -1;
mutex_init(&di->charger_attached_mutex); mutex_init(&di->charger_attached_mutex);
...@@ -3677,17 +3648,11 @@ static int ab8500_charger_probe(struct platform_device *pdev) ...@@ -3677,17 +3648,11 @@ static int ab8500_charger_probe(struct platform_device *pdev)
goto remove_ab8500_bm; goto remove_ab8500_bm;
} }
/* Notifier for external charger enabling */
if (!di->ac_chg.enabled)
blocking_notifier_chain_register(
&charger_notifier_list, &charger_nb);
di->usb_phy = usb_get_phy(USB_PHY_TYPE_USB2); di->usb_phy = usb_get_phy(USB_PHY_TYPE_USB2);
if (IS_ERR_OR_NULL(di->usb_phy)) { if (IS_ERR_OR_NULL(di->usb_phy)) {
dev_err(dev, "failed to get usb transceiver\n"); dev_err(dev, "failed to get usb transceiver\n");
ret = -EINVAL; ret = -EINVAL;
goto out_charger_notifier; goto remove_ab8500_bm;
} }
di->nb.notifier_call = ab8500_charger_usb_notifier_call; di->nb.notifier_call = ab8500_charger_usb_notifier_call;
ret = usb_register_notifier(di->usb_phy, &di->nb); ret = usb_register_notifier(di->usb_phy, &di->nb);
...@@ -3696,7 +3661,6 @@ static int ab8500_charger_probe(struct platform_device *pdev) ...@@ -3696,7 +3661,6 @@ static int ab8500_charger_probe(struct platform_device *pdev)
goto put_usb_phy; goto put_usb_phy;
} }
ret = component_master_add_with_match(&pdev->dev, ret = component_master_add_with_match(&pdev->dev,
&ab8500_charger_comp_ops, &ab8500_charger_comp_ops,
match); match);
...@@ -3711,10 +3675,6 @@ static int ab8500_charger_probe(struct platform_device *pdev) ...@@ -3711,10 +3675,6 @@ static int ab8500_charger_probe(struct platform_device *pdev)
usb_unregister_notifier(di->usb_phy, &di->nb); usb_unregister_notifier(di->usb_phy, &di->nb);
put_usb_phy: put_usb_phy:
usb_put_phy(di->usb_phy); usb_put_phy(di->usb_phy);
out_charger_notifier:
if (!di->ac_chg.enabled)
blocking_notifier_chain_unregister(
&charger_notifier_list, &charger_nb);
remove_ab8500_bm: remove_ab8500_bm:
ab8500_bm_of_remove(di->usb_chg.psy, di->bm); ab8500_bm_of_remove(di->usb_chg.psy, di->bm);
return ret; return ret;
...@@ -3729,9 +3689,6 @@ static int ab8500_charger_remove(struct platform_device *pdev) ...@@ -3729,9 +3689,6 @@ static int ab8500_charger_remove(struct platform_device *pdev)
usb_unregister_notifier(di->usb_phy, &di->nb); usb_unregister_notifier(di->usb_phy, &di->nb);
ab8500_bm_of_remove(di->usb_chg.psy, di->bm); ab8500_bm_of_remove(di->usb_chg.psy, di->bm);
usb_put_phy(di->usb_phy); usb_put_phy(di->usb_phy);
if (!di->ac_chg.enabled)
blocking_notifier_chain_unregister(
&charger_notifier_list, &charger_nb);
return 0; return 0;
} }
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment