/Linux-v6.6/drivers/power/supply/ |
D | da9030_battery.c | 3 * Battery charger driver for Dialog Semiconductor DA9030 105 /* charger status */ 139 struct da9030_charger *charger = s->private; in bat_debug_show() local 141 seq_printf(s, "charger is %s\n", charger->is_on ? "on" : "off"); in bat_debug_show() 142 if (charger->chdet) { in bat_debug_show() 144 charger->mA, charger->mV); in bat_debug_show() 148 charger->adc.vbat_res, in bat_debug_show() 149 da9030_reg_to_mV(charger->adc.vbat_res)); in bat_debug_show() 151 charger->adc.vbatmin_res, in bat_debug_show() 152 da9030_reg_to_mV(charger->adc.vbatmin_res)); in bat_debug_show() [all …]
|
D | da9150-charger.c | 3 * DA9150 Charger Driver 42 static inline int da9150_charger_supply_online(struct da9150_charger *charger, in da9150_charger_supply_online() argument 46 val->intval = (psy == charger->supply_online) ? 1 : 0; in da9150_charger_supply_online() 51 /* Charger Properties */ 52 static int da9150_charger_vbus_voltage_now(struct da9150_charger *charger, in da9150_charger_vbus_voltage_now() argument 58 ret = iio_read_channel_processed(charger->vbus_chan, &v_val); in da9150_charger_vbus_voltage_now() 68 static int da9150_charger_ibus_current_avg(struct da9150_charger *charger, in da9150_charger_ibus_current_avg() argument 74 ret = iio_read_channel_processed(charger->ibus_chan, &i_val); in da9150_charger_ibus_current_avg() 84 static int da9150_charger_tjunc_temp(struct da9150_charger *charger, in da9150_charger_tjunc_temp() argument 90 ret = iio_read_channel_processed(charger->tjunc_chan, &t_val); in da9150_charger_tjunc_temp() [all …]
|
D | rk817_charger.c | 3 * Charger Driver for Rockchip rk817 170 static void rk817_bat_calib_vol(struct rk817_charger *charger) in rk817_bat_calib_vol() argument 177 regmap_bulk_read(charger->rk808->regmap, RK817_GAS_GAUGE_VCALIB0_H, in rk817_bat_calib_vol() 181 regmap_bulk_read(charger->rk808->regmap, RK817_GAS_GAUGE_VCALIB1_H, in rk817_bat_calib_vol() 186 charger->voltage_k = (4025 - 2300) * 1000 / in rk817_bat_calib_vol() 188 charger->voltage_b = 4025 - (charger->voltage_k * vcalib1) / 1000; in rk817_bat_calib_vol() 191 static void rk817_bat_calib_cur(struct rk817_charger *charger) in rk817_bat_calib_cur() argument 196 regmap_bulk_read(charger->rk808->regmap, RK817_GAS_GAUGE_IOFFSET_H, in rk817_bat_calib_cur() 198 regmap_bulk_write(charger->rk808->regmap, RK817_GAS_GAUGE_CAL_OFFSET_H, in rk817_bat_calib_cur() 206 static int rk817_record_battery_nvram_values(struct rk817_charger *charger) in rk817_record_battery_nvram_values() argument [all …]
|
D | bq24735-charger.c | 2 * Battery charger driver for TI BQ24735 32 #include <linux/power/bq24735-charger.h> 50 struct power_supply *charger; member 111 static int bq24735_config_charger(struct bq24735 *charger) in bq24735_config_charger() argument 113 struct bq24735_platform *pdata = charger->pdata; in bq24735_config_charger() 123 ret = bq24735_write_word(charger->client, in bq24735_config_charger() 126 dev_err(&charger->client->dev, in bq24735_config_charger() 127 "Failed to write charger current : %d\n", in bq24735_config_charger() 136 ret = bq24735_write_word(charger->client, in bq24735_config_charger() 139 dev_err(&charger->client->dev, in bq24735_config_charger() [all …]
|
D | tps65217_charger.c | 2 // Battery charger driver for TI's tps65217 8 * Battery charger driver for TI's tps65217 44 static int tps65217_config_charger(struct tps65217_charger *charger) in tps65217_config_charger() argument 53 * is not recommended to do so. In sleep mode, the charger continues in tps65217_config_charger() 55 * values. Therefore, the charger would get the wrong temperature in tps65217_config_charger() 66 ret = tps65217_clear_bits(charger->tps, TPS65217_REG_CHGCONFIG1, in tps65217_config_charger() 70 dev_err(charger->dev, in tps65217_config_charger() 78 static int tps65217_enable_charging(struct tps65217_charger *charger) in tps65217_enable_charging() argument 82 /* charger already enabled */ in tps65217_enable_charging() 83 if (charger->online) in tps65217_enable_charging() [all …]
|
D | rt5033_charger.c | 3 * Battery charger driver for RT5033 31 static int rt5033_get_charger_state(struct rt5033_charger *charger) in rt5033_get_charger_state() argument 33 struct regmap *regmap = charger->regmap; in rt5033_get_charger_state() 62 static int rt5033_get_charger_type(struct rt5033_charger *charger) in rt5033_get_charger_type() argument 64 struct regmap *regmap = charger->regmap; in rt5033_get_charger_type() 84 static int rt5033_get_charger_current_limit(struct rt5033_charger *charger) in rt5033_get_charger_current_limit() argument 86 struct regmap *regmap = charger->regmap; in rt5033_get_charger_current_limit() 100 static int rt5033_get_charger_const_voltage(struct rt5033_charger *charger) in rt5033_get_charger_const_voltage() argument 102 struct regmap *regmap = charger->regmap; in rt5033_get_charger_const_voltage() 116 static inline int rt5033_init_const_charge(struct rt5033_charger *charger) in rt5033_init_const_charge() argument [all …]
|
D | mp2629_charger.c | 3 * MP2629 battery charger driver 155 static int mp2629_read_adc(struct mp2629_charger *charger, in mp2629_read_adc() argument 162 ret = iio_read_channel_processed(charger->iiochan[ch], &chval); in mp2629_read_adc() 171 static int mp2629_get_prop(struct mp2629_charger *charger, in mp2629_get_prop() argument 178 ret = regmap_field_read(charger->regmap_fields[fld], &rval); in mp2629_get_prop() 187 static int mp2629_set_prop(struct mp2629_charger *charger, in mp2629_set_prop() argument 197 return regmap_field_write(charger->regmap_fields[fld], rval); in mp2629_set_prop() 200 static int mp2629_get_battery_capacity(struct mp2629_charger *charger, in mp2629_get_battery_capacity() argument 206 ret = mp2629_read_adc(charger, MP2629_BATT_VOLT, &vnow); in mp2629_get_battery_capacity() 210 ret = mp2629_get_prop(charger, CHARGE_VLIM, &vlim); in mp2629_get_battery_capacity() [all …]
|
D | Kconfig | 51 which include a battery charger and a boost converter. 54 tristate "MAX8925 battery charger support" 57 Say Y here to enable support for the battery charger in the Maxim 61 tristate "WM831X backup battery charger support" 64 Say Y here to enable support for the backup battery charger 93 tristate "ADP5061 battery charger driver" 98 charger. 104 tristate "Active-semi ACT8945A charger driver" 108 Active-semi ActivePath ACT8945A charger. 237 tristate "SBS Compliant charger" [all …]
|
D | max8997_charger.c | 46 POWER_SUPPLY_PROP_ONLINE, /* charger is active or not */ 49 /* Note that the charger control is done by a current regulator "CHARGER" */ 54 struct charger_data *charger = power_supply_get_drvdata(psy); in max8997_battery_get_property() local 55 struct i2c_client *i2c = charger->iodev->i2c; in max8997_battery_get_property() 100 struct charger_data *charger = in max8997_battery_extcon_evt_worker() local 102 struct extcon_dev *edev = charger->edev; in max8997_battery_extcon_evt_worker() 106 dev_dbg(charger->dev, "USB SDP charger is connected\n"); in max8997_battery_extcon_evt_worker() 109 dev_dbg(charger->dev, "USB DCP charger is connected\n"); in max8997_battery_extcon_evt_worker() 112 dev_dbg(charger->dev, "USB FAST charger is connected\n"); in max8997_battery_extcon_evt_worker() 115 dev_dbg(charger->dev, "USB SLOW charger is connected\n"); in max8997_battery_extcon_evt_worker() [all …]
|
D | cros_usbpd-charger.c | 3 * Power supply driver for ChromeOS EC based USB PD Charger. 25 #define DRV_NAME "cros-usbpd-charger" 41 struct charger_data *charger; member 92 return port->port_number >= port->charger->num_usbpd_ports; in cros_usbpd_charger_port_is_dedicated() 95 static int cros_usbpd_charger_ec_command(struct charger_data *charger, in cros_usbpd_charger_ec_command() argument 103 struct cros_ec_dev *ec_dev = charger->ec_dev; in cros_usbpd_charger_ec_command() 119 ret = cros_ec_cmd_xfer_status(charger->ec_device, msg); in cros_usbpd_charger_ec_command() 127 static int cros_usbpd_charger_get_num_ports(struct charger_data *charger) in cros_usbpd_charger_get_num_ports() argument 132 ret = cros_usbpd_charger_ec_command(charger, 0, in cros_usbpd_charger_get_num_ports() 141 static int cros_usbpd_charger_get_usbpd_num_ports(struct charger_data *charger) in cros_usbpd_charger_get_usbpd_num_ports() argument [all …]
|
D | act8945a_charger.c | 22 * ACT8945A Charger Register Map 209 static int act8945a_get_capacity_level(struct act8945a_charger *charger, in act8945a_get_capacity_level() argument 214 int lbo_level = gpiod_get_value(charger->lbo_gpio); in act8945a_get_capacity_level() 276 static int act8945a_get_current_max(struct act8945a_charger *charger, in act8945a_get_current_max() argument 282 int chgin_level = gpiod_get_value(charger->chglev_gpio); in act8945a_get_current_max() 346 struct act8945a_charger *charger = power_supply_get_drvdata(psy); in act8945a_charger_get_property() local 347 struct regmap *regmap = charger->regmap; in act8945a_charger_get_property() 364 ret = act8945a_get_capacity_level(charger, in act8945a_charger_get_property() 368 ret = act8945a_get_current_max(charger, in act8945a_charger_get_property() 384 static int act8945a_enable_interrupt(struct act8945a_charger *charger) in act8945a_enable_interrupt() argument [all …]
|
D | tps65090-charger.c | 3 * Battery charger driver for TI's tps65090 44 static int tps65090_low_chrg_current(struct tps65090_charger *charger) in tps65090_low_chrg_current() argument 48 if (charger->passive_mode) in tps65090_low_chrg_current() 51 ret = tps65090_write(charger->dev->parent, TPS65090_REG_CG_CTRL5, in tps65090_low_chrg_current() 54 dev_err(charger->dev, "%s(): error reading in register 0x%x\n", in tps65090_low_chrg_current() 61 static int tps65090_enable_charging(struct tps65090_charger *charger) in tps65090_enable_charging() argument 66 if (charger->passive_mode) in tps65090_enable_charging() 69 ret = tps65090_read(charger->dev->parent, TPS65090_REG_CG_CTRL0, in tps65090_enable_charging() 72 dev_err(charger->dev, "%s(): error reading in register 0x%x\n", in tps65090_enable_charging() 77 ret = tps65090_write(charger->dev->parent, TPS65090_REG_CG_CTRL0, in tps65090_enable_charging() [all …]
|
D | charger-manager.c | 6 * This driver enables to monitor battery health and control charger 8 * Charger manager depends on other devices. Register this later than 23 #include <linux/power/charger-manager.h> 40 { "FAST-CHARGER", EXTCON_CHG_USB_FAST }, 41 { "SLOW-CHARGER", EXTCON_CHG_USB_SLOW }, 93 * @cm: the Charger Manager representing the battery. 145 * @cm: the Charger Manager representing the battery. 181 * @cm: the Charger Manager representing the battery. 209 * @cm: the Charger Manager representing the battery. 222 /* If at least one of the charger is charging, return yes */ in is_charging() [all …]
|
D | cros_peripheral_charger.c | 3 * Power supply driver for ChromeOS EC based Peripheral Device Charger. 34 struct charger_data *charger; member 54 static int cros_pchg_ec_command(const struct charger_data *charger, in cros_pchg_ec_command() argument 62 struct cros_ec_dev *ec_dev = charger->ec_dev; in cros_pchg_ec_command() 78 ret = cros_ec_cmd_xfer_status(charger->ec_device, msg); in cros_pchg_ec_command() 88 static bool cros_pchg_cmd_ver_check(const struct charger_data *charger) in cros_pchg_cmd_ver_check() argument 95 ret = cros_pchg_ec_command(charger, 1, EC_CMD_GET_CMD_VERSIONS, in cros_pchg_cmd_ver_check() 98 dev_warn(charger->dev, in cros_pchg_cmd_ver_check() 107 static int cros_pchg_port_count(const struct charger_data *charger) in cros_pchg_port_count() argument 112 ret = cros_pchg_ec_command(charger, 0, EC_CMD_PCHG_COUNT, in cros_pchg_port_count() [all …]
|
D | ab8500_charger.c | 5 * Charger driver for AB8500 39 /* Charger constants */ 94 /* Lowest charger voltage is 3.39V -> 0x4E */ 107 /*External charger control*/ 218 * struct ab8500_charger - ab8500 Charger device information 223 * @ac_conn: This will be true when the AC charger has been plugged 225 * charger is enabled 227 * charger is enabled 233 * @invalid_charger_detect_state State when forcing AB to use invalid charger 238 * @adc_main_charger_v ADC channel for main charger voltage [all …]
|
D | max77650-charger.c | 6 // Battery charger driver for MAXIM 77650/77651 charger/power-supply. 24 /* Charger is OFF. */ 26 /* Charger is in prequalification mode. */ 28 /* Charger is in fast-charge constant current mode. */ 30 /* Charger is in JEITA modified fast-charge constant-current mode. */ 32 /* Charger is in fast-charge constant-voltage mode. */ 34 /* Charger is in JEITA modified fast-charge constant-voltage mode. */ 36 /* Charger is in top-off mode. */ 38 /* Charger is in JEITA modified top-off mode. */ 40 /* Charger is done. */ [all …]
|
D | Makefile | 44 obj-$(CONFIG_CHARGER_SBS) += sbs-charger.o 51 obj-$(CONFIG_CHARGER_DA9150) += da9150-charger.o 59 obj-$(CONFIG_CHARGER_RT9467) += rt9467-charger.o 63 obj-$(CONFIG_CHARGER_PCF50633) += pcf50633-charger.o 66 obj-$(CONFIG_CHARGER_CPCAP) += cpcap-charger.o 71 obj-$(CONFIG_CHARGER_LP8788) += lp8788-charger.o 72 obj-$(CONFIG_CHARGER_GPIO) += gpio-charger.o 73 obj-$(CONFIG_CHARGER_MANAGER) += charger-manager.o 74 obj-$(CONFIG_CHARGER_LT3651) += lt3651-charger.o 75 obj-$(CONFIG_CHARGER_LTC4162L) += ltc4162-l-charger.o [all …]
|
D | lt3651-charger.c | 3 * Driver for Analog Devices (Linear Technology) LT3651 charger IC. 19 struct power_supply *charger; member 28 struct power_supply *charger = devid; in lt3651_charger_irq() local 30 power_supply_changed(charger); in lt3651_charger_irq() 137 lt3651_charger->charger = devm_power_supply_register(&pdev->dev, in lt3651_charger_probe() 139 if (IS_ERR(lt3651_charger->charger)) { in lt3651_charger_probe() 140 ret = PTR_ERR(lt3651_charger->charger); in lt3651_charger_probe() 157 dev_name(&pdev->dev), lt3651_charger->charger); in lt3651_charger_probe() 167 dev_name(&pdev->dev), lt3651_charger->charger); in lt3651_charger_probe() 177 dev_name(&pdev->dev), lt3651_charger->charger); in lt3651_charger_probe() [all …]
|
D | max8903_charger.c | 3 * max8903_charger.c - Maxim 8903 USB/Adapter Charger Driver 27 struct gpio_desc *cen; /* Charger Enable input */ 30 struct gpio_desc *chg; /* Charger status output */ 40 POWER_SUPPLY_PROP_STATUS, /* Charger status output */ 105 /* Charger Enable / Disable */ in max8903_dcin() 113 /* Enable if the USB charger is enabled */ in max8903_dcin() 122 dev_dbg(data->dev, "TA(DC-IN) Charger %s.\n", ta_in ? in max8903_dcin() 162 /* Charger Enable / Disable */ in max8903_usbin() 170 /* Enable if the DC charger is enabled */ in max8903_usbin() 179 dev_dbg(data->dev, "USB Charger %s.\n", usb_in ? in max8903_usbin() [all …]
|
/Linux-v6.6/drivers/platform/x86/intel/ |
D | crystal_cove_charger.c | 3 * Driver for the external-charger IRQ pass-through function of the 35 struct crystal_cove_charger_data *charger = data; in crystal_cove_charger_irq() local 38 handle_nested_irq(charger->charger_irq); in crystal_cove_charger_irq() 41 regmap_write(charger->regmap, CHGRIRQ_REG, BIT(0)); in crystal_cove_charger_irq() 48 struct crystal_cove_charger_data *charger = irq_data_get_irq_chip_data(data); in crystal_cove_charger_irq_bus_lock() local 50 mutex_lock(&charger->buslock); in crystal_cove_charger_irq_bus_lock() 55 struct crystal_cove_charger_data *charger = irq_data_get_irq_chip_data(data); in crystal_cove_charger_irq_bus_sync_unlock() local 57 if (charger->mask != charger->new_mask) { in crystal_cove_charger_irq_bus_sync_unlock() 58 regmap_write(charger->regmap, MCHGRIRQ_REG, charger->new_mask); in crystal_cove_charger_irq_bus_sync_unlock() 59 charger->mask = charger->new_mask; in crystal_cove_charger_irq_bus_sync_unlock() [all …]
|
/Linux-v6.6/include/linux/power/ |
D | charger-manager.h | 6 * Charger Manager. 45 * @wq: the workqueue to control charger according to the state of 46 * charger cable. If charger cable is attached, enable charger. 47 * But if charger cable is detached, disable charger. 49 * (External Connector) when charger cable is attached/detached. 50 * @attached: the state of charger cable. 51 * true: the charger cable is attached 52 * false: the charger cable is detached 53 * @charger: the instance of struct charger_regulator. 54 * @cm: the Charger Manager representing the battery. [all …]
|
/Linux-v6.6/Documentation/power/ |
D | charger-manager.rst | 2 Charger Manager 7 Charger Manager provides in-kernel battery charger management that 12 Charger Manager is a platform_driver with power-supply-class entries. 13 An instance of Charger Manager (a platform-device created with Charger-Manager) 16 the system may need multiple instances of Charger Manager. 21 Charger Manager supports the following: 25 they may be activated at the same time. Each charger may have its 28 aggregates charger-related information from multiple sources and 43 Charger Manager provides a function "cm_suspend_again" that can be 48 that are used by Charger Manager. [all …]
|
/Linux-v6.6/Documentation/devicetree/bindings/mfd/ |
D | maxim,max14577.yaml | 17 includes voltage safeout regulators, charger and MicroUSB management IC. 20 includes voltage safeout and LDO regulators, charger, fuel-gauge and MicroUSB 37 charger: 59 - charger 69 charger: 72 const: maxim,max14577-charger 83 charger: 86 const: maxim,max77836-charger 123 CHARGER { 124 regulator-name = "CHARGER"; [all …]
|
/Linux-v6.6/include/linux/mfd/ |
D | rt5033-private.h | 57 /* RT5033 Charger state register */ 116 /* RT5033 charger property - model, manufacturer */ 117 #define RT5033_CHARGER_MODEL "RT5033WSC Charger" 121 * While RT5033 charger can limit the fast-charge current (as in CHGCTRL1 134 /* RT5033 charger minimum input voltage regulation */ 157 * RT5033 charger opa mode. RT5033 has two opa modes for OTG: charger mode 163 /* RT5033 charger termination enable */ 167 /* RT5033 charger CFO enable */ 171 /* RT5033 charger constant charge voltage (as in CHGCTRL2 register), uV */ 177 /* RT5033 charger pre-charge current limits (as in CHGCTRL4 register), uA */ [all …]
|
/Linux-v6.6/drivers/phy/ti/ |
D | phy-tusb1210.c | 42 /* TUSB1210 charger detection work states */ 68 struct power_supply *charger; member 181 dev_dbg(&tusb->ulpi->dev, "charger type: %d\n", type); in tusb1210_chg_det_set_type() 214 * Boards using a TUSB121x for charger-detection have 3 power_supply class devs: 216 * tusb1211-charger-detect(1) -> charger -> fuel-gauge 218 * To determine if an USB charger is connected to the board, the online prop of 219 * the charger psy needs to be read. Since the tusb1211-charger-detect psy is 224 * these boards and the charger psy is looked up by name from this list. 226 * (1) modelling the external USB charger 229 "bq24190-charger", [all …]
|