Tim Crawford has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/76152?usp=email )
Change subject: {ec,mb}/system76: Replace color keyboard logic ......................................................................
{ec,mb}/system76: Replace color keyboard logic
System76 EC since system76/ec@9ac513128ad9 detects if the keyboard is white or RGB backlit via `RGBKB-DET#` at runtime. Remove the Kconfig for the selection and update the ACPI methods for the new functionality.
Change-Id: I60d3d165a58e30d2afc8736c0eb64dd90c8227ca Signed-off-by: Tim Crawford tcrawford@system76.com --- M src/ec/system76/ec/Kconfig M src/ec/system76/ec/acpi/s76.asl M src/mainboard/system76/addw1/Kconfig M src/mainboard/system76/adl/Kconfig M src/mainboard/system76/bonw14/Kconfig M src/mainboard/system76/cml-u/Kconfig M src/mainboard/system76/gaze15/Kconfig M src/mainboard/system76/oryp5/Kconfig M src/mainboard/system76/oryp6/Kconfig M src/mainboard/system76/rpl/Kconfig M src/mainboard/system76/tgl-h/Kconfig M src/mainboard/system76/tgl-u/Kconfig M src/mainboard/system76/whl-u/Kconfig 13 files changed, 39 insertions(+), 47 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/52/76152/1
diff --git a/src/ec/system76/ec/Kconfig b/src/ec/system76/ec/Kconfig index c1e4caf..d1cd079 100644 --- a/src/ec/system76/ec/Kconfig +++ b/src/ec/system76/ec/Kconfig @@ -8,11 +8,6 @@ bool default y
-config EC_SYSTEM76_EC_COLOR_KEYBOARD - depends on EC_SYSTEM76_EC - bool - default n - config EC_SYSTEM76_EC_DGPU depends on EC_SYSTEM76_EC bool diff --git a/src/ec/system76/ec/acpi/s76.asl b/src/ec/system76/ec/acpi/s76.asl index cf9889e..329c5d3 100644 --- a/src/ec/system76/ec/acpi/s76.asl +++ b/src/ec/system76/ec/acpi/s76.asl @@ -16,10 +16,8 @@ Method (RSET, 0, Serialized) { Printf ("S76D: RSET") SAPL(0) - SKBL(0) -#if CONFIG(EC_SYSTEM76_EC_COLOR_KEYBOARD) - SKBC(0xFFFFFF) -#endif // CONFIG(EC_SYSTEM76_EC_COLOR_KEYBOARD) + SKBB(0) + SKBC(0xFFFFFF) }
Method (INIT, 0, Serialized) { @@ -67,53 +65,63 @@ } }
-#if CONFIG(EC_SYSTEM76_EC_COLOR_KEYBOARD) - // Set KB LED Brightness - Method (SKBL, 1, Serialized) { + // Get Keyboard Backlight Kind + // 0 - No backlight + // 1 - White backlight + // 2 - RGB backlight + Method (GKBK, 0, Serialized) { + Local0 = 0 If (^^PCI0.LPCB.EC0.ECOK) { - ^^PCI0.LPCB.EC0.FDAT = 6 - ^^PCI0.LPCB.EC0.FBUF = Arg0 - ^^PCI0.LPCB.EC0.FBF1 = 0 - ^^PCI0.LPCB.EC0.FBF2 = Arg0 + ^^PCI0.LPCB.EC0.FDAT = 2 ^^PCI0.LPCB.EC0.FCMD = 0xCA + Local0 = ^^PCI0.LPCB.EC0.FBUF } + Return (Local0) }
- // Set Keyboard Color - Method (SKBC, 1, Serialized) { - If (^^PCI0.LPCB.EC0.ECOK) { - ^^PCI0.LPCB.EC0.FDAT = 0x3 - ^^PCI0.LPCB.EC0.FBUF = (Arg0 & 0xFF) - ^^PCI0.LPCB.EC0.FBF1 = ((Arg0 >> 16) & 0xFF) - ^^PCI0.LPCB.EC0.FBF2 = ((Arg0 >> 8) & 0xFF) - ^^PCI0.LPCB.EC0.FCMD = 0xCA - Return (Arg0) - } Else { - Return (0) - } - } -#else // CONFIG(EC_SYSTEM76_EC_COLOR_KEYBOARD) - // Get KB LED - Method (GKBL, 0, Serialized) { + // Get Keyboard Brightness + Method (GKBB, 0, Serialized) { Local0 = 0 If (^^PCI0.LPCB.EC0.ECOK) { ^^PCI0.LPCB.EC0.FDAT = 1 ^^PCI0.LPCB.EC0.FCMD = 0xCA Local0 = ^^PCI0.LPCB.EC0.FBUF - ^^PCI0.LPCB.EC0.FCMD = 0 } Return (Local0) }
- // Set KB Led - Method (SKBL, 1, Serialized) { + // Set Keyboard Brightness + Method (SKBB, 1, Serialized) { If (^^PCI0.LPCB.EC0.ECOK) { ^^PCI0.LPCB.EC0.FDAT = 0 ^^PCI0.LPCB.EC0.FBUF = Arg0 ^^PCI0.LPCB.EC0.FCMD = 0xCA } } -#endif // CONFIG(EC_SYSTEM76_EC_COLOR_KEYBOARD) + + // Get Keyboard Color + Method (GKBC, 0, Serialized) { + Local0 = 0 + If (^^PCI0.LPCB.EC0.ECOK) { + ^^PCI0.LPCB.EC0.FDAT = 4 + ^^PCI0.LPCB.EC0.FCMD = 0xCA + Local0 = ^^PCI0.LPCB.EC0.FBUF + Local0 |= (^^PCI0.LPCB.EC0.FBF1) << 16 + Local0 |= (^^PCI0.LPCB.EC0.FBF2) << 8 + } + Return (Local0) + } + + // Set Keyboard Color + Method (SKBC, 1, Serialized) { + If (^^PCI0.LPCB.EC0.ECOK) { + ^^PCI0.LPCB.EC0.FDAT = 3 + ^^PCI0.LPCB.EC0.FBUF = (Arg0 & 0xFF) + ^^PCI0.LPCB.EC0.FBF1 = ((Arg0 >> 16) & 0xFF) + ^^PCI0.LPCB.EC0.FBF2 = ((Arg0 >> 8) & 0xFF) + ^^PCI0.LPCB.EC0.FCMD = 0xCA + } + }
// Fan names Method (NFAN, 0, Serialized) { diff --git a/src/mainboard/system76/addw1/Kconfig b/src/mainboard/system76/addw1/Kconfig index f152392..058f770 100644 --- a/src/mainboard/system76/addw1/Kconfig +++ b/src/mainboard/system76/addw1/Kconfig @@ -6,7 +6,6 @@ select DRIVERS_I2C_HID select DRIVERS_I2C_TAS5825M select EC_SYSTEM76_EC - select EC_SYSTEM76_EC_COLOR_KEYBOARD select EC_SYSTEM76_EC_DGPU select EC_SYSTEM76_EC_OLED select HAVE_ACPI_RESUME diff --git a/src/mainboard/system76/adl/Kconfig b/src/mainboard/system76/adl/Kconfig index 83176d1..68e76c0 100644 --- a/src/mainboard/system76/adl/Kconfig +++ b/src/mainboard/system76/adl/Kconfig @@ -8,7 +8,6 @@ select DRIVERS_INTEL_USB4_RETIMER select DRIVERS_I2C_TAS5825M if BOARD_SYSTEM76_ORYP9 select EC_SYSTEM76_EC - select EC_SYSTEM76_EC_COLOR_KEYBOARD if BOARD_SYSTEM76_DARP8 || BOARD_SYSTEM76_ORYP9 || BOARD_SYSTEM76_ORYP10 select EC_SYSTEM76_EC_DGPU if BOARD_SYSTEM76_ORYP9 || BOARD_SYSTEM76_ORYP10 select HAVE_ACPI_TABLES select HAVE_CMOS_DEFAULT diff --git a/src/mainboard/system76/bonw14/Kconfig b/src/mainboard/system76/bonw14/Kconfig index b3f1707..4d28fef 100644 --- a/src/mainboard/system76/bonw14/Kconfig +++ b/src/mainboard/system76/bonw14/Kconfig @@ -5,7 +5,6 @@ select BOARD_ROMSIZE_KB_16384 select DRIVERS_I2C_HID select EC_SYSTEM76_EC - select EC_SYSTEM76_EC_COLOR_KEYBOARD select EC_SYSTEM76_EC_DGPU select HAVE_ACPI_RESUME select HAVE_ACPI_TABLES diff --git a/src/mainboard/system76/cml-u/Kconfig b/src/mainboard/system76/cml-u/Kconfig index 992f8dc..19a9623 100644 --- a/src/mainboard/system76/cml-u/Kconfig +++ b/src/mainboard/system76/cml-u/Kconfig @@ -5,7 +5,6 @@ select BOARD_ROMSIZE_KB_16384 select DRIVERS_I2C_HID select EC_SYSTEM76_EC - select EC_SYSTEM76_EC_COLOR_KEYBOARD if BOARD_SYSTEM76_DARP6 select HAVE_ACPI_RESUME select HAVE_ACPI_TABLES select HAVE_CMOS_DEFAULT diff --git a/src/mainboard/system76/gaze15/Kconfig b/src/mainboard/system76/gaze15/Kconfig index 3627cb1..6e58e54 100644 --- a/src/mainboard/system76/gaze15/Kconfig +++ b/src/mainboard/system76/gaze15/Kconfig @@ -5,7 +5,6 @@ select BOARD_ROMSIZE_KB_16384 select DRIVERS_I2C_HID select EC_SYSTEM76_EC - select EC_SYSTEM76_EC_COLOR_KEYBOARD select EC_SYSTEM76_EC_DGPU select HAVE_ACPI_RESUME select HAVE_ACPI_TABLES diff --git a/src/mainboard/system76/oryp5/Kconfig b/src/mainboard/system76/oryp5/Kconfig index 9a0a323..5ecccee 100644 --- a/src/mainboard/system76/oryp5/Kconfig +++ b/src/mainboard/system76/oryp5/Kconfig @@ -6,7 +6,6 @@ select DRIVERS_I2C_HID select DRIVERS_I2C_TAS5825M select EC_SYSTEM76_EC - select EC_SYSTEM76_EC_COLOR_KEYBOARD select EC_SYSTEM76_EC_DGPU select HAVE_ACPI_RESUME select HAVE_ACPI_TABLES diff --git a/src/mainboard/system76/oryp6/Kconfig b/src/mainboard/system76/oryp6/Kconfig index 0aef4a6..7480cf2 100644 --- a/src/mainboard/system76/oryp6/Kconfig +++ b/src/mainboard/system76/oryp6/Kconfig @@ -6,7 +6,6 @@ select DRIVERS_I2C_HID select DRIVERS_I2C_TAS5825M select EC_SYSTEM76_EC - select EC_SYSTEM76_EC_COLOR_KEYBOARD select EC_SYSTEM76_EC_DGPU select HAVE_ACPI_RESUME select HAVE_ACPI_TABLES diff --git a/src/mainboard/system76/rpl/Kconfig b/src/mainboard/system76/rpl/Kconfig index b2058d4..cbe18691 100644 --- a/src/mainboard/system76/rpl/Kconfig +++ b/src/mainboard/system76/rpl/Kconfig @@ -22,7 +22,6 @@
config BOARD_SYSTEM76_GAZE18 select BOARD_SYSTEM76_RPL_COMMON - select EC_SYSTEM76_EC_COLOR_KEYBOARD select EC_SYSTEM76_EC_DGPU select SOC_INTEL_ALDERLAKE_PCH_P
diff --git a/src/mainboard/system76/tgl-h/Kconfig b/src/mainboard/system76/tgl-h/Kconfig index 7debee2..5df7ab5 100644 --- a/src/mainboard/system76/tgl-h/Kconfig +++ b/src/mainboard/system76/tgl-h/Kconfig @@ -6,7 +6,6 @@ select DRIVERS_I2C_HID select DRIVERS_I2C_TAS5825M if BOARD_SYSTEM76_ORYP8 select EC_SYSTEM76_EC - select EC_SYSTEM76_EC_COLOR_KEYBOARD select EC_SYSTEM76_EC_DGPU select HAVE_ACPI_RESUME select HAVE_ACPI_TABLES diff --git a/src/mainboard/system76/tgl-u/Kconfig b/src/mainboard/system76/tgl-u/Kconfig index ea2419b..23b93f7 100644 --- a/src/mainboard/system76/tgl-u/Kconfig +++ b/src/mainboard/system76/tgl-u/Kconfig @@ -7,7 +7,6 @@ select DRIVERS_INTEL_PMC select DRIVERS_INTEL_USB4_RETIMER select EC_SYSTEM76_EC - select EC_SYSTEM76_EC_COLOR_KEYBOARD if BOARD_SYSTEM76_DARP7 select EC_SYSTEM76_EC_DGPU if BOARD_SYSTEM76_GALP5 select HAVE_ACPI_TABLES select HAVE_CMOS_DEFAULT diff --git a/src/mainboard/system76/whl-u/Kconfig b/src/mainboard/system76/whl-u/Kconfig index 470de97..02cf981 100644 --- a/src/mainboard/system76/whl-u/Kconfig +++ b/src/mainboard/system76/whl-u/Kconfig @@ -5,7 +5,6 @@ select BOARD_ROMSIZE_KB_16384 select DRIVERS_I2C_HID select EC_SYSTEM76_EC - select EC_SYSTEM76_EC_COLOR_KEYBOARD if BOARD_SYSTEM76_DARP5 select HAVE_ACPI_RESUME select HAVE_ACPI_TABLES select HAVE_CMOS_DEFAULT