Akshu Agrawal has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30724
Change subject: drivers/generic/adau7002: Add wakeup-delay-ms property ......................................................................
drivers/generic/adau7002: Add wakeup-delay-ms property
Passes out wakeup-delay to driver. This delay is applied at the start of capture to make sure dmics are ready before we start recording. This avoids pop noise at begining of capture.
BUG=b:119926436 TEST= With kernel patch https://lore.kernel.org/patchwork/patch/1029806/ No pop sound heard at start of capture
Change-Id: I32b18bf80fad5899ab4093a127dfd52d589bc365 Signed-off-by: Akshu Agrawal akshu.agrawal@amd.com --- M src/drivers/generic/adau7002/adau7002.c M src/drivers/generic/adau7002/chip.h 2 files changed, 14 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/30724/1
diff --git a/src/drivers/generic/adau7002/adau7002.c b/src/drivers/generic/adau7002/adau7002.c index 2ea1086..223a19b 100644 --- a/src/drivers/generic/adau7002/adau7002.c +++ b/src/drivers/generic/adau7002/adau7002.c @@ -29,7 +29,11 @@
static void adau7002_fill_ssdt(struct device *dev) { - if (!dev || !dev->enabled) + struct drivers_generic_adau7002_config *config = dev->chip_info; + const char *path; + struct acpi_dp *dp; + + if (!dev || !dev->enabled || !config) return;
const char *scope = acpi_device_scope(dev); @@ -45,6 +49,13 @@ acpigen_write_name_string("_DDN", dev->chip_ops->name); acpigen_write_STA(acpi_device_status(dev));
+ /* _DSD for devicetree properties */ + /* This points to the first pin in the first gpio entry in _CRS */ + path = acpi_device_path(dev); + dp = acpi_dp_new_table("_DSD"); + acpi_dp_add_integer(dp, "wakeup-delay-ms", config->wakeup_delay); + acpi_dp_write(dp); + acpigen_pop_len(); /* Device */ acpigen_pop_len(); /* Scope */
diff --git a/src/drivers/generic/adau7002/chip.h b/src/drivers/generic/adau7002/chip.h index 95b4d1e..cfe3dea 100644 --- a/src/drivers/generic/adau7002/chip.h +++ b/src/drivers/generic/adau7002/chip.h @@ -17,6 +17,8 @@ #define __I2C_GENERIC_ADAU7002_CHIP_H__
struct drivers_generic_adau7002_config { + /* Delay */ + unsigned wakeup_delay; };
#endif /* __I2C_GENERIC_ADAU7002_CHIP_H__ */
Daniel Kurtz has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30724 )
Change subject: drivers/generic/adau7002: Add wakeup-delay-ms property ......................................................................
Patch Set 1: Code-Review-1
(1 comment)
https://review.coreboot.org/#/c/30724/1/src/drivers/generic/adau7002/adau700... File src/drivers/generic/adau7002/adau7002.c:
https://review.coreboot.org/#/c/30724/1/src/drivers/generic/adau7002/adau700... PS1, Line 32: dev->chip_info; if dev == NULL, you already crashed here...
If dev != NULL, is it possible for dev->config to be NULL? If not, no need for the "!config" check below.
Daniel Kurtz has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30724 )
Change subject: drivers/generic/adau7002: Add wakeup-delay-ms property ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/30724/1/src/drivers/generic/adau7002/adau700... File src/drivers/generic/adau7002/adau7002.c:
https://review.coreboot.org/#/c/30724/1/src/drivers/generic/adau7002/adau700... PS1, Line 53: /* This points to the first pin in the first gpio entry in _CRS */ huh?
Akshu Agrawal has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30724 )
Change subject: drivers/generic/adau7002: Add wakeup-delay-ms property ......................................................................
Patch Set 1:
(2 comments)
https://review.coreboot.org/#/c/30724/1/src/drivers/generic/adau7002/adau700... File src/drivers/generic/adau7002/adau7002.c:
https://review.coreboot.org/#/c/30724/1/src/drivers/generic/adau7002/adau700... PS1, Line 32: dev->chip_info;
if dev == NULL, you already crashed here... […]
It's possible to have dev-> config NULL, so will have a check if (!dev || !dev->enabled || !dev->config) ... and then assign config = dev->config;
https://review.coreboot.org/#/c/30724/1/src/drivers/generic/adau7002/adau700... PS1, Line 53: /* This points to the first pin in the first gpio entry in _CRS */
huh?
Will remove it. Residue form initial version where I was adding GPIO also along with wake-delay but later realized adau7002 does not have GPIO to turn ON/OFF but uses BCLK.
Hello build bot (Jenkins), Daniel Kurtz, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30724
to look at the new patch set (#2).
Change subject: drivers/generic/adau7002: Add wakeup-delay-ms property ......................................................................
drivers/generic/adau7002: Add wakeup-delay-ms property
Passes out wakeup-delay to driver. This delay is applied at the start of capture to make sure dmics are ready before we start recording. This avoids pop noise at begining of capture.
BUG=b:119926436 TEST= With kernel patch https://lore.kernel.org/patchwork/patch/1029806/ No pop sound heard at start of capture
Change-Id: I32b18bf80fad5899ab4093a127dfd52d589bc365 Signed-off-by: Akshu Agrawal akshu.agrawal@amd.com --- M src/drivers/generic/adau7002/adau7002.c M src/drivers/generic/adau7002/chip.h 2 files changed, 12 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/30724/2
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30724 )
Change subject: drivers/generic/adau7002: Add wakeup-delay-ms property ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/#/c/30724/2/src/drivers/generic/adau7002/chip.h File src/drivers/generic/adau7002/chip.h:
https://review.coreboot.org/#/c/30724/2/src/drivers/generic/adau7002/chip.h@... PS2, Line 21: unsigned wakeup_delay; Prefer 'unsigned int' to bare use of 'unsigned'
Daniel Kurtz has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30724 )
Change subject: drivers/generic/adau7002: Add wakeup-delay-ms property ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/#/c/30724/2/src/drivers/generic/adau7002/adau700... File src/drivers/generic/adau7002/adau7002.c:
https://review.coreboot.org/#/c/30724/2/src/drivers/generic/adau7002/adau700... PS2, Line 35: !dev->chip_info ADAU7002 is a common chip that is used in many configurations without this delay.
So, I think it is better if !dev->chip_info is not fatal, and instead just don't populate wakeup-delay-ms, or use a default value.
Daniel Kurtz has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30724 )
Change subject: drivers/generic/adau7002: Add wakeup-delay-ms property ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/#/c/30724/2/src/drivers/generic/adau7002/adau700... File src/drivers/generic/adau7002/adau7002.c:
https://review.coreboot.org/#/c/30724/2/src/drivers/generic/adau7002/adau700... PS2, Line 35: !dev->chip_info
ADAU7002 is a common chip that is used in many configurations without this delay. […]
Or... maybe I don't understand under which condition dev->chip_info is NULL?
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30724 )
Change subject: drivers/generic/adau7002: Add wakeup-delay-ms property ......................................................................
Patch Set 2:
(2 comments)
https://review.coreboot.org/#/c/30724/2/src/drivers/generic/adau7002/adau700... File src/drivers/generic/adau7002/adau7002.c:
https://review.coreboot.org/#/c/30724/2/src/drivers/generic/adau7002/adau700... PS2, Line 35: !dev->chip_info
Or... […]
dev_chip_info shouldn't ever be null. If the wakeup_delay value isn't set in devicetree, we'll still have the chip_info structure in the static devicetree, and wakeup_delay will be 0.
https://review.coreboot.org/#/c/30724/2/src/drivers/generic/adau7002/chip.h File src/drivers/generic/adau7002/chip.h:
https://review.coreboot.org/#/c/30724/2/src/drivers/generic/adau7002/chip.h@... PS2, Line 21: unsigned please change to 'unsigned int'
Hello build bot (Jenkins), Daniel Kurtz, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/30724
to look at the new patch set (#3).
Change subject: drivers/generic/adau7002: Add wakeup-delay-ms property ......................................................................
drivers/generic/adau7002: Add wakeup-delay-ms property
Passes out wakeup-delay to driver. This delay is applied at the start of capture to make sure dmics are ready before we start recording. This avoids pop noise at begining of capture.
BUG=b:119926436 TEST= With kernel patch https://lore.kernel.org/patchwork/patch/1029806/ No pop sound heard at start of capture
Change-Id: I32b18bf80fad5899ab4093a127dfd52d589bc365 Signed-off-by: Akshu Agrawal akshu.agrawal@amd.com --- M src/drivers/generic/adau7002/adau7002.c M src/drivers/generic/adau7002/chip.h 2 files changed, 11 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/30724/3
Akshu Agrawal has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30724 )
Change subject: drivers/generic/adau7002: Add wakeup-delay-ms property ......................................................................
Patch Set 3:
(2 comments)
https://review.coreboot.org/#/c/30724/2/src/drivers/generic/adau7002/adau700... File src/drivers/generic/adau7002/adau7002.c:
https://review.coreboot.org/#/c/30724/2/src/drivers/generic/adau7002/adau700... PS2, Line 35: !dev->chip_info
dev_chip_info shouldn't ever be null. […]
Done
https://review.coreboot.org/#/c/30724/2/src/drivers/generic/adau7002/chip.h File src/drivers/generic/adau7002/chip.h:
https://review.coreboot.org/#/c/30724/2/src/drivers/generic/adau7002/chip.h@... PS2, Line 21: unsigned
please change to 'unsigned int'
Done
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30724 )
Change subject: drivers/generic/adau7002: Add wakeup-delay-ms property ......................................................................
Patch Set 3: Code-Review+2
Martin Roth has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/30724 )
Change subject: drivers/generic/adau7002: Add wakeup-delay-ms property ......................................................................
drivers/generic/adau7002: Add wakeup-delay-ms property
Passes out wakeup-delay to driver. This delay is applied at the start of capture to make sure dmics are ready before we start recording. This avoids pop noise at begining of capture.
BUG=b:119926436 TEST= With kernel patch https://lore.kernel.org/patchwork/patch/1029806/ No pop sound heard at start of capture
Change-Id: I32b18bf80fad5899ab4093a127dfd52d589bc365 Signed-off-by: Akshu Agrawal akshu.agrawal@amd.com Reviewed-on: https://review.coreboot.org/c/30724 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Martin Roth martinroth@google.com --- M src/drivers/generic/adau7002/adau7002.c M src/drivers/generic/adau7002/chip.h 2 files changed, 11 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Martin Roth: Looks good to me, approved
diff --git a/src/drivers/generic/adau7002/adau7002.c b/src/drivers/generic/adau7002/adau7002.c index 2ea1086..38d3d07 100644 --- a/src/drivers/generic/adau7002/adau7002.c +++ b/src/drivers/generic/adau7002/adau7002.c @@ -29,6 +29,9 @@
static void adau7002_fill_ssdt(struct device *dev) { + struct drivers_generic_adau7002_config *config; + struct acpi_dp *dp; + if (!dev || !dev->enabled) return;
@@ -45,6 +48,12 @@ acpigen_write_name_string("_DDN", dev->chip_ops->name); acpigen_write_STA(acpi_device_status(dev));
+ /* _DSD for devicetree properties */ + config = dev->chip_info; + dp = acpi_dp_new_table("_DSD"); + acpi_dp_add_integer(dp, "wakeup-delay-ms", config->wakeup_delay); + acpi_dp_write(dp); + acpigen_pop_len(); /* Device */ acpigen_pop_len(); /* Scope */
diff --git a/src/drivers/generic/adau7002/chip.h b/src/drivers/generic/adau7002/chip.h index 95b4d1e..f8cab44 100644 --- a/src/drivers/generic/adau7002/chip.h +++ b/src/drivers/generic/adau7002/chip.h @@ -17,6 +17,8 @@ #define __I2C_GENERIC_ADAU7002_CHIP_H__
struct drivers_generic_adau7002_config { + /* Delay */ + unsigned int wakeup_delay; };
#endif /* __I2C_GENERIC_ADAU7002_CHIP_H__ */