Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-v5.16-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply

Pull power supply fixes from Sebastian Reichel:
"Three fixes for the 5.16 cycle:

- Avoid going beyond last capacity in the power-supply core

- Replace 1E6L with NSEC_PER_MSEC to avoid floating point calculation
in LLVM resulting in a build failure

- Fix ADC measurements in bq25890 charger driver"

* tag 'for-v5.16-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply:
power: reset: ltc2952: Fix use of floating point literals
power: bq25890: Enable continuous conversion for ADC at charging
power: supply: core: Break capacity loop

+8 -4
+2 -2
drivers/power/reset/ltc2952-poweroff.c
··· 159 159 160 160 static void ltc2952_poweroff_default(struct ltc2952_poweroff *data) 161 161 { 162 - data->wde_interval = 300L * 1E6L; 163 - data->trigger_delay = ktime_set(2, 500L*1E6L); 162 + data->wde_interval = 300L * NSEC_PER_MSEC; 163 + data->trigger_delay = ktime_set(2, 500L * NSEC_PER_MSEC); 164 164 165 165 hrtimer_init(&data->timer_trigger, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 166 166 data->timer_trigger.function = ltc2952_poweroff_timer_trigger;
+2 -2
drivers/power/supply/bq25890_charger.c
··· 581 581 582 582 if (!new_state.online && bq->state.online) { /* power removed */ 583 583 /* disable ADC */ 584 - ret = bq25890_field_write(bq, F_CONV_START, 0); 584 + ret = bq25890_field_write(bq, F_CONV_RATE, 0); 585 585 if (ret < 0) 586 586 goto error; 587 587 } else if (new_state.online && !bq->state.online) { /* power inserted */ 588 588 /* enable ADC, to have control of charge current/voltage */ 589 - ret = bq25890_field_write(bq, F_CONV_START, 1); 589 + ret = bq25890_field_write(bq, F_CONV_RATE, 1); 590 590 if (ret < 0) 591 591 goto error; 592 592 }
+4
drivers/power/supply/power_supply_core.c
··· 853 853 return NULL; 854 854 855 855 for (i = 0; i < POWER_SUPPLY_OCV_TEMP_MAX; i++) { 856 + /* Out of capacity tables */ 857 + if (!info->ocv_table[i]) 858 + break; 859 + 856 860 temp_diff = abs(info->ocv_temp[i] - temp); 857 861 858 862 if (temp_diff < best_temp_diff) {