[coreboot-gerrit] New patch to review for coreboot: ec/lenovo/h8: dont set configuration value when boot from s3
Alexander Couzens (lynxis@fe80.eu)
gerrit at coreboot.org
Sun Aug 14 23:21:16 CEST 2016
Alexander Couzens (lynxis at fe80.eu) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16215
-gerrit
commit 5354aea73ccdfa57ef19d7ae85572ce83f23b762
Author: Alexander Couzens <lynxis at fe80.eu>
Date: Sun Aug 14 23:18:51 2016 +0200
ec/lenovo/h8: dont set configuration value when boot from s3
Change-Id: Ifacca35210474ec3db41a53d2ad18f3798b14077
Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
src/ec/lenovo/h8/h8.c | 85 ++++++++++++++++++++++++++-------------------------
1 file changed, 44 insertions(+), 41 deletions(-)
diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c
index 943bdd4..a3cfc23 100644
--- a/src/ec/lenovo/h8/h8.c
+++ b/src/ec/lenovo/h8/h8.c
@@ -209,22 +209,6 @@ static void h8_enable(struct device *dev)
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;
- }
-
- if (conf->has_power_management_beeps) {
- if (get_option(&val, "low_battery_beep") != CB_SUCCESS)
- val = 1;
- if (val)
- beepmask0 |= 2;
- else
- beepmask0 &= ~2;
- }
-
ec_write(H8_SOUND_ENABLE0, beepmask0);
ec_write(H8_SOUND_ENABLE1, beepmask1);
@@ -252,48 +236,67 @@ static void h8_enable(struct device *dev)
ec_write(H8_FAN_CONTROL, H8_FAN_CONTROL_AUTO);
- if (get_option(&val, "wlan") != CB_SUCCESS)
- val = 1;
- h8_wlan_enable(val);
-
h8_trackpoint_enable(1);
h8_usb_power_enable(1);
- if (get_option(&val, "volume") == CB_SUCCESS && !acpi_is_wakeup_s3())
- ec_write(H8_VOLUME_CONTROL, val);
- if (get_option(&val, "bluetooth") != CB_SUCCESS)
- val = 1;
- h8_bluetooth_enable(val);
+ if (!acpi_is_wakeup_s3()) {
+ if (conf->has_power_management_beeps
+ && get_option(&val, "power_management_beeps") == CB_SUCCESS
+ && val == 0) {
+ beepmask0 = 0x00;
+ beepmask1 = 0x00;
+ }
+
+ if (conf->has_power_management_beeps) {
+ if (get_option(&val, "low_battery_beep") != CB_SUCCESS)
+ val = 1;
+ if (val)
+ beepmask0 |= 2;
+ else
+ beepmask0 &= ~2;
+ }
+
+ if (get_option(&val, "wlan") != CB_SUCCESS)
+ val = 1;
+ h8_wlan_enable(val);
- if (get_option(&val, "wwan") != CB_SUCCESS)
- val = 1;
+ if (get_option(&val, "volume") == CB_SUCCESS)
+ ec_write(H8_VOLUME_CONTROL, val);
- h8_wwan_enable(val);
+ if (get_option(&val, "bluetooth") != CB_SUCCESS)
+ val = 1;
+ h8_bluetooth_enable(val);
- if (conf->has_uwb) {
- if (get_option(&val, "uwb") != CB_SUCCESS)
+ if (get_option(&val, "wwan") != CB_SUCCESS)
val = 1;
- h8_uwb_enable(val);
- }
+ h8_wwan_enable(val);
- if (get_option(&val, "fn_ctrl_swap") != CB_SUCCESS)
- val = 0;
- h8_fn_ctrl_swap(val);
+ if (conf->has_uwb) {
+ if (get_option(&val, "uwb") != CB_SUCCESS)
+ val = 1;
+ h8_uwb_enable(val);
+ }
- if (get_option(&val, "sticky_fn") != CB_SUCCESS)
- val = 0;
- h8_sticky_fn(val);
+ if (get_option(&val, "fn_ctrl_swap") != CB_SUCCESS)
+ val = 0;
+ h8_fn_ctrl_swap(val);
- if (get_option(&val, "first_battery") != CB_SUCCESS)
- val = 1;
+ if (get_option(&val, "sticky_fn") != CB_SUCCESS)
+ val = 0;
+ h8_sticky_fn(val);
+
+ if (get_option(&val, "first_battery") != CB_SUCCESS)
+ val = 1;
+
+ h8_set_audio_mute(0);
+ }
tmp = ec_read(H8_CONFIG3);
tmp &= ~(1 << 4);
tmp |= (val & 1) << 4;
ec_write(H8_CONFIG3, tmp);
- h8_set_audio_mute(0);
#if !IS_ENABLED(CONFIG_H8_DOCK_EARLY_INIT)
h8_mainboard_init_dock ();
More information about the coreboot-gerrit
mailing list