diff mbox series

[SRU,OEM-5.6,1/1] ALSA: hda: add autodetection for SoundWire

Message ID 20200805030228.15386-2-hui.wang@canonical.com
State New
Headers show
Series alsa: should not load sof driver if the internal mic connects to the codec | expand

Commit Message

Hui Wang Aug. 5, 2020, 3:02 a.m. UTC
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

BugLink: https://bugs.launchpad.net/bugs/1890231

When an ACPI companion device is present and the SoundWire link mask
information is available, use SoundWire instead of legacy HDA or
Skylake drivers.

The SOF driver is selected when SoundWire or DMIC are detected. There
is no precedence at this level. In the SOF driver proper, SoundWire
will be handled first since it is mutually exclusive with HDaudio.

Known devices with an existing DMI quirk bypass this detection to
avoid any dependency on ACPI/DSDT tables.

[Drop the FLAG_SOF_ONLY_IF_SOUNDWIRE and related code since
sdw_intel_acpi_scan() is not implemented yet in the mainline kernel,
and sdw_intel_acpi_scan() in the oem-5.6 kernel doesn't work well,
this function will return true on Dell machines without soundwire.
- Hui.Wang]

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200409190251.16569-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(backported from commit 0650857570d161486a95d37bc8682628881ae2da)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
---
 sound/hda/intel-dsp-config.c | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

Comments

Anthony Wong Aug. 12, 2020, 7:37 a.m. UTC | #1
Hui Wang 於 5/8/2020 上午11:02 寫道:
> From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1890231
> 
> When an ACPI companion device is present and the SoundWire link mask
> information is available, use SoundWire instead of legacy HDA or
> Skylake drivers.
> 
> The SOF driver is selected when SoundWire or DMIC are detected. There
> is no precedence at this level. In the SOF driver proper, SoundWire
> will be handled first since it is mutually exclusive with HDaudio.
> 
> Known devices with an existing DMI quirk bypass this detection to
> avoid any dependency on ACPI/DSDT tables.
> 
> [Drop the FLAG_SOF_ONLY_IF_SOUNDWIRE and related code since
> sdw_intel_acpi_scan() is not implemented yet in the mainline kernel,
> and sdw_intel_acpi_scan() in the oem-5.6 kernel doesn't work well,
> this function will return true on Dell machines without soundwire.
> - Hui.Wang] >
> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Link: https://lore.kernel.org/r/20200409190251.16569-1-pierre-louis.bossart@linux.intel.com
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> (backported from commit 0650857570d161486a95d37bc8682628881ae2da)
> Signed-off-by: Hui Wang <hui.wang@canonical.com>
> ---
>   sound/hda/intel-dsp-config.c | 23 ++++++++++++++++++-----
>   1 file changed, 18 insertions(+), 5 deletions(-)
> 
> diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c
> index 72c64bf42dec..a4f8149cac74 100644
> --- a/sound/hda/intel-dsp-config.c
> +++ b/sound/hda/intel-dsp-config.c
> @@ -205,10 +205,17 @@ static const struct config_entry config_table[] = {
>   				}
>   			},
>   			{
> -				.ident = "Dell laptop",
>   				.matches = {
>   					DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
> -				}
> +					DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "09C6")
> +				},
> +			},
> +			{
> +				/* early version of SKU 09C6 */
> +				.matches = {
> +					DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
> +					DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0983")
> +				},
>   			},
>   			{}
>   		}
> @@ -225,10 +232,16 @@ static const struct config_entry config_table[] = {
>   		.device = 0x06c8,
>   		.dmi_table = (const struct dmi_system_id []) {
>   			{
> -				.ident = "Dell laptop",
>   				.matches = {
> -					DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
> -				}
> +					DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
> +					DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "098F"),
> +				},
> +			},
> +			{
> +				.matches = {
> +					DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
> +					DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0990"),
> +				},
>   			},
>   			{}
>   		}
> 

Acked-by: Anthony Wong <anthony.wong@canonical.com>
Stefan Bader Aug. 13, 2020, 9:02 a.m. UTC | #2
On 05.08.20 05:02, Hui Wang wrote:
> From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1890231
> 
> When an ACPI companion device is present and the SoundWire link mask
> information is available, use SoundWire instead of legacy HDA or
> Skylake drivers.
> 
> The SOF driver is selected when SoundWire or DMIC are detected. There
> is no precedence at this level. In the SOF driver proper, SoundWire
> will be handled first since it is mutually exclusive with HDaudio.
> 
> Known devices with an existing DMI quirk bypass this detection to
> avoid any dependency on ACPI/DSDT tables.
> 
> [Drop the FLAG_SOF_ONLY_IF_SOUNDWIRE and related code since
> sdw_intel_acpi_scan() is not implemented yet in the mainline kernel,
> and sdw_intel_acpi_scan() in the oem-5.6 kernel doesn't work well,
> this function will return true on Dell machines without soundwire.
> - Hui.Wang]
> 
> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Link: https://lore.kernel.org/r/20200409190251.16569-1-pierre-louis.bossart@linux.intel.com
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> (backported from commit 0650857570d161486a95d37bc8682628881ae2da)
> Signed-off-by: Hui Wang <hui.wang@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>  sound/hda/intel-dsp-config.c | 23 ++++++++++++++++++-----
>  1 file changed, 18 insertions(+), 5 deletions(-)
> 
> diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c
> index 72c64bf42dec..a4f8149cac74 100644
> --- a/sound/hda/intel-dsp-config.c
> +++ b/sound/hda/intel-dsp-config.c
> @@ -205,10 +205,17 @@ static const struct config_entry config_table[] = {
>  				}
>  			},
>  			{
> -				.ident = "Dell laptop",
>  				.matches = {
>  					DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
> -				}
> +					DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "09C6")
> +				},
> +			},
> +			{
> +				/* early version of SKU 09C6 */
> +				.matches = {
> +					DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
> +					DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0983")
> +				},
>  			},
>  			{}
>  		}
> @@ -225,10 +232,16 @@ static const struct config_entry config_table[] = {
>  		.device = 0x06c8,
>  		.dmi_table = (const struct dmi_system_id []) {
>  			{
> -				.ident = "Dell laptop",
>  				.matches = {
> -					DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
> -				}
> +					DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
> +					DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "098F"),
> +				},
> +			},
> +			{
> +				.matches = {
> +					DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
> +					DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0990"),
> +				},
>  			},
>  			{}
>  		}
>
diff mbox series

Patch

diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c
index 72c64bf42dec..a4f8149cac74 100644
--- a/sound/hda/intel-dsp-config.c
+++ b/sound/hda/intel-dsp-config.c
@@ -205,10 +205,17 @@  static const struct config_entry config_table[] = {
 				}
 			},
 			{
-				.ident = "Dell laptop",
 				.matches = {
 					DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
-				}
+					DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "09C6")
+				},
+			},
+			{
+				/* early version of SKU 09C6 */
+				.matches = {
+					DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
+					DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0983")
+				},
 			},
 			{}
 		}
@@ -225,10 +232,16 @@  static const struct config_entry config_table[] = {
 		.device = 0x06c8,
 		.dmi_table = (const struct dmi_system_id []) {
 			{
-				.ident = "Dell laptop",
 				.matches = {
-					DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
-				}
+					DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
+					DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "098F"),
+				},
+			},
+			{
+				.matches = {
+					DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
+					DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0990"),
+				},
 			},
 			{}
 		}