| /OK3568_Linux_fs/kernel/drivers/power/supply/ |
| 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 | ab8500_charger.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (C) ST-Ericsson SA 2012 5 * Charger driver for AB8500 31 #include <linux/mfd/abx500/ab8500-bm.h> 37 /* Charger constants */ 92 /* Lowest charger voltage is 3.39V -> 0x4E */ 105 /*External charger control*/ 110 /* UsbLineStatus register - usb types */ 172 * struct ab8500_charger_interrupts - ab8500 interupts 216 * struct ab8500_charger - ab8500 Charger device information [all …]
|
| H A D | pm2301_charger.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * Power supply driver for ST Ericsson pm2xxx_charger charger 21 #include <linux/mfd/abx500/ab8500-bm.h> 109 if (!pm2->ac.charger_connected && gpio_is_valid(pm2->lpn_pin)) { in set_lpn_pin() 110 gpio_set_value(pm2->lpn_pin, 1); in set_lpn_pin() 117 if (!pm2->ac.charger_connected && gpio_is_valid(pm2->lpn_pin)) in clear_lpn_pin() 118 gpio_set_value(pm2->lpn_pin, 0); in clear_lpn_pin() 126 pm_runtime_get_sync(pm2->dev); in pm2xxx_reg_read() 128 ret = i2c_smbus_read_i2c_block_data(pm2->config.pm2xxx_i2c, reg, in pm2xxx_reg_read() 131 dev_err(pm2->dev, "Error reading register at 0x%x\n", reg); in pm2xxx_reg_read() [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. 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() 114 if (pdata->ext_control) in bq24735_config_charger() 117 if (pdata->charge_current) { in bq24735_config_charger() 118 value = pdata->charge_current & BQ24735_CHARGE_CURRENT_MASK; in bq24735_config_charger() 120 ret = bq24735_write_word(charger->client, in bq24735_config_charger() [all …]
|
| H A D | pda_power.c | 1 // SPDX-License-Identifier: GPL-2.0-only 4 * power supplies (AC/USB) connected to main and backup batteries, 5 * and optional builtin charger. 24 return IRQF_SHARED | (res->flags & IRQF_TRIGGER_MASK); in get_irq_flags() 48 static int new_ac_status = -1; 49 static int new_usb_status = -1; 50 static int ac_status = -1; 51 static int usb_status = -1; 59 if (psy->desc->type == POWER_SUPPLY_TYPE_MAINS) in pda_power_get_property() 60 val->intval = pdata->is_ac_online ? in pda_power_get_property() [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 | Kconfig | 1 # SPDX-License-Identifier: GPL-2.0-only 6 power supply (batteries, AC, USB) monitoring by userspace 37 one or two external power supplies (AC/USB) connected to main and 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. [all …]
|
| H A D | abx500_chargalg.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (C) ST-Ericsson SA 2012 32 #include <linux/mfd/abx500/ab8500-bm.h> 38 /* End-of-charge criteria counter */ 177 * struct abx500_charge_curr_maximization - Charger maximization parameters 178 * @original_iset: the non optimized/maximised charger current 182 * @condition_cnt: number of iterations needed before a new charger current 184 * @max_current: maximum charger current 185 * @wait_cnt: to avoid too fast current step down in case of charger 208 * struct abx500_chargalg - abx500 Charging algorithm device information [all …]
|
| H A D | twl4030_charger.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * TWL4030/TPS65950 BCI (Battery Charger Interface) driver 72 #define TWL4030_ICHGEOC BIT(4) /* Battery current end-of-charge */ 80 #define TWL4030_ACCHGOV BIT(3) /* Ac charger overvoltage */ 91 * If AC (Accessory Charger) voltage exceeds 4.5V (MADC 11) 92 * then AC is available. 113 struct power_supply *ac; member 206 * CGAIN == 0: ICHG = (BCIICHG * 1.7) / (2^10 - 1) - 0.85 207 * CGAIN == 1: ICHG = (BCIICHG * 3.4) / (2^10 - 1) - 1.7 209 * 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 | rk817_charger.c | 2 * rk817 charger driver 5 * xsf <xsf@rock-chips.com> 361 if (charge->pdata->virtual_power) in rk817_charge_ac_get_property() 362 val->intval = 1; in rk817_charge_ac_get_property() 364 val->intval = (charge->ac_in | charge->dc_in); in rk817_charge_ac_get_property() 366 DBG("ac report online: %d\n", val->intval); in rk817_charge_ac_get_property() 369 if (charge->pdata->virtual_power) in rk817_charge_ac_get_property() 370 val->intval = POWER_SUPPLY_STATUS_CHARGING; in rk817_charge_ac_get_property() 372 val->intval = charge->prop_status; in rk817_charge_ac_get_property() 374 DBG("report prop: %d\n", val->intval); in rk817_charge_ac_get_property() [all …]
|
| /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/power/supply/ |
| H A D | tps65217_charger.txt | 1 TPS65217 Charger 4 -compatible: "ti,tps65217-charger" 5 -interrupts: TPS65217 interrupt numbers for the AC and USB charger input change. 6 Should be <0> for the USB charger and <1> for the AC adapter. 7 -interrupt-names: Should be "USB" and "AC" 13 tps65217-charger { 14 compatible = "ti,tps65217-charger"; 16 interrupt-names = "USB", "AC";
|
| H A D | lp8727_charger.txt | 1 Binding for TI/National Semiconductor LP8727 Charger 4 - compatible: "ti,lp8727" 5 - reg: I2C slave address 27h 8 - interrupts: interrupt specifier (see interrupt binding[0]) 9 - debounce-ms: interrupt debounce time. (u32) 11 AC and USB charging parameters 12 - charger-type: "ac" or "usb" (string) 13 - eoc-level: value of 'enum lp8727_eoc_level' (u8) 14 - charging-current: value of 'enum lp8727_ichg' (u8) 16 [0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt [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 - Dan Murphy <dmurphy@ti.com> 12 - Ricardo Rivera-Matos <r-rivera-matos@ti.com> 16 integrates the most common functions for wearable devices, namely a charger, 18 push-button controller. 20 Specifications about the charger can be found at: 27 - ti,bq25150 [all …]
|
| H A D | ti,bq24735.txt | 5 - compatible : "ti,bq24735" 8 - interrupts : Specify the interrupt to be used to trigger when the AC 10 - ti,ac-detect-gpios : This GPIO is optionally used to read the AC adapter 13 the GPIO must be active on AC adapter absence despite ACOK being active 14 (high) on AC adapter presence. 15 - ti,charge-current : Used to control and set the charging current. This value 19 - ti,charge-voltage : Used to control and set the charging voltage. This value 23 - ti,input-current : Used to control and set the charger input current. This 27 - ti,external-control : Indicates that the charger is configured externally 30 - poll-interval : In case 'interrupts' is not specified, poll AC adapter [all …]
|
| H A D | sc8551_charger.txt | 1 Binding for sc8551 battery charger 4 - compatible: "sc,sc8551-standalone" for sc8551 Charger Power Supply 5 - monitored-battery: phandle of battery characteristics devicetree node 6 - interrupts: Interrupt mapping for GPIO IRQ. Use in conjunction with 7 "interrupt-parent". If an interrupt is not provided the driver will switch 10 - input-voltage-limit-microvolt: integer, input voltage level in uV, used to 13 - input-current-limit-microamp: integer, input current value in uA drained by the 14 charger from the power source.Default: 500000 uA (500mA) 16 - sc,sc8551,bat-ovp-disable: enable the battery over voltage protection 17 - sc,sc8551,bat-ocp-disable: enable the battery over current protection [all …]
|
| H A D | power-supply.yaml | 1 # SPDX-License-Identifier: GPL-2.0 3 --- 4 $id: "http://devicetree.org/schemas/power/supply/power-supply.yaml#" 5 $schema: "http://devicetree.org/meta-schemas/core.yaml#" 10 - Sebastian Reichel <sre@kernel.org> 13 power-supplies: 14 $ref: /schemas/types.yaml#/definitions/phandle-array 22 - | 24 #address-cells = <1>; 25 #size-cells = <0>; [all …]
|
| /OK3568_Linux_fs/kernel/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 $) 24 #define ACPI_AC_DEVICE_NAME "AC Adapter" 32 ACPI_MODULE_NAME("ac"); 35 MODULE_DESCRIPTION("ACPI AC Adapter Driver"); 54 /* Lists of PMIC ACPI HIDs with an (often better) native charger driver */ 56 { "INT33F4", -1 }, /* X-Powers AXP288 PMIC */ 70 .name = "ac", 83 struct power_supply *charger; member 92 /* -------------------------------------------------------------------------- [all …]
|
| /OK3568_Linux_fs/kernel/include/linux/ |
| H A D | pm2301_charger.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 3 * PM2301 charger driver. 14 * struct pm2xxx_bm_charger_parameters - Charger specific parameters 15 * @ac_volt_max: maximum allowed AC charger voltage in mV 16 * @ac_curr_max: maximum allowed AC charger current in mA 24 * struct pm2xxx_bm_data - pm2xxx battery management data 26 * @chg_params charger parameters
|
| /OK3568_Linux_fs/kernel/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
|
| /OK3568_Linux_fs/kernel/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 <mach/pxa2xx-regs.h> 28 #include "regs-rtc.h" 177 /* max1111 accepts channels from 0-3, however, in sharpsl_pm_pxa_read_max1111() 178 * it is encoded from 0-7 here in the code. in sharpsl_pm_pxa_read_max1111() 185 int i = sharpsl_pm.machinfo->bat_levels - 1; in get_percentage() [all …]
|
| /OK3568_Linux_fs/kernel/include/linux/mfd/ |
| H A D | abx500.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 3 * Copyright (C) 2007-2009 ST-Ericsson AB 45 * struct abx500_res_to_temp - defines one point in a temp to res curve. To 57 * struct abx500_v_to_cap - Table for translating voltage to capacity 70 * struct abx500_fg_parameters - Fuel gauge algorithm parameters, in seconds 122 * struct abx500_charger_maximization - struct used by the board config. 124 * @maxi_chg_curr: Maximum charger current allowed 125 * @maxi_wait_cycles: cycles to wait before setting charger current 126 * @charger_curr_step delta between two charger current settings (mA) 136 * struct abx500_battery_type - different batteries supported [all …]
|
| /OK3568_Linux_fs/kernel/include/linux/mfd/abx500/ |
| H A D | ab8500-bm.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 3 * Copyright ST-Ericsson 2012. 30 * Charger / status register offfsets 41 * Charger / control register offfsets 58 * Charger / main control register offsets 67 * Charger / USB control register offsets 277 * struct res_to_temp - defines one point in a temp to res curve. To 289 * struct batres_vs_temp - defines one point in a temp vs battery internal 303 * struct ab8500_fg_parameters - Fuel gauge algorithm parameters, in seconds 353 * struct ab8500_charger_maximization - struct used by the board config. [all …]
|
| /OK3568_Linux_fs/kernel/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 …]
|