Skip to content

Commit

Permalink
bat.d/lg: ensure lg-legacy plugin is also probed
Browse files Browse the repository at this point in the history
Rationale: if either the standard attributes charge_control_start/end_threshold
do not exist or contain a '0' value, then lg-legacy may apply.

Reference:
* #708
  • Loading branch information
linrunner committed Sep 15, 2023
1 parent f003012 commit aca3f58
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bat.d/35-lg
Expand Up @@ -120,6 +120,12 @@ batdrv_init () {
fi
done

if [ $_natacpi -ge 32 ]; then
# let's probe lg-legacy next (kernel 5.17 and older)
echo_debug "bat" "batdrv_init.${_batdrv_plugin}.no_natacpi: batteries=$_batteries; natacpi=$_natacpi"
return 1
fi

# shellcheck disable=SC2034
_batdrv_selected=$_batdrv_plugin
echo_debug "bat" "batdrv_init.${_batdrv_plugin}: batteries=$_batteries; natacpi=$_natacpi; thresh=$_bm_thresh; bn_stop=$_bn_stop"
Expand Down

0 comments on commit aca3f58

Please sign in to comment.