Lines Matching +full:7 +full:- +full:bit

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
7 * This driver is for the switch-mode battery charger and boost
12 #include <linux/devm-helpers.h>
26 /* clang-format off */
28 #define BVR_INITIAL_RAMP_BIT BIT(7)
29 #define CC_SOFT_TERMINATE_BIT BIT(6)
35 #define INPUT_CURRENT_LIMITED_BIT BIT(7)
36 #define CHARGER_ERROR_STATUS_SFT_EXPIRE_BIT BIT(6)
37 #define CHARGER_ERROR_STATUS_BAT_OV_BIT BIT(5)
38 #define CHARGER_ERROR_STATUS_BAT_TERM_MISSING_BIT BIT(4)
41 #define BAT_TEMP_STATUS_HOT_SOFT_LIMIT_BIT BIT(3)
42 #define BAT_TEMP_STATUS_COLD_SOFT_LIMIT_BIT BIT(2)
43 #define BAT_TEMP_STATUS_TOO_HOT_BIT BIT(1)
44 #define BAT_TEMP_STATUS_TOO_COLD_BIT BIT(0)
47 #define CHARGE_CURRENT_POST_JEITA_MASK GENMASK(7, 0)
50 #define ENABLE_TRICKLE_BIT BIT(7)
51 #define ENABLE_PRE_CHARGING_BIT BIT(6)
52 #define ENABLE_FAST_CHARGING_BIT BIT(5)
53 #define ENABLE_FULLON_MODE_BIT BIT(4)
54 #define TOO_COLD_ADC_BIT BIT(3)
55 #define TOO_HOT_ADC_BIT BIT(2)
56 #define HOT_SL_ADC_BIT BIT(1)
57 #define COLD_SL_ADC_BIT BIT(0)
60 #define CHARGING_ENABLE_CMD_BIT BIT(0)
63 #define CHG_EN_SRC_BIT BIT(7)
64 #define CHG_EN_POLARITY_BIT BIT(6)
65 #define PRETOFAST_TRANSITION_CFG_BIT BIT(5)
66 #define BAT_OV_ECC_BIT BIT(4)
67 #define I_TERM_BIT BIT(3)
68 #define AUTO_RECHG_BIT BIT(2)
69 #define EN_ANALOG_DROP_IN_VBATT_BIT BIT(1)
70 #define CHARGER_INHIBIT_BIT BIT(0)
76 #define FAST_CHARGE_CURRENT_SETTING_MASK GENMASK(7, 0)
79 #define FLOAT_VOLTAGE_SETTING_MASK GENMASK(7, 0)
82 #define SOC_LT_OTG_THRESH_SEL_BIT BIT(3)
83 #define SOC_LT_CHG_RECHARGE_THRESH_SEL_BIT BIT(2)
84 #define VBT_LT_CHG_RECHARGE_THRESH_SEL_BIT BIT(1)
85 #define IBT_LT_CHG_TERM_THRESH_SEL_BIT BIT(0)
88 #define JEITA_EN_HARDLIMIT_BIT BIT(4)
89 #define JEITA_EN_HOT_SL_FCV_BIT BIT(3)
90 #define JEITA_EN_COLD_SL_FCV_BIT BIT(2)
91 #define JEITA_EN_HOT_SL_CCC_BIT BIT(1)
92 #define JEITA_EN_COLD_SL_CCC_BIT BIT(0)
95 #define TYPE_C_CHANGE_RT_STS_BIT BIT(7)
96 #define USBIN_ICL_CHANGE_RT_STS_BIT BIT(6)
97 #define USBIN_SOURCE_CHANGE_RT_STS_BIT BIT(5)
98 #define USBIN_PLUGIN_RT_STS_BIT BIT(4)
99 #define USBIN_OV_RT_STS_BIT BIT(3)
100 #define USBIN_UV_RT_STS_BIT BIT(2)
101 #define USBIN_LT_3P6V_RT_STS_BIT BIT(1)
102 #define USBIN_COLLAPSE_RT_STS_BIT BIT(0)
105 #define OTG_RESERVED_MASK GENMASK(7, 6)
106 #define DIS_OTG_ON_TLIM_BIT BIT(5)
107 #define QUICKSTART_OTG_FASTROLESWAP_BIT BIT(4)
108 #define INCREASE_DFP_TIME_BIT BIT(3)
109 #define ENABLE_OTG_IN_DEBUG_MODE_BIT BIT(2)
110 #define OTG_EN_SRC_CFG_BIT BIT(1)
111 #define CONCURRENT_MODE_CFG_BIT BIT(0)
114 #define ENG_BUCKBOOST_HALT1_8_MODE_BIT BIT(0)
117 #define APSD_STATUS_7_BIT BIT(7)
118 #define HVDCP_CHECK_TIMEOUT_BIT BIT(6)
119 #define SLOW_PLUGIN_TIMEOUT_BIT BIT(5)
120 #define ENUMERATION_DONE_BIT BIT(4)
121 #define VADP_CHANGE_DONE_AFTER_AUTH_BIT BIT(3)
122 #define QC_AUTH_DONE_STATUS_BIT BIT(2)
123 #define QC_CHARGER_BIT BIT(1)
124 #define APSD_DTC_STATUS_DONE_BIT BIT(0)
127 #define ICL_OVERRIDE_LATCH_BIT BIT(7)
129 #define QC_3P0_BIT BIT(6)
130 #define QC_2P0_BIT BIT(5)
131 #define FLOAT_CHARGER_BIT BIT(4)
132 #define DCP_CHARGER_BIT BIT(3)
133 #define CDP_CHARGER_BIT BIT(2)
134 #define OCP_CHARGER_BIT BIT(1)
135 #define SDP_CHARGER_BIT BIT(0)
138 #define UFP_TYPEC_MASK GENMASK(7, 5)
139 #define UFP_TYPEC_RDSTD_BIT BIT(7)
140 #define UFP_TYPEC_RD1P5_BIT BIT(6)
141 #define UFP_TYPEC_RD3P0_BIT BIT(5)
142 #define UFP_TYPEC_FMB_255K_BIT BIT(4)
143 #define UFP_TYPEC_FMB_301K_BIT BIT(3)
144 #define UFP_TYPEC_FMB_523K_BIT BIT(2)
145 #define UFP_TYPEC_FMB_619K_BIT BIT(1)
146 #define UFP_TYPEC_OPEN_OPEN_BIT BIT(0)
149 #define DFP_RA_OPEN_BIT BIT(7)
150 #define TIMER_STAGE_BIT BIT(6)
151 #define EXIT_UFP_MODE_BIT BIT(5)
152 #define EXIT_DFP_MODE_BIT BIT(4)
154 #define DFP_RD_OPEN_BIT BIT(3)
155 #define DFP_RD_RA_VCONN_BIT BIT(2)
156 #define DFP_RD_RD_BIT BIT(1)
157 #define DFP_RA_RA_BIT BIT(0)
160 #define ENABLE_BANDGAP_BIT BIT(7)
161 #define U_USB_GND_NOVBUS_BIT BIT(6)
162 #define U_USB_FLOAT_NOVBUS_BIT BIT(5)
163 #define U_USB_GND_BIT BIT(4)
164 #define U_USB_FMB1_BIT BIT(3)
165 #define U_USB_FLOAT1_BIT BIT(2)
166 #define U_USB_FMB2_BIT BIT(1)
167 #define U_USB_FLOAT2_BIT BIT(0)
170 #define UFP_DFP_MODE_STATUS_BIT BIT(7)
171 #define TYPEC_VBUS_STATUS_BIT BIT(6)
172 #define TYPEC_VBUS_ERROR_STATUS_BIT BIT(5)
173 #define TYPEC_DEBOUNCE_DONE_STATUS_BIT BIT(4)
174 #define TYPEC_UFP_AUDIO_ADAPT_STATUS_BIT BIT(3)
175 #define TYPEC_VCONN_OVERCURR_STATUS_BIT BIT(2)
176 #define CC_ORIENTATION_BIT BIT(1)
177 #define CC_ATTACHED_BIT BIT(0)
180 #define TRY_SOURCE_FAILED_BIT BIT(6)
181 #define TRY_SINK_FAILED_BIT BIT(5)
182 #define TIMER_STAGE_2_BIT BIT(4)
183 #define TYPEC_LEGACY_CABLE_STATUS_BIT BIT(3)
184 #define TYPEC_NONCOMP_LEGACY_CABLE_STATUS_BIT BIT(2)
185 #define TYPEC_TRYSOURCE_DETECT_STATUS_BIT BIT(1)
186 #define TYPEC_TRYSINK_DETECT_STATUS_BIT BIT(0)
189 #define ICL_OVERRIDE_BIT BIT(1)
190 #define APSD_RERUN_BIT BIT(0)
193 #define APSD_START_ON_CC_BIT BIT(7)
194 #define WAIT_FOR_APSD_BIT BIT(6)
195 #define FACTORY_MODE_DETECTION_EN_BIT BIT(5)
196 #define FACTORY_MODE_ICL_3A_4A_BIT BIT(4)
197 #define FACTORY_MODE_DIS_CHGING_CFG_BIT BIT(3)
198 #define SUSPEND_NON_COMPLIANT_CFG_BIT BIT(2)
199 #define VCONN_OC_CFG_BIT BIT(1)
200 #define TYPE_C_OR_U_USB_BIT BIT(0)
203 #define TYPE_C_DFP_CURRSRC_MODE_BIT BIT(7)
204 #define DFP_CC_1P4V_OR_1P6V_BIT BIT(6)
206 #define EN_TRY_SOURCE_MODE_BIT BIT(3)
207 #define USB_FACTORY_MODE_ENABLE_BIT BIT(2)
208 #define TYPE_C_UFP_MODE_BIT BIT(1)
209 #define EN_80UA_180UA_CUR_SOURCE_BIT BIT(0)
212 #define TVBUS_DEBOUNCE_BIT BIT(7)
213 #define TYPEC_LEGACY_CABLE_INT_EN_BIT BIT(6)
214 #define TYPEC_NONCOMPLIANT_LEGACY_CABLE_INT_EN_B BIT(5)
215 #define TYPEC_TRYSOURCE_DETECT_INT_EN_BIT BIT(4)
216 #define TYPEC_TRYSINK_DETECT_INT_EN_BIT BIT(3)
217 #define EN_TRYSINK_MODE_BIT BIT(2)
218 #define EN_LEGACY_CABLE_DETECTION_BIT BIT(1)
219 #define ALLOW_PD_DRING_UFP_TCCDB_BIT BIT(0)
222 #define CABLE_R_SEL_BIT BIT(7)
223 #define HVDCP_AUTH_ALG_EN_CFG_BIT BIT(6)
224 #define HVDCP_AUTONOMOUS_MODE_EN_CFG_BIT BIT(5)
225 #define INPUT_PRIORITY_BIT BIT(4)
226 #define AUTO_SRC_DETECT_BIT BIT(3)
227 #define HVDCP_EN_BIT BIT(2)
228 #define VADP_INCREMENT_VOLTAGE_LIMIT_BIT BIT(1)
229 #define VADP_TAPER_TIMER_EN_BIT BIT(0)
232 #define WIPWR_RST_EUD_CFG_BIT BIT(7)
233 #define SWITCHER_START_CFG_BIT BIT(6)
234 #define DCD_TIMEOUT_SEL_BIT BIT(5)
235 #define OCD_CURRENT_SEL_BIT BIT(4)
236 #define SLOW_PLUGIN_TIMER_EN_CFG_BIT BIT(3)
238 #define FLOAT_DIS_CHGING_CFG_BIT BIT(2)
239 #define SUSPEND_FLOAT_CFG_BIT BIT(1)
240 #define FORCE_FLOAT_SDP_CFG_BIT BIT(0)
243 #define TYPEC_SPARE_CFG_BIT BIT(7)
244 #define TYPEC_DRP_DFP_TIME_CFG_BIT BIT(5)
248 #define USBIN_OV_CH_LOAD_OPTION_BIT BIT(7)
249 #define ICL_OVERRIDE_AFTER_APSD_BIT BIT(4)
252 #define CFG_USB3P0_SEL_BIT BIT(2)
253 #define USB51_MODE_BIT BIT(1)
254 #define USBIN_MODE_CHG_BIT BIT(0)
257 #define EXIT_SNK_BASED_ON_CC_BIT BIT(7)
258 #define VCONN_EN_ORIENTATION_BIT BIT(6)
259 #define TYPEC_VCONN_OVERCURR_INT_EN_BIT BIT(5)
260 #define VCONN_EN_SRC_BIT BIT(4)
261 #define VCONN_EN_VALUE_BIT BIT(3)
263 #define UFP_EN_CMD_BIT BIT(2)
264 #define DFP_EN_CMD_BIT BIT(1)
265 #define TYPEC_DISABLE_CMD_BIT BIT(0)
268 #define USBIN_CURRENT_LIMIT_MASK GENMASK(7, 0)
271 #define SUSPEND_ON_COLLAPSE_USBIN_BIT BIT(7)
272 #define USBIN_AICL_HDC_EN_BIT BIT(6)
273 #define USBIN_AICL_START_AT_MAX_BIT BIT(5)
274 #define USBIN_AICL_RERUN_EN_BIT BIT(4)
275 #define USBIN_AICL_ADC_EN_BIT BIT(3)
276 #define USBIN_AICL_EN_BIT BIT(2)
277 #define USBIN_HV_COLLAPSE_RESPONSE_BIT BIT(1)
278 #define USBIN_LV_COLLAPSE_RESPONSE_BIT BIT(0)
294 #define CHG_OK_BIT BIT(7)
295 #define WIPWR_UVLO_IRQ_OPT_BIT BIT(6)
296 #define BUCK_HOLDOFF_ENABLE_BIT BIT(5)
297 #define CHG_OK_HW_SW_SELECT_BIT BIT(4)
298 #define WIPWR_RST_ENABLE_BIT BIT(3)
299 #define DCIN_WIPWR_IRQ_SELECT_BIT BIT(2)
300 #define AICL_SWITCH_ENABLE_BIT BIT(1)
301 #define ZIN_ICL_ENABLE_BIT BIT(0)
304 #define INPUT_CURRENT_LIMIT_MASK GENMASK(7, 0)
307 #define P_PATH_INPUT_SS_DONE_BIT BIT(7)
308 #define P_PATH_USBIN_SUSPEND_STS_BIT BIT(6)
309 #define P_PATH_DCIN_SUSPEND_STS_BIT BIT(5)
310 #define P_PATH_USE_USBIN_BIT BIT(4)
311 #define P_PATH_USE_DCIN_BIT BIT(3)
313 #define P_PATH_VALID_INPUT_POWER_SOURCE_STS_BIT BIT(0)
316 #define BARK_BITE_WDOG_PET_BIT BIT(0)
319 #define WATCHDOG_TRIGGER_AFP_EN_BIT BIT(7)
320 #define BARK_WDOG_INT_EN_BIT BIT(6)
321 #define BITE_WDOG_INT_EN_BIT BIT(5)
323 #define WDOG_IRQ_SFT_BIT BIT(2)
324 #define WDOG_TIMER_EN_ON_PLUGIN_BIT BIT(1)
325 #define WDOG_TIMER_EN_BIT BIT(0)
328 #define BITE_WDOG_DISABLE_CHARGING_CFG_BIT BIT(7)
337 #define STAT_SW_OVERRIDE_VALUE_BIT BIT(7)
338 #define STAT_SW_OVERRIDE_CFG_BIT BIT(6)
340 #define STAT_POLARITY_CFG_BIT BIT(3)
341 #define STAT_PARALLEL_CFG_BIT BIT(2)
342 #define STAT_FUNCTION_CFG_BIT BIT(1)
343 #define STAT_IRQ_PULSING_EN_BIT BIT(0)
352 /* clang-format on */
372 * struct smb2_chip - smb2 chip structure
419 rc = regmap_read(chip->regmap, chip->base + POWER_PATH_STATUS, &stat); in smb2_get_prop_usb_online()
421 dev_err(chip->dev, "Couldn't read power path status: %d\n", rc); in smb2_get_prop_usb_online()
446 rc = regmap_read(chip->regmap, chip->base + APSD_STATUS, &apsd_stat); in smb2_apsd_get_charger_type()
448 dev_err(chip->dev, "Failed to read apsd status, rc = %d", rc); in smb2_apsd_get_charger_type()
452 dev_dbg(chip->dev, "Apsd not ready"); in smb2_apsd_get_charger_type()
453 return -EAGAIN; in smb2_apsd_get_charger_type()
456 rc = regmap_read(chip->regmap, chip->base + APSD_RESULT_STATUS, &stat); in smb2_apsd_get_charger_type()
458 dev_err(chip->dev, "Failed to read apsd result, rc = %d", rc); in smb2_apsd_get_charger_type()
486 rc = regmap_bulk_read(chip->regmap, in smb2_get_prop_status()
487 chip->base + BATTERY_CHARGER_STATUS_1, &stat, 2); in smb2_get_prop_status()
489 dev_err(chip->dev, "Failed to read charging status ret=%d\n", in smb2_get_prop_status()
525 int rc = regmap_read(chip->regmap, chip->base + ICL_STATUS, val); in smb2_get_current_limit()
537 dev_err(chip->dev, in smb2_set_current_limit()
539 return -EINVAL; in smb2_set_current_limit()
543 return regmap_write(chip->regmap, chip->base + USBIN_CURRENT_LIMIT_CFG, in smb2_set_current_limit()
561 dev_dbg(chip->dev, "get charger type retry %d\n", count); in smb2_status_change_work()
563 if (rc != -EAGAIN) in smb2_status_change_work()
568 if (rc < 0 && rc != -EAGAIN) { in smb2_status_change_work()
569 dev_err(chip->dev, "get charger type failed: %d\n", rc); in smb2_status_change_work()
574 rc = regmap_update_bits(chip->regmap, chip->base + CMD_APSD, in smb2_status_change_work()
576 schedule_delayed_work(&chip->status_change_work, in smb2_status_change_work()
578 dev_dbg(chip->dev, "get charger type failed, rerun apsd\n"); in smb2_status_change_work()
596 power_supply_changed(chip->chg_psy); in smb2_status_change_work()
605 rc = power_supply_get_property(chip->chg_psy, POWER_SUPPLY_PROP_STATUS, in smb2_get_iio_chan()
613 dev_err(chip->dev, "Failed to chan, err = %li", PTR_ERR(chan)); in smb2_get_iio_chan()
625 rc = regmap_read(chip->regmap, chip->base + BATTERY_CHARGER_STATUS_2, in smb2_get_prop_health()
628 dev_err(chip->dev, "Couldn't read charger status rc=%d\n", rc); in smb2_get_prop_health()
662 val->strval = "Qualcomm"; in smb2_get_property()
665 val->strval = chip->name; in smb2_get_property()
668 return smb2_get_current_limit(chip, &val->intval); in smb2_get_property()
670 return smb2_get_iio_chan(chip, chip->usb_in_i_chan, in smb2_get_property()
671 &val->intval); in smb2_get_property()
673 return smb2_get_iio_chan(chip, chip->usb_in_v_chan, in smb2_get_property()
674 &val->intval); in smb2_get_property()
676 return smb2_get_prop_usb_online(chip, &val->intval); in smb2_get_property()
678 return smb2_get_prop_status(chip, &val->intval); in smb2_get_property()
680 return smb2_get_prop_health(chip, &val->intval); in smb2_get_property()
682 return smb2_apsd_get_charger_type(chip, &val->intval); in smb2_get_property()
684 dev_err(chip->dev, "invalid property: %d\n", psp); in smb2_get_property()
685 return -EINVAL; in smb2_get_property()
697 return smb2_set_current_limit(chip, val->intval); in smb2_set_property()
699 dev_err(chip->dev, "No setter for property: %d\n", psp); in smb2_set_property()
700 return -EINVAL; in smb2_set_property()
720 regmap_read(chip->regmap, chip->base + BATTERY_CHARGER_STATUS_2, in smb2_handle_batt_overvoltage()
725 dev_err(chip->dev, "battery overvoltage detected\n"); in smb2_handle_batt_overvoltage()
726 power_supply_changed(chip->chg_psy); in smb2_handle_batt_overvoltage()
736 power_supply_changed(chip->chg_psy); in smb2_handle_usb_plugin()
738 schedule_delayed_work(&chip->status_change_work, in smb2_handle_usb_plugin()
748 power_supply_changed(chip->chg_psy); in smb2_handle_usb_icl_change()
758 power_supply_changed(chip->chg_psy); in smb2_handle_wdog_bark()
760 rc = regmap_write(chip->regmap, BARK_BITE_WDOG_PET, in smb2_handle_wdog_bark()
763 dev_err(chip->dev, "Couldn't pet the dog rc=%d\n", rc); in smb2_handle_wdog_bark()
771 .usb_types = BIT(POWER_SUPPLY_USB_TYPE_SDP) |
772 BIT(POWER_SUPPLY_USB_TYPE_CDP) |
773 BIT(POWER_SUPPLY_USB_TYPE_DCP) |
774 BIT(POWER_SUPPLY_USB_TYPE_UNKNOWN),
787 * FIXME: This will be handled by the type-c driver
794 * Disable Type-C factory mode and stay in Attached.SRC state when VCONN
795 * over-current happens
817 * CHG_EN_SRC_BIT - charger enable is controlled by software
818 * CHG_EN_POLARITY_BIT - polarity of charge enable pin when in HW control
820 * PRETOFAST_TRANSITION_CFG_BIT -
821 * BAT_OV_ECC_BIT -
822 * I_TERM_BIT - Current termination ?? 0 = enabled
823 * AUTO_RECHG_BIT - Enable automatic recharge when battery is full
826 * CHARGER_INHIBIT_BIT - Inhibit charging based on battery voltage
890 dev_dbg(chip->dev, "%d: Writing 0x%02x to 0x%02x\n", i, in smb2_init_hw()
892 rc = regmap_update_bits(chip->regmap, in smb2_init_hw()
893 chip->base + smb2_init_seq[i].addr, in smb2_init_hw()
897 return dev_err_probe(chip->dev, rc, in smb2_init_hw()
911 irqnum = platform_get_irq_byname(to_platform_device(chip->dev), name); in smb2_init_irq()
915 rc = devm_request_threaded_irq(chip->dev, irqnum, NULL, handler, in smb2_init_irq()
918 return dev_err_probe(chip->dev, rc, "Couldn't request irq %s\n", in smb2_init_irq()
934 chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL); in smb2_probe()
936 return -ENOMEM; in smb2_probe()
938 chip->dev = &pdev->dev; in smb2_probe()
939 chip->name = pdev->name; in smb2_probe()
941 chip->regmap = dev_get_regmap(pdev->dev.parent, NULL); in smb2_probe()
942 if (!chip->regmap) in smb2_probe()
943 return dev_err_probe(chip->dev, -ENODEV, in smb2_probe()
946 rc = device_property_read_u32(chip->dev, "reg", &chip->base); in smb2_probe()
948 return dev_err_probe(chip->dev, rc, in smb2_probe()
951 chip->usb_in_v_chan = devm_iio_channel_get(chip->dev, "usbin_v"); in smb2_probe()
952 if (IS_ERR(chip->usb_in_v_chan)) in smb2_probe()
953 return dev_err_probe(chip->dev, PTR_ERR(chip->usb_in_v_chan), in smb2_probe()
956 chip->usb_in_i_chan = devm_iio_channel_get(chip->dev, "usbin_i"); in smb2_probe()
957 if (IS_ERR(chip->usb_in_i_chan)) { in smb2_probe()
958 return dev_err_probe(chip->dev, PTR_ERR(chip->usb_in_i_chan), in smb2_probe()
967 supply_config.of_node = pdev->dev.of_node; in smb2_probe()
969 desc = devm_kzalloc(chip->dev, sizeof(smb2_psy_desc), GFP_KERNEL); in smb2_probe()
971 return -ENOMEM; in smb2_probe()
973 desc->name = in smb2_probe()
974 devm_kasprintf(chip->dev, GFP_KERNEL, "%s-charger", in smb2_probe()
975 (const char *)device_get_match_data(chip->dev)); in smb2_probe()
976 if (!desc->name) in smb2_probe()
977 return -ENOMEM; in smb2_probe()
979 chip->chg_psy = in smb2_probe()
980 devm_power_supply_register(chip->dev, desc, &supply_config); in smb2_probe()
981 if (IS_ERR(chip->chg_psy)) in smb2_probe()
982 return dev_err_probe(chip->dev, PTR_ERR(chip->chg_psy), in smb2_probe()
985 rc = power_supply_get_battery_info(chip->chg_psy, &chip->batt_info); in smb2_probe()
987 return dev_err_probe(chip->dev, rc, in smb2_probe()
990 rc = devm_delayed_work_autocancel(chip->dev, &chip->status_change_work, in smb2_probe()
993 return dev_err_probe(chip->dev, rc, in smb2_probe()
996 rc = (chip->batt_info->voltage_max_design_uv - 3487500) / 7500 + 1; in smb2_probe()
997 rc = regmap_update_bits(chip->regmap, chip->base + FLOAT_VOLTAGE_CFG, in smb2_probe()
1000 return dev_err_probe(chip->dev, rc, "Couldn't set vbat max\n"); in smb2_probe()
1002 rc = smb2_init_irq(chip, &irq, "bat-ov", smb2_handle_batt_overvoltage); in smb2_probe()
1006 rc = smb2_init_irq(chip, &chip->cable_irq, "usb-plugin", in smb2_probe()
1011 rc = smb2_init_irq(chip, &irq, "usbin-icl-change", in smb2_probe()
1015 rc = smb2_init_irq(chip, &irq, "wdog-bark", smb2_handle_wdog_bark); in smb2_probe()
1019 rc = dev_pm_set_wake_irq(chip->dev, chip->cable_irq); in smb2_probe()
1021 return dev_err_probe(chip->dev, rc, "Couldn't set wake irq\n"); in smb2_probe()
1026 schedule_delayed_work(&chip->status_change_work, 0); in smb2_probe()
1032 { .compatible = "qcom,pmi8998-charger", .data = "pmi8998" },
1033 { .compatible = "qcom,pm660-charger", .data = "pm660" },
1041 .name = "qcom-pmi8998/pm660-charger",