From aee3b148ba8263e983de12cfb873ee5ec6d0569f Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Thu, 18 Jun 2020 22:25:12 -0700 Subject: mb/google/zork: Generate I2SM ACPI device at runtime This change moves the generation of I2SM ACPI device from static asl file to runtime generation by ACP device driver. dmic_select_gpio is set to match version 3+ of Trembyle and Dalboz schematics. In order to maintain backward compatibility, dmic_select_gpio is updated at runtime using variant_audio_update for board versions that are prior to version 3 of reference schematics. The only difference from static generation is that the device I2SM is added under ACPD (i.e. ACP device) instead of CREC (Chrome EC device). It does not make any functional difference from the kernel perspective. BUG=b:157603026 TEST=Verified that the following device gets generated in SSDT: Scope (\_SB.PCI0.PBRA.ACPD) { Device (I2SM) { Name (_HID, "AMDI5682") // _HID: Hardware ID Name (_UID, One) // _UID: Unique ID Name (_DDN, "I2S machine driver") // _DDN: DOS Device Name Method (_STA, 0, NotSerialized) // _STA: Status { Return (0x0F) } Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings { GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly, "\\_SB.GPIO", 0x00, ResourceConsumer, , ) { // Pin list 0x000D } }) Name (_DSD, Package (0x02) // _DSD: Device-Specific Data { ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301") /* Device Properties for _DSD */, Package (0x01) { Package (0x02) { "dmic-gpios", Package (0x04) { \_SB.PCI0.PBRA.ACPD.I2SM, Zero, Zero, Zero } } } }) } } Verified audio via speakers and mic input. Signed-off-by: Furquan Shaikh Change-Id: I5d1602c7f719eef9487ddea68e429d27408f9a76 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/coreboot/+/2253638 Commit-Queue: Furquan Shaikh Tested-by: Furquan Shaikh Reviewed-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/c/coreboot/+/42971 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Aaron Durbin --- src/mainboard/google/zork/mainboard.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/mainboard/google/zork/mainboard.c') diff --git a/src/mainboard/google/zork/mainboard.c b/src/mainboard/google/zork/mainboard.c index 283f0e0841..f295271596 100644 --- a/src/mainboard/google/zork/mainboard.c +++ b/src/mainboard/google/zork/mainboard.c @@ -132,6 +132,12 @@ static void mainboard_configure_gpios(void) override_num_gpios); } +static void mainboard_devtree_update(void) +{ + variant_audio_update(); + variant_devtree_update(); +} + static void mainboard_init(void *chip_info) { const struct sci_source *gpes; @@ -145,7 +151,7 @@ static void mainboard_init(void *chip_info) mainboard_configure_gpios(); /* Update DUT configuration */ - variant_devtree_update(); + mainboard_devtree_update(); /* * Some platforms use SCI not generated by a GPIO pin (event above 23). -- cgit v1.2.3