/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 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 …]
|
H A D | tps65090-charger.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Battery charger driver for TI's tps65090 36 struct power_supply *ac; member 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() [all …]
|
H A D | bq24735-charger.c | 2 * Battery charger driver for TI BQ24735 17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 #include <linux/devm-helpers.h> 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() 117 if (pdata->ext_control) in bq24735_config_charger() 120 if (pdata->charge_current) { in bq24735_config_charger() 121 value = pdata->charge_current & BQ24735_CHARGE_CURRENT_MASK; in bq24735_config_charger() [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 | max8925_power.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * Copyright (c) 2009-2010 Marvell International Ltd. 68 struct power_supply *ac; member 87 struct max8925_chip *chip = info->chip; in __set_charger() 89 /* enable charger in platform */ in __set_charger() 90 if (info->set_charger) in __set_charger() 91 info->set_charger(1); in __set_charger() 92 /* enable charger */ in __set_charger() 93 max8925_set_bits(info->gpm, MAX8925_CHG_CNTL1, 1 << 7, 0); in __set_charger() 96 max8925_set_bits(info->gpm, MAX8925_CHG_CNTL1, 1 << 7, 1 << 7); in __set_charger() [all …]
|
H A 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 …]
|
H A D | twl4030_charger.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * TWL4030/TPS65950 BCI (Battery Charger Interface) driver 73 #define TWL4030_ICHGEOC BIT(4) /* Battery current end-of-charge */ 81 #define TWL4030_ACCHGOV BIT(3) /* Ac charger overvoltage */ 92 * If AC (Accessory Charger) voltage exceeds 4.5V (MADC 11) 93 * then AC is available. 114 struct power_supply *ac; member 207 * CGAIN == 0: ICHG = (BCIICHG * 1.7) / (2^10 - 1) - 0.85 208 * CGAIN == 1: ICHG = (BCIICHG * 3.4) / (2^10 - 1) - 1.7 210 * CGAIN == 0: val * 1.6618 - 0.85 * 1000 [all …]
|
H A D | lp8727_charger.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Driver for LP8727 Micro/Mini USB IC with integrated charger 79 struct power_supply *ac; member 91 /* Charger Data */ 105 mutex_lock(&pchg->xfer_lock); in lp8727_read_bytes() 106 ret = i2c_smbus_read_i2c_block_data(pchg->client, reg, len, data); in lp8727_read_bytes() 107 mutex_unlock(&pchg->xfer_lock); in lp8727_read_bytes() 109 return (ret != len) ? -EIO : 0; in lp8727_read_bytes() 121 mutex_lock(&pchg->xfer_lock); in lp8727_write_byte() 122 ret = i2c_smbus_write_byte_data(pchg->client, reg, data); in lp8727_write_byte() [all …]
|
H A D | wm8350_power.c | 1 // SPDX-License-Identifier: GPL-2.0-only 44 if (!wm8350->power.rev_g_coeff) in wm8350_charge_time_min() 45 return (((min - 30) / 15) & 0xf) << 8; in wm8350_charge_time_min() 47 return (((min - 30) / 30) & 0xf) << 8; in wm8350_charge_time_min() 92 dev_warn(wm8350->dev, in wm8350_charger_config() 93 "No charger policy, charger not configured.\n"); in wm8350_charger_config() 94 return -EINVAL; in wm8350_charger_config() 98 if (policy->fast_limit_USB_mA > 500) { in wm8350_charger_config() 99 dev_err(wm8350->dev, "USB fast charge > 500mA\n"); in wm8350_charger_config() 100 return -EINVAL; in wm8350_charger_config() [all …]
|
H A D | ab8500-bm.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 24 * Charger / status register offfsets 35 * Charger / control register offfsets 52 * Charger / main control register offsets 61 * Charger / USB control register offsets 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 320 * @maxi_wait_cycles: cycles to wait before setting charger current 321 * @charger_curr_step_ua: delta between two charger current settings (uA) [all …]
|
H A 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 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() [all …]
|
/linux/drivers/acpi/ |
H A D | ac.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * acpi_ac.c - ACPI AC Adapter Driver (Revision: 27) 9 #define pr_fmt(fmt) "ACPI: AC: " fmt 25 #define ACPI_AC_DEVICE_NAME "AC Adapter" 33 MODULE_DESCRIPTION("ACPI AC Adapter Driver"); 56 struct power_supply *charger; member 65 /* AC Adapter Management */ 66 static int acpi_ac_get_state(struct acpi_ac *ac) in acpi_ac_get_state() argument 70 if (!ac) in acpi_ac_get_state() 71 return -EINVAL; in acpi_ac_get_state() [all …]
|
/linux/Documentation/devicetree/bindings/power/supply/ |
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 | bq24735.yaml | 1 # SPDX-License-Identifier: GPL-2.0 4 --- 6 $schema: http://devicetree.org/meta-schemas/core.yaml# 8 title: TI BQ24735 Li-Ion Battery Charger 11 - Sebastian Reichel <sre@kernel.org> 14 - $ref: power-supply.yaml# 24 description: AC adapter plug event interrupt 27 ti,ac-detect-gpios: 30 This GPIO is optionally used to read the AC adapter status. This is a Host GPIO 32 Note: for backwards compatibility reasons, the GPIO must be active on AC adapter [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 …]
|
H A D | bq2515x.yaml | 1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 4 --- 6 $schema: http://devicetree.org/meta-schemas/core.yaml# 8 title: TI bq2515x 500-mA Linear charger family 11 - Andrew Davis <afd@ti.com> 15 integrates the most common functions for wearable devices, namely a charger, 17 push-button controller. 19 Specifications about the charger can be found at: 26 - ti,bq25150 27 - ti,bq25155 [all …]
|
/linux/include/linux/platform_data/ |
H A D | lp8727.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 3 * LP8727 Micro/Mini USB IC with integrated charger 47 * @get_batt_present : check battery status - exists or not 51 * @ac : charging parameters for AC type charger 52 * @usb : charging parameters for USB type charger 60 struct lp8727_chg_param *ac; member
|
/linux/arch/arm/mach-pxa/ |
H A D | sharpsl_pm.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Battery and Power Management code for the Sharp SL-C7xx and SL-Cxx00 6 * Copyright (c) 2004-2005 Richard Purdie 17 #include <linux/apm-emulation.h> 25 #include <asm/mach-types.h> 27 #include "pxa2xx-regs.h" 28 #include "regs-rtc.h" 173 /* max1111 accepts channels from 0-3, however, in sharpsl_pm_pxa_read_max1111() 174 * it is encoded from 0-7 here in the code. in sharpsl_pm_pxa_read_max1111() 181 int i = sharpsl_pm.machinfo->bat_levels - 1; in get_percentage() [all …]
|
/linux/Documentation/power/ |
H A D | power_supply_class.rst | 7 Power supply class used to represent battery, UPS, AC or DC power supply 8 properties to user-space. 26 AC/USB power supply online status. (Note that specific details of the 60 +--------------------------------------------------------------------------+ 61 | **Charge/Energy/Capacity - how to not confuse** | 62 +--------------------------------------------------------------------------+ 66 | - `CHARGE_*` | 68 | - `ENERGY_*` | 70 | - `CAPACITY` | 72 +--------------------------------------------------------------------------+ [all …]
|
H A 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: 23 * Support for multiple chargers (e.g., a device with USB, AC, and solar panels) 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 [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 …]
|
/linux/Documentation/ABI/testing/ |
H A D | sysfs-class-power-wilco | 1 What: /sys/class/power_supply/wilco-charger/charge_type 16 primarily use their Chromebook while connected to AC. 24 On Wilco device this mode is pre-configured in the factory 28 What: /sys/class/power_supply/wilco-charger/charge_control_start_threshold 35 What: /sys/class/power_supply/wilco-charger/charge_control_end_threshold
|
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 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 106 Contact: linux-pm@vger.kernel.org 124 Contact: linux-pm@vger.kernel.org [all …]
|
/linux/arch/arm/boot/dts/ |
H A D | tps65217.dtsi | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ 13 interrupt-controller; 14 #interrupt-cells = <1>; 16 charger { 17 compatible = "ti,tps65217-charger"; 19 interrupt-names = "USB", "AC"; 24 compatible = "ti,tps65217-pwrbutton"; 30 #address-cells = <1>; 31 #size-cells = <0>; [all …]
|
/linux/Documentation/devicetree/bindings/mfd/ |
H A D | ene-kb930.yaml | 1 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 3 --- 4 $id: http://devicetree.org/schemas/mfd/ene-kb930.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 14 - Dmitry Osipenko <digetx@gmail.com> 16 $ref: /schemas/power/supply/power-supply.yaml 21 - enum: 22 - acer,a500-iconia-ec # Acer A500 Iconia tablet device 23 - const: ene,kb930 27 system-power-controller: true [all …]
|