summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Rosin <peda@axentia.se>2016-12-20 06:33:00 -0500
committerSebastian Reichel <sre@kernel.org>2017-01-04 16:00:41 -0500
commit2e66585ca255df195278a50143e0bccf26d735d6 (patch)
tree9d855b7312f49b3418f93cebd9800671e7f1f4af
parent5b903a1555e1d5b6e12ede53d5d8dc86fef94a03 (diff)
power: supply: bq24735: move down bq24735_{en,dis}able_charging
bq24735_enable_charging() needs to call bq24735_config_charging(), which is something to change later, this is just a preparatory patch. Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Sebastian Reichel <sre@kernel.org>
-rw-r--r--drivers/power/supply/bq24735-charger.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/power/supply/bq24735-charger.c b/drivers/power/supply/bq24735-charger.c
index 8a0242c13b7e..2787c19d6696 100644
--- a/drivers/power/supply/bq24735-charger.c
+++ b/drivers/power/supply/bq24735-charger.c
@@ -107,25 +107,6 @@ static int bq24735_update_word(struct i2c_client *client, u8 reg,
107 return bq24735_write_word(client, reg, tmp); 107 return bq24735_write_word(client, reg, tmp);
108} 108}
109 109
110static inline int bq24735_enable_charging(struct bq24735 *charger)
111{
112 if (charger->pdata->ext_control)
113 return 0;
114
115 return bq24735_update_word(charger->client, BQ24735_CHG_OPT,
116 BQ24735_CHG_OPT_CHARGE_DISABLE, 0);
117}
118
119static inline int bq24735_disable_charging(struct bq24735 *charger)
120{
121 if (charger->pdata->ext_control)
122 return 0;
123
124 return bq24735_update_word(charger->client, BQ24735_CHG_OPT,
125 BQ24735_CHG_OPT_CHARGE_DISABLE,
126 BQ24735_CHG_OPT_CHARGE_DISABLE);
127}
128
129static int bq24735_config_charger(struct bq24735 *charger) 110static int bq24735_config_charger(struct bq24735 *charger)
130{ 111{
131 struct bq24735_platform *pdata = charger->pdata; 112 struct bq24735_platform *pdata = charger->pdata;
@@ -177,6 +158,25 @@ static int bq24735_config_charger(struct bq24735 *charger)
177 return 0; 158 return 0;
178} 159}
179 160
161static inline int bq24735_enable_charging(struct bq24735 *charger)
162{
163 if (charger->pdata->ext_control)
164 return 0;
165
166 return bq24735_update_word(charger->client, BQ24735_CHG_OPT,
167 BQ24735_CHG_OPT_CHARGE_DISABLE, 0);
168}
169
170static inline int bq24735_disable_charging(struct bq24735 *charger)
171{
172 if (charger->pdata->ext_control)
173 return 0;
174
175 return bq24735_update_word(charger->client, BQ24735_CHG_OPT,
176 BQ24735_CHG_OPT_CHARGE_DISABLE,
177 BQ24735_CHG_OPT_CHARGE_DISABLE);
178}
179
180static bool bq24735_charger_is_present(struct bq24735 *charger) 180static bool bq24735_charger_is_present(struct bq24735 *charger)
181{ 181{
182 if (charger->status_gpio) { 182 if (charger->status_gpio) {