/Linux-v6.1/drivers/power/supply/ |
D | cros_usbpd-charger.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * Power supply driver for ChromeOS EC based USB PD Charger. 5 * Copyright (c) 2014 - 2018 Google, Inc 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() 109 return -ENOMEM; in cros_usbpd_charger_ec_command() 111 msg->version = version; in cros_usbpd_charger_ec_command() [all …]
|
D | act8945a_charger.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Power supply driver for the Active-semi ACT8945A PMIC 19 static const char *act8945a_charger_manufacturer = "Active-semi"; 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() 268 * Riset(K) = 2336 * (1V/Ichg(mA)) - 0.205 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 [all …]
|
D | max8903_charger.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * max8903_charger.c - Maxim 8903 USB/Adapter Charger Driver 28 struct gpio_desc *cen; /* Charger Enable input */ 31 struct gpio_desc *chg; /* Charger status output */ 33 struct gpio_desc *dcm; /* Current-Limit Mode input (1: DC, 2: USB) */ 41 POWER_SUPPLY_PROP_STATUS, /* Charger status output */ 54 val->intval = POWER_SUPPLY_STATUS_UNKNOWN; in max8903_get_property() 55 if (data->chg) { in max8903_get_property() 56 if (gpiod_get_value(data->chg)) in max8903_get_property() 58 val->intval = POWER_SUPPLY_STATUS_CHARGING; in max8903_get_property() [all …]
|
D | ab8500_charger.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (C) ST-Ericsson SA 2012 5 * Charger driver for AB8500 36 #include "ab8500-bm.h" 37 #include "ab8500-chargalg.h" 39 /* Charger constants */ 94 /* Lowest charger voltage is 3.39V -> 0x4E */ 107 /*External charger control*/ 112 /* UsbLineStatus register - usb types */ 174 * struct ab8500_charger_interrupts - ab8500 interrupts [all …]
|
D | tps65217_charger.c | 1 // SPDX-License-Identifier: GPL-2.0 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() 62 * NTC TYPE (for battery temperature measurement) 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 [all …]
|
D | gpio-charger.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Copyright (C) 2010, Lars-Peter Clausen <lars@metafoo.de> 18 #include <linux/power/gpio-charger.h> 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() 59 int ndescs = gpio_charger->current_limit_gpios->ndescs; in set_charge_current_limit() 60 struct gpio_desc **gpios = gpio_charger->current_limit_gpios->desc; in set_charge_current_limit() 63 if (!gpio_charger->current_limit_map_size) in set_charge_current_limit() 64 return -EINVAL; in set_charge_current_limit() [all …]
|
D | isp1704_charger.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * ISP1704 USB Charger Detection driver 6 * Copyright (C) 2012 - 2013 Pali Rohár <pali@kernel.org> 63 return usb_phy_io_read(isp->phy, reg); in isp1704_read() 68 return usb_phy_io_write(isp->phy, val, reg); in isp1704_write() 73 gpiod_set_value(isp->enable_gpio, on); in isp1704_charger_set_power() 77 * Determine is the charging port DCP (dedicated charger) or CDP (Host/HUB 88 int type = POWER_SUPPLY_TYPE_USB_DCP; in isp1704_charger_type() local 103 /* Enable strong pull-up on DP (1.5K) and reset */ in isp1704_charger_type() 110 type = POWER_SUPPLY_TYPE_USB_CDP; in isp1704_charger_type() [all …]
|
D | lt3651-charger.c | 1 // SPDX-License-Identifier: GPL-2.0+ 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() 48 if (!lt3651_charger->chrg_gpio) { in lt3651_charger_get_property() 49 val->intval = POWER_SUPPLY_STATUS_UNKNOWN; in lt3651_charger_get_property() 52 if (gpiod_get_value(lt3651_charger->chrg_gpio)) in lt3651_charger_get_property() 53 val->intval = POWER_SUPPLY_STATUS_CHARGING; in lt3651_charger_get_property() 55 val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; in lt3651_charger_get_property() [all …]
|
D | da9150-charger.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 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 59 /* Read processed value - mV units */ in da9150_charger_vbus_voltage_now() 60 ret = iio_read_channel_processed(charger->vbus_chan, &v_val); in da9150_charger_vbus_voltage_now() 65 val->intval = v_val * 1000; 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 [all …]
|
D | ab8500_chargalg.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (C) ST-Ericsson SA 2012 34 #include "ab8500-bm.h" 35 #include "ab8500-chargalg.h" 40 /* End-of-charge criteria counter */ 169 * struct ab8500_charge_curr_maximization - Charger maximization parameters 170 * @original_iset_ua: the non optimized/maximised charger current 172 * @condition_cnt: number of iterations needed before a new charger current 174 * @max_current_ua: maximum charger current 175 * @wait_cnt: to avoid too fast current step down in case of charger [all …]
|
D | mp2629_charger.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * MP2629 battery charger driver 148 "mp2629-batt-volt", 149 "mp2629-system-volt", 150 "mp2629-input-volt", 151 "mp2629-batt-current", 152 "mp2629-input-current", 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() 166 val->intval = chval * 1000; in mp2629_read_adc() [all …]
|
D | z2_battery.c | 1 // SPDX-License-Identifier: GPL-2.0-only 30 static unsigned long z2_read_bat(struct z2_charger *charger) in z2_read_bat() argument 33 data = i2c_smbus_read_byte_data(charger->client, in z2_read_bat() 34 charger->info->batt_I2C_reg); in z2_read_bat() 38 return data * charger->info->batt_mult / charger->info->batt_div; in z2_read_bat() 45 struct z2_charger *charger = power_supply_get_drvdata(batt_ps); in z2_batt_get_property() local 46 struct z2_battery_info *info = charger->info; in z2_batt_get_property() 50 val->intval = charger->bat_status; in z2_batt_get_property() 53 val->intval = info->batt_tech; in z2_batt_get_property() 56 if (info->batt_I2C_reg >= 0) in z2_batt_get_property() [all …]
|
D | rk817_charger.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * Charger Driver for Rockchip rk817 12 #include <linux/devm-helpers.h> 68 * soc - state of charge - like the BSP this is stored as a percentage, 143 return -EINVAL; in rk817_chg_cur_to_reg() 166 return -EINVAL; in rk817_chg_cur_from_reg() 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() [all …]
|
/Linux-v6.1/drivers/usb/phy/ |
D | phy.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * phy.c -- USB phy handling 5 * Copyright (C) 2004-2013 Texas Instruments 17 /* Default current range by charger type. */ 52 enum usb_phy_type type) in __usb_find_phy() argument 57 if (phy->type != type) in __usb_find_phy() 63 return ERR_PTR(-ENODEV); in __usb_find_phy() 71 return ERR_PTR(-ENODEV); in __of_usb_find_phy() 74 if (node != phy->dev->of_node) in __of_usb_find_phy() 80 return ERR_PTR(-EPROBE_DEFER); in __of_usb_find_phy() [all …]
|
/Linux-v6.1/Documentation/power/ |
D | charger-manager.rst | 2 Charger Manager 7 Charger Manager provides in-kernel battery charger management that 8 requires temperature monitoring during suspend-to-RAM state 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 26 own power-supply-class and each power-supply-class can provide 28 aggregates charger-related information from multiple sources and [all …]
|
/Linux-v6.1/Documentation/devicetree/bindings/power/supply/ |
D | gpio-charger.yaml | 1 # SPDX-License-Identifier: GPL-2.0 3 --- 4 $id: http://devicetree.org/schemas/power/supply/gpio-charger.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 - Sebastian Reichel <sre@kernel.org> 19 const: gpio-charger 21 charger-type: 23 - unknown 24 - battery 25 - ups [all …]
|
D | ti,lp8727.yaml | 1 # SPDX-License-Identifier: GPL-2.0 3 --- 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: Binding for TI/National Semiconductor LP8727 Charger 10 - Sebastian Reichel <sre@kernel.org> 13 - $ref: power-supply.yaml# 25 debounce-ms: 30 type: object 33 charger-type: 35 - ac [all …]
|
D | charger-manager.yaml | 1 # SPDX-License-Identifier: GPL-2.0 3 --- 4 $id: http://devicetree.org/schemas/power/supply/charger-manager.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: Charger Manager 10 - Sebastian Reichel <sre@kernel.org> 13 Binding for the legacy charger manager driver. 18 const: charger-manager 20 cm-chargers: 22 $ref: /schemas/types.yaml#/definitions/string-array [all …]
|
/Linux-v6.1/drivers/phy/ti/ |
D | phy-tusb1210.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * tusb1210.c - TUSB1210 USB ULPI PHY driver 41 /* TUSB1210 charger detection work states */ 67 struct power_supply *charger; member 75 ret = ulpi_write(tusb->ulpi, reg, val); in tusb1210_ulpi_write() 77 dev_err(&tusb->ulpi->dev, "error %d writing val 0x%02x to reg 0x%02x\n", in tusb1210_ulpi_write() 87 ret = ulpi_read(tusb->ulpi, reg); in tusb1210_ulpi_read() 92 dev_err(&tusb->ulpi->dev, "error %d reading reg 0x%02x\n", ret, reg); in tusb1210_ulpi_read() 102 gpiod_set_value_cansleep(tusb->gpio_reset, 1); in tusb1210_power_on() 103 gpiod_set_value_cansleep(tusb->gpio_cs, 1); in tusb1210_power_on() [all …]
|
/Linux-v6.1/drivers/regulator/ |
D | max77693-regulator.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 // max77693.c - Regulator driver for the Maxim 77693 and 77843 5 // Copyright (C) 2013-2015 Samsung Electronics 19 #include <linux/mfd/max77693-common.h> 20 #include <linux/mfd/max77693-private.h> 21 #include <linux/mfd/max77843-private.h> 46 * MAX77693 CHARGER regulator - Min : 20mA, Max : 2580mA, step : 20mA 48 * 0x04 ~ 0x7E = (60 + (X - 3) * 20) mA 58 unsigned int chg_min_uA = rdev->constraints->min_uA; in max77693_chg_get_current_limit() 59 unsigned int chg_max_uA = rdev->constraints->max_uA; in max77693_chg_get_current_limit() [all …]
|
/Linux-v6.1/Documentation/ABI/testing/ |
D | sysfs-class-power | 5 Contact: linux-pm@vger.kernel.org 14 Contact: linux-pm@vger.kernel.org 23 Contact: linux-pm@vger.kernel.org 30 What: /sys/class/power_supply/<supply_name>/type 32 Contact: linux-pm@vger.kernel.org 34 Describes the main type of the supply. 43 Contact: linux-pm@vger.kernel.org 66 Contact: linux-pm@vger.kernel.org 81 Contact: linux-pm@vger.kernel.org 94 read-only reporting, unless the 'online' state of the supply [all …]
|
/Linux-v6.1/Documentation/devicetree/bindings/regulator/ |
D | maxim,max8997.yaml | 1 # SPDX-License-Identifier: GPL-2.0-only 3 --- 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 - Krzysztof Kozlowski <krzk@kernel.org> 14 regulators, charger controller with fuel gauge, RTC, clock outputs, haptic 15 motor driver, flash LED driver and Micro-USB Interface Controller. 17 The binding here is not complete and describes only regulator and charger 22 const: maxim,max8997-pmic 24 charger-supply: 30 - description: irq1 interrupt [all …]
|
/Linux-v6.1/Documentation/devicetree/bindings/mfd/ |
D | maxim,max14577.yaml | 1 # SPDX-License-Identifier: GPL-2.0-only 3 --- 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 - Krzysztof Kozlowski <krzk@kernel.org> 17 includes voltage safeout regulators, charger and MicroUSB management IC. 20 includes voltage safeout and LDO regulators, charger, fuel-gauge and MicroUSB 26 - maxim,max14577 27 - maxim,max77836 35 wakeup-source: true 37 charger: [all …]
|
D | maxim,max77693.yaml | 1 # SPDX-License-Identifier: GPL-2.0-only 3 --- 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 - Chanwoo Choi <cw00.choi@samsung.com> 11 - Krzysztof Kozlowski <krzk@kernel.org> 18 includes voltage current regulators, charger, LED/flash, haptic motor driver 31 charger: 37 max77693-muic: 38 type: object 43 const: maxim,max77693-muic [all …]
|
D | mediatek,mt6370.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 3 --- 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 - ChiYuan Huang <cy_huang@richtek.com> 13 MT6370 is a highly-integrated smart power management IC, which includes a 14 single cell Li-Ion/Li-Polymer switching battery charger, a USB Type-C & 26 wakeup-source: true 31 interrupt-controller: true 33 "#interrupt-cells": 37 type: object [all …]
|