blob: 57154474da57750ed6ec57b099f1b35d4b1e4831 [file] [log] [blame]
Harry Yang4b7db0f2017-11-27 10:50:44 -08001/* Copyright (c) 2018 The Linux Foundation. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef __SMB5_CHARGER_H
14#define __SMB5_CHARGER_H
15#include <linux/types.h>
16#include <linux/interrupt.h>
17#include <linux/irqreturn.h>
18#include <linux/regulator/driver.h>
19#include <linux/regulator/consumer.h>
20#include <linux/extcon.h>
21#include "storm-watch.h"
22
23enum print_reason {
24 PR_INTERRUPT = BIT(0),
25 PR_REGISTER = BIT(1),
26 PR_MISC = BIT(2),
27 PR_PARALLEL = BIT(3),
28 PR_OTG = BIT(4),
29};
30
31#define DEFAULT_VOTER "DEFAULT_VOTER"
32#define USER_VOTER "USER_VOTER"
33#define PD_VOTER "PD_VOTER"
34#define DCP_VOTER "DCP_VOTER"
35#define QC_VOTER "QC_VOTER"
36#define PL_USBIN_USBIN_VOTER "PL_USBIN_USBIN_VOTER"
37#define USB_PSY_VOTER "USB_PSY_VOTER"
38#define PL_TAPER_WORK_RUNNING_VOTER "PL_TAPER_WORK_RUNNING_VOTER"
39#define PL_QNOVO_VOTER "PL_QNOVO_VOTER"
40#define USBIN_V_VOTER "USBIN_V_VOTER"
41#define CHG_STATE_VOTER "CHG_STATE_VOTER"
42#define TYPEC_SRC_VOTER "TYPEC_SRC_VOTER"
43#define TAPER_END_VOTER "TAPER_END_VOTER"
44#define THERMAL_DAEMON_VOTER "THERMAL_DAEMON_VOTER"
45#define CC_DETACHED_VOTER "CC_DETACHED_VOTER"
46#define APSD_VOTER "APSD_VOTER"
47#define PD_DISALLOWED_INDIRECT_VOTER "PD_DISALLOWED_INDIRECT_VOTER"
48#define VBUS_CC_SHORT_VOTER "VBUS_CC_SHORT_VOTER"
49#define PD_INACTIVE_VOTER "PD_INACTIVE_VOTER"
50#define BOOST_BACK_VOTER "BOOST_BACK_VOTER"
51#define USBIN_USBIN_BOOST_VOTER "USBIN_USBIN_BOOST_VOTER"
52#define MICRO_USB_VOTER "MICRO_USB_VOTER"
53#define DEBUG_BOARD_VOTER "DEBUG_BOARD_VOTER"
54#define PD_SUSPEND_SUPPORTED_VOTER "PD_SUSPEND_SUPPORTED_VOTER"
55#define PL_DELAY_VOTER "PL_DELAY_VOTER"
56#define CTM_VOTER "CTM_VOTER"
57#define SW_QC3_VOTER "SW_QC3_VOTER"
58#define AICL_RERUN_VOTER "AICL_RERUN_VOTER"
Harry Yang4b7db0f2017-11-27 10:50:44 -080059#define QNOVO_VOTER "QNOVO_VOTER"
60#define BATT_PROFILE_VOTER "BATT_PROFILE_VOTER"
61#define OTG_DELAY_VOTER "OTG_DELAY_VOTER"
62#define USBIN_I_VOTER "USBIN_I_VOTER"
63#define WEAK_CHARGER_VOTER "WEAK_CHARGER_VOTER"
64#define OTG_VOTER "OTG_VOTER"
65#define PL_FCC_LOW_VOTER "PL_FCC_LOW_VOTER"
66#define WBC_VOTER "WBC_VOTER"
67#define HW_LIMIT_VOTER "HW_LIMIT_VOTER"
Ashay Jaiswal9ad978672018-02-28 17:13:05 +053068#define DYNAMIC_RP_VOTER "DYNAMIC_RP_VOTER"
69#define DEFAULT_100MA_VOTER "DEFAULT_100MA_VOTER"
Anirudh Ghayaldfdb8412018-04-21 10:37:18 +053070#define FORCE_RECHARGE_VOTER "FORCE_RECHARGE_VOTER"
Harry Yang4b7db0f2017-11-27 10:50:44 -080071
72#define BOOST_BACK_STORM_COUNT 3
73#define WEAK_CHG_STORM_COUNT 8
74
Anirudh Ghayal1380d312018-02-23 00:01:43 +053075#define VBAT_TO_VRAW_ADC(v) div_u64((u64)v * 1000000UL, 194637UL)
76
Harry Yang4b7db0f2017-11-27 10:50:44 -080077enum smb_mode {
78 PARALLEL_MASTER = 0,
79 PARALLEL_SLAVE,
80 NUM_MODES,
81};
82
83enum {
84 BOOST_BACK_WA = BIT(0),
85};
86
87enum smb_irq_index {
88 /* CHGR */
89 CHGR_ERROR_IRQ = 0,
90 CHG_STATE_CHANGE_IRQ,
91 STEP_CHG_STATE_CHANGE_IRQ,
92 STEP_CHG_SOC_UPDATE_FAIL_IRQ,
93 STEP_CHG_SOC_UPDATE_REQ_IRQ,
94 FG_FVCAL_QUALIFIED_IRQ,
95 VPH_ALARM_IRQ,
96 VPH_DROP_PRECHG_IRQ,
97 /* DCDC */
98 OTG_FAIL_IRQ,
99 OTG_OC_DISABLE_SW_IRQ,
100 OTG_OC_HICCUP_IRQ,
101 BSM_ACTIVE_IRQ,
102 HIGH_DUTY_CYCLE_IRQ,
103 INPUT_CURRENT_LIMITING_IRQ,
104 CONCURRENT_MODE_DISABLE_IRQ,
105 SWITCHER_POWER_OK_IRQ,
106 /* BATIF */
107 BAT_TEMP_IRQ,
108 ALL_CHNL_CONV_DONE_IRQ,
109 BAT_OV_IRQ,
110 BAT_LOW_IRQ,
111 BAT_THERM_OR_ID_MISSING_IRQ,
112 BAT_TERMINAL_MISSING_IRQ,
113 BUCK_OC_IRQ,
114 VPH_OV_IRQ,
115 /* USB */
116 USBIN_COLLAPSE_IRQ,
117 USBIN_VASHDN_IRQ,
118 USBIN_UV_IRQ,
119 USBIN_OV_IRQ,
120 USBIN_PLUGIN_IRQ,
121 USBIN_REVI_CHANGE_IRQ,
122 USBIN_SRC_CHANGE_IRQ,
123 USBIN_ICL_CHANGE_IRQ,
124 /* DC */
125 DCIN_VASHDN_IRQ,
126 DCIN_UV_IRQ,
127 DCIN_OV_IRQ,
128 DCIN_PLUGIN_IRQ,
129 DCIN_REVI_IRQ,
130 DCIN_PON_IRQ,
131 DCIN_EN_IRQ,
132 /* TYPEC */
133 TYPEC_OR_RID_DETECTION_CHANGE_IRQ,
134 TYPEC_VPD_DETECT_IRQ,
135 TYPEC_CC_STATE_CHANGE_IRQ,
136 TYPEC_VCONN_OC_IRQ,
137 TYPEC_VBUS_CHANGE_IRQ,
138 TYPEC_ATTACH_DETACH_IRQ,
139 TYPEC_LEGACY_CABLE_DETECT_IRQ,
140 TYPEC_TRY_SNK_SRC_DETECT_IRQ,
141 /* MISC */
142 WDOG_SNARL_IRQ,
143 WDOG_BARK_IRQ,
144 AICL_FAIL_IRQ,
145 AICL_DONE_IRQ,
146 SMB_EN_IRQ,
147 IMP_TRIGGER_IRQ,
148 TEMP_CHANGE_IRQ,
149 TEMP_CHANGE_SMB_IRQ,
Ashay Jaiswal09feab82018-02-12 12:33:18 +0530150 /* FLASH */
151 VREG_OK_IRQ,
152 ILIM_S2_IRQ,
153 ILIM_S1_IRQ,
154 VOUT_DOWN_IRQ,
155 VOUT_UP_IRQ,
156 FLASH_STATE_CHANGE_IRQ,
157 TORCH_REQ_IRQ,
158 FLASH_EN_IRQ,
Harry Yang4b7db0f2017-11-27 10:50:44 -0800159 /* END */
160 SMB_IRQ_MAX,
161};
162
163enum float_options {
164 FLOAT_DCP = 1,
165 FLOAT_SDP = 2,
166 DISABLE_CHARGING = 3,
167 SUSPEND_INPUT = 4,
168};
169
170struct smb_irq_info {
171 const char *name;
172 const irq_handler_t handler;
173 const bool wake;
174 const struct storm_watch storm_data;
175 struct smb_irq_data *irq_data;
176 int irq;
177};
178
179static const unsigned int smblib_extcon_cable[] = {
180 EXTCON_USB,
181 EXTCON_USB_HOST,
182 EXTCON_NONE,
183};
184
185/* EXTCON_USB and EXTCON_USB_HOST are mutually exclusive */
186static const u32 smblib_extcon_exclusive[] = {0x3, 0};
187
188struct smb_regulator {
189 struct regulator_dev *rdev;
190 struct regulator_desc rdesc;
191};
192
193struct smb_irq_data {
194 void *parent_data;
195 const char *name;
196 struct storm_watch storm_data;
197};
198
199struct smb_chg_param {
200 const char *name;
201 u16 reg;
202 int min_u;
203 int max_u;
204 int step_u;
205 int (*get_proc)(struct smb_chg_param *param,
206 u8 val_raw);
207 int (*set_proc)(struct smb_chg_param *param,
208 int val_u,
209 u8 *val_raw);
210};
211
Ashay Jaiswala9e10912018-02-02 14:03:35 +0530212struct buck_boost_freq {
213 int freq_khz;
214 u8 val;
215};
216
Harry Yang4b7db0f2017-11-27 10:50:44 -0800217struct smb_chg_freq {
218 unsigned int freq_5V;
219 unsigned int freq_6V_8V;
220 unsigned int freq_9V;
221 unsigned int freq_12V;
222 unsigned int freq_removal;
223 unsigned int freq_below_otg_threshold;
224 unsigned int freq_above_otg_threshold;
225};
226
227struct smb_params {
228 struct smb_chg_param fcc;
229 struct smb_chg_param fv;
230 struct smb_chg_param usb_icl;
231 struct smb_chg_param icl_stat;
232 struct smb_chg_param otg_cl;
233 struct smb_chg_param jeita_cc_comp_hot;
234 struct smb_chg_param jeita_cc_comp_cold;
235 struct smb_chg_param freq_switcher;
236};
237
238struct parallel_params {
239 struct power_supply *psy;
240};
241
242struct smb_iio {
243 struct iio_channel *temp_chan;
244 struct iio_channel *temp_max_chan;
245 struct iio_channel *usbin_i_chan;
246 struct iio_channel *usbin_v_chan;
247 struct iio_channel *batt_i_chan;
248 struct iio_channel *connector_temp_chan;
249 struct iio_channel *connector_temp_thr1_chan;
250 struct iio_channel *connector_temp_thr2_chan;
251 struct iio_channel *connector_temp_thr3_chan;
252};
253
254struct smb_charger {
255 struct device *dev;
256 char *name;
257 struct regmap *regmap;
258 struct smb_irq_info *irq_info;
259 struct smb_params param;
260 struct smb_iio iio;
261 int *debug_mask;
262 enum smb_mode mode;
263 struct smb_chg_freq chg_freq;
264 int smb_version;
265 int otg_delay_ms;
266 int *weak_chg_icl_ua;
267
268 /* locks */
269 struct mutex lock;
270 struct mutex ps_change_lock;
271 struct mutex otg_oc_lock;
272
273 /* power supplies */
274 struct power_supply *batt_psy;
275 struct power_supply *usb_psy;
276 struct power_supply *dc_psy;
277 struct power_supply *bms_psy;
278 struct power_supply *usb_main_psy;
279 struct power_supply *usb_port_psy;
280 enum power_supply_type real_charger_type;
281
282 /* notifiers */
283 struct notifier_block nb;
284
285 /* parallel charging */
286 struct parallel_params pl;
287
288 /* regulators */
289 struct smb_regulator *vbus_vreg;
290 struct smb_regulator *vconn_vreg;
291 struct regulator *dpdm_reg;
292
293 /* votables */
294 struct votable *dc_suspend_votable;
295 struct votable *fcc_votable;
296 struct votable *fv_votable;
297 struct votable *usb_icl_votable;
298 struct votable *pd_disallowed_votable_indirect;
299 struct votable *pd_allowed_votable;
300 struct votable *awake_votable;
301 struct votable *pl_disable_votable;
302 struct votable *chg_disable_votable;
303 struct votable *pl_enable_votable_indirect;
304 struct votable *usb_irq_enable_votable;
305
306 /* work */
307 struct work_struct bms_update_work;
308 struct work_struct pl_update_work;
Ashay Jaiswalf05bd552018-04-12 18:11:00 +0530309 struct work_struct jeita_update_work;
Harry Yang4b7db0f2017-11-27 10:50:44 -0800310 struct delayed_work ps_change_timeout_work;
311 struct delayed_work clear_hdc_work;
312 struct delayed_work icl_change_work;
313 struct delayed_work pl_enable_work;
314 struct delayed_work uusb_otg_work;
315 struct delayed_work bb_removal_work;
316
317 /* cached status */
318 int voltage_min_uv;
319 int voltage_max_uv;
320 int pd_active;
321 bool system_suspend_supported;
322 int boost_threshold_ua;
323 int system_temp_level;
324 int thermal_levels;
325 int *thermal_mitigation;
326 int dcp_icl_ua;
327 int fake_capacity;
328 int fake_batt_status;
329 bool step_chg_enabled;
330 bool sw_jeita_enabled;
331 bool is_hdc;
332 bool chg_done;
Ashay Jaiswala9e10912018-02-02 14:03:35 +0530333 int connector_type;
Harry Yang4b7db0f2017-11-27 10:50:44 -0800334 bool otg_en;
335 bool suspend_input_on_debug_batt;
336 int otg_attempts;
337 int vconn_attempts;
338 int default_icl_ua;
339 int otg_cl_ua;
340 bool uusb_apsd_rerun_done;
341 bool pd_hard_reset;
342 bool typec_present;
343 int fake_input_current_limited;
344 bool pr_swap_in_progress;
345 int typec_mode;
346 int usb_icl_change_irq_enabled;
347 u32 jeita_status;
348 u8 float_cfg;
349 bool use_extcon;
350 bool otg_present;
Ashay Jaiswala9e10912018-02-02 14:03:35 +0530351 int hw_max_icl_ua;
Anirudh Ghayal1380d312018-02-23 00:01:43 +0530352 int auto_recharge_soc;
Ashay Jaiswalf05bd552018-04-12 18:11:00 +0530353 bool jeita_configured;
Harry Yang4b7db0f2017-11-27 10:50:44 -0800354
355 /* workaround flag */
356 u32 wa_flags;
357 int boost_current_ua;
358
359 /* extcon for VBUS / ID notification to USB for uUSB */
360 struct extcon_dev *extcon;
361
362 /* battery profile */
363 int batt_profile_fcc_ua;
364 int batt_profile_fv_uv;
365
366 int usb_icl_delta_ua;
367 int pulse_cnt;
368
369 int die_health;
Ashay Jaiswal09feab82018-02-12 12:33:18 +0530370
371 /* flash */
372 u32 flash_derating_soc;
373 u32 flash_disable_soc;
374 u32 headroom_mode;
375 bool flash_init_done;
376 bool flash_active;
Harry Yang4b7db0f2017-11-27 10:50:44 -0800377};
378
379int smblib_read(struct smb_charger *chg, u16 addr, u8 *val);
380int smblib_masked_write(struct smb_charger *chg, u16 addr, u8 mask, u8 val);
381int smblib_write(struct smb_charger *chg, u16 addr, u8 val);
Anirudh Ghayal1380d312018-02-23 00:01:43 +0530382int smblib_batch_write(struct smb_charger *chg, u16 addr, u8 *val, int count);
383int smblib_batch_read(struct smb_charger *chg, u16 addr, u8 *val, int count);
Harry Yang4b7db0f2017-11-27 10:50:44 -0800384
385int smblib_get_charge_param(struct smb_charger *chg,
386 struct smb_chg_param *param, int *val_u);
387int smblib_get_usb_suspend(struct smb_charger *chg, int *suspend);
388
389int smblib_enable_charging(struct smb_charger *chg, bool enable);
390int smblib_set_charge_param(struct smb_charger *chg,
391 struct smb_chg_param *param, int val_u);
392int smblib_set_usb_suspend(struct smb_charger *chg, bool suspend);
393int smblib_set_dc_suspend(struct smb_charger *chg, bool suspend);
394
395int smblib_mapping_soc_from_field_value(struct smb_chg_param *param,
396 int val_u, u8 *val_raw);
397int smblib_mapping_cc_delta_to_field_value(struct smb_chg_param *param,
398 u8 val_raw);
399int smblib_mapping_cc_delta_from_field_value(struct smb_chg_param *param,
400 int val_u, u8 *val_raw);
401int smblib_set_chg_freq(struct smb_chg_param *param,
402 int val_u, u8 *val_raw);
Ashay Jaiswala9e10912018-02-02 14:03:35 +0530403int smblib_set_prop_boost_current(struct smb_charger *chg,
404 const union power_supply_propval *val);
Harry Yang4b7db0f2017-11-27 10:50:44 -0800405int smblib_vbus_regulator_enable(struct regulator_dev *rdev);
406int smblib_vbus_regulator_disable(struct regulator_dev *rdev);
407int smblib_vbus_regulator_is_enabled(struct regulator_dev *rdev);
408
409int smblib_vconn_regulator_enable(struct regulator_dev *rdev);
410int smblib_vconn_regulator_disable(struct regulator_dev *rdev);
411int smblib_vconn_regulator_is_enabled(struct regulator_dev *rdev);
412
413irqreturn_t default_irq_handler(int irq, void *data);
414irqreturn_t chg_state_change_irq_handler(int irq, void *data);
415irqreturn_t batt_temp_changed_irq_handler(int irq, void *data);
416irqreturn_t batt_psy_changed_irq_handler(int irq, void *data);
417irqreturn_t usbin_uv_irq_handler(int irq, void *data);
418irqreturn_t usb_plugin_irq_handler(int irq, void *data);
419irqreturn_t usb_source_change_irq_handler(int irq, void *data);
420irqreturn_t icl_change_irq_handler(int irq, void *data);
421irqreturn_t typec_state_change_irq_handler(int irq, void *data);
422irqreturn_t dc_plugin_irq_handler(int irq, void *data);
423irqreturn_t high_duty_cycle_irq_handler(int irq, void *data);
424irqreturn_t switcher_power_ok_irq_handler(int irq, void *data);
425irqreturn_t wdog_bark_irq_handler(int irq, void *data);
Ashay Jaiswala9e10912018-02-02 14:03:35 +0530426irqreturn_t typec_or_rid_detection_change_irq_handler(int irq, void *data);
Harry Yang4b7db0f2017-11-27 10:50:44 -0800427
428int smblib_get_prop_input_suspend(struct smb_charger *chg,
429 union power_supply_propval *val);
430int smblib_get_prop_batt_present(struct smb_charger *chg,
431 union power_supply_propval *val);
432int smblib_get_prop_batt_capacity(struct smb_charger *chg,
433 union power_supply_propval *val);
434int smblib_get_prop_batt_status(struct smb_charger *chg,
435 union power_supply_propval *val);
436int smblib_get_prop_batt_charge_type(struct smb_charger *chg,
437 union power_supply_propval *val);
438int smblib_get_prop_batt_charge_done(struct smb_charger *chg,
439 union power_supply_propval *val);
440int smblib_get_prop_batt_health(struct smb_charger *chg,
441 union power_supply_propval *val);
442int smblib_get_prop_system_temp_level(struct smb_charger *chg,
443 union power_supply_propval *val);
444int smblib_get_prop_system_temp_level_max(struct smb_charger *chg,
445 union power_supply_propval *val);
446int smblib_get_prop_input_current_limited(struct smb_charger *chg,
447 union power_supply_propval *val);
448int smblib_get_prop_batt_voltage_now(struct smb_charger *chg,
449 union power_supply_propval *val);
450int smblib_get_prop_batt_current_now(struct smb_charger *chg,
451 union power_supply_propval *val);
452int smblib_get_prop_batt_temp(struct smb_charger *chg,
453 union power_supply_propval *val);
454int smblib_get_prop_batt_charge_counter(struct smb_charger *chg,
455 union power_supply_propval *val);
456int smblib_set_prop_input_suspend(struct smb_charger *chg,
457 const union power_supply_propval *val);
458int smblib_set_prop_batt_capacity(struct smb_charger *chg,
459 const union power_supply_propval *val);
460int smblib_set_prop_batt_status(struct smb_charger *chg,
461 const union power_supply_propval *val);
462int smblib_set_prop_system_temp_level(struct smb_charger *chg,
463 const union power_supply_propval *val);
464int smblib_set_prop_input_current_limited(struct smb_charger *chg,
465 const union power_supply_propval *val);
466
467int smblib_get_prop_dc_present(struct smb_charger *chg,
468 union power_supply_propval *val);
469int smblib_get_prop_dc_online(struct smb_charger *chg,
470 union power_supply_propval *val);
471int smblib_get_prop_dc_current_max(struct smb_charger *chg,
472 union power_supply_propval *val);
473int smblib_set_prop_dc_current_max(struct smb_charger *chg,
474 const union power_supply_propval *val);
475int smblib_get_prop_usb_present(struct smb_charger *chg,
476 union power_supply_propval *val);
477int smblib_get_prop_usb_online(struct smb_charger *chg,
478 union power_supply_propval *val);
479int smblib_get_prop_usb_suspend(struct smb_charger *chg,
480 union power_supply_propval *val);
481int smblib_get_prop_usb_voltage_max(struct smb_charger *chg,
482 union power_supply_propval *val);
483int smblib_get_prop_typec_cc_orientation(struct smb_charger *chg,
484 union power_supply_propval *val);
485int smblib_get_prop_typec_power_role(struct smb_charger *chg,
486 union power_supply_propval *val);
487int smblib_get_prop_pd_allowed(struct smb_charger *chg,
488 union power_supply_propval *val);
489int smblib_get_prop_input_current_settled(struct smb_charger *chg,
490 union power_supply_propval *val);
491int smblib_get_prop_input_voltage_settled(struct smb_charger *chg,
492 union power_supply_propval *val);
493int smblib_get_prop_pd_in_hard_reset(struct smb_charger *chg,
494 union power_supply_propval *val);
495int smblib_get_pe_start(struct smb_charger *chg,
496 union power_supply_propval *val);
497int smblib_get_prop_die_health(struct smb_charger *chg,
498 union power_supply_propval *val);
499int smblib_set_prop_pd_current_max(struct smb_charger *chg,
500 const union power_supply_propval *val);
501int smblib_set_prop_sdp_current_max(struct smb_charger *chg,
502 const union power_supply_propval *val);
503int smblib_set_prop_pd_voltage_max(struct smb_charger *chg,
504 const union power_supply_propval *val);
505int smblib_set_prop_pd_voltage_min(struct smb_charger *chg,
506 const union power_supply_propval *val);
Harry Yang4b7db0f2017-11-27 10:50:44 -0800507int smblib_set_prop_typec_power_role(struct smb_charger *chg,
508 const union power_supply_propval *val);
509int smblib_set_prop_pd_active(struct smb_charger *chg,
510 const union power_supply_propval *val);
511int smblib_set_prop_pd_in_hard_reset(struct smb_charger *chg,
512 const union power_supply_propval *val);
513int smblib_set_prop_ship_mode(struct smb_charger *chg,
514 const union power_supply_propval *val);
515void smblib_suspend_on_debug_battery(struct smb_charger *chg);
516int smblib_rerun_apsd_if_required(struct smb_charger *chg);
517int smblib_get_prop_fcc_delta(struct smb_charger *chg,
518 union power_supply_propval *val);
Harry Yang4b7db0f2017-11-27 10:50:44 -0800519int smblib_dp_dm(struct smb_charger *chg, int val);
520int smblib_disable_hw_jeita(struct smb_charger *chg, bool disable);
521int smblib_rerun_aicl(struct smb_charger *chg);
522int smblib_set_icl_current(struct smb_charger *chg, int icl_ua);
523int smblib_get_icl_current(struct smb_charger *chg, int *icl_ua);
524int smblib_get_charge_current(struct smb_charger *chg, int *total_current_ua);
525int smblib_get_prop_pr_swap_in_progress(struct smb_charger *chg,
526 union power_supply_propval *val);
527int smblib_set_prop_pr_swap_in_progress(struct smb_charger *chg,
528 const union power_supply_propval *val);
529int smblib_stat_sw_override_cfg(struct smb_charger *chg, bool override);
Ashay Jaiswala55b7ed2018-03-23 17:23:48 +0530530int smblib_configure_wdog(struct smb_charger *chg, bool enable);
Ashay Jaiswal4d334f42018-04-25 10:58:49 +0530531int smblib_force_vbus_voltage(struct smb_charger *chg, u8 val);
Harry Yang4b7db0f2017-11-27 10:50:44 -0800532
533int smblib_init(struct smb_charger *chg);
534int smblib_deinit(struct smb_charger *chg);
535#endif /* __SMB5_CHARGER_H */