ec/lenovo/h8: do not reset volume on s3 wakeup

On s3 wakeup h8_enable is called which resets the (audio) volume. But the
volume should be the same as before the s3 state. In particular, userland
programs (e.g. pulseaudio) may be out of sync, if the volume can be changed
by hardware buttons also emitting acpi events. Hence, do not reset the
volume on s3 wakeup.

Tested on a Lenovo ThinkPad X220.

Change-Id: I2af08dea1a3f14a40734d67d372e845cc18c5e09
Signed-off-by: Christopher Spinrath <christopher.spinrath@rwth-aachen.de>
Reviewed-on: https://review.coreboot.org/14183
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
This commit is contained in:
Christopher Spinrath 2016-03-24 20:45:13 +01:00 committed by Martin Roth
parent 2bf7a2ca82
commit b2f9a10c18
1 changed files with 2 additions and 1 deletions

View File

@ -13,6 +13,7 @@
* GNU General Public License for more details.
*/
#include <arch/acpi.h>
#include <arch/io.h>
#include <console/console.h>
#include <device/device.h>
@ -258,7 +259,7 @@ static void h8_enable(struct device *dev)
h8_trackpoint_enable(1);
h8_usb_power_enable(1);
if (get_option(&val, "volume") == CB_SUCCESS)
if (get_option(&val, "volume") == CB_SUCCESS && !acpi_is_wakeup_s3())
ec_write(H8_VOLUME_CONTROL, val);
if (get_option(&val, "bluetooth") != CB_SUCCESS)