/linux/drivers/power/supply/ |
H A D | ab8500_charger.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (C) ST-Ericsson SA 2012 5 * Charger driver for AB8500 32 #include <linux/usb/otg.h> 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 */ [all …]
|
H A D | da9150-charger.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * DA9150 Charger Driver 17 #include <linux/usb/phy.h> 27 struct power_supply *usb; member 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 57 /* Read processed value - mV units */ in da9150_charger_vbus_voltage_now() 58 ret = iio_read_channel_processed(charger->vbus_chan, &v_val); in da9150_charger_vbus_voltage_now() [all …]
|
H A D | twl6030_charger.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * TWL6030 charger 24 #include <linux/usb/otg.h> 26 #include <linux/devm-helpers.h> 48 /* TWL6032 registers 0xDA to 0xDE - TWL6032_MODULE_CHARGER */ 139 #define UA_TO_VITERM(x) (((x) / 50000 - 1) << 5) 149 #define UV_TO_VOREG(x) (((x) - 3500000) / 20000) 161 #define UA_TO_VICHRG(x) (((x) / 100000) - 1) 194 struct power_supply *usb; member 218 static int twl6030_config_cinlimit_reg(struct twl6030_charger_info *charger, in twl6030_config_cinlimit_reg() argument [all …]
|
H A D | Kconfig | 1 # SPDX-License-Identifier: GPL-2.0-only 6 power supply (batteries, AC, USB) monitoring by userspace 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" [all …]
|
H A D | max8903_charger.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * max8903_charger.c - Maxim 8903 USB/Adapter Charger Driver 27 struct gpio_desc *cen; /* Charger Enable input */ 29 struct gpio_desc *uok; /* USB Power OK output */ 30 struct gpio_desc *chg; /* Charger status output */ 32 struct gpio_desc *dcm; /* Current-Limit Mode input (1: DC, 2: USB) */ 33 struct gpio_desc *usus; /* USB Suspend Input (1: suspended) */ 40 POWER_SUPPLY_PROP_STATUS, /* Charger status output */ 53 val->intval = POWER_SUPPLY_STATUS_UNKNOWN; in max8903_get_property() 54 if (data->chg) { in max8903_get_property() [all …]
|
H A D | max8997_charger.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 // max8997_charger.c - Power supply consumer driver for the Maxim 8997/8966 15 #include <linux/mfd/max8997-private.h> 17 #include <linux/devm-helpers.h> 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() 61 val->intval = 0; in max8997_battery_get_property() 66 val->intval = POWER_SUPPLY_STATUS_FULL; in max8997_battery_get_property() [all …]
|
H A 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 26 #define DRV_NAME "cros-usbpd-charger" 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() 99 return -ENOMEM; in cros_usbpd_charger_ec_command() 101 msg->version = version; in cros_usbpd_charger_ec_command() [all …]
|
H A 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 …]
|
H A D | mp2629_charger.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * MP2629 battery charger driver 83 struct power_supply *usb; member 140 "mp2629-batt-volt", 141 "mp2629-system-volt", 142 "mp2629-input-volt", 143 "mp2629-batt-current", 144 "mp2629-input-current", 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() [all …]
|
H A D | rt5033_charger.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Battery charger driver for RT5033 9 #include <linux/devm-helpers.h> 18 #include <linux/mfd/rt5033-private.h> 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 [all …]
|
H A D | ab8500-bm.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 16 * USB/ULPI register offsets 24 * Charger / status register offfsets 35 * Charger / control register offfsets 52 * Charger / main control register offsets 61 * Charger / USB control register offsets 253 /* USB Power Path constants for ab8540 */ 267 * struct ab8500_fg_parameters - Fuel gauge algorithm parameters, in seconds 317 * struct ab8500_charger_maximization - struct used by the board config. 319 * @maxi_chg_curr_ua: Maximum charger current allowed in microampere [all …]
|
H A 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> 22 #include <linux/usb/otg.h> 23 #include <linux/usb/ulpi.h> 24 #include <linux/usb/ch9.h> 25 #include <linux/usb/gadget.h> 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() [all …]
|
/linux/Documentation/devicetree/bindings/power/supply/ |
H A 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 …]
|
H A D | ti,lp8727.yaml | 1 # SPDX-License-Identifier: GPL-2.0 3 --- 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: TI/National Semiconductor LP8727 Charger 10 - Sebastian Reichel <sre@kernel.org> 13 - $ref: power-supply.yaml# 25 debounce-ms: 29 '^(ac|usb)$': 32 description: USB/AC charging parameters 34 charger-type: [all …]
|
H A D | richtek,rt5033-charger.yaml | 1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 3 --- 4 $id: http://devicetree.org/schemas/power/supply/richtek,rt5033-charger.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: Richtek RT5033 PMIC Battery Charger 10 - Jakob Hauser <jahau@rocketmail.com> 13 The battery charger of the multifunction device RT5033 has to be instantiated 14 under sub-node named "charger" using the following format. 18 const: richtek,rt5033-charger 20 monitored-battery: [all …]
|
H A D | qcom,pm8941-charger.yaml | 1 # SPDX-License-Identifier: GPL-2.0 3 --- 4 $id: http://devicetree.org/schemas/power/supply/qcom,pm8941-charger.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: Qualcomm Switch-Mode Battery Charger and Boost 10 - Sebastian Reichel <sre@kernel.org> 15 - qcom,pm8226-charger 16 - qcom,pm8941-charger 23 - description: charge done 24 - description: charge fast mode [all …]
|
H A D | qcom,pmi8998-charger.yaml | 1 # SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause 3 --- 4 $id: http://devicetree.org/schemas/power/supply/qcom,pmi8998-charger.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: Qualcomm PMI8998/PM660 Switch-Mode Battery Charger "2" 10 - Caleb Connolly <caleb.connolly@linaro.org> 15 - qcom,pmi8998-charger 16 - qcom,pm660-charger 24 interrupt-names: 26 - const: usb-plugin [all …]
|
H A D | twl4030-charger.yaml | 1 # SPDX-License-Identifier: GPL-2.0 3 --- 4 $id: http://devicetree.org/schemas/power/supply/twl4030-charger.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: TWL4030 BCI (Battery Charger Interface) 10 The battery charger needs to interact with the USB phy in order to know when 14 value in explicit configuration in device-tree. Rather if there is a sibling 15 of the BCI node which is compatible with "ti,twl4030-usb", then that is used 16 to determine when and how use USB power for charging. 19 - Sebastian Reichel <sre@kernel.org> [all …]
|
H A D | qcom,pm8916-lbc.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 3 --- 4 $id: http://devicetree.org/schemas/power/supply/qcom,pm8916-lbc.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: Qualcomm Linear Battery Charger 10 - Nikita Travkin <nikita@trvn.ru> 13 Linear Battery Charger hardware block, found in some Qualcomm PMICs 14 such as pm8916. Implements a simple, autonomous CC/CV charger. 17 - $ref: power-supply.yaml# 21 const: qcom,pm8916-lbc [all …]
|
H A D | bq2415x.yaml | 1 # SPDX-License-Identifier: GPL-2.0 4 --- 6 $schema: http://devicetree.org/meta-schemas/core.yaml# 8 title: TI bq2415x Li-Ion Charger 11 - Sebastian Reichel <sre@kernel.org> 14 - $ref: power-supply.yaml# 19 - ti,bq24150 20 - ti,bq24150a 21 - ti,bq24151 22 - ti,bq24151a [all …]
|
H A D | mediatek,mt6370-charger.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 3 --- 4 $id: http://devicetree.org/schemas/power/supply/mediatek,mt6370-charger.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: MediaTek MT6370 Battery Charger 10 - ChiaEn Wu <chiaen_wu@richtek.com> 14 Provides Battery Charger, Boost for OTG devices and BC1.2 detection. 18 const: mediatek,mt6370-charger 22 Specify what irqs are needed to be handled by MT6370 Charger driver. 23 We need to use the IRQ "MT6370_IRQ_OVPCTRL_UVP_D" to know when USB [all …]
|
H A D | tps65217-charger.yaml | 1 # SPDX-License-Identifier: GPL-2.0 3 --- 4 $id: http://devicetree.org/schemas/power/supply/tps65217-charger.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: TPS65217 Charger 10 - Sebastian Reichel <sre@kernel.org> 13 - $ref: power-supply.yaml# 17 const: ti,tps65217-charger 23 interrupt-names: 25 - const: USB [all …]
|
/linux/Documentation/ABI/testing/ |
H A D | usb-charger-uevent | 1 What: Raise a uevent when a USB charger is inserted or removed 2 Date: 2020-01-14 4 Contact: linux-usb@vger.kernel.org 5 Description: There are two USB charger states: 7 - USB_CHARGER_ABSENT 8 - USB_CHARGER_PRESENT 10 There are five USB charger types: 13 USB_CHARGER_UNKNOWN_TYPE Charger type is unknown 20 https://www.usb.org/document-library/battery-charging-v12-spec-and-adopters-agreement 22 Here are two examples taken using ``udevadm monitor -p`` when [all …]
|
H A 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 32 Contact: linux-pm@vger.kernel.org 37 Valid values: "Battery", "UPS", "Mains", "USB", "Wireless" 39 **Battery and USB properties** 43 Contact: linux-pm@vger.kernel.org 52 USB: 62 batteries and for USB IBUS current. 66 Contact: linux-pm@vger.kernel.org [all …]
|
/linux/include/linux/mfd/wm8350/ |
H A D | supply.h | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 3 * supply.h -- Power Supply Driver for Wolfson WM8350 PMIC 15 * Charger registers 22 * R168 (0xA8) - Battery Charger Control 1 39 * R169 (0xA9) - Battery Charger Control 2 54 * R170 (0xAA) - Battery Charger Control 3 61 * Charger Interrupts 75 * Charger Policy 84 #define WM8350_CHG_EOC_mA(x) (((x - 10) & 0x7) << 10) 104 * Policy to control charger state machine. [all …]
|