Varshit B Pandya has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Add hid check ......................................................................
drivers/generic/max98357a: Add hid check
It's possible to re-use the driver for MAX98360A/B/C/D.
Signed-off-by: Pandya, Varshit B varshit.b.pandya@intel.com Signed-off-by: Yong Zhi yong.zhi@intel.com Change-Id: I22d2d078a9a4eb6ab330da8439737ff5133086d4 --- M src/drivers/generic/max98357a/max98357a.c 1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/39286/1
diff --git a/src/drivers/generic/max98357a/max98357a.c b/src/drivers/generic/max98357a/max98357a.c index 2b0ec3b..f5a66f1 100644 --- a/src/drivers/generic/max98357a/max98357a.c +++ b/src/drivers/generic/max98357a/max98357a.c @@ -42,7 +42,10 @@ /* Device */ acpigen_write_scope(scope); acpigen_write_device(name); - acpigen_write_name_string("_HID", MAX98357A_ACPI_HID); + if (!config->hid) + acpigen_write_name_string("_HID", MAX98357A_ACPI_HID); + else + acpigen_write_name_string("_HID", config->hid); acpigen_write_name_integer("_UID", 0); acpigen_write_name_string("_DDN", dev->chip_ops->name); acpigen_write_STA(acpi_device_status(dev));
Aamir Bohra has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 2:
This change is ready for review.
Divagar Mohandass has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 2: Code-Review+1
Verified audio spk and jack playback.
Aamir Bohra has uploaded a new patch set (#4) to the change originally created by Varshit B Pandya. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
drivers/generic/max98357a: Allow custom _HID from config
It's possible to re-use the driver for MAX98360A/B/C/D.
Signed-off-by: Pandya, Varshit B varshit.b.pandya@intel.com Signed-off-by: Yong Zhi yong.zhi@intel.com Change-Id: I22d2d078a9a4eb6ab330da8439737ff5133086d4 --- M src/drivers/generic/max98357a/chip.h M src/drivers/generic/max98357a/max98357a.c 2 files changed, 10 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/39286/4
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39286/4/src/drivers/generic/max9835... File src/drivers/generic/max98357a/max98357a.c:
https://review.coreboot.org/c/coreboot/+/39286/4/src/drivers/generic/max9835... PS4, Line 49: acpigen_write_name_string("_HID", config->hid); Only use that and update all other boards.
Aamir Bohra has uploaded a new patch set (#10) to the change originally created by Varshit B Pandya. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
drivers/generic/max98357a: Allow custom _HID from config
It's possible to re-use the driver for MAX98360A/B/C/D.
Signed-off-by: Pandya, Varshit B varshit.b.pandya@intel.com Signed-off-by: Yong Zhi yong.zhi@intel.com Change-Id: I22d2d078a9a4eb6ab330da8439737ff5133086d4 --- M src/drivers/generic/max98357a/chip.h M src/drivers/generic/max98357a/max98357a.c 2 files changed, 10 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/39286/10
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 11:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39286/11/src/drivers/generic/max983... File src/drivers/generic/max98357a/max98357a.c:
https://review.coreboot.org/c/coreboot/+/39286/11/src/drivers/generic/max983... PS11, Line 46: if (!config->hid) : acpigen_write_name_string("_HID", MAX98357A_ACPI_HID); : else : acpigen_write_name_string("_HID", config->hid); I believe Paul meant to just use: acpigen_write_name_string("_HID", config->hid); here, and then update all of the devicetrees that use this device to add register "hid" = "MAX98357A_ACPI_HID" (or other as appropriate).
Aamir Bohra has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 11:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39286/11/src/drivers/generic/max983... File src/drivers/generic/max98357a/max98357a.c:
https://review.coreboot.org/c/coreboot/+/39286/11/src/drivers/generic/max983... PS11, Line 46: if (!config->hid) : acpigen_write_name_string("_HID", MAX98357A_ACPI_HID); : else : acpigen_write_name_string("_HID", config->hid);
I believe Paul meant to just use: […]
Paul/Tim,
Ok, I see this implementation covering for default case, without updating the existing boards. Can we keep this? thoughts?
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 11:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39286/11/src/drivers/generic/max983... File src/drivers/generic/max98357a/max98357a.c:
https://review.coreboot.org/c/coreboot/+/39286/11/src/drivers/generic/max983... PS11, Line 46: if (!config->hid) : acpigen_write_name_string("_HID", MAX98357A_ACPI_HID); : else : acpigen_write_name_string("_HID", config->hid);
Paul/Tim, […]
I had another thought... what about a "variant" option in chip.h that has enumerated values for MAX98357A, MAX98357B. Then here it could write out the HID appropriate for each MAX chip variant, with the default being the one that uses the MAX9357A_ACPI_HID.
Karthik Ramasubramanian has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 11:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39286/11/src/drivers/generic/max983... File src/drivers/generic/max98357a/max98357a.c:
https://review.coreboot.org/c/coreboot/+/39286/11/src/drivers/generic/max983... PS11, Line 46: if (!config->hid) : acpigen_write_name_string("_HID", MAX98357A_ACPI_HID); : else : acpigen_write_name_string("_HID", config->hid);
I had another thought... what about a "variant" option in chip.h that has enumerated values for […]
Depending on sed capabilities in your machine you can try to search and replace using the below command:
find . -name *.cb | xargs sed -i -r 's/^([\t]+)(.*max98357a)/\1\2\n\1\tregister "hid" = "MAX98357A"/g'
I donot see a need, but if required use Static assert to ensure that all occurrences are handled.
Aamir Bohra has uploaded a new patch set (#12) to the change originally created by Varshit B Pandya. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
drivers/generic/max98357a: Allow custom _HID from config
Add HID field in max98357a_config and allow mainboards to set it.
Signed-off-by: Aamir Bohra aamir.bohra@intel.com Change-Id: I22d2d078a9a4eb6ab330da8439737ff5133086d4 --- M src/drivers/generic/max98357a/chip.h M src/drivers/generic/max98357a/max98357a.c M src/mainboard/google/fizz/variants/karma/overridetree.cb M src/mainboard/google/glados/variants/asuka/devicetree.cb M src/mainboard/google/glados/variants/cave/devicetree.cb M src/mainboard/google/glados/variants/lars/devicetree.cb M src/mainboard/google/glados/variants/sentry/devicetree.cb M src/mainboard/google/hatch/variants/akemi/overridetree.cb M src/mainboard/google/hatch/variants/dratini/overridetree.cb M src/mainboard/google/hatch/variants/hatch/overridetree.cb M src/mainboard/google/hatch/variants/helios_diskswap/overridetree.cb M src/mainboard/google/hatch/variants/jinlon/overridetree.cb M src/mainboard/google/hatch/variants/kindred/overridetree.cb M src/mainboard/google/hatch/variants/kohaku/overridetree.cb M src/mainboard/google/hatch/variants/mushu/overridetree.cb M src/mainboard/google/hatch/variants/nightfury/overridetree.cb M src/mainboard/google/hatch/variants/palkia/overridetree.cb M src/mainboard/google/hatch/variants/stryke/overridetree.cb M src/mainboard/google/kahlee/variants/aleena/devicetree.cb M src/mainboard/google/kahlee/variants/careena/devicetree.cb M src/mainboard/google/kahlee/variants/grunt/devicetree.cb M src/mainboard/google/kahlee/variants/liara/devicetree.cb M src/mainboard/google/kahlee/variants/nuwani/devicetree.cb M src/mainboard/google/kahlee/variants/treeya/devicetree.cb M src/mainboard/google/octopus/variants/baseboard/devicetree.cb M src/mainboard/google/poppy/variants/nami/devicetree.cb M src/mainboard/google/poppy/variants/nautilus/devicetree.cb M src/mainboard/google/reef/variants/baseboard/devicetree.cb M src/mainboard/google/reef/variants/coral/devicetree.cb M src/mainboard/google/reef/variants/pyro/devicetree.cb M src/mainboard/google/reef/variants/sand/devicetree.cb M src/mainboard/google/reef/variants/snappy/devicetree.cb M src/mainboard/google/volteer/variants/baseboard/devicetree.cb M src/mainboard/intel/cannonlake_rvp/variants/cnl_y/devicetree.cb M src/mainboard/intel/glkrvp/variants/baseboard/devicetree.cb M src/mainboard/intel/kunimitsu/devicetree.cb 36 files changed, 45 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/39286/12
Aamir Bohra has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 12:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39286/11/src/drivers/generic/max983... File src/drivers/generic/max98357a/max98357a.c:
https://review.coreboot.org/c/coreboot/+/39286/11/src/drivers/generic/max983... PS11, Line 46: if (!config->hid) : acpigen_write_name_string("_HID", MAX98357A_ACPI_HID); : else : acpigen_write_name_string("_HID", config->hid);
Depending on sed capabilities in your machine you can try to search and replace using the below comm […]
Done, added a check to mandate HID from mainboard, and added HID field in devictree for mainboards using it.
Aamir Bohra has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 12:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39286/11/src/drivers/generic/max983... File src/drivers/generic/max98357a/max98357a.c:
https://review.coreboot.org/c/coreboot/+/39286/11/src/drivers/generic/max983... PS11, Line 46: if (!config->hid) : acpigen_write_name_string("_HID", MAX98357A_ACPI_HID); : else : acpigen_write_name_string("_HID", config->hid);
Done, added a check to mandate HID from mainboard, and added HID field in devictree for mainboards u […]
Done
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 12: Code-Review+2
Karthik Ramasubramanian has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 12: Code-Review+2
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 12:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39286/12//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/39286/12//COMMIT_MSG@7 PS12, Line 7: max98357a Should this driver be renamed now that it supports chips other than max98357a?
Karthik Ramasubramanian has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 12:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39286/12//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/39286/12//COMMIT_MSG@7 PS12, Line 7: max98357a
Should this driver be renamed now that it supports chips other than max98357a?
It supports only the chips that are pin-compatible with max98357a eg. mamx98360a.
Not all maxim chips are pin-compatible with max98357a eg. max98373. These examples make it tricky to rename this driver.
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 12:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39286/12//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/39286/12//COMMIT_MSG@7 PS12, Line 7: max98357a
It supports only the chips that are pin-compatible with max98357a eg. mamx98360a. […]
Good point, does someone know which other devices? max983xx ?
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 12:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39286/12//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/39286/12//COMMIT_MSG@7 PS12, Line 7: max98357a
Not all maxim chips are pin-compatible with max98357a eg. max98373.
How are these pin incompatible chips handled by the kernel? Do their drivers require similar information in ACPI tables i.e. SD mode gpio and delay? or is the information very different?
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 12:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39286/12//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/39286/12//COMMIT_MSG@7 PS12, Line 7: max98357a
Not all maxim chips are pin-compatible with max98357a eg. max98373. […]
My understanding is the point of this CL was to allow several MAX98356 variants (A/B/C/D ?) to share the same kernel driver. So a board can change the HID to MX98357B instead and get some additional variant-specific behavior.
Karthik Ramasubramanian has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 12:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39286/12//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/39286/12//COMMIT_MSG@7 PS12, Line 7: max98357a
My understanding is the point of this CL was to allow several MAX98356 variants (A/B/C/D ?) to share […]
With reference to that CL: https://review.coreboot.org/c/coreboot/+/39285/17/src/mainboard/google/deded...
for max98360a chip similar information is passed to the kernel. Based on what I grepped around, kernel also is either using or planning to use max98357a driver for max98360a chip. Aamir to confirm regarding that.
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 12:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39286/12//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/39286/12//COMMIT_MSG@7 PS12, Line 7: max98357a
With reference to that CL: […]
Aah I see.. So as you mentioned above.. maybe max983xx?
Karthik Ramasubramanian has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 12:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39286/12//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/39286/12//COMMIT_MSG@7 PS12, Line 7: max98357a
Aah I see.. So as you mentioned above.. […]
max983xx is Tim's suggestion. I initially thought about it.
But max98373 driver exists under drivers/i2c/max98373 and xx can conflict with that.
Aamir Bohra has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 12:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39286/12//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/39286/12//COMMIT_MSG@7 PS12, Line 7: max98357a
max983xx is Tim's suggestion. I initially thought about it. […]
https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2... Looking at above CL , the plan seems to re-use MX98357A driver for MX98360A. Kernel would looks for only MX98357A and MX98360A _HID to bind to.
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 13:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39286/12//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/39286/12//COMMIT_MSG@7 PS12, Line 7: max98357a
https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2... […]
Thanks for the pointer Aamir!
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 13: Code-Review+2
Aamir Bohra has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
Patch Set 13:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39286/4/src/drivers/generic/max9835... File src/drivers/generic/max98357a/max98357a.c:
https://review.coreboot.org/c/coreboot/+/39286/4/src/drivers/generic/max9835... PS4, Line 49: acpigen_write_name_string("_HID", config->hid);
Only use that and update all other boards.
Done
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/39286 )
Change subject: drivers/generic/max98357a: Allow custom _HID from config ......................................................................
drivers/generic/max98357a: Allow custom _HID from config
Add HID field in max98357a_config and allow mainboards to set it.
Signed-off-by: Aamir Bohra aamir.bohra@intel.com Change-Id: I22d2d078a9a4eb6ab330da8439737ff5133086d4 Reviewed-on: https://review.coreboot.org/c/coreboot/+/39286 Reviewed-by: Furquan Shaikh furquan@google.com Reviewed-by: Tim Wawrzynczak twawrzynczak@chromium.org Reviewed-by: Karthik Ramasubramanian kramasub@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/drivers/generic/max98357a/chip.h M src/drivers/generic/max98357a/max98357a.c M src/mainboard/google/fizz/variants/karma/overridetree.cb M src/mainboard/google/glados/variants/asuka/devicetree.cb M src/mainboard/google/glados/variants/cave/devicetree.cb M src/mainboard/google/glados/variants/lars/devicetree.cb M src/mainboard/google/glados/variants/sentry/devicetree.cb M src/mainboard/google/hatch/variants/akemi/overridetree.cb M src/mainboard/google/hatch/variants/dratini/overridetree.cb M src/mainboard/google/hatch/variants/hatch/overridetree.cb M src/mainboard/google/hatch/variants/helios_diskswap/overridetree.cb M src/mainboard/google/hatch/variants/jinlon/overridetree.cb M src/mainboard/google/hatch/variants/kindred/overridetree.cb M src/mainboard/google/hatch/variants/kohaku/overridetree.cb M src/mainboard/google/hatch/variants/mushu/overridetree.cb M src/mainboard/google/hatch/variants/nightfury/overridetree.cb M src/mainboard/google/hatch/variants/palkia/overridetree.cb M src/mainboard/google/hatch/variants/stryke/overridetree.cb M src/mainboard/google/kahlee/variants/aleena/devicetree.cb M src/mainboard/google/kahlee/variants/careena/devicetree.cb M src/mainboard/google/kahlee/variants/grunt/devicetree.cb M src/mainboard/google/kahlee/variants/liara/devicetree.cb M src/mainboard/google/kahlee/variants/nuwani/devicetree.cb M src/mainboard/google/kahlee/variants/treeya/devicetree.cb M src/mainboard/google/octopus/variants/baseboard/devicetree.cb M src/mainboard/google/poppy/variants/nami/devicetree.cb M src/mainboard/google/poppy/variants/nautilus/devicetree.cb M src/mainboard/google/reef/variants/baseboard/devicetree.cb M src/mainboard/google/reef/variants/coral/devicetree.cb M src/mainboard/google/reef/variants/pyro/devicetree.cb M src/mainboard/google/reef/variants/sand/devicetree.cb M src/mainboard/google/reef/variants/snappy/devicetree.cb M src/mainboard/google/volteer/variants/baseboard/devicetree.cb M src/mainboard/intel/cannonlake_rvp/variants/cnl_y/devicetree.cb M src/mainboard/intel/glkrvp/variants/baseboard/devicetree.cb M src/mainboard/intel/kunimitsu/devicetree.cb 36 files changed, 45 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved Karthik Ramasubramanian: Looks good to me, approved Tim Wawrzynczak: Looks good to me, approved
diff --git a/src/drivers/generic/max98357a/chip.h b/src/drivers/generic/max98357a/chip.h index ec4e94f..f956846 100644 --- a/src/drivers/generic/max98357a/chip.h +++ b/src/drivers/generic/max98357a/chip.h @@ -14,6 +14,10 @@ #include <arch/acpi_device.h>
struct drivers_generic_max98357a_config { + + /* ACPI _HID */ + const char *hid; + /* SDMODE GPIO */ struct acpi_gpio sdmode_gpio;
diff --git a/src/drivers/generic/max98357a/max98357a.c b/src/drivers/generic/max98357a/max98357a.c index 2b0ec3b..56fd26c 100644 --- a/src/drivers/generic/max98357a/max98357a.c +++ b/src/drivers/generic/max98357a/max98357a.c @@ -23,7 +23,6 @@ #if CONFIG(HAVE_ACPI_TABLES)
#define MAX98357A_ACPI_NAME "MAXM" -#define MAX98357A_ACPI_HID "MX98357A"
static void max98357a_fill_ssdt(struct device *dev) { @@ -42,7 +41,13 @@ /* Device */ acpigen_write_scope(scope); acpigen_write_device(name); - acpigen_write_name_string("_HID", MAX98357A_ACPI_HID); + + if (!config->hid) { + printk(BIOS_ERR, "%s: ERROR: _HID required\n", dev_path(dev)); + return; + } + + acpigen_write_name_string("_HID", config->hid); acpigen_write_name_integer("_UID", 0); acpigen_write_name_string("_DDN", dev->chip_ops->name); acpigen_write_STA(acpi_device_status(dev)); diff --git a/src/mainboard/google/fizz/variants/karma/overridetree.cb b/src/mainboard/google/fizz/variants/karma/overridetree.cb index 0273f78..f978240 100644 --- a/src/mainboard/google/fizz/variants/karma/overridetree.cb +++ b/src/mainboard/google/fizz/variants/karma/overridetree.cb @@ -58,6 +58,7 @@ end # USB xHCI device pci 19.1 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_A23)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/glados/variants/asuka/devicetree.cb b/src/mainboard/google/glados/variants/asuka/devicetree.cb index 27bbeba..772584d 100644 --- a/src/mainboard/google/glados/variants/asuka/devicetree.cb +++ b/src/mainboard/google/glados/variants/asuka/devicetree.cb @@ -269,6 +269,7 @@ device pci 1f.2 on end # Power Management Controller device pci 1f.3 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_E3)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/glados/variants/cave/devicetree.cb b/src/mainboard/google/glados/variants/cave/devicetree.cb index 22ee80f..1d04a8e 100644 --- a/src/mainboard/google/glados/variants/cave/devicetree.cb +++ b/src/mainboard/google/glados/variants/cave/devicetree.cb @@ -284,6 +284,7 @@ device pci 1f.2 on end # Power Management Controller device pci 1f.3 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_E3)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/glados/variants/lars/devicetree.cb b/src/mainboard/google/glados/variants/lars/devicetree.cb index 503cf5a..76e614d 100644 --- a/src/mainboard/google/glados/variants/lars/devicetree.cb +++ b/src/mainboard/google/glados/variants/lars/devicetree.cb @@ -267,6 +267,7 @@ device pci 1f.2 on end # Power Management Controller device pci 1f.3 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_B2)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/glados/variants/sentry/devicetree.cb b/src/mainboard/google/glados/variants/sentry/devicetree.cb index 4c6bbf8..3e2137b 100644 --- a/src/mainboard/google/glados/variants/sentry/devicetree.cb +++ b/src/mainboard/google/glados/variants/sentry/devicetree.cb @@ -290,6 +290,7 @@ device pci 1f.2 on end # Power Management Controller device pci 1f.3 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_E3)" register "device_present_gpio" = "GPP_E3" register "device_present_gpio_invert" = "1" diff --git a/src/mainboard/google/hatch/variants/akemi/overridetree.cb b/src/mainboard/google/hatch/variants/akemi/overridetree.cb index d236cb0..27d11cc 100644 --- a/src/mainboard/google/hatch/variants/akemi/overridetree.cb +++ b/src/mainboard/google/hatch/variants/akemi/overridetree.cb @@ -236,6 +236,7 @@ device pci 1e.3 off end # GSPI #1 device pci 1f.3 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_H3)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/hatch/variants/dratini/overridetree.cb b/src/mainboard/google/hatch/variants/dratini/overridetree.cb index 5c30a5a..0bd3d8e 100644 --- a/src/mainboard/google/hatch/variants/dratini/overridetree.cb +++ b/src/mainboard/google/hatch/variants/dratini/overridetree.cb @@ -170,6 +170,7 @@ end # GSPI #1 device pci 1f.3 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_H3)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/hatch/variants/hatch/overridetree.cb b/src/mainboard/google/hatch/variants/hatch/overridetree.cb index c623fde..a92ef9b 100644 --- a/src/mainboard/google/hatch/variants/hatch/overridetree.cb +++ b/src/mainboard/google/hatch/variants/hatch/overridetree.cb @@ -178,6 +178,7 @@ end # GSPI #1 device pci 1f.3 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_H3)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/hatch/variants/helios_diskswap/overridetree.cb b/src/mainboard/google/hatch/variants/helios_diskswap/overridetree.cb index 22534f3..8a3745d 100644 --- a/src/mainboard/google/hatch/variants/helios_diskswap/overridetree.cb +++ b/src/mainboard/google/hatch/variants/helios_diskswap/overridetree.cb @@ -207,6 +207,7 @@ end # GSPI #1 device pci 1f.3 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_H3)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/hatch/variants/jinlon/overridetree.cb b/src/mainboard/google/hatch/variants/jinlon/overridetree.cb index f7ca7d5..7cf434d 100644 --- a/src/mainboard/google/hatch/variants/jinlon/overridetree.cb +++ b/src/mainboard/google/hatch/variants/jinlon/overridetree.cb @@ -178,6 +178,7 @@ end # GSPI #1 device pci 1f.3 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_H3)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/hatch/variants/kindred/overridetree.cb b/src/mainboard/google/hatch/variants/kindred/overridetree.cb index 5067991..8afae39 100644 --- a/src/mainboard/google/hatch/variants/kindred/overridetree.cb +++ b/src/mainboard/google/hatch/variants/kindred/overridetree.cb @@ -199,6 +199,7 @@ device pci 1e.3 off end # GSPI #1 unused device pci 1f.3 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_H3)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/hatch/variants/kohaku/overridetree.cb b/src/mainboard/google/hatch/variants/kohaku/overridetree.cb index ce87469..6a5ce7c 100644 --- a/src/mainboard/google/hatch/variants/kohaku/overridetree.cb +++ b/src/mainboard/google/hatch/variants/kohaku/overridetree.cb @@ -261,6 +261,7 @@ end # GSPI #1 device pci 1f.3 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_H3)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/hatch/variants/mushu/overridetree.cb b/src/mainboard/google/hatch/variants/mushu/overridetree.cb index f50bab2..0c8cb53 100644 --- a/src/mainboard/google/hatch/variants/mushu/overridetree.cb +++ b/src/mainboard/google/hatch/variants/mushu/overridetree.cb @@ -193,6 +193,7 @@ end # GSPI #1 device pci 1f.3 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_H3)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/hatch/variants/nightfury/overridetree.cb b/src/mainboard/google/hatch/variants/nightfury/overridetree.cb index 6dc3d9f..a35e99d 100644 --- a/src/mainboard/google/hatch/variants/nightfury/overridetree.cb +++ b/src/mainboard/google/hatch/variants/nightfury/overridetree.cb @@ -255,6 +255,7 @@ device pci 1e.3 off end # GSPI #1 device pci 1f.3 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_H3)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/hatch/variants/palkia/overridetree.cb b/src/mainboard/google/hatch/variants/palkia/overridetree.cb index 0792b96..bce5801 100644 --- a/src/mainboard/google/hatch/variants/palkia/overridetree.cb +++ b/src/mainboard/google/hatch/variants/palkia/overridetree.cb @@ -183,6 +183,7 @@
device pci 1f.3 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_H3)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/hatch/variants/stryke/overridetree.cb b/src/mainboard/google/hatch/variants/stryke/overridetree.cb index 796e589..329efa3 100644 --- a/src/mainboard/google/hatch/variants/stryke/overridetree.cb +++ b/src/mainboard/google/hatch/variants/stryke/overridetree.cb @@ -212,6 +212,7 @@ device pci 1e.3 off end # GSPI #1 device pci 1f.3 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_H3)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/kahlee/variants/aleena/devicetree.cb b/src/mainboard/google/kahlee/variants/aleena/devicetree.cb index cf0978f..864e0cd 100644 --- a/src/mainboard/google/kahlee/variants/aleena/devicetree.cb +++ b/src/mainboard/google/kahlee/variants/aleena/devicetree.cb @@ -118,6 +118,7 @@ device i2c 1a on end end chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPIO_119)" register "sdmode_delay" = "5" device generic 0.1 on end diff --git a/src/mainboard/google/kahlee/variants/careena/devicetree.cb b/src/mainboard/google/kahlee/variants/careena/devicetree.cb index ac07aa1..6c28d0f 100644 --- a/src/mainboard/google/kahlee/variants/careena/devicetree.cb +++ b/src/mainboard/google/kahlee/variants/careena/devicetree.cb @@ -119,6 +119,7 @@ device i2c 1a on end end chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPIO_119)" register "sdmode_delay" = "5" device generic 0.1 on end diff --git a/src/mainboard/google/kahlee/variants/grunt/devicetree.cb b/src/mainboard/google/kahlee/variants/grunt/devicetree.cb index 18053d7..efa4066 100644 --- a/src/mainboard/google/kahlee/variants/grunt/devicetree.cb +++ b/src/mainboard/google/kahlee/variants/grunt/devicetree.cb @@ -118,6 +118,7 @@ device i2c 1a on end end chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPIO_119)" register "sdmode_delay" = "5" device generic 0.1 on end diff --git a/src/mainboard/google/kahlee/variants/liara/devicetree.cb b/src/mainboard/google/kahlee/variants/liara/devicetree.cb index 7dd34f3..0983f79 100644 --- a/src/mainboard/google/kahlee/variants/liara/devicetree.cb +++ b/src/mainboard/google/kahlee/variants/liara/devicetree.cb @@ -118,6 +118,7 @@ device i2c 1a on end end chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPIO_119)" register "sdmode_delay" = "5" device generic 0.1 on end diff --git a/src/mainboard/google/kahlee/variants/nuwani/devicetree.cb b/src/mainboard/google/kahlee/variants/nuwani/devicetree.cb index 6828d36..efe92f7 100644 --- a/src/mainboard/google/kahlee/variants/nuwani/devicetree.cb +++ b/src/mainboard/google/kahlee/variants/nuwani/devicetree.cb @@ -121,6 +121,7 @@ device i2c 1a on end end chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPIO_119)" register "sdmode_delay" = "5" device generic 0.1 on end diff --git a/src/mainboard/google/kahlee/variants/treeya/devicetree.cb b/src/mainboard/google/kahlee/variants/treeya/devicetree.cb index f92767f..efc384f 100644 --- a/src/mainboard/google/kahlee/variants/treeya/devicetree.cb +++ b/src/mainboard/google/kahlee/variants/treeya/devicetree.cb @@ -121,6 +121,7 @@ device i2c 1a on end end chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPIO_119)" register "sdmode_delay" = "5" device generic 0.1 on end diff --git a/src/mainboard/google/octopus/variants/baseboard/devicetree.cb b/src/mainboard/google/octopus/variants/baseboard/devicetree.cb index 5404531..9253f11 100644 --- a/src/mainboard/google/octopus/variants/baseboard/devicetree.cb +++ b/src/mainboard/google/octopus/variants/baseboard/devicetree.cb @@ -122,6 +122,7 @@ device pci 0d.3 on end # - Shared SRAM device pci 0e.0 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPIO_91)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/poppy/variants/nami/devicetree.cb b/src/mainboard/google/poppy/variants/nami/devicetree.cb index 3d37eda..1b3fdcc 100644 --- a/src/mainboard/google/poppy/variants/nami/devicetree.cb +++ b/src/mainboard/google/poppy/variants/nami/devicetree.cb @@ -401,6 +401,7 @@ end # I2C #2 device pci 15.3 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_A23)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/poppy/variants/nautilus/devicetree.cb b/src/mainboard/google/poppy/variants/nautilus/devicetree.cb index ef5e8ad..66ceb2d 100644 --- a/src/mainboard/google/poppy/variants/nautilus/devicetree.cb +++ b/src/mainboard/google/poppy/variants/nautilus/devicetree.cb @@ -365,6 +365,7 @@ device pci 19.0 on end # UART #2 device pci 19.1 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_A23)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/reef/variants/baseboard/devicetree.cb b/src/mainboard/google/reef/variants/baseboard/devicetree.cb index da842ba..cbc2e22 100644 --- a/src/mainboard/google/reef/variants/baseboard/devicetree.cb +++ b/src/mainboard/google/reef/variants/baseboard/devicetree.cb @@ -131,6 +131,7 @@ device pci 0d.3 on end # - Shared SRAM device pci 0e.0 on # - Audio chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPIO_76)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/reef/variants/coral/devicetree.cb b/src/mainboard/google/reef/variants/coral/devicetree.cb index 1608343..00e63bc 100644 --- a/src/mainboard/google/reef/variants/coral/devicetree.cb +++ b/src/mainboard/google/reef/variants/coral/devicetree.cb @@ -131,6 +131,7 @@ device pci 0d.3 on end # - Shared SRAM device pci 0e.0 on # - Audio chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPIO_76)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/reef/variants/pyro/devicetree.cb b/src/mainboard/google/reef/variants/pyro/devicetree.cb index c2d67aa..f62af8a 100644 --- a/src/mainboard/google/reef/variants/pyro/devicetree.cb +++ b/src/mainboard/google/reef/variants/pyro/devicetree.cb @@ -140,6 +140,7 @@ device pci 0d.3 on end # - Shared SRAM device pci 0e.0 on # - Audio chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPIO_76)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/reef/variants/sand/devicetree.cb b/src/mainboard/google/reef/variants/sand/devicetree.cb index 68f33ae..b62704a 100644 --- a/src/mainboard/google/reef/variants/sand/devicetree.cb +++ b/src/mainboard/google/reef/variants/sand/devicetree.cb @@ -127,6 +127,7 @@ device pci 0d.3 on end # - Shared SRAM device pci 0e.0 on # - Audio chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPIO_76)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/reef/variants/snappy/devicetree.cb b/src/mainboard/google/reef/variants/snappy/devicetree.cb index aaf61de..4edf739 100644 --- a/src/mainboard/google/reef/variants/snappy/devicetree.cb +++ b/src/mainboard/google/reef/variants/snappy/devicetree.cb @@ -136,6 +136,7 @@ device pci 0d.3 on end # - Shared SRAM device pci 0e.0 on # - Audio chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPIO_76)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/google/volteer/variants/baseboard/devicetree.cb b/src/mainboard/google/volteer/variants/baseboard/devicetree.cb index 84d121f..6be69fe 100644 --- a/src/mainboard/google/volteer/variants/baseboard/devicetree.cb +++ b/src/mainboard/google/volteer/variants/baseboard/devicetree.cb @@ -363,6 +363,7 @@ device pci 1f.2 on end # PMC 0xA0A1 device pci 1f.3 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_A10)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/intel/cannonlake_rvp/variants/cnl_y/devicetree.cb b/src/mainboard/intel/cannonlake_rvp/variants/cnl_y/devicetree.cb index a6d329b..53c677b 100644 --- a/src/mainboard/intel/cannonlake_rvp/variants/cnl_y/devicetree.cb +++ b/src/mainboard/intel/cannonlake_rvp/variants/cnl_y/devicetree.cb @@ -166,6 +166,7 @@ device pci 1f.2 on end # Power Management Controller device pci 1f.3 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_D16)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/intel/glkrvp/variants/baseboard/devicetree.cb b/src/mainboard/intel/glkrvp/variants/baseboard/devicetree.cb index c5ad27d..361a4a3 100644 --- a/src/mainboard/intel/glkrvp/variants/baseboard/devicetree.cb +++ b/src/mainboard/intel/glkrvp/variants/baseboard/devicetree.cb @@ -112,6 +112,7 @@ device pci 0d.3 on end # - Shared SRAM device pci 0e.0 on # - Audio chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPIO_160)" register "sdmode_delay" = "5" device generic 0 on end diff --git a/src/mainboard/intel/kunimitsu/devicetree.cb b/src/mainboard/intel/kunimitsu/devicetree.cb index ea35785..ab30614 100644 --- a/src/mainboard/intel/kunimitsu/devicetree.cb +++ b/src/mainboard/intel/kunimitsu/devicetree.cb @@ -289,6 +289,7 @@ device pci 1f.2 on end # Power Management Controller device pci 1f.3 on chip drivers/generic/max98357a + register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_E3)" register "device_present_gpio" = "GPP_E3" register "device_present_gpio_invert" = "1"