linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Tegra HDA specific fixes
@ 2020-08-25  5:24 Mohan Kumar
  2020-08-25  5:24 ` [PATCH 1/2] ALSA: hda: Fix 2 channel swapping for Tegra Mohan Kumar
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Mohan Kumar @ 2020-08-25  5:24 UTC (permalink / raw)
  To: tiwai, aplattner, spujar
  Cc: alsa-devel, linux-tegra, treding, jonathanh, Mohan Kumar

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(+)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] ALSA: hda: Fix 2 channel swapping for Tegra
  2020-08-25  5:24 [PATCH 0/2] Tegra HDA specific fixes Mohan Kumar
@ 2020-08-25  5:24 ` Mohan Kumar
  2020-08-25  7:36   ` Takashi Iwai
  2020-08-25  5:24 ` [PATCH 2/2] ALSA: hda/tegra: Program WAKEEN register " Mohan Kumar
  2020-08-25  5:31 ` [PATCH 0/2] Tegra HDA specific fixes Sameer Pujar
  2 siblings, 1 reply; 6+ messages in thread
From: Mohan Kumar @ 2020-08-25  5:24 UTC (permalink / raw)
  To: tiwai, aplattner, spujar
  Cc: alsa-devel, linux-tegra, treding, jonathanh, 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.

Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
---
 sound/pci/hda/patch_hdmi.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index b8c8490e568b..3259d713ace9 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -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;
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] ALSA: hda/tegra: Program WAKEEN register for Tegra
  2020-08-25  5:24 [PATCH 0/2] Tegra HDA specific fixes Mohan Kumar
  2020-08-25  5:24 ` [PATCH 1/2] ALSA: hda: Fix 2 channel swapping for Tegra Mohan Kumar
@ 2020-08-25  5:24 ` Mohan Kumar
  2020-08-25  7:36   ` Takashi Iwai
  2020-08-25  5:31 ` [PATCH 0/2] Tegra HDA specific fixes Sameer Pujar
  2 siblings, 1 reply; 6+ messages in thread
From: Mohan Kumar @ 2020-08-25  5:24 UTC (permalink / raw)
  To: tiwai, aplattner, spujar
  Cc: alsa-devel, linux-tegra, treding, jonathanh, 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.

Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
---
 sound/pci/hda/hda_tegra.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c
index c94553bcca88..70164d1428d4 100644
--- a/sound/pci/hda/hda_tegra.c
+++ b/sound/pci/hda/hda_tegra.c
@@ -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;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] Tegra HDA specific fixes
  2020-08-25  5:24 [PATCH 0/2] Tegra HDA specific fixes Mohan Kumar
  2020-08-25  5:24 ` [PATCH 1/2] ALSA: hda: Fix 2 channel swapping for Tegra Mohan Kumar
  2020-08-25  5:24 ` [PATCH 2/2] ALSA: hda/tegra: Program WAKEEN register " Mohan Kumar
@ 2020-08-25  5:31 ` Sameer Pujar
  2 siblings, 0 replies; 6+ messages in thread
From: Sameer Pujar @ 2020-08-25  5:31 UTC (permalink / raw)
  To: Mohan Kumar, tiwai, aplattner; +Cc: alsa-devel, linux-tegra, treding, jonathanh


> 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(+)
>
Acked-by: Sameer Pujar <spujar@nvidia.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] ALSA: hda: Fix 2 channel swapping for Tegra
  2020-08-25  5:24 ` [PATCH 1/2] ALSA: hda: Fix 2 channel swapping for Tegra Mohan Kumar
@ 2020-08-25  7:36   ` Takashi Iwai
  0 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2020-08-25  7:36 UTC (permalink / raw)
  To: Mohan Kumar
  Cc: tiwai, aplattner, spujar, alsa-devel, linux-tegra, treding, jonathanh

On Tue, 25 Aug 2020 07:24:14 +0200,
Mohan Kumar wrote:
> 
> 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.
> 
> Signed-off-by: Mohan Kumar <mkumard@nvidia.com>

Thanks, applied.


Takashi

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] ALSA: hda/tegra: Program WAKEEN register for Tegra
  2020-08-25  5:24 ` [PATCH 2/2] ALSA: hda/tegra: Program WAKEEN register " Mohan Kumar
@ 2020-08-25  7:36   ` Takashi Iwai
  0 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2020-08-25  7:36 UTC (permalink / raw)
  To: Mohan Kumar
  Cc: tiwai, aplattner, spujar, alsa-devel, linux-tegra, treding, jonathanh

On Tue, 25 Aug 2020 07:24:15 +0200,
Mohan Kumar wrote:
> 
> 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.
> 
> Signed-off-by: Mohan Kumar <mkumard@nvidia.com>

Thanks, applied.


Takashi

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-08-25  7:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-25  5:24 [PATCH 0/2] Tegra HDA specific fixes Mohan Kumar
2020-08-25  5:24 ` [PATCH 1/2] ALSA: hda: Fix 2 channel swapping for Tegra Mohan Kumar
2020-08-25  7:36   ` Takashi Iwai
2020-08-25  5:24 ` [PATCH 2/2] ALSA: hda/tegra: Program WAKEEN register " Mohan Kumar
2020-08-25  7:36   ` Takashi Iwai
2020-08-25  5:31 ` [PATCH 0/2] Tegra HDA specific fixes Sameer Pujar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).