Lines Matching refs:voltage

156 	int voltage;
1373 /* 0x1001: Battery voltage */
1382 static int hidpp20_battery_map_status_voltage(u8 data[3], int *voltage,
1420 *voltage = get_unaligned_be16(data);
1427 int *status, int *voltage,
1448 *status = hidpp20_battery_map_status_voltage(params, voltage,
1454 static int hidpp20_map_battery_capacity(struct hid_device *hid_dev, int voltage)
1456 /* NB: This voltage curve doesn't necessarily map perfectly to all
1476 if (unlikely(voltage < 3500 || voltage >= 5000))
1478 "%s: possibly using the wrong voltage curve\n",
1482 if (voltage >= voltages[i])
1493 int status, voltage, level, charge_type;
1505 &status, &voltage, &level, &charge_type);
1511 hidpp->battery.voltage = voltage;
1513 voltage);
1525 int status, voltage, level, charge_type;
1531 status = hidpp20_battery_map_status_voltage(report->fap.params, &voltage,
1536 if (voltage != hidpp->battery.voltage || status != hidpp->battery.status) {
1537 hidpp->battery.voltage = voltage;
1539 voltage);
1815 /* hardware reports voltage in mV. sysfs expects uV */
1816 val->intval = hidpp->battery.voltage * 1000;
1856 static int hidpp20_map_adc_measurement_1f20_capacity(struct hid_device *hid_dev, int voltage)
1858 /* NB: This voltage curve doesn't necessarily map perfectly to all
1880 if (voltage == 0)
1883 if (unlikely(voltage < 3400 || voltage >= 5000))
1885 "%s: possibly using the wrong voltage curve\n",
1889 if (voltage >= voltages[i])
1896 static int hidpp20_map_adc_measurement_1f20(u8 data[3], int *voltage)
1919 *voltage = get_unaligned_be16(data);
1921 dbg_hid("Parsed 1f20 data as flag 0x%02x voltage %dmV\n",
1922 flags, *voltage);
1930 int *status, int *voltage)
1937 *voltage = 0;
1948 *status = hidpp20_map_adc_measurement_1f20(params, voltage);
1971 &hidpp->battery.voltage);
1973 hidpp->battery.voltage);
1983 int status, voltage;
1989 status = hidpp20_map_adc_measurement_1f20(report->fap.params, &voltage);
1993 if (voltage != hidpp->battery.voltage || status != hidpp->battery.status) {
1995 hidpp->battery.voltage = voltage;
1996 hidpp->battery.capacity = hidpp20_map_adc_measurement_1f20_capacity(hidpp->hid_dev, voltage);
4054 and leave voltage for last */