| /kernel/linux/linux-6.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. 26 #define DRV_NAME "cros-usbpd-charger" 42 struct charger_data *charger; member 93 return port->port_number >= port->charger->num_usbpd_ports; in cros_usbpd_charger_port_is_dedicated() 96 static int cros_usbpd_charger_ec_command(struct charger_data *charger, in cros_usbpd_charger_ec_command() argument 104 struct cros_ec_dev *ec_dev = charger->ec_dev; in cros_usbpd_charger_ec_command() 120 ret = cros_ec_cmd_xfer_status(charger->ec_device, msg); in cros_usbpd_charger_ec_command() 128 static int cros_usbpd_charger_get_num_ports(struct charger_data *charger) in cros_usbpd_charger_get_num_ports() argument 133 ret = cros_usbpd_charger_ec_command(charger, 0, in cros_usbpd_charger_get_num_ports() 142 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 …]
|
| /kernel/linux/linux-5.10/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 44 static inline int da9150_charger_supply_online(struct da9150_charger *charger, in da9150_charger_supply_online() argument 48 val->intval = (psy == charger->supply_online) ? 1 : 0; in da9150_charger_supply_online() 53 /* Charger Properties */ 54 static int da9150_charger_vbus_voltage_now(struct da9150_charger *charger, in da9150_charger_vbus_voltage_now() argument 60 ret = iio_read_channel_processed(charger->vbus_chan, &v_val); in da9150_charger_vbus_voltage_now() 70 static int da9150_charger_ibus_current_avg(struct da9150_charger *charger, in da9150_charger_ibus_current_avg() argument 76 ret = iio_read_channel_processed(charger->ibus_chan, &i_val); in da9150_charger_ibus_current_avg() 86 static int da9150_charger_tjunc_temp(struct da9150_charger *charger, in da9150_charger_tjunc_temp() argument 92 ret = iio_read_channel_processed(charger->tjunc_chan, &t_val); in da9150_charger_tjunc_temp() [all …]
|
| D | bq24735-charger.c | 2 * Battery charger driver for TI BQ24735 32 #include <linux/power/bq24735-charger.h> 47 struct power_supply *charger; member 108 static int bq24735_config_charger(struct bq24735 *charger) in bq24735_config_charger() argument 110 struct bq24735_platform *pdata = charger->pdata; in bq24735_config_charger() 120 ret = bq24735_write_word(charger->client, in bq24735_config_charger() 123 dev_err(&charger->client->dev, in bq24735_config_charger() 124 "Failed to write charger current : %d\n", in bq24735_config_charger() 133 ret = bq24735_write_word(charger->client, in bq24735_config_charger() 136 dev_err(&charger->client->dev, in bq24735_config_charger() [all …]
|
| D | z2_battery.c | 29 static unsigned long z2_read_bat(struct z2_charger *charger) in z2_read_bat() argument 32 data = i2c_smbus_read_byte_data(charger->client, in z2_read_bat() 33 charger->info->batt_I2C_reg); in z2_read_bat() 37 return data * charger->info->batt_mult / charger->info->batt_div; in z2_read_bat() 44 struct z2_charger *charger = power_supply_get_drvdata(batt_ps); in z2_batt_get_property() local 45 struct z2_battery_info *info = charger->info; in z2_batt_get_property() 49 val->intval = charger->bat_status; in z2_batt_get_property() 56 val->intval = z2_read_bat(charger); in z2_batt_get_property() 84 struct z2_charger *charger = power_supply_get_drvdata(batt_ps); in z2_batt_ext_power_changed() local 86 schedule_work(&charger->bat_work); in z2_batt_ext_power_changed() [all …]
|
| D | tps65217_charger.c | 2 // Battery charger driver for TI's tps65217 8 * Battery charger driver for TI's tps65217 45 static int tps65217_config_charger(struct tps65217_charger *charger) in tps65217_config_charger() argument 54 * is not recommended to do so. In sleep mode, the charger continues in tps65217_config_charger() 56 * values. Therefore, the charger would get the wrong temperature in tps65217_config_charger() 67 ret = tps65217_clear_bits(charger->tps, TPS65217_REG_CHGCONFIG1, in tps65217_config_charger() 71 dev_err(charger->dev, in tps65217_config_charger() 79 static int tps65217_enable_charging(struct tps65217_charger *charger) in tps65217_enable_charging() argument 83 /* charger already enabled */ in tps65217_enable_charging() 84 if (charger->online) in tps65217_enable_charging() [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 | 38 backup batteries, and optional builtin charger. 55 tristate "MAX8925 battery charger support" 58 Say Y here to enable support for the battery charger in the Maxim 62 tristate "WM831X backup battery charger support" 65 Say Y here to enable support for the backup battery charger 94 tristate "ADP5061 battery charger driver" 99 charger. 105 tristate "Active-semi ACT8945A charger driver" 109 Active-semi ActivePath ACT8945A charger. 230 tristate "SBS Compliant charger" [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 …]
|
| /kernel/linux/linux-6.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 …]
|
| /kernel/linux/linux-5.10/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 …]
|
| /kernel/linux/linux-6.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 …]
|
| /kernel/linux/linux-6.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 …]
|
| /kernel/linux/linux-5.10/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 …]
|