/openbmc/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() 178 status = ssam_retry(ssam_bat_get_bix, bat->sdev, &bat->bix); in spwr_battery_load_bix() [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, &chg_current); in da9052_bat_check_status() [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->gpio_temp || bat->adc_temp < 0) in collie_read_temp() 80 gpiod_set_value(bat->gpio_temp, 1); in collie_read_temp() [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(bat->channel, &val->intval); in ingenic_battery_get_property() 44 ret = iio_read_channel_processed(bat->channel, &val->intval); in ingenic_battery_get_property() 61 static int ingenic_battery_set_scale(struct ingenic_battery *bat) in ingenic_battery_set_scale() argument 67 ret = iio_read_max_channel_raw(bat->channel, &max_raw); in ingenic_battery_set_scale() 69 dev_err(bat->dev, "Unable to read max raw channel value\n"); in ingenic_battery_set_scale() 73 ret = iio_read_avail_channel_attribute(bat->channel, &scale_raw, in ingenic_battery_set_scale() 77 dev_err(bat->dev, "Unable to read channel avail scale\n"); in ingenic_battery_set_scale() 83 max_mV = bat->info->voltage_max_design_uv / 1000; in ingenic_battery_set_scale() [all …]
|
H A D | acer_a500_battery.c | 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() 149 struct a500_battery *bat = power_supply_get_drvdata(psy); in a500_battery_get_property() local 155 val->intval = a500_battery_get_status(bat); in a500_battery_get_property() 163 a500_battery_update_capacity(bat); in a500_battery_get_property() [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 = dev_get_drvdata(dev); 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 …]
|
/openbmc/u-boot/drivers/power/mfd/ |
H A D | fg_max77693.c | 47 static int power_update_battery(struct pmic *p, struct pmic *bat) in power_update_battery() argument 49 struct power_battery *pb = bat->pbat; in power_update_battery() 57 ret = max77693_get_soc(&pb->bat->state_of_chrg); in power_update_battery() 61 max77693_get_vcell(&pb->bat->voltage_uV); in power_update_battery() 66 static int power_check_battery(struct pmic *p, struct pmic *bat) in power_check_battery() argument 68 struct power_battery *pb = bat->pbat; in power_check_battery() 82 ret = pmic_reg_read(p, MAX77693_VERSION, &pb->bat->version); in power_check_battery() 86 ret = power_update_battery(p, bat); in power_check_battery() 89 debug("fg ver: 0x%x\n", pb->bat->version); in power_check_battery() 90 printf("BAT: state_of_charge(SOC):%d%%\n", in power_check_battery() [all …]
|
/openbmc/u-boot/drivers/power/fuel_gauge/ |
H A D | fg_max17042.c | 193 static int power_update_battery(struct pmic *p, struct pmic *bat) in power_update_battery() argument 195 struct power_battery *pb = bat->pbat; in power_update_battery() 205 pb->bat->state_of_chrg = (val >> 8); in power_update_battery() 209 pb->bat->voltage_uV = ((val & 0xFFUL) >> 3) + ((val & 0xFF00) >> 3); in power_update_battery() 210 pb->bat->voltage_uV = (pb->bat->voltage_uV * 625); in power_update_battery() 213 pb->bat->capacity = val >> 2; in power_update_battery() 218 static int power_check_battery(struct pmic *p, struct pmic *bat) in power_check_battery() argument 220 struct power_battery *pb = bat->pbat; in power_check_battery() 236 pb->bat->version = val; in power_check_battery() 238 power_update_battery(p, bat); in power_check_battery() [all …]
|
/openbmc/u-boot/drivers/power/battery/ |
H A D | bat_trats.c | 16 static int power_battery_charge(struct pmic *bat) in power_battery_charge() argument 18 struct power_battery *p_bat = bat->pbat; in power_battery_charge() 19 struct battery *battery = p_bat->bat; in power_battery_charge() 22 if (bat->chrg->chrg_state(p_bat->chrg, PMIC_CHARGER_ENABLE, 450)) in power_battery_charge() 25 for (k = 0; bat->chrg->chrg_bat_present(p_bat->chrg) && in power_battery_charge() 26 bat->chrg->chrg_type(p_bat->muic) && in power_battery_charge() 31 bat->fg->fg_battery_update(p_bat->fg, bat); in power_battery_charge() 45 bat->chrg->chrg_state(p_bat->chrg, PMIC_CHARGER_DISABLE, 0); in power_battery_charge() 66 .bat = &battery_trats, 81 debug("Board BAT init\n"); in power_bat_init()
|
H A D | bat_trats2.c | 15 static int power_battery_charge(struct pmic *bat) in power_battery_charge() argument 17 struct power_battery *p_bat = bat->pbat; in power_battery_charge() 19 if (bat->chrg->chrg_state(p_bat->chrg, PMIC_CHARGER_ENABLE, 450)) in power_battery_charge() 41 .bat = &battery_trats, 56 debug("Board BAT init\n"); in power_bat_init()
|
/openbmc/qemu/docs/interop/ |
H A D | parallels.rst | 15 * BAT 33 BAT 60 Disk size, in clusters (BAT size). 87 - If data_off is zero, the offset is calculated as the end of BAT 109 defined by BAT entries (see below). 111 BAT chapter 114 BAT is placed immediately after the image header. In the file, BAT is a 118 Each BAT entry contains an offset from the start of the file to the 122 If a BAT entry is zero, the corresponding cluster is not allocated and should 125 Cluster offsets specified by BAT entries must meet the following requirements: [all …]
|
/openbmc/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-over-res"), [all …]
|
/openbmc/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[0].batl = 0; in clearibat() [all …]
|
/openbmc/u-boot/arch/powerpc/include/asm/ |
H A D | processor.h | 107 #define SPRN_DBAT0L 0x219 /* Data BAT 0 Lower Register */ 108 #define SPRN_DBAT0U 0x218 /* Data BAT 0 Upper Register */ 109 #define SPRN_DBAT1L 0x21B /* Data BAT 1 Lower Register */ 110 #define SPRN_DBAT1U 0x21A /* Data BAT 1 Upper Register */ 111 #define SPRN_DBAT2L 0x21D /* Data BAT 2 Lower Register */ 112 #define SPRN_DBAT2U 0x21C /* Data BAT 2 Upper Register */ 113 #define SPRN_DBAT3L 0x21F /* Data BAT 3 Lower Register */ 114 #define SPRN_DBAT3U 0x21E /* Data BAT 3 Upper Register */ 115 #define SPRN_DBAT4L 0x239 /* Data BAT 4 Lower Register */ 116 #define SPRN_DBAT4U 0x238 /* Data BAT 4 Upper Register */ [all …]
|
/openbmc/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->brpn | (eaddr & ~bat->bepi_mask); in kvmppc_mmu_book3s_32_xlate_bat() 163 pte->may_read = bat->pp; in kvmppc_mmu_book3s_32_xlate_bat() [all …]
|
H A D | book3s_emulate.c | 633 void kvmppc_set_bat(struct kvm_vcpu *vcpu, struct kvmppc_bat *bat, bool upper, in kvmppc_set_bat() argument 637 /* Upper BAT */ in kvmppc_set_bat() 639 bat->bepi_mask = (~bl << 17); in kvmppc_set_bat() 640 bat->bepi = val & 0xfffe0000; in kvmppc_set_bat() 641 bat->vs = (val & 2) ? 1 : 0; in kvmppc_set_bat() 642 bat->vp = (val & 1) ? 1 : 0; in kvmppc_set_bat() 643 bat->raw = (bat->raw & 0xffffffff00000000ULL) | val; in kvmppc_set_bat() 645 /* Lower BAT */ in kvmppc_set_bat() 646 bat->brpn = val & 0xfffe0000; in kvmppc_set_bat() 647 bat->wimg = (val >> 3) & 0xf; in kvmppc_set_bat() [all …]
|
/openbmc/u-boot/arch/powerpc/cpu/mpc86xx/ |
H A D | cpu_init.c | 81 ppc_bat_t bat = DBAT0; in init_addr_map() local 85 for (i = 0; i < CONFIG_SYS_NUM_ADDR_MAP; i++, bat++) { in init_addr_map() 86 if (read_bat(bat, &upper, &lower) != -1) { in init_addr_map() 95 /* High bats are not contiguous with low BAT numbers */ in init_addr_map() 96 if (bat == DBAT3) in init_addr_map() 97 bat = DBAT4 - 1; in init_addr_map()
|
/openbmc/linux/drivers/net/wwan/t7xx/ |
H A D | t7xx_hif_dpmaif_rx.c | 109 dev_err(dpmaif_ctrl->dev, "RX BAT flow check fail\n"); in t7xx_dpmaif_update_bat_wr_idx() 150 * t7xx_dpmaif_rx_buf_alloc() - Allocate buffers for the BAT ring. 152 * @bat_req: Pointer to BAT request structure. 157 * Allocate skb and store the start address of the data buffer into the BAT ring. 175 /* Check BAT buffer space */ in t7xx_dpmaif_rx_buf_alloc() 304 * t7xx_dpmaif_rx_frag_alloc() - Allocates buffers for the Fragment BAT ring. 306 * @bat_req: Pointer to BAT request structure. 310 * Fragment BAT is used when the received packet does not fit in a normal BAT entry. 312 * into the Fragment BAT ring. 505 struct dpmaif_bat_request *bat; in t7xx_dpmaif_release_bat_entry() local [all …]
|
/openbmc/qemu/block/ |
H A D | vhdx.c | 134 uint32_t bat_idx; /* BAT entry index */ 872 * Calculate the number of BAT entries, including sector 906 if ((s->bat[i] & VHDX_BAT_STATE_BIT_MASK) == in vhdx_check_bat_entries() 908 uint64_t offset = s->bat[i] & VHDX_BAT_FILE_OFF_MASK; in vhdx_check_bat_entries() 917 * Check for BAT entry overflow. in vhdx_check_bat_entries() 920 error_report("VHDX BAT entry %" PRIu64 " offset overflow.", i); in vhdx_check_bat_entries() 928 * Check if fully allocated BAT entries do not reside after in vhdx_check_bat_entries() 932 error_report("VHDX BAT entry %" PRIu64 " start offset %" PRIu64 in vhdx_check_bat_entries() 942 error_report("VHDX BAT entry %" PRIu64 " end offset %" PRIu64 in vhdx_check_bat_entries() 954 * verify populated BAT field file offsets against in vhdx_check_bat_entries() [all …]
|
/openbmc/u-boot/test/env/ |
H A D | attr.c | 45 ut_assertok(env_attr_lookup("foo:bar,foo:bat,foo:baz", "foo", attrs)); in env_test_attrs_lookup() 49 " foo : bar , foo : bat , foot : baz ", "foo", attrs)); in env_test_attrs_lookup() 50 ut_asserteq_str("bat", attrs); in env_test_attrs_lookup() 53 " foo : bar , foo : bat , ufoo : baz ", "foo", attrs)); in env_test_attrs_lookup() 54 ut_asserteq_str("bat", attrs); in env_test_attrs_lookup()
|
/openbmc/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 = &sbs->battery[id]; in acpi_sbs_callback() [all …]
|
/openbmc/linux/Documentation/devicetree/bindings/power/supply/ |
H A D | sc27xx-fg.yaml | 37 - const: bat-temp 68 bat: battery { 92 io-channel-names = "bat-temp", "charge-vol"; 95 monitored-battery = <&bat>;
|
/openbmc/u-boot/board/ti/sdp4430/ |
H A D | cmd_bat.c | 35 bat, 2, 1, do_vbat, 38 "bat startcharge - start charging via USB\n" 39 "bat stopcharge - stop charging\n"
|
/openbmc/linux/net/batman-adv/ |
H A D | multicast.c | 67 * @bat_priv: the bat priv with all the soft interface information 152 * @bat_priv: the bat priv with all the soft interface information 183 * @bat_priv: the bat priv with all the soft interface information 214 * @bat_priv: the bat priv with all the soft interface information 240 * @bat_priv: the bat priv with all the soft interface information 644 * @bat_priv: the bat priv with all the soft interface information 676 * @bat_priv: the bat priv with all the soft interface information 709 * @bat_priv: the bat priv with all the soft interface information 761 * @bat_priv: the bat priv with all the soft interface information 799 * @bat_priv: the bat priv with all the soft interface information [all …]
|