/linux/drivers/power/supply/ |
H A D | surface_battery.c | 155 static bool spwr_battery_present(struct spwr_battery_device *bat) in spwr_battery_present() argument 157 lockdep_assert_held(&bat->lock); in spwr_battery_present() 159 return le32_to_cpu(bat->sta) & SAM_BATTERY_STA_PRESENT; in spwr_battery_present() 162 static int spwr_battery_load_sta(struct spwr_battery_device *bat) in spwr_battery_load_sta() argument 164 lockdep_assert_held(&bat->lock); in spwr_battery_load_sta() 166 return ssam_retry(ssam_bat_get_sta, bat->sdev, &bat->sta); in spwr_battery_load_sta() 169 static int spwr_battery_load_bix(struct spwr_battery_device *bat) in spwr_battery_load_bix() argument 173 lockdep_assert_held(&bat->lock); in spwr_battery_load_bix() 175 if (!spwr_battery_present(bat)) in spwr_battery_load_bix() 189 spwr_battery_load_bst(struct spwr_battery_device * bat) spwr_battery_load_bst() argument 199 spwr_battery_set_alarm_unlocked(struct spwr_battery_device * bat,u32 value) spwr_battery_set_alarm_unlocked() argument 209 spwr_battery_update_bst_unlocked(struct spwr_battery_device * bat,bool cached) spwr_battery_update_bst_unlocked() argument 231 spwr_battery_update_bst(struct spwr_battery_device * bat,bool cached) spwr_battery_update_bst() argument 242 spwr_battery_update_bix_unlocked(struct spwr_battery_device * bat) spwr_battery_update_bix_unlocked() argument 267 sprw_battery_get_full_cap_safe(struct spwr_battery_device * bat) sprw_battery_get_full_cap_safe() argument 279 spwr_battery_is_full(struct spwr_battery_device * bat) spwr_battery_is_full() argument 293 spwr_battery_recheck_full(struct spwr_battery_device * bat) spwr_battery_recheck_full() argument 332 spwr_battery_recheck_status(struct spwr_battery_device * bat) spwr_battery_recheck_status() argument 345 struct spwr_battery_device *bat = container_of(nf, struct spwr_battery_device, notif); spwr_notify_bat() local 395 struct spwr_battery_device *bat; spwr_battery_update_bst_workfn() local 411 struct spwr_battery_device *bat = power_supply_get_drvdata(psy); spwr_external_power_changed() local 464 spwr_battery_prop_status(struct spwr_battery_device * bat) spwr_battery_prop_status() argument 486 spwr_battery_prop_technology(struct spwr_battery_device * bat) spwr_battery_prop_technology() argument 508 spwr_battery_prop_capacity(struct spwr_battery_device * bat) spwr_battery_prop_capacity() argument 524 spwr_battery_prop_capacity_level(struct spwr_battery_device * bat) spwr_battery_prop_capacity_level() argument 546 struct spwr_battery_device *bat = power_supply_get_drvdata(psy); spwr_battery_get_property() local 671 struct spwr_battery_device *bat = power_supply_get_drvdata(psy); alarm_show() local 685 struct spwr_battery_device *bat = power_supply_get_drvdata(psy); alarm_store() local 721 spwr_battery_init(struct spwr_battery_device * bat,struct ssam_device * sdev,struct ssam_event_registry registry,const char * name) spwr_battery_init() argument 744 spwr_battery_register(struct spwr_battery_device * bat) spwr_battery_register() argument 820 struct spwr_battery_device *bat; surface_battery_probe() local 838 struct spwr_battery_device *bat = ssam_device_get_drvdata(sdev); surface_battery_remove() local [all...] |
H A D | pm8916_bms_vm.c | 62 struct pm8916_bms_vm_battery *bat = power_supply_get_drvdata(psy); in pm8916_bms_vm_battery_get_property() local 63 struct power_supply_battery_info *info = bat->info; in pm8916_bms_vm_battery_get_property() 79 if (bat->vbat_now < info->voltage_min_design_uv) in pm8916_bms_vm_battery_get_property() 81 else if (bat->vbat_now > info->voltage_max_design_uv) in pm8916_bms_vm_battery_get_property() 88 val->intval = bat->vbat_now; in pm8916_bms_vm_battery_get_property() 96 if (ktime_get_seconds() - bat->last_ocv_time > 180) in pm8916_bms_vm_battery_get_property() 99 val->intval = bat->last_ocv; in pm8916_bms_vm_battery_get_property() 116 struct pm8916_bms_vm_battery *bat = data; in pm8916_bms_vm_fifo_update_done_irq() local 120 ret = regmap_bulk_read(bat->regmap, bat in pm8916_bms_vm_fifo_update_done_irq() 151 struct pm8916_bms_vm_battery *bat; pm8916_bms_vm_battery_probe() local 233 struct pm8916_bms_vm_battery *bat = platform_get_drvdata(pdev); pm8916_bms_vm_battery_suspend() local 260 struct pm8916_bms_vm_battery *bat = platform_get_drvdata(pdev); pm8916_bms_vm_battery_resume() local [all...] |
H A D | da9052-battery.c | 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() 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() 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 233 ret = da9052_group_read(bat->da9052, DA9052_STATUS_A_REG, 2, v); in da9052_bat_check_status() 249 bat->charger_type = DA9052_CHARGER; in da9052_bat_check_status() 255 ret = da9052_read_chg_current(bat, in da9052_bat_check_status() 285 da9052_bat_read_volt(struct da9052_battery * bat,int * volt_mV) da9052_bat_read_volt() argument 298 da9052_bat_check_presence(struct da9052_battery * bat,int * illegal) da9052_bat_check_presence() argument 353 da9052_bat_read_capacity(struct da9052_battery * bat,int * capacity) da9052_bat_read_capacity() argument 406 da9052_bat_check_health(struct da9052_battery * bat,int * health) da9052_bat_check_health() argument 438 struct da9052_battery *bat = data; da9052_bat_irq() local 464 struct da9052_battery *bat = container_of(nb, struct da9052_battery, da9052_USB_current_notifier() local 498 struct da9052_battery *bat = power_supply_get_drvdata(psy); da9052_bat_get_property() local 588 struct da9052_battery *bat; da9052_bat_probe() local 643 struct da9052_battery *bat = platform_get_drvdata(pdev); da9052_bat_remove() local [all...] |
H A D | collie_battery.c | 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() 73 static unsigned long collie_read_temp(struct collie_bat *bat) in collie_read_temp() argument 76 if (!bat in collie_read_temp() 98 struct collie_bat *bat = power_supply_get_drvdata(psy); collie_bat_get_property() local 152 collie_bat_update(struct collie_bat * bat) collie_bat_update() argument [all...] |
H A D | ingenic-battery.c | 28 struct ingenic_battery *bat = power_supply_get_drvdata(psy); in ingenic_battery_get_property() local 29 struct power_supply_battery_info *info = bat->info; in ingenic_battery_get_property() 34 ret = iio_read_channel_processed_scale(bat->channel, in ingenic_battery_get_property() 45 ret = iio_read_channel_processed_scale(bat->channel, in ingenic_battery_get_property() 63 static int ingenic_battery_set_scale(struct ingenic_battery *bat) in ingenic_battery_set_scale() argument 69 ret = iio_read_max_channel_raw(bat->channel, &max_raw); in ingenic_battery_set_scale() 71 dev_err(bat->dev, "Unable to read max raw channel value\n"); in ingenic_battery_set_scale() 75 ret = iio_read_avail_channel_attribute(bat->channel, &scale_raw, in ingenic_battery_set_scale() 79 dev_err(bat->dev, "Unable to read channel avail scale\n"); in ingenic_battery_set_scale() 85 max_mV = bat in ingenic_battery_set_scale() 128 struct ingenic_battery *bat; ingenic_battery_probe() local [all...] |
H A D | twl4030_madc_battery.c | 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() 111 struct twl4030_madc_battery *bat = power_supply_get_drvdata(psy); in twl4030_madc_bat_get_property() local 115 if (twl4030_madc_bat_voltscale(bat, in twl4030_madc_bat_get_property() 116 twl4030_madc_bat_get_voltage(bat)) > 95) in twl4030_madc_bat_get_property() 119 if (twl4030_madc_bat_get_charging_status(bat)) in twl4030_madc_bat_get_property() 126 val->intval = twl4030_madc_bat_get_voltage(bat) * 1000; in twl4030_madc_bat_get_property() 132 val->intval = twl4030_madc_bat_get_current(bat); in twl4030_madc_bat_get_property() [all...] |
H A D | apm_power.c | 37 struct power_supply *bat; member 49 bp->bat = psy; in __find_main_battery() 51 if (bp->bat->desc->use_for_apm) { in __find_main_battery() 53 bp->main = bp->bat; in __find_main_battery() 57 if (!PSY_PROP(bp->bat, CHARGE_FULL_DESIGN, &bp->full) || in __find_main_battery() 58 !PSY_PROP(bp->bat, CHARGE_FULL, &bp->full)) { in __find_main_battery() 60 bp->max_charge_bat = bp->bat; in __find_main_battery() 63 } else if (!PSY_PROP(bp->bat, ENERGY_FULL_DESIGN, &bp->full) || in __find_main_battery() 64 !PSY_PROP(bp->bat, ENERGY_FULL, &bp->full)) { in __find_main_battery() 66 bp->max_energy_bat = bp->bat; in __find_main_battery() [all...] |
H A D | pmu_battery.c | 17 struct power_supply *bat; member 177 pbat->bat = power_supply_register(&bat_pdev->dev, in pmu_bat_init() 180 if (IS_ERR(pbat->bat)) { in pmu_bat_init() 181 ret = PTR_ERR(pbat->bat); in pmu_bat_init() 194 power_supply_unregister(pbats[i]->bat); in pmu_bat_init() 212 power_supply_unregister(pbats[i]->bat); in pmu_bat_exit()
|
/linux/drivers/mfd/ |
H A D | rohm-bd71828.c | 66 DEFINE_RES_IRQ_NAMED(BD71815_INT_BAT_TEMP_NORMAL, "bd71815-bat-temp-normal"), 67 DEFINE_RES_IRQ_NAMED(BD71815_INT_BAT_TEMP_ERANGE, "bd71815-bat-temp-erange"), 68 DEFINE_RES_IRQ_NAMED(BD71815_INT_BAT_REMOVED, "bd71815-bat-rmv"), 69 DEFINE_RES_IRQ_NAMED(BD71815_INT_BAT_DETECTED, "bd71815-bat-det"), 72 DEFINE_RES_IRQ_NAMED(BD71815_INT_BAT_DEAD, "bd71815-bat-dead"), 73 DEFINE_RES_IRQ_NAMED(BD71815_INT_BAT_SHORTC_RES, "bd71815-bat-short-res"), 74 DEFINE_RES_IRQ_NAMED(BD71815_INT_BAT_SHORTC_DET, "bd71815-bat-short-det"), 75 DEFINE_RES_IRQ_NAMED(BD71815_INT_BAT_LOW_VOLT_RES, "bd71815-bat-low-res"), 76 DEFINE_RES_IRQ_NAMED(BD71815_INT_BAT_LOW_VOLT_DET, "bd71815-bat-low-det"), 77 DEFINE_RES_IRQ_NAMED(BD71815_INT_BAT_OVER_VOLT_RES, "bd71815-bat [all...] |
/linux/arch/powerpc/mm/book3s32/ |
H A D | mmu.c | 53 * Return PA for this VA if it is mapped by a BAT, or 0 84 struct ppc_bat *bat = BATS[b]; in find_free_bat() local 86 if (!(bat[1].batu & 3)) in find_free_bat() 121 struct ppc_bat *bat = BATS[index]; in setibat() local 128 bat[0].batu = virt | (bl << 2) | 2; /* Vs=1, Vp=0 */ in setibat() 129 bat[0].batl = BAT_PHYS_ADDR(phys) | wimgxpp; in setibat() 131 bat[0].batu |= 1; /* Vp = 1 */ in setibat() 136 struct ppc_bat *bat = BATS[index]; in clearibat() local 138 bat[0].batu = 0; in clearibat() 139 bat[ in clearibat() 244 struct ppc_bat *bat = BATS[i]; mmu_mark_rodata_ro() local 265 struct ppc_bat *bat; setbat() local [all...] |
/linux/arch/powerpc/kvm/ |
H A D | book3s_32_mmu.c | 132 struct kvmppc_bat *bat; in kvmppc_mmu_book3s_32_xlate_bat() local 137 bat = &vcpu_book3s->dbat[i]; in kvmppc_mmu_book3s_32_xlate_bat() 139 bat = &vcpu_book3s->ibat[i]; in kvmppc_mmu_book3s_32_xlate_bat() 142 if (!bat->vp) in kvmppc_mmu_book3s_32_xlate_bat() 145 if (!bat->vs) in kvmppc_mmu_book3s_32_xlate_bat() 152 data ? 'd' : 'i', i, eaddr, bat->bepi, in kvmppc_mmu_book3s_32_xlate_bat() 153 bat->bepi_mask); in kvmppc_mmu_book3s_32_xlate_bat() 155 if ((eaddr & bat->bepi_mask) == bat->bepi) { in kvmppc_mmu_book3s_32_xlate_bat() 162 pte->raddr = bat in kvmppc_mmu_book3s_32_xlate_bat() [all...] |
/linux/drivers/net/wwan/t7xx/ |
H A D | t7xx_hif_dpmaif_rx.c | 110 dev_err(dpmaif_ctrl->dev, "RX BAT flow check fail\n"); in t7xx_dpmaif_update_bat_wr_idx() 151 * t7xx_dpmaif_rx_buf_alloc() - Allocate buffers for the BAT ring. 153 * @bat_req: Pointer to BAT request structure. 158 * Allocate skb and store the start address of the data buffer into the BAT ring. 176 /* Check BAT buffer space */ in t7xx_dpmaif_rx_buf_alloc() 305 * t7xx_dpmaif_rx_frag_alloc() - Allocates buffers for the Fragment BAT ring. 307 * @bat_req: Pointer to BAT request structure. 311 * Fragment BAT is used when the received packet does not fit in a normal BAT entry. 313 * into the Fragment BAT rin 506 struct dpmaif_bat_request *bat; t7xx_dpmaif_release_bat_entry() local [all...] |
/linux/net/batman-adv/ |
H A D | multicast.c | 66 * @bat_priv: the bat priv with all the mesh interface information 151 * @bat_priv: the bat priv with all the mesh interface information 182 * @bat_priv: the bat priv with all the mesh interface information 213 * @bat_priv: the bat priv with all the mesh interface information 239 * @bat_priv: the bat priv with all the mesh interface information 268 * @bat_priv: the bat priv with all the mesh interface information 673 * @bat_priv: the bat priv with all the mesh interface information 705 * @bat_priv: the bat priv with all the mesh interface information 738 * @bat_priv: the bat priv with all the mesh interface information 790 * @bat_priv: the bat pri [all...] |
H A D | tvlv.c | 62 * @bat_priv: the bat priv with all the mesh interface information 121 * @bat_priv: the bat priv with all the mesh interface information 155 * @bat_priv: the bat priv with all the mesh interface information 180 * @bat_priv: the bat priv with all the mesh interface information 204 * @bat_priv: the bat priv with all the mesh interface information 222 * @bat_priv: the bat priv with all the mesh interface information 300 * @bat_priv: the bat priv with all the mesh interface information 353 * @bat_priv: the bat priv with all the mesh interface information 424 * @bat_priv: the bat priv with all the mesh interface information 493 * @bat_priv: the bat pri [all...] |
H A D | gateway_common.c | 23 * @bat_priv: the bat priv with all the mesh interface information 51 * @bat_priv: the bat priv with all the mesh interface information 92 * @bat_priv: the bat priv with all the mesh interface information 108 * @bat_priv: the bat priv with all the mesh interface information
|
H A D | gateway_client.c | 74 * @bat_priv: the bat priv with all the mesh interface information 98 * @bat_priv: the bat priv with all the mesh interface information 147 * @bat_priv: the bat priv with all the mesh interface information 163 * @bat_priv: the bat priv with all the mesh interface information 195 * @bat_priv: the bat priv with all the mesh interface information 283 * @bat_priv: the bat priv with all the mesh interface information 317 * @bat_priv: the bat priv with all the mesh interface information 364 * @bat_priv: the bat priv with all the mesh interface information 394 * @bat_priv: the bat priv with all the mesh interface information 461 * @bat_priv: the bat pri [all...] |
H A D | network-coding.c | 68 * @bat_priv: the bat priv with all the mesh interface information 79 * @bat_priv: the bat priv with all the mesh interface information 112 * @bat_priv: the bat priv with all the mesh interface information 131 * @bat_priv: the bat priv with all the mesh interface information 174 * @bat_priv: the bat priv with all the mesh interface information 270 * @bat_priv: the bat priv with all the mesh interface information 286 * @bat_priv: the bat priv with all the mesh interface information 307 * @bat_priv: the bat priv with all the mesh interface information 328 * @bat_priv: the bat priv with all the mesh interface information 366 * @bat_priv: the bat pri [all...] |
H A D | send.c | 276 * @bat_priv: the bat priv with all the mesh interface information 318 * @bat_priv: the bat priv with all the mesh interface information 388 * @bat_priv: the bat priv with all the mesh interface information 434 * @bat_priv: the bat priv with all the mesh interface information 565 * @lock: a key to the store to steal from (e.g. forw_{bat,bcast}_list_lock) 656 * @lock: a key to the store (e.g. forw_{bat,bcast}_list_lock) 657 * @head: the shelve to queue it on (e.g. forw_{bat,bcast}_list) 699 * @bat_priv: the bat priv with all the mesh interface information 718 * @bat_priv: the bat priv with all the mesh interface information 736 * @bat_priv: the bat pri [all...] |
H A D | distributed-arp-table.c | 99 * @bat_priv: the bat priv with all the mesh interface information 148 * @bat_priv: the bat priv with all the mesh interface information 318 * @bat_priv: the bat priv with all the mesh interface information 360 * @bat_priv: the bat priv with all the mesh interface information 417 * @bat_priv: the bat priv with all the mesh interface information 552 * @bat_priv: the bat priv with all the mesh interface information 616 * @bat_priv: the bat priv with all the mesh interface information 661 * @bat_priv: the bat priv with all the mesh interface information 737 * @bat_priv: the bat priv with all the mesh interface information 770 * @bat_priv: the bat pri [all...] |
H A D | translation-table.c | 164 * @bat_priv: the bat priv with all the mesh interface information 189 * @bat_priv: the bat priv with all the mesh interface information 263 * @bat_priv: the bat priv with all the mesh interface information 289 * @bat_priv: the bat priv with all the mesh interface information 310 * @bat_priv: the bat priv with all the mesh interface information 322 * @bat_priv: the bat priv with all the mesh interface information 415 * @bat_priv: the bat priv with all the mesh interface information 507 * @bat_priv: the bat priv with all the mesh interface information 852 * @bat_priv: the bat priv with all the mesh interface information 935 * @bat_priv: the bat pri [all...] |
H A D | bat_v.c | 169 * @bat_priv: The bat priv with all the mesh interface information 206 * @bat_priv: The bat priv with all the mesh interface information 255 * @bat_priv: The bat priv with all the mesh interface information 323 * @bat_priv: The bat priv with all the mesh interface information 375 * @bat_priv: The bat priv with all the mesh interface information 415 * @bat_priv: The bat priv with all the mesh interface information 503 * @bat_priv: the bat priv with all the mesh interface information 554 * @bat_priv: the bat priv with all the mesh interface information 591 * @bat_priv: the bat priv with all the mesh interface information 648 * @bat_priv: The bat pri [all...] |
/linux/drivers/acpi/ |
H A D | sbs.c | 31 #define ACPI_BATTERY_DIR_NAME "BAT%i" 55 struct power_supply *bat; member 551 battery->bat = power_supply_register(&sbs->device->dev, in acpi_battery_add() 553 if (IS_ERR(battery->bat)) { in acpi_battery_add() 554 result = PTR_ERR(battery->bat); in acpi_battery_add() 555 battery->bat = NULL; in acpi_battery_add() 570 if (battery->bat) in acpi_battery_remove() 571 power_supply_unregister(battery->bat); in acpi_battery_remove() 607 struct acpi_battery *bat; in acpi_sbs_callback() local 621 bat in acpi_sbs_callback() [all...] |
H A D | battery.c | 96 struct power_supply *bat; member 715 if (!hook->remove_battery(battery->bat, hook)) in battery_hook_unregister_unlocked() 716 power_supply_changed(battery->bat); in battery_hook_unregister_unlocked() 751 if (hook->add_battery(battery->bat, hook)) { in battery_hook_register() 763 power_supply_changed(battery->bat); in battery_hook_register() 806 if (hook_node->add_battery(battery->bat, hook_node)) { in battery_hook_add_battery() 829 hook->remove_battery(battery->bat, hook); in battery_hook_remove_battery() 892 battery->bat = power_supply_register(&battery->device->dev, in sysfs_add_battery() 895 if (IS_ERR(battery->bat)) { in sysfs_add_battery() 896 int result = PTR_ERR(battery->bat); in sysfs_add_battery() [all...] |
/linux/arch/powerpc/include/asm/ |
H A D | reg.h | 506 #define SPRN_DBAT0L 0x219 /* Data BAT 0 Lower Register */ 507 #define SPRN_DBAT0U 0x218 /* Data BAT 0 Upper Register */ 508 #define SPRN_DBAT1L 0x21B /* Data BAT 1 Lower Register */ 509 #define SPRN_DBAT1U 0x21A /* Data BAT 1 Upper Register */ 510 #define SPRN_DBAT2L 0x21D /* Data BAT 2 Lower Register */ 511 #define SPRN_DBAT2U 0x21C /* Data BAT 2 Upper Register */ 512 #define SPRN_DBAT3L 0x21F /* Data BAT 3 Lower Register */ 513 #define SPRN_DBAT3U 0x21E /* Data BAT 3 Upper Register */ 514 #define SPRN_DBAT4L 0x239 /* Data BAT 4 Lower Register */ 515 #define SPRN_DBAT4U 0x238 /* Data BAT [all...] |
/linux/Documentation/devicetree/bindings/power/supply/ |
H A D | qcom,pm8941-charger.yaml | 37 - const: bat-temp-ok 38 - const: bat-present 167 "bat-temp-ok", 168 "bat-present",
|