Skip to contentSkip to conversation

Tegra HDA specific fixes

PATCH Applied Mohan Kumar 3 participants 6 messages Aug 25, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Tegra HDA specific fixes

This series has the fix for
- 2 Channel swapping issue for Tegra
- WAKEEN programming to detect wake events.

Mohan Kumar (2):
ALSA: hda: Fix 2 channel swapping for Tegra
ALSA: hda/tegra: Program WAKEEN register for Tegra

 sound/pci/hda/hda_tegra.c  | 7 +++++++
 sound/pci/hda/patch_hdmi.c | 5 +++++
 2 files changed, 12 insertions(+)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/2 ALSA: hda: Fix 2 channel swapping for Tegra

The Tegra HDA codec HW implementation has an issue related to not swapping the 2 channel Audio Sample Packet(ASP) channel mapping. Whatever the FL and FR mapping specified the left channel always comes out of left speaker and right channel on right speaker. So add condition to disallow the swapping of FL,FR during the playback.

---
 sound/pci/hda/patch_hdmi.c | 5 +++++
 1 file changed, 5 insertions(+)
sound/pci/hda/patch_hdmi.c +5 -0
index b8c8490e568b..3259d713ace9 100644
@@ -3734,6 +3734,7 @@ static int tegra_hdmi_build_pcms(struct hda_codec *codec)
 
 static int patch_tegra_hdmi(struct hda_codec *codec)
 {
+	struct hdmi_spec *spec;
 	int err;
 
 	err = patch_generic_hdmi(codec);
@@ -3741,6 +3742,10 @@ static int patch_tegra_hdmi(struct hda_codec *codec)
 		return err;
 
 	codec->patch_ops.build_pcms = tegra_hdmi_build_pcms;
+	spec = codec->spec;
+	spec->chmap.ops.chmap_cea_alloc_validate_get_type =
+		nvhdmi_chmap_cea_alloc_validate_get_type;
+	spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate;
 
 	return 0;
 }
Signature · 1 line
2.17.1
Applied
#2 lore raw

Re: [PATCH 1/2] ALSA: hda: Fix 2 channel swapping for Tegra

Quoted 8 lines · Mohan Kumar

The Tegra HDA codec HW implementation has an issue related to not swapping the 2 channel Audio Sample Packet(ASP) channel mapping. Whatever the FL and FR mapping specified the left channel always comes out of left speaker and right channel on right speaker. So add condition to disallow the swapping of FL,FR during the playback.

Thanks, applied.

Takashi

#3 lore raw

PATCH 2/2 ALSA: hda/tegra: Program WAKEEN register for Tegra

In reply to Mohan Kumar

The WAKEEN bits are used to indicate which bits in the STATESTS register may cause wake event during the codec state change request. Configure the WAKEEN register for the Tegra to detect the wake events.

---
 sound/pci/hda/hda_tegra.c | 7 +++++++
 1 file changed, 7 insertions(+)
sound/pci/hda/hda_tegra.c +7 -0
index c94553bcca88..70164d1428d4 100644
@@ -179,6 +179,10 @@ static int __maybe_unused hda_tegra_runtime_suspend(struct device *dev)
 	struct hda_tegra *hda = container_of(chip, struct hda_tegra, chip);
 
 	if (chip && chip->running) {
+		/* enable controller wake up event */
+		azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) |
+			   STATESTS_INT_MASK);
+
 		azx_stop_chip(chip);
 		azx_enter_link_reset(chip);
 	}
@@ -200,6 +204,9 @@ static int __maybe_unused hda_tegra_runtime_resume(struct device *dev)
 	if (chip && chip->running) {
 		hda_tegra_init(hda);
 		azx_init_chip(chip, 1);
+		/* disable controller wake up event*/
+		azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) &
+			   ~STATESTS_INT_MASK);
 	}
 
 	return 0;
Signature · 1 line
2.17.1
Applied
#4 lore raw

Re: [PATCH 2/2] ALSA: hda/tegra: Program WAKEEN register for Tegra

Quoted 7 lines · Mohan Kumar

The WAKEEN bits are used to indicate which bits in the STATESTS register may cause wake event during the codec state change request. Configure the WAKEEN register for the Tegra to detect the wake events.

Thanks, applied.

Takashi

Acked-by on the v1 series
#5 lore raw
In reply to Mohan Kumar
Quoted 5 lines

This series has the fix for
- 2 Channel swapping issue for Tegra
- WAKEEN programming to detect wake events.

Quoted 8 lines

Mohan Kumar (2):
ALSA: hda: Fix 2 channel swapping for Tegra
ALSA: hda/tegra: Program WAKEEN register for Tegra

  sound/pci/hda/hda_tegra.c  | 7 +++++++
  sound/pci/hda/patch_hdmi.c | 5 +++++
  2 files changed, 12 insertions(+)