Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

power: bq24735-charger: add 'ti,external-control' option

Implement an 'ti,external-control' option for when the charger
shouldn't be configured by the host.

Signed-off-by: Jonathan Tinkham <sctincman@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>

authored by

Jonathan Tinkham and committed by
Sebastian Reichel
64024ac7 a60da83f

+13
+11
drivers/power/bq24735-charger.c
··· 106 106 107 107 static inline int bq24735_enable_charging(struct bq24735 *charger) 108 108 { 109 + if (charger->pdata->ext_control) 110 + return 0; 111 + 109 112 return bq24735_update_word(charger->client, BQ24735_CHG_OPT, 110 113 BQ24735_CHG_OPT_CHARGE_DISABLE, 111 114 ~BQ24735_CHG_OPT_CHARGE_DISABLE); ··· 116 113 117 114 static inline int bq24735_disable_charging(struct bq24735 *charger) 118 115 { 116 + if (charger->pdata->ext_control) 117 + return 0; 118 + 119 119 return bq24735_update_word(charger->client, BQ24735_CHG_OPT, 120 120 BQ24735_CHG_OPT_CHARGE_DISABLE, 121 121 BQ24735_CHG_OPT_CHARGE_DISABLE); ··· 129 123 struct bq24735_platform *pdata = charger->pdata; 130 124 int ret; 131 125 u16 value; 126 + 127 + if (pdata->ext_control) 128 + return 0; 132 129 133 130 if (pdata->charge_current) { 134 131 value = pdata->charge_current & BQ24735_CHARGE_CURRENT_MASK; ··· 330 321 ret = of_property_read_u32(np, "ti,input-current", &val); 331 322 if (!ret) 332 323 pdata->input_current = val; 324 + 325 + pdata->ext_control = of_property_read_bool(np, "ti,external-control"); 333 326 334 327 return pdata; 335 328 }
+2
include/linux/power/bq24735-charger.h
··· 32 32 int status_gpio_active_low; 33 33 bool status_gpio_valid; 34 34 35 + bool ext_control; 36 + 35 37 char **supplied_to; 36 38 size_t num_supplicants; 37 39 };