ec/lenovo/h8/h8.c: Skip setting volume if out of range
commit9157ccb097d853645e8b1f4a6d82a93d677f6b1b
authorAngel Pons <th3fanbus@gmail.com>
Mon, 26 Apr 2021 16:05:42 +0000 (26 18:05 +0200)
committerPatrick Georgi <pgeorgi@google.com>
Thu, 29 Apr 2021 05:26:11 +0000 (29 05:26 +0000)
tree5c4cb2312bf04b25ddaaf078c0cdb8397e1d6c81
parentbd9d6ab2d5631cd9391114a57840a51416067b3e
ec/lenovo/h8/h8.c: Skip setting volume if out of range

This change is needed to update the option API to use unsigned integers.
The CMOS option system does not support negative numbers.

The volume field is only 8 bits long. Do not set the volume if it is out
of range. Also, use an out-of-range value as fallback to skip setting
the volume when it cannot be read using the option API, to preserve the
current behavior.

Change-Id: I7af68bb5c1ecd4489ab4b826b9a5e7999c77b1ff
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52675
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
src/ec/lenovo/h8/h8.c