Lines Matching +full:fuel +full:- +full:gauge
1 // SPDX-License-Identifier: GPL-2.0+
49 struct power_battery *pb = bat->pbat; in power_update_battery()
53 puts("Can't find max77693 fuel gauge\n"); in power_update_battery()
54 return -ENODEV; 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()
68 struct power_battery *pb = bat->pbat; in power_check_battery()
73 puts("Can't find max77693 fuel gauge\n"); in power_check_battery()
74 return -ENODEV; in power_check_battery()
82 ret = pmic_reg_read(p, MAX77693_VERSION, &pb->bat->version); in power_check_battery()
89 debug("fg ver: 0x%x\n", pb->bat->version); in power_check_battery()
91 pb->bat->state_of_chrg); in power_check_battery()
94 pb->bat->voltage_uV / 1000000, in power_check_battery()
95 pb->bat->voltage_uV % 1000000, in power_check_battery()
96 pb->bat->capacity); in power_check_battery()
98 if (pb->bat->voltage_uV > 3850000) in power_check_battery()
99 pb->bat->state = EXT_SOURCE; in power_check_battery()
100 else if (pb->bat->voltage_uV < 3600000 || pb->bat->state_of_chrg < 5) in power_check_battery()
101 pb->bat->state = CHARGE; in power_check_battery()
103 pb->bat->state = NORMAL; in power_check_battery()
120 return -ENOMEM; in power_fg_init()
123 debug("Board Fuel Gauge init\n"); in power_fg_init()
125 p->name = name; in power_fg_init()
126 p->interface = PMIC_I2C; in power_fg_init()
127 p->number_of_regs = FG_NUM_OF_REGS; in power_fg_init()
128 p->hw.i2c.addr = MAX77693_FUEL_I2C_ADDR; in power_fg_init()
129 p->hw.i2c.tx_num = 2; in power_fg_init()
130 p->sensor_byte_order = PMIC_SENSOR_BYTE_ORDER_BIG; in power_fg_init()
131 p->bus = bus; in power_fg_init()
133 p->fg = &power_fg_ops; in power_fg_init()