[SRU][OEM-5.10][PATCH 0/6] alsa/sdw: support soundwire audio for TGL-H machines

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU][OEM-5.10][PATCH 0/6] alsa/sdw: support soundwire audio for TGL-H machines

Hui Wang
BugLink: https://bugs.launchpad.net/bugs/1911830

The patchset are not upstreamed yet, their target upstream version
is 5.12, so here I just backported the patchset to oem-5.10 kernel,
after those patches are merged to upstream kernel, I will start to
backport them to 5.10 generic kernel.

[Impact]
In the OEM project, we have a new TGL-H soundwire machine, with
the current oem-5.10 kernel, the audio can't work.

[Fix]
Backport 6 patches from Intel thesofproject kernel.

[Test]
Put the testing sof-tgl-h.ri in the /lib/firmware/intel/sof,
boot the patched kernel, we could see speakers and microphone
from gnome-setting, and they all work well.


[Where problems could occur]
The patches changed soundwire machine driver, it is possible
to make the audio on old soundwire machines not work anymore.
But we tested the patches on TGL-U and cml soundwire machines,
all worked well.



Bard Liao (2):
  UBUNTU: SAUCE: ALSA: hda: intel-dsp-config: add PCI id for TGL-H
  UBUNTU: SAUCE: fixup! ALSA: hda: intel-dsp-config: add PCI id for
    TGL-H

Hui Wang (1):
  UBUNTU: SAUCE: ASoC: Intel: sof_sdw: set SOF_SDW_FOUR_SPK to Dell
    TGL-H SKU 0A5E

Libin Yang (3):
  UBUNTU: SAUCE: ASoC: SOF: allow soundwire use
    desc->default_fw_filename
  UBUNTU: SAUCE: ASoC: Intel: tgl: remove sof_fw_filename set for
    tgl_3_in_1_default
  UBUNTU: SAUCE: ASoC: Intel: sof_sdw: set proper flags for Dell TGL-H
    SKU 0A5E

 sound/hda/intel-dsp-config.c                      |  4 ++++
 sound/soc/intel/boards/sof_sdw.c                  | 10 ++++++++++
 sound/soc/intel/common/soc-acpi-intel-tgl-match.c |  7 -------
 sound/soc/sof/intel/hda.c                         |  5 ++++-
 4 files changed, 18 insertions(+), 8 deletions(-)

--
2.25.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][OEM-5.10][PATCH 1/6] UBUNTU: SAUCE: ALSA: hda: intel-dsp-config: add PCI id for TGL-H

Hui Wang
From: Bard Liao <[hidden email]>

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

Adding PCI id for TGL-H and SOF will be the default audio driver.

Signed-off-by: Bard Liao <[hidden email]>
(cherry picked from commit fc682e36bfaf73c267edb42ec632675a88c51527
git://github.com/thesofproject/linux.git topic/sof-dev)
Signed-off-by: Hui Wang <[hidden email]>
---
 sound/hda/intel-dsp-config.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c
index 1c5114dedda9..f81416c4ac82 100644
--- a/sound/hda/intel-dsp-config.c
+++ b/sound/hda/intel-dsp-config.c
@@ -306,6 +306,10 @@ static const struct config_entry config_table[] = {
  .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
  .device = 0xa0c8,
  },
+ {
+ .flags = FLAG_SOF,
+ .device = 0x43c8,
+ },
 #endif
 
 /* Elkhart Lake */
--
2.25.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][OEM-5.10][PATCH 2/6] UBUNTU: SAUCE: fixup! ALSA: hda: intel-dsp-config: add PCI id for TGL-H

Hui Wang
In reply to this post by Hui Wang
From: Bard Liao <[hidden email]>

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

Legacy HDA driver should still be the default unless Soundwire or DMIC is
detected.

Signed-off-by: Bard Liao <[hidden email]>
(cherry picked from commit 8bf71212f1e4fe1c305a43d4f3dd90b8a85b96ce
git://github.com/thesofproject/linux.git topic/sof-dev)
Signed-off-by: Hui Wang <[hidden email]>
---
 sound/hda/intel-dsp-config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c
index f81416c4ac82..fe49e9a97f0e 100644
--- a/sound/hda/intel-dsp-config.c
+++ b/sound/hda/intel-dsp-config.c
@@ -307,7 +307,7 @@ static const struct config_entry config_table[] = {
  .device = 0xa0c8,
  },
  {
- .flags = FLAG_SOF,
+ .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
  .device = 0x43c8,
  },
 #endif
--
2.25.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][OEM-5.10][PATCH 3/6] UBUNTU: SAUCE: ASoC: SOF: allow soundwire use desc->default_fw_filename

Hui Wang
In reply to this post by Hui Wang
From: Libin Yang <[hidden email]>

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

The old code always uses sof_fw_filename in struct snd_soc_acpi_mach
as the firmware name. However, firmware name should depend on the platform
instead of the machine. For example, different machines may use the same
soundwire link topology, but they are using the different firmware. In this
case, it's hard to determine in struct snd_soc_acpi_mach which firmware it
should use.

Signed-off-by: Libin Yang <[hidden email]>
(cherry picked from commit 2ad1b7a5c3624d265b487dc7a2fbf52a48f6ff71
git://github.com/thesofproject/linux.git topic/sof-dev)
Signed-off-by: Hui Wang <[hidden email]>
---
 sound/soc/sof/intel/hda.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index bb4128a72a42..ed75f940735d 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -1175,7 +1175,10 @@ static int hda_sdw_machine_select(struct snd_sof_dev *sdev)
  mach->mach_params.links = mach->links;
  mach->mach_params.link_mask = mach->link_mask;
  mach->mach_params.platform = dev_name(sdev->dev);
- pdata->fw_filename = mach->sof_fw_filename;
+ if (mach->sof_fw_filename)
+ pdata->fw_filename = mach->sof_fw_filename;
+ else
+ pdata->fw_filename = pdata->desc->default_fw_filename;
  pdata->tplg_filename = mach->sof_tplg_filename;
  } else {
  dev_info(sdev->dev,
--
2.25.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][OEM-5.10][PATCH 4/6] UBUNTU: SAUCE: ASoC: Intel: tgl: remove sof_fw_filename set for tgl_3_in_1_default

Hui Wang
In reply to this post by Hui Wang
From: Libin Yang <[hidden email]>

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

tgl_3_in_1_default link topology may be used by both TGL-LP and TGL-H.
Let's remove the sof_fw_filename setting in struct snd_soc_acpi_mach
and use the default_fw_filename setting in struct sof_dev_desc.

Signed-off-by: Libin Yang <[hidden email]>
(cherry picked from commit e5907b66d49adee1c5c553db4455c80766c543d7
git://github.com/thesofproject/linux.git topic/sof-dev)
Signed-off-by: Hui Wang <[hidden email]>
---
 sound/soc/intel/common/soc-acpi-intel-tgl-match.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/sound/soc/intel/common/soc-acpi-intel-tgl-match.c b/sound/soc/intel/common/soc-acpi-intel-tgl-match.c
index 9f243e60b95c..244ca63f43ee 100644
--- a/sound/soc/intel/common/soc-acpi-intel-tgl-match.c
+++ b/sound/soc/intel/common/soc-acpi-intel-tgl-match.c
@@ -345,14 +345,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_sdw_machines[] = {
  .link_mask = 0x7,
  .links = tgl_sdw_rt711_link1_rt1308_link2_rt715_link0,
  .drv_name = "sof_sdw",
- .sof_fw_filename = "sof-tgl.ri",
  .sof_tplg_filename = "sof-tgl-rt715-rt711-rt1308-mono.tplg",
  },
  {
  .link_mask = 0xF, /* 4 active links required */
  .links = tgl_3_in_1_default,
  .drv_name = "sof_sdw",
- .sof_fw_filename = "sof-tgl.ri",
  .sof_tplg_filename = "sof-tgl-rt711-rt1308-rt715.tplg",
  },
  {
@@ -364,35 +362,30 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_sdw_machines[] = {
  .link_mask = 0xF,
  .links = tgl_3_in_1_mono_amp,
  .drv_name = "sof_sdw",
- .sof_fw_filename = "sof-tgl.ri",
  .sof_tplg_filename = "sof-tgl-rt711-rt1308-mono-rt715.tplg",
  },
  {
  .link_mask = 0xF, /* 4 active links required */
  .links = tgl_3_in_1_sdca,
  .drv_name = "sof_sdw",
- .sof_fw_filename = "sof-tgl.ri",
  .sof_tplg_filename = "sof-tgl-rt711-rt1316-rt714.tplg",
  },
  {
  .link_mask = 0x3, /* rt711 on link 0 and 2 rt1308s on link 1 */
  .links = tgl_rvp,
  .drv_name = "sof_sdw",
- .sof_fw_filename = "sof-tgl.ri",
  .sof_tplg_filename = "sof-tgl-rt711-rt1308.tplg",
  },
  {
  .link_mask = 0x3, /* rt5682 on link0 & 2xmax98373 on link 1 */
  .links = tgl_chromebook_base,
  .drv_name = "sof_sdw",
- .sof_fw_filename = "sof-tgl.ri",
  .sof_tplg_filename = "sof-tgl-sdw-max98373-rt5682.tplg",
  },
  {
  .link_mask = 0x1, /* this will only enable rt5682 for now */
  .links = tgl_chromebook_base,
  .drv_name = "sof_sdw",
- .sof_fw_filename = "sof-tgl.ri",
  .sof_tplg_filename = "sof-tgl-rt5682.tplg",
  },
  {},
--
2.25.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][OEM-5.10][PATCH 5/6] UBUNTU: SAUCE: ASoC: Intel: sof_sdw: set proper flags for Dell TGL-H SKU 0A5E

Hui Wang
In reply to this post by Hui Wang
From: Libin Yang <[hidden email]>

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

Add flag "SOF_RT711_JD_SRC_JD2" and flag "SOF_RT715_DAI_ID_FIX"
to the Dell TGL-H based SKU "0A5E".

Signed-off-by: Libin Yang <[hidden email]>
(cherry picked from commit a0cbd7bf112eccbc81c2d94261607e5f4f678378
git://github.com/thesofproject/linux.git topic/sof-dev)
Signed-off-by: Hui Wang <[hidden email]>
---
 sound/soc/intel/boards/sof_sdw.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
index b29946eb4355..d0064b15d0e1 100644
--- a/sound/soc/intel/boards/sof_sdw.c
+++ b/sound/soc/intel/boards/sof_sdw.c
@@ -57,6 +57,15 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
  .driver_data = (void *)(SOF_RT711_JD_SRC_JD2 |
  SOF_RT715_DAI_ID_FIX),
  },
+ {
+ .callback = sof_sdw_quirk_cb,
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"),
+ DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A5E")
+ },
+ .driver_data = (void *)(SOF_RT711_JD_SRC_JD2 |
+ SOF_RT715_DAI_ID_FIX),
+ },
  {
  .callback = sof_sdw_quirk_cb,
  .matches = {
--
2.25.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[SRU][OEM-5.10][PATCH 6/6] UBUNTU: SAUCE: ASoC: Intel: sof_sdw: set SOF_SDW_FOUR_SPK to Dell TGL-H SKU 0A5E

Hui Wang
In reply to this post by Hui Wang
BugLink: https://bugs.launchpad.net/bugs/1911830

Otherwise the speakers on the right side can't output sound since
the alsa userspace will initialize the speakers by rt1308-2.conf.

Signed-off-by: Hui Wang <[hidden email]>
(cherry picked from commit 2105915ff42a665ffa85d1ede46b4c07e13ccf22
git://github.com/thesofproject/linux.git topic/sof-dev)
Signed-off-by: Hui Wang <[hidden email]>
---
 sound/soc/intel/boards/sof_sdw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
index d0064b15d0e1..a8d43c87cb5a 100644
--- a/sound/soc/intel/boards/sof_sdw.c
+++ b/sound/soc/intel/boards/sof_sdw.c
@@ -64,7 +64,8 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
  DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0A5E")
  },
  .driver_data = (void *)(SOF_RT711_JD_SRC_JD2 |
- SOF_RT715_DAI_ID_FIX),
+ SOF_RT715_DAI_ID_FIX |
+ SOF_SDW_FOUR_SPK),
  },
  {
  .callback = sof_sdw_quirk_cb,
--
2.25.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPLIED Re: [SRU][OEM-5.10][PATCH 0/6] alsa/sdw: support soundwire audio for TGL-H machines

Timo Aaltonen-6
In reply to this post by Hui Wang
On 15.1.2021 4.04, Hui Wang wrote:

> BugLink: https://bugs.launchpad.net/bugs/1911830
>
> The patchset are not upstreamed yet, their target upstream version
> is 5.12, so here I just backported the patchset to oem-5.10 kernel,
> after those patches are merged to upstream kernel, I will start to
> backport them to 5.10 generic kernel.
>
> [Impact]
> In the OEM project, we have a new TGL-H soundwire machine, with
> the current oem-5.10 kernel, the audio can't work.
>
> [Fix]
> Backport 6 patches from Intel thesofproject kernel.
>
> [Test]
> Put the testing sof-tgl-h.ri in the /lib/firmware/intel/sof,
> boot the patched kernel, we could see speakers and microphone
> from gnome-setting, and they all work well.
>
>
> [Where problems could occur]
> The patches changed soundwire machine driver, it is possible
> to make the audio on old soundwire machines not work anymore.
> But we tested the patches on TGL-U and cml soundwire machines,
> all worked well.
>
>
>
> Bard Liao (2):
>    UBUNTU: SAUCE: ALSA: hda: intel-dsp-config: add PCI id for TGL-H
>    UBUNTU: SAUCE: fixup! ALSA: hda: intel-dsp-config: add PCI id for
>      TGL-H
>
> Hui Wang (1):
>    UBUNTU: SAUCE: ASoC: Intel: sof_sdw: set SOF_SDW_FOUR_SPK to Dell
>      TGL-H SKU 0A5E
>
> Libin Yang (3):
>    UBUNTU: SAUCE: ASoC: SOF: allow soundwire use
>      desc->default_fw_filename
>    UBUNTU: SAUCE: ASoC: Intel: tgl: remove sof_fw_filename set for
>      tgl_3_in_1_default
>    UBUNTU: SAUCE: ASoC: Intel: sof_sdw: set proper flags for Dell TGL-H
>      SKU 0A5E
>
>   sound/hda/intel-dsp-config.c                      |  4 ++++
>   sound/soc/intel/boards/sof_sdw.c                  | 10 ++++++++++
>   sound/soc/intel/common/soc-acpi-intel-tgl-match.c |  7 -------
>   sound/soc/sof/intel/hda.c                         |  5 ++++-
>   4 files changed, 18 insertions(+), 8 deletions(-)
>

applied to oem-5.10, thanks



--
t

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team