[alsa-devel] [PATCH 1/2] ASoC: dmic: Enable ACPI device entry

Matthias Kaehlcke mka at chromium.org
Tue Oct 2 19:12:44 CEST 2018


Hi Jenny,

On Tue, Oct 02, 2018 at 11:27:30AM +0530, Jenny TC wrote:
> Enable ACPI device probing for dmic so that DMIC parameters can be passed
> from ACPI.
> 
> Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella at intel.com>
> Signed-off-by: Jairaj Arava <jairaj.arava at intel.com>
> Signed-off-by: Harsha Priya <harshapriya.n at intel.com>
> ---
>  sound/soc/codecs/dmic.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/sound/soc/codecs/dmic.c b/sound/soc/codecs/dmic.c
> index 8c4926d..ab1aa01 100644
> --- a/sound/soc/codecs/dmic.c
> +++ b/sound/soc/codecs/dmic.c
> @@ -19,6 +19,7 @@
>   *
>   */
>  
> +#include <linux/acpi.h>
>  #include <linux/delay.h>
>  #include <linux/gpio.h>
>  #include <linux/gpio/consumer.h>
> @@ -144,15 +145,26 @@ static int dmic_dev_probe(struct platform_device *pdev)
>  
>  MODULE_ALIAS("platform:dmic-codec");
>  
> +#ifdef CONFIG_OF
>  static const struct of_device_id dmic_dev_match[] = {
>  	{.compatible = "dmic-codec"},
>  	{}
>  };
> +#endif
> +
> +#ifdef CONFIG_ACPI
> +static const struct acpi_device_id dmic_acpi_match[] = {
> +	{ "DMIC", 0 },
> +	{},
> +};
> +MODULE_DEVICE_TABLE(acpi, dmic_acpi_match);
> +#endif
>  
>  static struct platform_driver dmic_driver = {
>  	.driver = {
>  		.name = "dmic-codec",
>  		.of_match_table = dmic_dev_match,

Above you make the definition of dmic_dev_match depend on CONFIG_OF,
you'll want to change the initialization here to
'of_match_ptr(dmic_dev_match)'


More information about the Alsa-devel mailing list