/linux/drivers/power/supply/ |
H A D | da9030_battery.c | 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() 154 charger->adc.vbatmintxon, in bat_debug_show() 155 da9030_reg_to_mV(charger->adc.vbatmintxon)); in bat_debug_show() [all …]
|
H A D | rk817_charger.c | 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 215 put_unaligned_le24(charger->soc, bulk_reg); in rk817_record_battery_nvram_values() [all …]
|
H A D | rt5033_charger.c | 43 static int rt5033_get_charger_state(struct rt5033_charger *charger) in rt5033_get_charger_state() argument 45 struct regmap *regmap = charger->regmap; in rt5033_get_charger_state() 72 if (charger->otg) in rt5033_get_charger_state() 78 static int rt5033_get_charger_type(struct rt5033_charger *charger) in rt5033_get_charger_type() argument 80 struct regmap *regmap = charger->regmap; in rt5033_get_charger_type() 100 static int rt5033_get_charger_current_limit(struct rt5033_charger *charger) in rt5033_get_charger_current_limit() argument 102 struct regmap *regmap = charger->regmap; in rt5033_get_charger_current_limit() 116 static int rt5033_get_charger_const_voltage(struct rt5033_charger *charger) in rt5033_get_charger_const_voltage() argument 118 struct regmap *regmap = charger->regmap; in rt5033_get_charger_const_voltage() 132 static inline int rt5033_init_const_charge(struct rt5033_charger *charger) in rt5033_init_const_charge() argument [all …]
|
H A D | da9150-charger.c | 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() 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() 111 struct da9150_charger *charger = dev_get_drvdata(psy->dev.parent); in da9150_charger_get_prop() local 116 ret = da9150_charger_supply_online(charger, psy, val); in da9150_charger_get_prop() [all …]
|
H A D | bq24735-charger.c | 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() 136 ret = bq24735_write_word(charger->client, in bq24735_config_charger() 139 dev_err(&charger->client->dev, in bq24735_config_charger() 149 ret = bq24735_write_word(charger->client, in bq24735_config_charger() 152 dev_err(&charger->client->dev, in bq24735_config_charger() 162 static inline int bq24735_enable_charging(struct bq24735 *charger) in bq24735_enable_charging() argument [all …]
|
H A D | tps65217_charger.c | 44 static int tps65217_config_charger(struct tps65217_charger *charger) in tps65217_config_charger() argument 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 83 if (charger->online) in tps65217_enable_charging() 86 dev_dbg(charger->dev, "%s: enable charging\n", __func__); in tps65217_enable_charging() 87 ret = tps65217_set_bits(charger->tps, TPS65217_REG_CHGCONFIG1, in tps65217_enable_charging() 92 dev_err(charger->dev, in tps65217_enable_charging() 98 charger->online = 1; in tps65217_enable_charging() 107 struct tps65217_charger *charger = power_supply_get_drvdata(psy); in tps65217_charger_get_property() local [all …]
|
H A D | mp2629_charger.c | 147 static int mp2629_read_adc(struct mp2629_charger *charger, in mp2629_read_adc() argument 154 ret = iio_read_channel_processed(charger->iiochan[ch], &chval); in mp2629_read_adc() 163 static int mp2629_get_prop(struct mp2629_charger *charger, in mp2629_get_prop() argument 170 ret = regmap_field_read(charger->regmap_fields[fld], &rval); in mp2629_get_prop() 179 static int mp2629_set_prop(struct mp2629_charger *charger, in mp2629_set_prop() argument 189 return regmap_field_write(charger->regmap_fields[fld], rval); in mp2629_set_prop() 192 static int mp2629_get_battery_capacity(struct mp2629_charger *charger, in mp2629_get_battery_capacity() argument 198 ret = mp2629_read_adc(charger, MP2629_BATT_VOLT, &vnow); in mp2629_get_battery_capacity() 202 ret = mp2629_get_prop(charger, CHARGE_VLIM, &vlim); in mp2629_get_battery_capacity() 216 struct mp2629_charger *charger = dev_get_drvdata(psy->dev.parent); in mp2629_charger_battery_get_prop() local [all …]
|
H A D | max8997_charger.c | 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() 118 dev_dbg(charger->dev, "USB CDP charger is connected\n"); in max8997_battery_extcon_evt_worker() 121 dev_dbg(charger->dev, "USB charger is disconnected\n"); in max8997_battery_extcon_evt_worker() [all …]
|
H A D | cros_usbpd-charger.c | 42 struct charger_data *charger; member 82 return port->port_number >= port->charger->num_usbpd_ports; in cros_usbpd_charger_port_is_dedicated() 85 static int cros_usbpd_charger_ec_command(struct charger_data *charger, in cros_usbpd_charger_ec_command() argument 93 struct cros_ec_dev *ec_dev = charger->ec_dev; in cros_usbpd_charger_ec_command() 109 ret = cros_ec_cmd_xfer_status(charger->ec_device, msg); in cros_usbpd_charger_ec_command() 117 static int cros_usbpd_charger_get_num_ports(struct charger_data *charger) in cros_usbpd_charger_get_num_ports() argument 122 ret = cros_usbpd_charger_ec_command(charger, 0, in cros_usbpd_charger_get_num_ports() 131 static int cros_usbpd_charger_get_usbpd_num_ports(struct charger_data *charger) in cros_usbpd_charger_get_usbpd_num_ports() argument 136 ret = cros_usbpd_charger_ec_command(charger, 0, EC_CMD_USB_PD_PORTS, in cros_usbpd_charger_get_usbpd_num_ports() 146 struct charger_data *charger = port->charger; in cros_usbpd_charger_get_discovery_info() local [all …]
|
H A D | act8945a_charger.c | 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 386 struct regmap *regmap = charger->regmap; in act8945a_enable_interrupt() [all …]
|
H A D | tps65090-charger.c | 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() 80 dev_err(charger->dev, "%s(): error writing in register 0x%x\n", in tps65090_enable_charging() [all …]
|
H A D | cros_peripheral_charger.c | 35 struct charger_data *charger; member 55 static int cros_pchg_ec_command(const struct charger_data *charger, in cros_pchg_ec_command() argument 63 struct cros_ec_dev *ec_dev = charger->ec_dev; in cros_pchg_ec_command() 79 ret = cros_ec_cmd_xfer_status(charger->ec_device, msg); in cros_pchg_ec_command() 89 static bool cros_pchg_cmd_ver_check(const struct charger_data *charger) in cros_pchg_cmd_ver_check() argument 96 ret = cros_pchg_ec_command(charger, 1, EC_CMD_GET_CMD_VERSIONS, in cros_pchg_cmd_ver_check() 99 dev_warn(charger->dev, in cros_pchg_cmd_ver_check() 108 static int cros_pchg_port_count(const struct charger_data *charger) in cros_pchg_port_count() argument 113 ret = cros_pchg_ec_command(charger, 0, EC_CMD_PCHG_COUNT, in cros_pchg_port_count() 116 dev_warn(charger->dev, in cros_pchg_port_count() [all …]
|
H A D | charger-manager.c | 920 ret = regulator_set_current_limit(cable->charger->consumer, in charger_extcon_work() 924 cable->charger->regulator_name, cable->name); in charger_extcon_work() 929 cable->charger->regulator_name, in charger_extcon_work() 1031 struct charger_regulator *charger; in charger_manager_register_extcon() local 1038 charger = &desc->charger_regulators[i]; in charger_manager_register_extcon() 1040 charger->consumer = regulator_get(cm->dev, in charger_manager_register_extcon() 1041 charger->regulator_name); in charger_manager_register_extcon() 1042 if (IS_ERR(charger->consumer)) { in charger_manager_register_extcon() 1044 charger->regulator_name); in charger_manager_register_extcon() 1045 return PTR_ERR(charger->consumer); in charger_manager_register_extcon() [all …]
|
H A D | Makefile | 45 obj-$(CONFIG_CHARGER_SBS) += sbs-charger.o 52 obj-$(CONFIG_CHARGER_DA9150) += da9150-charger.o 61 obj-$(CONFIG_CHARGER_RT9467) += rt9467-charger.o 65 obj-$(CONFIG_CHARGER_PCF50633) += pcf50633-charger.o 68 obj-$(CONFIG_CHARGER_CPCAP) += cpcap-charger.o 73 obj-$(CONFIG_CHARGER_LP8788) += lp8788-charger.o 74 obj-$(CONFIG_CHARGER_GPIO) += gpio-charger.o 75 obj-$(CONFIG_CHARGER_MANAGER) += charger-manager.o 76 obj-$(CONFIG_CHARGER_LT3651) += lt3651-charger.o 77 obj-$(CONFIG_CHARGER_LTC4162L) += ltc4162-l-charger.o [all …]
|
H A 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. 246 tristate "SBS Compliant charger" [all …]
|
H A D | lt3651-charger.c | 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()
|
H A D | gpio-charger.c | 31 struct power_supply *charger; member 44 struct power_supply *charger = devid; in gpio_charger_irq() local 46 power_supply_changed(charger); in gpio_charger_irq() 331 gpio_charger->charger = devm_power_supply_register(dev, charger_desc, in gpio_charger_probe() 333 if (IS_ERR(gpio_charger->charger)) { in gpio_charger_probe() 334 ret = PTR_ERR(gpio_charger->charger); in gpio_charger_probe() 339 gpio_charger->irq = gpio_charger_get_irq(dev, gpio_charger->charger, in gpio_charger_probe() 342 charge_status_irq = gpio_charger_get_irq(dev, gpio_charger->charger, in gpio_charger_probe() 371 power_supply_changed(gpio_charger->charger); in gpio_charger_resume()
|
/linux/drivers/platform/x86/intel/ |
H A D | crystal_cove_charger.c | 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() 62 mutex_unlock(&charger->buslock); in crystal_cove_charger_irq_bus_sync_unlock() [all …]
|
/linux/Documentation/devicetree/bindings/w1/ |
H A D | w1.txt | 11 charger: charger { 12 compatible = "gpio-charger"; 13 charger-type = "mains"; 23 power-supplies = <&charger>;
|
/linux/arch/arm/boot/dts/microchip/ |
H A D | at91-natte.dtsi | 67 charger@9 { 83 charger@9 { 99 charger@9 { 115 charger@9 { 131 charger@9 { 147 charger@9 { 163 charger@9 { 179 charger@9 {
|
/linux/drivers/acpi/ |
H A D | ac.c | 56 struct power_supply *charger; member 148 power_supply_changed(ac->charger); in acpi_ac_notify() 232 ac->charger = power_supply_register(&pdev->dev, in acpi_ac_probe() 234 if (IS_ERR(ac->charger)) { in acpi_ac_probe() 235 result = PTR_ERR(ac->charger); in acpi_ac_probe() 253 power_supply_unregister(ac->charger); in acpi_ac_probe() 271 power_supply_changed(ac->charger); in acpi_ac_resume() 285 power_supply_unregister(ac->charger); in acpi_ac_remove()
|
/linux/Documentation/devicetree/bindings/rtc/ |
H A D | dallas,ds1390.txt | 8 - trickle-resistor-ohms : Selected resistor for trickle charger 10 Should be given if trickle charger should be enabled 11 - trickle-diode-disable : Do not use internal trickle charger diode 12 Should be given if internal trickle charger diode should be disabled
|
/linux/Documentation/ABI/testing/ |
H A D | usb-charger-uevent | 1 What: Raise a uevent when a USB charger is inserted or removed 5 Description: There are two USB charger states: 10 There are five USB charger types: 23 USB charger is online:: 40 USB charger is offline::
|
/linux/Documentation/devicetree/bindings/mfd/ |
H A D | da9150.txt | 8 da9150-charger : Battery Charger 23 - da9150-charger: See ../power/da9150-charger.txt 40 charger { 41 compatible = "dlg,da9150-charger";
|
/linux/Documentation/power/ |
H A D | charger-manager.rst | 7 Charger Manager provides in-kernel battery charger management that 25 they may be activated at the same time. Each charger may have its 28 aggregates charger-related information from multiple sources and 57 With the charger-related events, the device sends 112 batteries are charged by a single charger, they are counted as one independent 140 fuel gauges or charger devices/chips. 186 5. Notify Charger-Manager of charger events: cm_notify_event() 188 If there is an charger event is required to notify 189 Charger Manager, a charger device driver that triggers the event can call 191 In the function, psy is the charger driver's power_supply pointer, which is [all …]
|