[coreboot-gerrit] Change in coreboot[master]: ec/lenovo/h8: Move ACPI methods that set battery thresholds from spec...

Alexey Derlaft (Code Review) gerrit at coreboot.org
Mon Jan 8 22:27:56 CET 2018


Alexey Derlaft has uploaded this change for review. ( https://review.coreboot.org/23176


Change subject: ec/lenovo/h8: Move ACPI methods that set battery thresholds from specific platforms
......................................................................

ec/lenovo/h8: Move ACPI methods that set battery thresholds from specific platforms

Change-Id: I639a3b051db1b51358ad15c446a0da95f88577ea
Signed-off-by: Alexey Kharlamov <der at 2-47.ru>
---
M src/ec/lenovo/h8/Kconfig
M src/ec/lenovo/h8/acpi/ec.asl
R src/ec/lenovo/h8/acpi/tp_acpi_bat_24.asl
R src/ec/lenovo/h8/acpi/tp_acpi_bat_b0.asl
M src/mainboard/lenovo/x200/Kconfig
M src/mainboard/lenovo/x200/dsdt.asl
M src/mainboard/lenovo/x220/Kconfig
M src/mainboard/lenovo/x230/Kconfig
M src/mainboard/lenovo/x230/dsdt.asl
9 files changed, 31 insertions(+), 7 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/76/23176/1

diff --git a/src/ec/lenovo/h8/Kconfig b/src/ec/lenovo/h8/Kconfig
index faeda09..5360be8 100644
--- a/src/ec/lenovo/h8/Kconfig
+++ b/src/ec/lenovo/h8/Kconfig
@@ -29,6 +29,23 @@
 	  charging tresholds. This will then implement the
 	  tpacpi-bat interface provides to include
 
+config IMPLEMENTS_ACPI_H8_BAT_TRESHOLDS_24
+	bool
+	select IMPLEMENTS_ACPI_H8_BAT_TRESHOLDS
+	help
+		Select this to enable an implementation for setting
+		battery thresholds that is suitable for the older
+		Lenovo Thinkpad laptops: X200, T400, T500, and probably some others.
+
+config IMPLEMENTS_ACPI_H8_BAT_TRESHOLDS_B0
+	bool
+	select IMPLEMENTS_ACPI_H8_BAT_TRESHOLDS
+	help
+		Select this to enable an implementation for setting
+		battery thresholds that is suitable for the newer
+		Lenovo Thinkpad laptops: X220/230, T420/430,
+		and probably some others.
+
 endif
 
 config H8_DOCK_EARLY_INIT
diff --git a/src/ec/lenovo/h8/acpi/ec.asl b/src/ec/lenovo/h8/acpi/ec.asl
index 6205c93..ed122d7 100644
--- a/src/ec/lenovo/h8/acpi/ec.asl
+++ b/src/ec/lenovo/h8/acpi/ec.asl
@@ -436,8 +436,9 @@
 		{
 			Return (\_SB.PCI0.LPCB.EC.GSTS)
 		}
+
 		#if IS_ENABLED(CONFIG_IMPLEMENTS_ACPI_H8_BAT_TRESHOLDS)
-		#include "tp_acpi_bat.asl"
+        #include "tp_acpi_bat.asl"
 		#endif
 	}
 
@@ -448,4 +449,12 @@
 #include "beep.asl"
 #include "thermal.asl"
 #include "systemstatus.asl"
+
+#if IS_ENABLED(CONFIG_IMPLEMENTS_ACPI_H8_BAT_TRESHOLDS_24)
+#include "tp_acpi_bat_24.asl"
+#endif
+
+#if IS_ENABLED(CONFIG_IMPLEMENTS_ACPI_H8_BAT_TRESHOLDS_B0)
+#include "tp_acpi_bat_b0.asl"
+#endif
 }
diff --git a/src/mainboard/lenovo/x200/acpi/bat_thresh.asl b/src/ec/lenovo/h8/acpi/tp_acpi_bat_24.asl
similarity index 100%
rename from src/mainboard/lenovo/x200/acpi/bat_thresh.asl
rename to src/ec/lenovo/h8/acpi/tp_acpi_bat_24.asl
diff --git a/src/mainboard/lenovo/x230/acpi/bat_thresh.asl b/src/ec/lenovo/h8/acpi/tp_acpi_bat_b0.asl
similarity index 96%
rename from src/mainboard/lenovo/x230/acpi/bat_thresh.asl
rename to src/ec/lenovo/h8/acpi/tp_acpi_bat_b0.asl
index 2cd19c6..6c568de 100644
--- a/src/mainboard/lenovo/x230/acpi/bat_thresh.asl
+++ b/src/ec/lenovo/h8/acpi/tp_acpi_bat_b0.asl
@@ -22,7 +22,7 @@
 		Offset (0xb0),
 				TSL0, 8, /* Battery0 start threshold */
 		Offset (0xb1),
-				TSH0, 8 /* Battery0 stop threshold */
+				TSH0, 8, /* Battery0 stop threshold */
 		Offset (0xb2),
 				TSL1, 8, /* Battery1 start threshold */
 		Offset (0xb3),
diff --git a/src/mainboard/lenovo/x200/Kconfig b/src/mainboard/lenovo/x200/Kconfig
index 1d0459e..f9570fa 100644
--- a/src/mainboard/lenovo/x200/Kconfig
+++ b/src/mainboard/lenovo/x200/Kconfig
@@ -8,7 +8,7 @@
 	select SOUTHBRIDGE_INTEL_I82801IX
 	select EC_LENOVO_PMH7
 	select EC_LENOVO_H8
-	select IMPLEMENTS_ACPI_H8_BAT_TRESHOLDS
+	select IMPLEMENTS_ACPI_H8_BAT_TRESHOLDS_24
 	select NO_UART_ON_SUPERIO
 	select BOARD_ROMSIZE_KB_8192
 	select DRIVERS_GENERIC_IOAPIC
diff --git a/src/mainboard/lenovo/x200/dsdt.asl b/src/mainboard/lenovo/x200/dsdt.asl
index 5705033..0706249 100644
--- a/src/mainboard/lenovo/x200/dsdt.asl
+++ b/src/mainboard/lenovo/x200/dsdt.asl
@@ -56,5 +56,4 @@
 
 	/* Dock support code */
 	#include "acpi/dock.asl"
-	#include "acpi/bat_thresh.asl"
 }
diff --git a/src/mainboard/lenovo/x220/Kconfig b/src/mainboard/lenovo/x220/Kconfig
index 4b9451b..c87df0e 100644
--- a/src/mainboard/lenovo/x220/Kconfig
+++ b/src/mainboard/lenovo/x220/Kconfig
@@ -9,6 +9,7 @@
 	select SOUTHBRIDGE_INTEL_C216
 	select EC_LENOVO_PMH7
 	select EC_LENOVO_H8
+	select IMPLEMENTS_ACPI_H8_BAT_TRESHOLDS_B0
 	select NO_UART_ON_SUPERIO
 	select BOARD_ROMSIZE_KB_8192
 	select HAVE_ACPI_TABLES
diff --git a/src/mainboard/lenovo/x230/Kconfig b/src/mainboard/lenovo/x230/Kconfig
index 6c3b7eb..2591c21 100644
--- a/src/mainboard/lenovo/x230/Kconfig
+++ b/src/mainboard/lenovo/x230/Kconfig
@@ -9,7 +9,7 @@
 	select SOUTHBRIDGE_INTEL_C216
 	select EC_LENOVO_PMH7
 	select EC_LENOVO_H8
-	select IMPLEMENTS_ACPI_H8_BAT_TRESHOLDS
+	select IMPLEMENTS_ACPI_H8_BAT_TRESHOLDS_B0
 	select NO_UART_ON_SUPERIO
 	select BOARD_ROMSIZE_KB_12288
 	select HAVE_ACPI_TABLES
diff --git a/src/mainboard/lenovo/x230/dsdt.asl b/src/mainboard/lenovo/x230/dsdt.asl
index 3939741..7db8344 100644
--- a/src/mainboard/lenovo/x230/dsdt.asl
+++ b/src/mainboard/lenovo/x230/dsdt.asl
@@ -52,6 +52,4 @@
 
 	/* Chipset specific sleep states */
 	#include <southbridge/intel/bd82x6x/acpi/sleepstates.asl>
-
-	#include "acpi/bat_thresh.asl"
 }

-- 
To view, visit https://review.coreboot.org/23176
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I639a3b051db1b51358ad15c446a0da95f88577ea
Gerrit-Change-Number: 23176
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Derlaft <derlafff at ya.ru>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180108/ae14d89a/attachment.html>


More information about the coreboot-gerrit mailing list