Home
last modified time | relevance | path

Searched +full:bat +full:- +full:temp (Results 1 – 25 of 29) sorted by relevance

12

/linux/drivers/mfd/
H A Drohm-bd71828.c1 // SPDX-License-Identifier: GPL-2.0-only
14 #include <linux/mfd/rohm-bd71815.h>
15 #include <linux/mfd/rohm-bd71828.h>
16 #include <linux/mfd/rohm-generic.h>
24 .gpio = -1,
31 .name = "bd71828-pwrkey",
35 DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC0, "bd71815-rtc-alm-0"),
36 DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC1, "bd71815-rtc-alm-1"),
37 DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC2, "bd71815-rtc-alm-2"),
41 DEFINE_RES_IRQ_NAMED(BD71828_INT_RTC0, "bd71828-rtc-alm-0"),
[all …]
/linux/drivers/power/supply/
H A Drx51_battery.c1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Nokia RX-51 battery driver
18 struct power_supply *bat; member
39 * This conversion formula was extracted from maemo program bsi-read
43 int voltage = rx51_battery_read_adc(di->channel_vbat); in rx51_battery_read_voltage()
46 dev_err(di->dev, "Could not read ADC: %d\n", voltage); in rx51_battery_read_voltage()
54 * Temperature look-up tables
55 * TEMP = (1/(t1 + 1/298) - 273.15)
57 * Formula is based on experimental data, RX-51 CAL data, maemo program bme
63 * Usage: TEMP = rx51_temp_table1[RAW]
[all …]
H A Dacer_a500_battery.c1 // SPDX-License-Identifier: GPL-2.0+
5 * Copyright 2020 GRATE-driver project.
42 [REG_TEMPERATURE] = EC_DATA(0x0a, TEMP),
63 static bool a500_battery_update_capacity(struct a500_battery *bat) in a500_battery_update_capacity() argument
68 err = regmap_read(bat->regmap, ec_data[REG_CAPACITY].reg, &capacity); in a500_battery_update_capacity()
75 if (bat->capacity != capacity) { in a500_battery_update_capacity()
76 bat->capacity = capacity; in a500_battery_update_capacity()
83 static int a500_battery_get_status(struct a500_battery *bat) in a500_battery_get_status() argument
85 if (bat->capacity < 100) { in a500_battery_get_status()
86 if (power_supply_am_i_supplied(bat->psy)) in a500_battery_get_status()
[all …]
H A Dtwl4030_madc_battery.c1 // SPDX-License-Identifier: GPL-2.0-only
57 return (madc_read(bt->channel_ichg) > 0) ? 1 : 0; in twl4030_madc_bat_get_charging_status()
62 return madc_read(bt->channel_vbat); in twl4030_madc_bat_get_voltage()
67 return madc_read(bt->channel_ichg) * 1000; in twl4030_madc_bat_get_current()
72 return madc_read(bt->channel_temp) * 10; in twl4030_madc_bat_get_temp()
75 static int twl4030_madc_bat_voltscale(struct twl4030_madc_battery *bat, in twl4030_madc_bat_voltscale() argument
82 if (twl4030_madc_bat_get_charging_status(bat)) in twl4030_madc_bat_voltscale()
83 calibration = bat->pdata->charging; in twl4030_madc_bat_voltscale()
85 calibration = bat->pdata->discharging; in twl4030_madc_bat_voltscale()
93 /* interval found - interpolate within range */ in twl4030_madc_bat_voltscale()
[all …]
H A Dds2760_battery.c5 * 2004-2007 Matt Reimer
111 struct power_supply *bat; member
127 mutex_lock(&sl->master->bus_mutex); in w1_ds2760_io()
134 count = DS2760_DATA_SIZE - addr; in w1_ds2760_io()
138 w1_write_8(sl->master, W1_DS2760_READ_DATA); in w1_ds2760_io()
139 w1_write_8(sl->master, addr); in w1_ds2760_io()
140 count = w1_read_block(sl->master, buf, count); in w1_ds2760_io()
142 w1_write_8(sl->master, W1_DS2760_WRITE_DATA); in w1_ds2760_io()
143 w1_write_8(sl->master, addr); in w1_ds2760_io()
144 w1_write_block(sl->master, buf, count); in w1_ds2760_io()
[all …]
H A Dcollie_battery.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * Battery and Power Management code for the Sharp SL-5x00
21 #include <asm/mach-types.h>
35 bool (*is_present)(struct collie_bat *bat);
54 static unsigned long collie_read_bat(struct collie_bat *bat) in collie_read_bat() argument
58 if (!bat->gpio_bat || bat->adc_bat < 0) in collie_read_bat()
61 gpiod_set_value(bat->gpio_bat, 1); in collie_read_bat()
64 value = ucb1x00_adc_read(ucb, bat->adc_bat, UCB_SYNC); in collie_read_bat()
66 gpiod_set_value(bat->gpio_bat, 0); in collie_read_bat()
68 value = value * 1000000 / bat->adc_bat_divider; in collie_read_bat()
[all …]
H A Dda9052-battery.c1 // SPDX-License-Identifier: GPL-2.0-or-later
185 static int da9052_read_chgend_current(struct da9052_battery *bat, in da9052_read_chgend_current() argument
190 if (bat->status == POWER_SUPPLY_STATUS_DISCHARGING) in da9052_read_chgend_current()
191 return -EINVAL; in da9052_read_chgend_current()
193 ret = da9052_reg_read(bat->da9052, DA9052_ICHG_END_REG); in da9052_read_chgend_current()
202 static int da9052_read_chg_current(struct da9052_battery *bat, int *current_mA) in da9052_read_chg_current() argument
206 if (bat->status == POWER_SUPPLY_STATUS_DISCHARGING) in da9052_read_chg_current()
207 return -EINVAL; in da9052_read_chg_current()
209 ret = da9052_reg_read(bat->da9052, DA9052_ICHG_AV_REG); in da9052_read_chg_current()
218 static int da9052_bat_check_status(struct da9052_battery *bat, int *status) in da9052_bat_check_status() argument
[all …]
H A Dds2781_battery.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * 1-wire client/driver for the Maxim/Dallas DS2781 Stand-Alone Fuel Gauge IC
21 /* Current unit measurement in uA for a 1 milli-ohm sense resistor */
23 /* Charge unit measurement in uAh for a 1 milli-ohm sense resistor */
26 #define DS2781_USER_EEPROM_SIZE (DS2781_EEPROM_BLOCK0_END - \
29 #define DS2781_PARAM_EEPROM_SIZE (DS2781_EEPROM_BLOCK1_END - \
34 struct power_supply *bat; member
56 return w1_ds2781_io(dev_info->w1_dev, buf, addr, count, io); in ds2781_battery_io()
112 ret = ds2781_store_eeprom(dev_info->w1_dev, reg); in ds2781_save_eeprom()
116 ret = ds2781_recall_eeprom(dev_info->w1_dev, reg); in ds2781_save_eeprom()
[all …]
H A Dcpcap-battery.c1 // SPDX-License-Identifier: GPL-2.0-only
10 * Copyright (C) 2009-2010 Motorola, Inc.
23 #include <linux/nvmem-consumer.h>
28 #include <linux/mfd/motorola-cpcap.h>
32 * map to MC13783UG.pdf "Table 5-19. Register 13, Power Control 0"
97 struct power_supply_battery_info bat; member
141 #define CPCAP_NO_BATTERY -400
153 return &ddata->state[state]; in cpcap_battery_get_state()
186 channel = ddata->channels[CPCAP_BATTERY_IIO_BATTDET]; in cpcap_charger_battery_temperature()
190 dev_warn(ddata->dev, "%s failed: %i\n", __func__, error); in cpcap_charger_battery_temperature()
[all …]
H A Dbq27xxx_battery.c1 // SPDX-License-Identifier: GPL-2.0
7 * Copyright (C) 2010-2011 Lars-Peter Clausen <lars@metafoo.de>
19 * https://www.ti.com/product/bq27510-g1
20 * https://www.ti.com/product/bq27510-g2
21 * https://www.ti.com/product/bq27510-g3
22 * https://www.ti.com/product/bq27520-g1
23 * https://www.ti.com/product/bq27520-g2
24 * https://www.ti.com/product/bq27520-g3
25 * https://www.ti.com/product/bq27520-g4
26 * https://www.ti.com/product/bq27530-g1
[all …]
H A Dsc27xx_fuel_gauge.c1 // SPDX-License-Identifier: GPL-2.0
10 #include <linux/nvmem-consumer.h>
128 static int sc27xx_fgu_get_temp(struct sc27xx_fgu_data *data, int *temp);
139 return DIV_S64_ROUND_CLOSEST(adc * 1000, data->cur_1000ma_adc); in sc27xx_fgu_adc_to_current()
144 return DIV_S64_ROUND_CLOSEST(adc * 1000, data->vol_1000mv_adc); in sc27xx_fgu_adc_to_voltage()
149 return DIV_ROUND_CLOSEST(vol * data->vol_1000mv_adc, 1000); in sc27xx_fgu_voltage_to_adc()
156 ret = regmap_read(data->regmap, in sc27xx_fgu_is_first_poweron()
157 data->base + SC27XX_FGU_USER_AREA_STATUS, &status); in sc27xx_fgu_is_first_poweron()
184 ret = regmap_update_bits(data->regmap, in sc27xx_fgu_save_boot_mode()
185 data->base + SC27XX_FGU_USER_AREA_CLEAR, in sc27xx_fgu_save_boot_mode()
[all …]
H A Dqcom_smbb.c1 // SPDX-License-Identifier: GPL-2.0-only
4 * This driver is for the multi-block Switch-Mode Battery Charger and Boost
6 * integrated, single-cell lithium-ion battery charger.
8 * Sub-components:
9 * - Charger core
10 * - Buck
11 * - DC charge-path
12 * - USB charge-path
13 * - Battery interface
14 * - Boost (not implemented)
[all …]
H A Dab8500_btemp.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) ST-Ericsson SA 2012
31 #include <linux/fixp-arith.h>
33 #include "ab8500-bm.h"
35 #define BTEMP_THERMAL_LOW_LIMIT -10
51 * struct ab8500_btemp_interrupts - ab8500 interrupts
77 * struct ab8500_btemp - ab8500 BTEMP device information
124 * ab8500_btemp_batctrl_volt_to_res() - convert batctrl voltage to resistance
136 if (is_ab8500_1p1_or_earlier(di->parent)) { in ab8500_btemp_batctrl_volt_to_res()
141 return (450000 * (v_batctrl)) / (1800 - v_batctrl); in ab8500_btemp_batctrl_volt_to_res()
[all …]
H A Dmax77693_charger.c1 // SPDX-License-Identifier: GPL-2.0+
3 // max77693_charger.c - Battery charger driver for the Maxim 77693
13 #include <linux/mfd/max77693-common.h>
14 #include <linux/mfd/max77693-private.h>
16 #define MAX77693_CHARGER_NAME "max77693-charger"
49 /* In high temp the charging current is reduced, but still charging */ in max77693_get_charger_state()
88 * Top-off: trickle or fast? In top-off the current varies between in max77693_get_charge_type()
96 /* In high temp the charging current is reduced, but still charging */ in max77693_get_charge_type()
118 * - POWER_SUPPLY_HEALTH_DEAD
119 * - POWER_SUPPLY_HEALTH_GOOD
[all …]
/linux/Documentation/devicetree/bindings/power/supply/
H A Dsc27xx-fg.yaml1 # SPDX-License-Identifier: GPL-2.0
3 ---
4 $id: http://devicetree.org/schemas/power/supply/sc27xx-fg.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
10 - Sebastian Reichel <sre@kernel.org>
13 - $ref: power-supply.yaml#
18 - sprd,sc2720-fgu
19 - sprd,sc2721-fgu
20 - sprd,sc2723-fgu
21 - sprd,sc2730-fgu
[all …]
H A Dqcom,pm8941-charger.yaml1 # 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 …]
/linux/arch/arm/boot/dts/qcom/
H A Dpm8226.dtsi1 // SPDX-License-Identifier: BSD-3-Clause
2 #include <dt-bindings/iio/qcom,spmi-vadc.h>
3 #include <dt-bindings/input/linux-event-codes.h>
4 #include <dt-bindings/interrupt-controller/irq.h>
5 #include <dt-bindings/spmi/spmi.h>
8 thermal-zones {
9 pm8226-thermal {
10 polling-delay-passive = <100>;
11 polling-delay = <0>;
12 thermal-sensors = <&pm8226_temp>;
[all …]
H A Dpm8941.dtsi1 // SPDX-License-Identifier: GPL-2.0
2 #include <dt-bindings/iio/qcom,spmi-vadc.h>
3 #include <dt-bindings/interrupt-controller/irq.h>
4 #include <dt-bindings/spmi/spmi.h>
8 thermal-zones {
9 pm8941-thermal {
10 polling-delay-passive = <100>;
11 polling-delay = <0>;
12 thermal-sensors = <&pm8941_temp>;
40 compatible = "qcom,pm8941", "qcom,spmi-pmic";
[all …]
/linux/arch/arm64/boot/dts/sprd/
H A Dsc2731.dtsi1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
12 spi-max-frequency = <26000000>;
14 interrupt-controller;
15 #interrupt-cells = <1>;
16 #address-cells = <1>;
17 #size-cells = <0>;
20 compatible = "sprd,sc2731-charger";
22 monitored-battery = <&bat>;
25 led-controller@200 {
26 compatible = "sprd,sc2731-bltc";
[all …]
/linux/drivers/gpu/drm/nouveau/include/nvkm/subdev/
H A Dclk.h1 /* SPDX-License-Identifier: MIT */
9 #define NVKM_CLK_CSTATE_DEFAULT -1 /* POSTed default */
10 #define NVKM_CLK_CSTATE_BASE -2 /* pstate base */
11 #define NVKM_CLK_CSTATE_HIGHEST -3 /* highest possible */
64 struct list_head list; /* c-states */
98 int ustate_ac; /* user-requested (-1 disabled, -2 perfmon) */
99 int ustate_dc; /* user-requested (-1 disabled, -2 perfmon) */
102 u8 temp; member
113 * bat-shit insane what-was-nouveau_hw.c code
/linux/arch/arm64/boot/dts/qcom/
H A Dpm660.dtsi1 // SPDX-License-Identifier: BSD-3-Clause
6 #include <dt-bindings/iio/qcom,spmi-vadc.h>
7 #include <dt-bindings/input/linux-event-codes.h>
8 #include <dt-bindings/interrupt-controller/irq.h>
9 #include <dt-bindings/spmi/spmi.h>
10 #include <dt-bindings/thermal/thermal.h>
13 thermal-zones {
14 pm660-thermal {
15 polling-delay-passive = <250>;
17 thermal-sensors = <&pm660_temp>;
[all …]
/linux/net/batman-adv/
H A Dtranslation-table.c1 // SPDX-License-Identifier: GPL-2.0
7 #include "translation-table.h"
46 #include "hard-interface.h"
51 #include "soft-interface.h"
78 * batadv_compare_tt() - check if two TT entries are the same
93 return (tt1->vid == tt2->vid) && batadv_compare_eth(data1, data2); in batadv_compare_tt()
97 * batadv_choose_tt() - retur
[all...]
/linux/arch/arm/boot/dts/aspeed/
H A Daspeed-bmc-asrock-spc621d8hm3.dts1 // SPDX-License-Identifier: GPL-2.0+
2 /dts-v1/;
4 #include "aspeed-g5.dtsi"
5 #include <dt-bindings/gpio/aspeed-gpio.h>
6 #include <dt-bindings/i2c/i2c.h>
7 #include <dt-bindings/interrupt-controller/irq.h>
8 #include <dt-bindings/leds/common.h>
12 compatible = "asrock,spc621d8hm3-bmc", "aspeed,ast2500";
22 stdout-path = &uart5;
30 compatible = "gpio-leds";
[all …]
/linux/arch/arm64/boot/dts/freescale/
H A Dimx8mq-librem5.dtsi1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright 2018-2020 Purism SPC
6 /dts-v1/;
8 #include "dt-bindings/input/input.h"
9 #include <dt-bindings/interrupt-controller/irq.h>
10 #include <dt-bindings/leds/common.h>
11 #include "dt-bindings/pwm/pwm.h"
12 #include "dt-bindings/usb/pd.h"
18 chassis-type = "handset";
20 backlight_dsi: backlight-dsi {
[all …]
/linux/Documentation/ABI/testing/
H A Dsysfs-class-power5 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
104 What: /sys/class/power_supply/<supply_name>/temp
106 Contact: linux-pm@vger.kernel.org
[all …]

12