On Mon, 22 Jun 2020 15:27:25 +0200, Jaroslav Kysela wrote:
Dne 20. 06. 20 v 14:04 Vijendar Mukunda napsal(a):
Add logic to check DMIC hardware exists or not on the platform at runtime.
Add module param for overriding DMIC hardware check at runtime.
Signed-off-by: Vijendar Mukunda Vijendar.Mukunda@amd.com
sound/soc/amd/renoir/rn-pci-acp3x.c | 29 +++++++++++++++++++++++++++++ sound/soc/amd/renoir/rn_acp3x.h | 7 +++++++ 2 files changed, 36 insertions(+)
diff --git a/sound/soc/amd/renoir/rn-pci-acp3x.c b/sound/soc/amd/renoir/rn-pci-acp3x.c index 859ed67..ef6eeba 100644 --- a/sound/soc/amd/renoir/rn-pci-acp3x.c +++ b/sound/soc/amd/renoir/rn-pci-acp3x.c @@ -5,6 +5,7 @@ //Copyright 2020 Advanced Micro Devices, Inc. #include <linux/pci.h> +#include <linux/acpi.h> #include <linux/module.h> #include <linux/io.h> #include <linux/delay.h> @@ -18,6 +19,16 @@ static int acp_power_gating; module_param(acp_power_gating, int, 0644); MODULE_PARM_DESC(acp_power_gating, "Enable acp power gating"); +/**
- dmic_acpi_check = 0 - Skips DMIC device creation and returns probe failure
= 1 - Assumes that platform has DMIC support and skips ACPI
method check
= 2 - Checks ACPI method to know DMIC hardware status runtime
- */
+static int dmic_acpi_check = ACP_DMIC_AUTO;
I would prefer to have 0 = auto, 1 = force, 2 = skip to put the dmic_acpi_check variable to BSS. Otherwise the patch looks good. Thanks.
It's "bint" module parameter type is used for this kind of flag, which implies: -1 = auto, whatever the default 0 = disable 1 = enable
Then user can pass dmic_acpi_check=1 or dmic_acpi_check=true (or on) to explicitly enable the flag.
Takashi