Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2016 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 __SMB2_CHARGER_H |
| 14 | #define __SMB2_CHARGER_H |
| 15 | #include <linux/types.h> |
| 16 | #include <linux/irqreturn.h> |
| 17 | #include <linux/regulator/driver.h> |
| 18 | #include <linux/regulator/consumer.h> |
Nicholas Troast | 47ae461 | 2016-08-03 09:49:36 -0700 | [diff] [blame] | 19 | #include "storm-watch.h" |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 20 | |
| 21 | enum print_reason { |
| 22 | PR_INTERRUPT = BIT(0), |
| 23 | PR_REGISTER = BIT(1), |
| 24 | PR_MISC = BIT(2), |
| 25 | }; |
| 26 | |
Harry Yang | 995b742 | 2016-08-29 16:06:50 -0700 | [diff] [blame] | 27 | #define DEFAULT_VOTER "DEFAULT_VOTER" |
| 28 | #define USER_VOTER "USER_VOTER" |
| 29 | #define PD_VOTER "PD_VOTER" |
| 30 | #define PL_TAPER_WORK_RUNNING_VOTER "PL_TAPER_WORK_RUNNING_VOTER" |
| 31 | #define PARALLEL_PSY_VOTER "PARALLEL_PSY_VOTER" |
Harry Yang | aba1f5f | 2016-09-28 10:47:29 -0700 | [diff] [blame] | 32 | #define PL_INDIRECT_VOTER "PL_INDIRECT_VOTER" |
| 33 | #define USBIN_I_VOTER "USBIN_I_VOTER" |
| 34 | #define USBIN_V_VOTER "USBIN_V_VOTER" |
Harry Yang | 995b742 | 2016-08-29 16:06:50 -0700 | [diff] [blame] | 35 | #define CHG_STATE_VOTER "CHG_STATE_VOTER" |
| 36 | #define TYPEC_SRC_VOTER "TYPEC_SRC_VOTER" |
| 37 | #define TAPER_END_VOTER "TAPER_END_VOTER" |
Harry Yang | aba1f5f | 2016-09-28 10:47:29 -0700 | [diff] [blame] | 38 | #define FCC_MAX_RESULT_VOTER "FCC_MAX_RESULT_VOTER" |
| 39 | #define THERMAL_DAEMON_VOTER "THERMAL_DAEMON_VOTER" |
Abhijeet Dharmapurikar | 4b13c6e | 2016-10-05 15:15:10 -0700 | [diff] [blame] | 40 | #define CC_DETACHED_VOTER "CC_DETACHED_VOTER" |
| 41 | #define HVDCP_TIMEOUT_VOTER "HVDCP_TIMEOUT_VOTER" |
| 42 | #define PD_DISALLOWED_INDIRECT_VOTER "PD_DISALLOWED_INDIRECT_VOTER" |
Abhijeet Dharmapurikar | f8a7a4a | 2016-10-07 18:46:45 -0700 | [diff] [blame^] | 43 | #define PD_HARD_RESET_VOTER "PD_HARD_RESET_VOTER" |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 44 | |
Nicholas Troast | 320839e | 2016-06-03 10:18:00 -0700 | [diff] [blame] | 45 | enum smb_mode { |
| 46 | PARALLEL_MASTER = 0, |
| 47 | PARALLEL_SLAVE, |
| 48 | NUM_MODES, |
| 49 | }; |
| 50 | |
Harry Yang | 1369b7a | 2016-09-27 15:59:50 -0700 | [diff] [blame] | 51 | enum { |
| 52 | QC_CHARGER_DETECTION_WA_BIT = BIT(0), |
| 53 | }; |
| 54 | |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 55 | struct smb_regulator { |
| 56 | struct regulator_dev *rdev; |
| 57 | struct regulator_desc rdesc; |
| 58 | }; |
| 59 | |
| 60 | struct smb_irq_data { |
Nicholas Troast | 47ae461 | 2016-08-03 09:49:36 -0700 | [diff] [blame] | 61 | void *parent_data; |
| 62 | const char *name; |
| 63 | struct storm_watch storm_data; |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 64 | }; |
| 65 | |
| 66 | struct smb_chg_param { |
| 67 | const char *name; |
| 68 | u16 reg; |
| 69 | int min_u; |
| 70 | int max_u; |
| 71 | int step_u; |
Harry Yang | f8b4125 | 2016-08-10 14:21:10 -0700 | [diff] [blame] | 72 | int (*get_proc)(struct smb_chg_param *param, |
| 73 | u8 val_raw); |
| 74 | int (*set_proc)(struct smb_chg_param *param, |
| 75 | int val_u, |
| 76 | u8 *val_raw); |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 77 | }; |
| 78 | |
| 79 | struct smb_params { |
| 80 | struct smb_chg_param fcc; |
| 81 | struct smb_chg_param fv; |
| 82 | struct smb_chg_param usb_icl; |
Harry Yang | 1d1034c | 2016-06-15 12:09:42 -0700 | [diff] [blame] | 83 | struct smb_chg_param icl_stat; |
Harry Yang | 360bd53 | 2016-09-26 11:03:22 -0700 | [diff] [blame] | 84 | struct smb_chg_param otg_cl; |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 85 | struct smb_chg_param dc_icl; |
Abhijeet Dharmapurikar | 5cf5faf | 2016-06-21 14:20:24 -0700 | [diff] [blame] | 86 | struct smb_chg_param dc_icl_pt_lv; |
| 87 | struct smb_chg_param dc_icl_pt_hv; |
| 88 | struct smb_chg_param dc_icl_div2_lv; |
| 89 | struct smb_chg_param dc_icl_div2_mid_lv; |
| 90 | struct smb_chg_param dc_icl_div2_mid_hv; |
| 91 | struct smb_chg_param dc_icl_div2_hv; |
Abhijeet Dharmapurikar | 2644cd6 | 2016-07-20 16:54:55 -0700 | [diff] [blame] | 92 | struct smb_chg_param jeita_cc_comp; |
Harry Yang | fe91384 | 2016-08-10 12:27:28 -0700 | [diff] [blame] | 93 | struct smb_chg_param step_soc_threshold[4]; |
| 94 | struct smb_chg_param step_soc; |
| 95 | struct smb_chg_param step_cc_delta[5]; |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 96 | }; |
| 97 | |
Harry Yang | 1d1034c | 2016-06-15 12:09:42 -0700 | [diff] [blame] | 98 | struct parallel_params { |
| 99 | struct power_supply *psy; |
| 100 | int *master_percent; |
| 101 | int taper_percent; |
| 102 | int slave_fcc; |
| 103 | }; |
| 104 | |
Harry Yang | ba874ce | 2016-08-19 14:17:01 -0700 | [diff] [blame] | 105 | struct smb_iio { |
| 106 | struct iio_channel *temp_chan; |
| 107 | struct iio_channel *temp_max_chan; |
| 108 | struct iio_channel *usbin_i_chan; |
| 109 | struct iio_channel *usbin_v_chan; |
Nicholas Troast | 7dbcad2 | 2016-10-05 13:30:18 -0700 | [diff] [blame] | 110 | struct iio_channel *batt_i_chan; |
Harry Yang | ba874ce | 2016-08-19 14:17:01 -0700 | [diff] [blame] | 111 | }; |
| 112 | |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 113 | struct smb_charger { |
| 114 | struct device *dev; |
| 115 | struct regmap *regmap; |
| 116 | struct smb_params param; |
Harry Yang | ba874ce | 2016-08-19 14:17:01 -0700 | [diff] [blame] | 117 | struct smb_iio iio; |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 118 | int *debug_mask; |
Nicholas Troast | 320839e | 2016-06-03 10:18:00 -0700 | [diff] [blame] | 119 | enum smb_mode mode; |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 120 | |
| 121 | /* locks */ |
Harry Yang | bacd222 | 2016-05-11 16:43:51 -0700 | [diff] [blame] | 122 | struct mutex write_lock; |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 123 | struct mutex ps_change_lock; |
| 124 | |
| 125 | /* power supplies */ |
| 126 | struct power_supply *batt_psy; |
| 127 | struct power_supply *usb_psy; |
Harry Yang | f302359 | 2016-07-20 14:56:41 -0700 | [diff] [blame] | 128 | struct power_supply *dc_psy; |
Harry Yang | 5e1a522 | 2016-07-26 15:16:04 -0700 | [diff] [blame] | 129 | struct power_supply *bms_psy; |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 130 | struct power_supply_desc usb_psy_desc; |
| 131 | |
Harry Yang | 5e1a522 | 2016-07-26 15:16:04 -0700 | [diff] [blame] | 132 | /* notifiers */ |
| 133 | struct notifier_block nb; |
| 134 | |
Harry Yang | 1d1034c | 2016-06-15 12:09:42 -0700 | [diff] [blame] | 135 | /* parallel charging */ |
| 136 | struct parallel_params pl; |
| 137 | |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 138 | /* regulators */ |
| 139 | struct smb_regulator *vbus_vreg; |
| 140 | struct smb_regulator *vconn_vreg; |
| 141 | struct regulator *dpdm_reg; |
| 142 | |
| 143 | /* votables */ |
| 144 | struct votable *usb_suspend_votable; |
| 145 | struct votable *dc_suspend_votable; |
Abhijeet Dharmapurikar | 99fb894 | 2016-07-08 11:39:23 -0700 | [diff] [blame] | 146 | struct votable *fcc_max_votable; |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 147 | struct votable *fcc_votable; |
Abhijeet Dharmapurikar | f9805d4 | 2016-05-17 18:38:42 -0700 | [diff] [blame] | 148 | struct votable *fv_votable; |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 149 | struct votable *usb_icl_votable; |
| 150 | struct votable *dc_icl_votable; |
Abhijeet Dharmapurikar | 4b13c6e | 2016-10-05 15:15:10 -0700 | [diff] [blame] | 151 | struct votable *pd_disallowed_votable_indirect; |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 152 | struct votable *pd_allowed_votable; |
Harry Yang | 1d1034c | 2016-06-15 12:09:42 -0700 | [diff] [blame] | 153 | struct votable *awake_votable; |
| 154 | struct votable *pl_disable_votable; |
Abhijeet Dharmapurikar | ee54de0 | 2016-07-08 14:51:47 -0700 | [diff] [blame] | 155 | struct votable *chg_disable_votable; |
Harry Yang | aba1f5f | 2016-09-28 10:47:29 -0700 | [diff] [blame] | 156 | struct votable *pl_enable_votable_indirect; |
Abhijeet Dharmapurikar | f0b0a04 | 2016-10-10 16:43:43 -0700 | [diff] [blame] | 157 | struct votable *hvdcp_disable_votable; |
Abhijeet Dharmapurikar | f8a7a4a | 2016-10-07 18:46:45 -0700 | [diff] [blame^] | 158 | struct votable *apsd_disable_votable; |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 159 | |
| 160 | /* work */ |
Harry Yang | 5e1a522 | 2016-07-26 15:16:04 -0700 | [diff] [blame] | 161 | struct work_struct bms_update_work; |
Harry Yang | 58a9e7a | 2016-06-23 14:54:43 -0700 | [diff] [blame] | 162 | struct work_struct pl_detect_work; |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 163 | struct delayed_work hvdcp_detect_work; |
| 164 | struct delayed_work ps_change_timeout_work; |
Harry Yang | 1d1034c | 2016-06-15 12:09:42 -0700 | [diff] [blame] | 165 | struct delayed_work pl_taper_work; |
Harry Yang | fe91384 | 2016-08-10 12:27:28 -0700 | [diff] [blame] | 166 | struct delayed_work step_soc_req_work; |
Abhijeet Dharmapurikar | 0e36900 | 2016-09-07 17:25:36 -0700 | [diff] [blame] | 167 | struct delayed_work clear_hdc_work; |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 168 | |
| 169 | /* cached status */ |
| 170 | int voltage_min_uv; |
| 171 | int voltage_max_uv; |
| 172 | bool pd_active; |
| 173 | bool vbus_present; |
Abhijeet Dharmapurikar | 99fb894 | 2016-07-08 11:39:23 -0700 | [diff] [blame] | 174 | |
| 175 | int system_temp_level; |
| 176 | int thermal_levels; |
| 177 | int *thermal_mitigation; |
Abhijeet Dharmapurikar | 9e7e48c | 2016-08-23 12:55:49 -0700 | [diff] [blame] | 178 | |
Harry Yang | 360bd53 | 2016-09-26 11:03:22 -0700 | [diff] [blame] | 179 | int otg_cl_ua; |
| 180 | |
Abhijeet Dharmapurikar | 9e7e48c | 2016-08-23 12:55:49 -0700 | [diff] [blame] | 181 | int fake_capacity; |
Harry Yang | fe91384 | 2016-08-10 12:27:28 -0700 | [diff] [blame] | 182 | |
| 183 | bool step_chg_enabled; |
Abhijeet Dharmapurikar | 0e36900 | 2016-09-07 17:25:36 -0700 | [diff] [blame] | 184 | bool is_hdc; |
Subbaraman Narayanamurthy | 270a265 | 2016-10-04 17:08:42 -0700 | [diff] [blame] | 185 | bool chg_done; |
Harry Yang | f725198 | 2016-09-16 11:14:49 -0700 | [diff] [blame] | 186 | |
| 187 | /* workaround flag */ |
| 188 | u32 wa_flags; |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 189 | }; |
| 190 | |
| 191 | int smblib_read(struct smb_charger *chg, u16 addr, u8 *val); |
| 192 | int smblib_masked_write(struct smb_charger *chg, u16 addr, u8 mask, u8 val); |
| 193 | int smblib_write(struct smb_charger *chg, u16 addr, u8 val); |
| 194 | |
Nicholas Troast | 4c31049 | 2016-05-12 17:56:35 -0700 | [diff] [blame] | 195 | int smblib_get_charge_param(struct smb_charger *chg, |
| 196 | struct smb_chg_param *param, int *val_u); |
| 197 | int smblib_get_usb_suspend(struct smb_charger *chg, int *suspend); |
| 198 | |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 199 | int smblib_enable_charging(struct smb_charger *chg, bool enable); |
Nicholas Troast | 4c31049 | 2016-05-12 17:56:35 -0700 | [diff] [blame] | 200 | int smblib_set_charge_param(struct smb_charger *chg, |
| 201 | struct smb_chg_param *param, int val_u); |
| 202 | int smblib_set_usb_suspend(struct smb_charger *chg, bool suspend); |
| 203 | int smblib_set_dc_suspend(struct smb_charger *chg, bool suspend); |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 204 | |
Harry Yang | fe91384 | 2016-08-10 12:27:28 -0700 | [diff] [blame] | 205 | int smblib_mapping_soc_from_field_value(struct smb_chg_param *param, |
| 206 | int val_u, u8 *val_raw); |
| 207 | int smblib_mapping_cc_delta_to_field_value(struct smb_chg_param *param, |
| 208 | u8 val_raw); |
| 209 | int smblib_mapping_cc_delta_from_field_value(struct smb_chg_param *param, |
| 210 | int val_u, u8 *val_raw); |
| 211 | |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 212 | int smblib_vbus_regulator_enable(struct regulator_dev *rdev); |
| 213 | int smblib_vbus_regulator_disable(struct regulator_dev *rdev); |
| 214 | int smblib_vbus_regulator_is_enabled(struct regulator_dev *rdev); |
| 215 | |
| 216 | int smblib_vconn_regulator_enable(struct regulator_dev *rdev); |
| 217 | int smblib_vconn_regulator_disable(struct regulator_dev *rdev); |
| 218 | int smblib_vconn_regulator_is_enabled(struct regulator_dev *rdev); |
| 219 | |
| 220 | irqreturn_t smblib_handle_debug(int irq, void *data); |
Harry Yang | 6fe72ab | 2016-06-14 16:21:39 -0700 | [diff] [blame] | 221 | irqreturn_t smblib_handle_chg_state_change(int irq, void *data); |
Harry Yang | fe91384 | 2016-08-10 12:27:28 -0700 | [diff] [blame] | 222 | irqreturn_t smblib_handle_step_chg_state_change(int irq, void *data); |
| 223 | irqreturn_t smblib_handle_step_chg_soc_update_fail(int irq, void *data); |
| 224 | irqreturn_t smblib_handle_step_chg_soc_update_request(int irq, void *data); |
Abhijeet Dharmapurikar | 2644cd6 | 2016-07-20 16:54:55 -0700 | [diff] [blame] | 225 | irqreturn_t smblib_handle_batt_temp_changed(int irq, void *data); |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 226 | irqreturn_t smblib_handle_batt_psy_changed(int irq, void *data); |
| 227 | irqreturn_t smblib_handle_usb_psy_changed(int irq, void *data); |
| 228 | irqreturn_t smblib_handle_usb_plugin(int irq, void *data); |
| 229 | irqreturn_t smblib_handle_usb_source_change(int irq, void *data); |
Harry Yang | 6fe72ab | 2016-06-14 16:21:39 -0700 | [diff] [blame] | 230 | irqreturn_t smblib_handle_icl_change(int irq, void *data); |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 231 | irqreturn_t smblib_handle_usb_typec_change(int irq, void *data); |
Abhijeet Dharmapurikar | 0e36900 | 2016-09-07 17:25:36 -0700 | [diff] [blame] | 232 | irqreturn_t smblib_handle_high_duty_cycle(int irq, void *data); |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 233 | |
| 234 | int smblib_get_prop_input_suspend(struct smb_charger *chg, |
| 235 | union power_supply_propval *val); |
| 236 | int smblib_get_prop_batt_present(struct smb_charger *chg, |
| 237 | union power_supply_propval *val); |
| 238 | int smblib_get_prop_batt_capacity(struct smb_charger *chg, |
| 239 | union power_supply_propval *val); |
| 240 | int smblib_get_prop_batt_status(struct smb_charger *chg, |
| 241 | union power_supply_propval *val); |
| 242 | int smblib_get_prop_batt_charge_type(struct smb_charger *chg, |
| 243 | union power_supply_propval *val); |
Subbaraman Narayanamurthy | b491d02 | 2016-10-10 20:22:48 -0700 | [diff] [blame] | 244 | int smblib_get_prop_batt_charge_done(struct smb_charger *chg, |
| 245 | union power_supply_propval *val); |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 246 | int smblib_get_prop_batt_health(struct smb_charger *chg, |
| 247 | union power_supply_propval *val); |
Abhijeet Dharmapurikar | 99fb894 | 2016-07-08 11:39:23 -0700 | [diff] [blame] | 248 | int smblib_get_prop_system_temp_level(struct smb_charger *chg, |
| 249 | union power_supply_propval *val); |
Abhijeet Dharmapurikar | 0e36900 | 2016-09-07 17:25:36 -0700 | [diff] [blame] | 250 | int smblib_get_prop_input_current_limited(struct smb_charger *chg, |
| 251 | union power_supply_propval *val); |
Nicholas Troast | 66b21d7 | 2016-09-20 15:33:20 -0700 | [diff] [blame] | 252 | int smblib_get_prop_batt_voltage_now(struct smb_charger *chg, |
| 253 | union power_supply_propval *val); |
| 254 | int smblib_get_prop_batt_current_now(struct smb_charger *chg, |
| 255 | union power_supply_propval *val); |
| 256 | int smblib_get_prop_batt_temp(struct smb_charger *chg, |
| 257 | union power_supply_propval *val); |
Harry Yang | bedee33 | 2016-08-31 16:14:29 -0700 | [diff] [blame] | 258 | int smblib_get_prop_step_chg_step(struct smb_charger *chg, |
| 259 | union power_supply_propval *val); |
Abhijeet Dharmapurikar | 99fb894 | 2016-07-08 11:39:23 -0700 | [diff] [blame] | 260 | |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 261 | int smblib_set_prop_input_suspend(struct smb_charger *chg, |
| 262 | const union power_supply_propval *val); |
Abhijeet Dharmapurikar | 9e7e48c | 2016-08-23 12:55:49 -0700 | [diff] [blame] | 263 | int smblib_set_prop_batt_capacity(struct smb_charger *chg, |
| 264 | const union power_supply_propval *val); |
Abhijeet Dharmapurikar | 99fb894 | 2016-07-08 11:39:23 -0700 | [diff] [blame] | 265 | int smblib_set_prop_system_temp_level(struct smb_charger *chg, |
| 266 | const union power_supply_propval *val); |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 267 | |
Harry Yang | f302359 | 2016-07-20 14:56:41 -0700 | [diff] [blame] | 268 | int smblib_get_prop_dc_present(struct smb_charger *chg, |
| 269 | union power_supply_propval *val); |
| 270 | int smblib_get_prop_dc_online(struct smb_charger *chg, |
| 271 | union power_supply_propval *val); |
| 272 | int smblib_get_prop_dc_current_max(struct smb_charger *chg, |
| 273 | union power_supply_propval *val); |
| 274 | int smblib_set_prop_dc_current_max(struct smb_charger *chg, |
| 275 | const union power_supply_propval *val); |
| 276 | |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 277 | int smblib_get_prop_usb_present(struct smb_charger *chg, |
| 278 | union power_supply_propval *val); |
| 279 | int smblib_get_prop_usb_online(struct smb_charger *chg, |
| 280 | union power_supply_propval *val); |
| 281 | int smblib_get_prop_usb_suspend(struct smb_charger *chg, |
| 282 | union power_supply_propval *val); |
| 283 | int smblib_get_prop_usb_voltage_now(struct smb_charger *chg, |
| 284 | union power_supply_propval *val); |
| 285 | int smblib_get_prop_usb_current_max(struct smb_charger *chg, |
| 286 | union power_supply_propval *val); |
Harry Yang | ba874ce | 2016-08-19 14:17:01 -0700 | [diff] [blame] | 287 | int smblib_get_prop_usb_current_now(struct smb_charger *chg, |
| 288 | union power_supply_propval *val); |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 289 | int smblib_get_prop_typec_cc_orientation(struct smb_charger *chg, |
| 290 | union power_supply_propval *val); |
| 291 | int smblib_get_prop_typec_mode(struct smb_charger *chg, |
| 292 | union power_supply_propval *val); |
| 293 | int smblib_get_prop_typec_power_role(struct smb_charger *chg, |
| 294 | union power_supply_propval *val); |
| 295 | int smblib_get_prop_pd_allowed(struct smb_charger *chg, |
| 296 | union power_supply_propval *val); |
Nicholas Troast | 133a7f5 | 2016-06-29 13:48:20 -0700 | [diff] [blame] | 297 | int smblib_get_prop_input_current_settled(struct smb_charger *chg, |
| 298 | union power_supply_propval *val); |
Abhijeet Dharmapurikar | f8a7a4a | 2016-10-07 18:46:45 -0700 | [diff] [blame^] | 299 | int smblib_get_prop_pd_in_hard_reset(struct smb_charger *chg, |
| 300 | union power_supply_propval *val); |
Harry Yang | ba874ce | 2016-08-19 14:17:01 -0700 | [diff] [blame] | 301 | int smblib_get_prop_charger_temp(struct smb_charger *chg, |
| 302 | union power_supply_propval *val); |
| 303 | int smblib_get_prop_charger_temp_max(struct smb_charger *chg, |
| 304 | union power_supply_propval *val); |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 305 | int smblib_set_prop_usb_current_max(struct smb_charger *chg, |
| 306 | const union power_supply_propval *val); |
| 307 | int smblib_set_prop_usb_voltage_min(struct smb_charger *chg, |
| 308 | const union power_supply_propval *val); |
| 309 | int smblib_set_prop_usb_voltage_max(struct smb_charger *chg, |
| 310 | const union power_supply_propval *val); |
| 311 | int smblib_set_prop_typec_power_role(struct smb_charger *chg, |
| 312 | const union power_supply_propval *val); |
| 313 | int smblib_set_prop_pd_active(struct smb_charger *chg, |
| 314 | const union power_supply_propval *val); |
Abhijeet Dharmapurikar | f8a7a4a | 2016-10-07 18:46:45 -0700 | [diff] [blame^] | 315 | int smblib_set_prop_pd_in_hard_reset(struct smb_charger *chg, |
| 316 | const union power_supply_propval *val); |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 317 | |
Nicholas Troast | 7dbcad2 | 2016-10-05 13:30:18 -0700 | [diff] [blame] | 318 | int smblib_get_prop_slave_current_now(struct smb_charger *chg, |
| 319 | union power_supply_propval *val); |
| 320 | |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 321 | int smblib_init(struct smb_charger *chg); |
Abhijeet Dharmapurikar | 8e9e757 | 2016-06-06 16:13:14 -0700 | [diff] [blame] | 322 | int smblib_deinit(struct smb_charger *chg); |
Nicholas Troast | 34db503 | 2016-03-28 12:26:44 -0700 | [diff] [blame] | 323 | #endif /* __SMB2_CHARGER_H */ |