diff options
author | Vladimir Serbinenko <phcoder@gmail.com> | 2014-01-11 20:56:47 +0100 |
---|---|---|
committer | Vladimir Serbinenko <phcoder@gmail.com> | 2014-01-12 18:03:33 +0100 |
commit | 9a3b9c42d3063b03bf0028a3cbca0f2465f8f609 (patch) | |
tree | 2b25c5b69c40ea06378a75e35f0336e3c71c64e5 /src/ec | |
parent | 6d6298dddc4147e7a1df6c51cb97b3d94e9c4584 (diff) |
ec/lenovo/h8: Allow user to disable powermanagement beeps.
They're pretty annoying.
Change-Id: I44d26dc168927a9cedfd6ecc4c9a51a3a7b362c7
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/4662
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'src/ec')
-rw-r--r-- | src/ec/lenovo/h8/chip.h | 1 | ||||
-rw-r--r-- | src/ec/lenovo/h8/h8.c | 15 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/ec/lenovo/h8/chip.h b/src/ec/lenovo/h8/chip.h index 58313d4a2a..947a7a0779 100644 --- a/src/ec/lenovo/h8/chip.h +++ b/src/ec/lenovo/h8/chip.h @@ -48,5 +48,6 @@ struct ec_lenovo_h8_config { u8 eventf_enable; u8 trackpoint_enable; + u8 has_power_management_beeps; }; #endif diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c index c67b3b3872..9c85da79db 100644 --- a/src/ec/lenovo/h8/h8.c +++ b/src/ec/lenovo/h8/h8.c @@ -160,6 +160,7 @@ static void h8_enable(device_t dev) { struct ec_lenovo_h8_config *conf = dev->chip_info; u8 val, tmp; + u8 beepmask0, beepmask1; h8_log_ec_version(); @@ -168,8 +169,18 @@ static void h8_enable(device_t dev) ec_write(H8_CONFIG2, conf->config2); ec_write(H8_CONFIG3, conf->config3); - ec_write(H8_SOUND_ENABLE0, conf->beepmask0); - ec_write(H8_SOUND_ENABLE1, conf->beepmask1); + beepmask0 = conf->beepmask0; + beepmask1 = conf->beepmask1; + + if (conf->has_power_management_beeps + && get_option(&val, "power_management_beeps") == CB_SUCCESS + && val == 0) { + beepmask0 = 0x00; + beepmask1 = 0x00; + } + ec_write(H8_SOUND_ENABLE0, beepmask0); + ec_write(H8_SOUND_ENABLE1, beepmask1); + ec_write(H8_SOUND_REPEAT, 0x00); ec_write(0x10, conf->event0_enable); |