/linux/drivers/mfd/ |
H A D | rohm-bd71828.c | 1 // 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, "bd70528-rtc-alm-0"), 36 DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC1, "bd70528-rtc-alm-1"), 37 DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC2, "bd70528-rtc-alm-2"), 41 DEFINE_RES_IRQ_NAMED(BD71828_INT_RTC0, "bd70528-rtc-alm-0"), [all …]
|
/linux/drivers/power/supply/ |
H A D | rx51_battery.c | 1 // 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 D | acer_a500_battery.c | 1 // 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 D | twl4030_madc_battery.c | 1 // 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 D | ds2760_battery.c | 5 * 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->maste in w1_ds2760_io() 240 battery_interpolate(int array[],int temp) battery_interpolate() argument [all...] |
H A D | collie_battery.c | 1 // 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 D | da9052-battery.c | 1 // 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 D | ds2781_battery.c | 1 // 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; global() member 189 ds2781_get_temperature(struct ds2781_device_info * dev_info,int * temp) ds2781_get_temperature() argument [all...] |
H A D | sc27xx_fuel_gauge.c | 1 // 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 D | cpcap-battery.c | 1 // 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 D | qcom_smbb.c | 1 // 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 D | max77693_charger.c | 1 // 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 …]
|
H A D | rk817_charger.c | 1 // SPDX-License-Identifier: GPL-2.0+ 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() 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() 187 ((vcalib1 - vcalib0) ? (vcalib1 - vcalib0) : 1); in rk817_bat_calib_vol() 188 charger->voltage_b = 4025 - (charger->voltage_k * vcalib1) / 1000; in rk817_bat_calib_vol() [all …]
|
/linux/Documentation/devicetree/bindings/power/supply/ |
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 | sc27xx-fg.yaml | 1 # 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 …]
|
/linux/arch/arm/boot/dts/qcom/ |
H A D | pm8226.dtsi | 1 // 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 D | pm8941.dtsi | 1 // 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/drivers/gpu/drm/nouveau/include/nvkm/subdev/ |
H A D | clk.h | 1 /* 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 D | pm660.dtsi | 1 // 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 D | translation-table.c | 1 // SPDX-License-Identifier: GPL-2.0 7 #include "translation-table.h" 47 #include "hard-interface.h" 52 #include "soft-interface.h" 79 * batadv_compare_tt() - check if two TT entries are the same 94 return (tt1->vid == tt2->vid) && batadv_compare_eth(data1, data2); in batadv_compare_tt() 98 * batadv_choose_tt() - return the index of the tt entry in the hash table 111 hash = jhash(&tt->addr, ETH_ALEN, hash); in batadv_choose_tt() 112 hash = jhash(&tt->vid, sizeof(tt->vid), hash); in batadv_choose_tt() 118 * batadv_tt_hash_find() - look for a client in the given hash table [all …]
|
/linux/arch/arm/boot/dts/aspeed/ |
H A D | aspeed-bmc-asrock-spc621d8hm3.dts | 1 // 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/Documentation/ABI/testing/ |
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 104 What: /sys/class/power_supply/<supply_name>/temp 106 Contact: linux-p [all...] |
/linux/fs/xfs/libxfs/ |
H A D | xfs_bmap.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Copyright (c) 2000-2006 Silicon Graphics, Inc. 70 * leaf entries, is controlled by the size of the on-disk extent count. in xfs_bmap_compute_maxlevels() 88 minleafrecs = mp->m_bmap_dmnr[0]; in xfs_bmap_compute_maxlevels() 89 minnoderecs = mp->m_bmap_dmnr[1]; in xfs_bmap_compute_maxlevels() 97 mp->m_bm_maxlevels[whichfork] = level; in xfs_bmap_compute_maxlevels() 98 ASSERT(mp->m_bm_maxlevels[whichfork] <= xfs_bmbt_maxlevels_ondisk()); in xfs_bmap_compute_maxlevels() 105 if (mp->m_sb.sb_inodesize == 256) in xfs_bmap_compute_attr_offset() 106 return XFS_LITINO(mp) - xfs_bmdr_space_calc(MINABTPTRS); in xfs_bmap_compute_attr_offset() 116 cur->bc_rec.b = *irec; in xfs_bmbt_lookup_eq() [all …]
|
/linux/Documentation/admin-guide/laptops/ |
H A D | thinkpad-acpi.rst | 9 - Borislav Deianov <borislav@users.sf.net> 10 - Henrique de Moraes Holschuh <hmh@hmh.eng.br> 12 http://ibm-acpi.sf.net/ 19 This driver used to be named ibm-acpi until kernel 2.6.21 and release 20 0.13-20070314. It used to be in the drivers/acpi tree, but it was 21 moved to the drivers/misc tree and renamed to thinkpad-acpi for kernel 25 The driver is named "thinkpad-acpi". In some places, like module 29 "tpacpi" is used as a shorthand where "thinkpad-acpi" would be too 33 ------ 38 - Fn key combinations [all …]
|