All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Add Tegra234 HDA support
@ 2022-02-10  6:50 ` Mohan Kumar
  0 siblings, 0 replies; 26+ messages in thread
From: Mohan Kumar @ 2022-02-10  6:50 UTC (permalink / raw)
  To: broonie, lgirdwood, robh+dt, thierry.reding, tiwai, jonathanh, spujar
  Cc: alsa-devel, devicetree, linux-tegra, linux-kernel, Mohan Kumar

This series add the support for TEGRA234 HDA driver support

Mohan Kumar (6):
  ALSA: hda/tegra: Add Tegra234 hda driver support
  ALSA: hda/tegra: Hardcode GCAP ISS value on T234
  ALSA: hda/tegra: Update scratch reg. communication
  dt-bindings: Add HDA support for Tegra234
  dt-bindings: Document Tegra234 HDA support
  arm64: tegra: Add hda dts node for Tegra234

 .../bindings/sound/nvidia,tegra30-hda.yaml    |   3 +
 .../nvidia/tegra234-p3737-0000+p3701-0000.dts |   6 +
 arch/arm64/boot/dts/nvidia/tegra234.dtsi      |  18 +++
 include/dt-bindings/clock/tegra234-clock.h    |   4 +
 include/dt-bindings/memory/tegra234-mc.h      |   6 +
 .../dt-bindings/power/tegra234-powergate.h    |   9 ++
 include/dt-bindings/reset/tegra234-reset.h    |   2 +
 sound/pci/hda/hda_tegra.c                     |  33 ++++-
 sound/pci/hda/patch_hdmi.c                    | 118 ++++++++++++++----
 9 files changed, 175 insertions(+), 24 deletions(-)
 create mode 100644 include/dt-bindings/power/tegra234-powergate.h

-- 
2.17.1


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

* [PATCH v2 0/6] Add Tegra234 HDA support
@ 2022-02-10  6:50 ` Mohan Kumar
  0 siblings, 0 replies; 26+ messages in thread
From: Mohan Kumar @ 2022-02-10  6:50 UTC (permalink / raw)
  To: broonie, lgirdwood, robh+dt, thierry.reding, tiwai, jonathanh, spujar
  Cc: linux-tegra, devicetree, alsa-devel, linux-kernel, Mohan Kumar

This series add the support for TEGRA234 HDA driver support

Mohan Kumar (6):
  ALSA: hda/tegra: Add Tegra234 hda driver support
  ALSA: hda/tegra: Hardcode GCAP ISS value on T234
  ALSA: hda/tegra: Update scratch reg. communication
  dt-bindings: Add HDA support for Tegra234
  dt-bindings: Document Tegra234 HDA support
  arm64: tegra: Add hda dts node for Tegra234

 .../bindings/sound/nvidia,tegra30-hda.yaml    |   3 +
 .../nvidia/tegra234-p3737-0000+p3701-0000.dts |   6 +
 arch/arm64/boot/dts/nvidia/tegra234.dtsi      |  18 +++
 include/dt-bindings/clock/tegra234-clock.h    |   4 +
 include/dt-bindings/memory/tegra234-mc.h      |   6 +
 .../dt-bindings/power/tegra234-powergate.h    |   9 ++
 include/dt-bindings/reset/tegra234-reset.h    |   2 +
 sound/pci/hda/hda_tegra.c                     |  33 ++++-
 sound/pci/hda/patch_hdmi.c                    | 118 ++++++++++++++----
 9 files changed, 175 insertions(+), 24 deletions(-)
 create mode 100644 include/dt-bindings/power/tegra234-powergate.h

-- 
2.17.1


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

* [PATCH v2 1/6] ALSA: hda/tegra: Add Tegra234 hda driver support
  2022-02-10  6:50 ` Mohan Kumar
@ 2022-02-10  6:50   ` Mohan Kumar
  -1 siblings, 0 replies; 26+ messages in thread
From: Mohan Kumar @ 2022-02-10  6:50 UTC (permalink / raw)
  To: broonie, lgirdwood, robh+dt, thierry.reding, tiwai, jonathanh, spujar
  Cc: alsa-devel, devicetree, linux-tegra, linux-kernel, Mohan Kumar

Add hda driver support for the Tegra234 chip. The hdacodec
on this chip now supports DP MST feature, HDA block contains
azalia controller and one hda-codec instance by supporting
4 independent output streams over DP MST mode. There is no
input stream support.

Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
---
 sound/pci/hda/hda_tegra.c  | 21 +++++++++++++--
 sound/pci/hda/patch_hdmi.c | 54 +++++++++++++++++++++++++++++++++-----
 2 files changed, 67 insertions(+), 8 deletions(-)

diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c
index 773f4903550a..95df52b0505b 100644
--- a/sound/pci/hda/hda_tegra.c
+++ b/sound/pci/hda/hda_tegra.c
@@ -70,6 +70,7 @@
 
 struct hda_tegra_soc {
 	bool has_hda2codec_2x_reset;
+	bool has_hda2hdmi;
 };
 
 struct hda_tegra {
@@ -435,15 +436,23 @@ static int hda_tegra_create(struct snd_card *card,
 
 static const struct hda_tegra_soc tegra30_data = {
 	.has_hda2codec_2x_reset = true,
+	.has_hda2hdmi = true,
 };
 
 static const struct hda_tegra_soc tegra194_data = {
 	.has_hda2codec_2x_reset = false,
+	.has_hda2hdmi = true,
+};
+
+static const struct hda_tegra_soc tegra234_data = {
+	.has_hda2codec_2x_reset = true,
+	.has_hda2hdmi = false,
 };
 
 static const struct of_device_id hda_tegra_match[] = {
 	{ .compatible = "nvidia,tegra30-hda", .data = &tegra30_data },
 	{ .compatible = "nvidia,tegra194-hda", .data = &tegra194_data },
+	{ .compatible = "nvidia,tegra234-hda", .data = &tegra234_data },
 	{},
 };
 MODULE_DEVICE_TABLE(of, hda_tegra_match);
@@ -473,7 +482,14 @@ static int hda_tegra_probe(struct platform_device *pdev)
 	}
 
 	hda->resets[hda->nresets++].id = "hda";
-	hda->resets[hda->nresets++].id = "hda2hdmi";
+
+	/*
+	 * "hda2hdmi" is not applicable for Tegra234. This is because the
+	 * codec is separate IP and not under display SOR partition now.
+	 */
+	if (hda->soc->has_hda2hdmi)
+		hda->resets[hda->nresets++].id = "hda2hdmi";
+
 	/*
 	 * "hda2codec_2x" reset is not present on Tegra194. Though DT would
 	 * be updated to reflect this, but to have backward compatibility
@@ -488,7 +504,8 @@ static int hda_tegra_probe(struct platform_device *pdev)
 		goto out_free;
 
 	hda->clocks[hda->nclocks++].id = "hda";
-	hda->clocks[hda->nclocks++].id = "hda2hdmi";
+	if (hda->soc->has_hda2hdmi)
+		hda->clocks[hda->nclocks++].id = "hda2hdmi";
 	hda->clocks[hda->nclocks++].id = "hda2codec_2x";
 
 	err = devm_clk_bulk_get(&pdev->dev, hda->nclocks, hda->clocks);
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 92df4f243ec6..879f886d2406 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -3851,17 +3851,29 @@ static int tegra_hdmi_build_pcms(struct hda_codec *codec)
 	return 0;
 }
 
-static int patch_tegra_hdmi(struct hda_codec *codec)
+static int tegra_hdmi_init(struct hda_codec *codec)
 {
-	struct hdmi_spec *spec;
-	int err;
+	struct hdmi_spec *spec = codec->spec;
+	int i, err;
 
-	err = patch_generic_hdmi(codec);
-	if (err)
+	err = hdmi_parse_codec(codec);
+	if (err < 0) {
+		generic_spec_free(codec);
 		return err;
+	}
+
+	for (i = 0; i < spec->num_cvts; i++)
+		snd_hda_codec_write(codec, spec->cvt_nids[i], 0,
+					AC_VERB_SET_DIGI_CONVERT_1,
+					AC_DIG1_ENABLE);
+
+	generic_hdmi_init_per_pins(codec);
 
 	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;
+
 	spec->chmap.ops.chmap_cea_alloc_validate_get_type =
 		nvhdmi_chmap_cea_alloc_validate_get_type;
 	spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate;
@@ -3869,6 +3881,35 @@ static int patch_tegra_hdmi(struct hda_codec *codec)
 	return 0;
 }
 
+static int patch_tegra_hdmi(struct hda_codec *codec)
+{
+	int err;
+
+	err = alloc_generic_hdmi(codec);
+	if (err < 0)
+		return err;
+
+	return tegra_hdmi_init(codec);
+}
+
+static int patch_tegra234_hdmi(struct hda_codec *codec)
+{
+	struct hdmi_spec *spec;
+	int err;
+
+	err = alloc_generic_hdmi(codec);
+	if (err < 0)
+		return err;
+
+	codec->dp_mst = true;
+	codec->mst_no_extra_pcms = true;
+	spec = codec->spec;
+	spec->dyn_pin_out = true;
+	spec->dyn_pcm_assign = true;
+
+	return tegra_hdmi_init(codec);
+}
+
 /*
  * ATI/AMD-specific implementations
  */
@@ -4322,6 +4363,7 @@ HDA_CODEC_ENTRY(0x10de002d, "Tegra186 HDMI/DP0", patch_tegra_hdmi),
 HDA_CODEC_ENTRY(0x10de002e, "Tegra186 HDMI/DP1", patch_tegra_hdmi),
 HDA_CODEC_ENTRY(0x10de002f, "Tegra194 HDMI/DP2", patch_tegra_hdmi),
 HDA_CODEC_ENTRY(0x10de0030, "Tegra194 HDMI/DP3", patch_tegra_hdmi),
+HDA_CODEC_ENTRY(0x10de0031, "Tegra234 HDMI/DP", patch_tegra234_hdmi),
 HDA_CODEC_ENTRY(0x10de0040, "GPU 40 HDMI/DP",	patch_nvhdmi),
 HDA_CODEC_ENTRY(0x10de0041, "GPU 41 HDMI/DP",	patch_nvhdmi),
 HDA_CODEC_ENTRY(0x10de0042, "GPU 42 HDMI/DP",	patch_nvhdmi),
-- 
2.17.1


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

* [PATCH v2 1/6] ALSA: hda/tegra: Add Tegra234 hda driver support
@ 2022-02-10  6:50   ` Mohan Kumar
  0 siblings, 0 replies; 26+ messages in thread
From: Mohan Kumar @ 2022-02-10  6:50 UTC (permalink / raw)
  To: broonie, lgirdwood, robh+dt, thierry.reding, tiwai, jonathanh, spujar
  Cc: linux-tegra, devicetree, alsa-devel, linux-kernel, Mohan Kumar

Add hda driver support for the Tegra234 chip. The hdacodec
on this chip now supports DP MST feature, HDA block contains
azalia controller and one hda-codec instance by supporting
4 independent output streams over DP MST mode. There is no
input stream support.

Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
---
 sound/pci/hda/hda_tegra.c  | 21 +++++++++++++--
 sound/pci/hda/patch_hdmi.c | 54 +++++++++++++++++++++++++++++++++-----
 2 files changed, 67 insertions(+), 8 deletions(-)

diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c
index 773f4903550a..95df52b0505b 100644
--- a/sound/pci/hda/hda_tegra.c
+++ b/sound/pci/hda/hda_tegra.c
@@ -70,6 +70,7 @@
 
 struct hda_tegra_soc {
 	bool has_hda2codec_2x_reset;
+	bool has_hda2hdmi;
 };
 
 struct hda_tegra {
@@ -435,15 +436,23 @@ static int hda_tegra_create(struct snd_card *card,
 
 static const struct hda_tegra_soc tegra30_data = {
 	.has_hda2codec_2x_reset = true,
+	.has_hda2hdmi = true,
 };
 
 static const struct hda_tegra_soc tegra194_data = {
 	.has_hda2codec_2x_reset = false,
+	.has_hda2hdmi = true,
+};
+
+static const struct hda_tegra_soc tegra234_data = {
+	.has_hda2codec_2x_reset = true,
+	.has_hda2hdmi = false,
 };
 
 static const struct of_device_id hda_tegra_match[] = {
 	{ .compatible = "nvidia,tegra30-hda", .data = &tegra30_data },
 	{ .compatible = "nvidia,tegra194-hda", .data = &tegra194_data },
+	{ .compatible = "nvidia,tegra234-hda", .data = &tegra234_data },
 	{},
 };
 MODULE_DEVICE_TABLE(of, hda_tegra_match);
@@ -473,7 +482,14 @@ static int hda_tegra_probe(struct platform_device *pdev)
 	}
 
 	hda->resets[hda->nresets++].id = "hda";
-	hda->resets[hda->nresets++].id = "hda2hdmi";
+
+	/*
+	 * "hda2hdmi" is not applicable for Tegra234. This is because the
+	 * codec is separate IP and not under display SOR partition now.
+	 */
+	if (hda->soc->has_hda2hdmi)
+		hda->resets[hda->nresets++].id = "hda2hdmi";
+
 	/*
 	 * "hda2codec_2x" reset is not present on Tegra194. Though DT would
 	 * be updated to reflect this, but to have backward compatibility
@@ -488,7 +504,8 @@ static int hda_tegra_probe(struct platform_device *pdev)
 		goto out_free;
 
 	hda->clocks[hda->nclocks++].id = "hda";
-	hda->clocks[hda->nclocks++].id = "hda2hdmi";
+	if (hda->soc->has_hda2hdmi)
+		hda->clocks[hda->nclocks++].id = "hda2hdmi";
 	hda->clocks[hda->nclocks++].id = "hda2codec_2x";
 
 	err = devm_clk_bulk_get(&pdev->dev, hda->nclocks, hda->clocks);
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 92df4f243ec6..879f886d2406 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -3851,17 +3851,29 @@ static int tegra_hdmi_build_pcms(struct hda_codec *codec)
 	return 0;
 }
 
-static int patch_tegra_hdmi(struct hda_codec *codec)
+static int tegra_hdmi_init(struct hda_codec *codec)
 {
-	struct hdmi_spec *spec;
-	int err;
+	struct hdmi_spec *spec = codec->spec;
+	int i, err;
 
-	err = patch_generic_hdmi(codec);
-	if (err)
+	err = hdmi_parse_codec(codec);
+	if (err < 0) {
+		generic_spec_free(codec);
 		return err;
+	}
+
+	for (i = 0; i < spec->num_cvts; i++)
+		snd_hda_codec_write(codec, spec->cvt_nids[i], 0,
+					AC_VERB_SET_DIGI_CONVERT_1,
+					AC_DIG1_ENABLE);
+
+	generic_hdmi_init_per_pins(codec);
 
 	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;
+
 	spec->chmap.ops.chmap_cea_alloc_validate_get_type =
 		nvhdmi_chmap_cea_alloc_validate_get_type;
 	spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate;
@@ -3869,6 +3881,35 @@ static int patch_tegra_hdmi(struct hda_codec *codec)
 	return 0;
 }
 
+static int patch_tegra_hdmi(struct hda_codec *codec)
+{
+	int err;
+
+	err = alloc_generic_hdmi(codec);
+	if (err < 0)
+		return err;
+
+	return tegra_hdmi_init(codec);
+}
+
+static int patch_tegra234_hdmi(struct hda_codec *codec)
+{
+	struct hdmi_spec *spec;
+	int err;
+
+	err = alloc_generic_hdmi(codec);
+	if (err < 0)
+		return err;
+
+	codec->dp_mst = true;
+	codec->mst_no_extra_pcms = true;
+	spec = codec->spec;
+	spec->dyn_pin_out = true;
+	spec->dyn_pcm_assign = true;
+
+	return tegra_hdmi_init(codec);
+}
+
 /*
  * ATI/AMD-specific implementations
  */
@@ -4322,6 +4363,7 @@ HDA_CODEC_ENTRY(0x10de002d, "Tegra186 HDMI/DP0", patch_tegra_hdmi),
 HDA_CODEC_ENTRY(0x10de002e, "Tegra186 HDMI/DP1", patch_tegra_hdmi),
 HDA_CODEC_ENTRY(0x10de002f, "Tegra194 HDMI/DP2", patch_tegra_hdmi),
 HDA_CODEC_ENTRY(0x10de0030, "Tegra194 HDMI/DP3", patch_tegra_hdmi),
+HDA_CODEC_ENTRY(0x10de0031, "Tegra234 HDMI/DP", patch_tegra234_hdmi),
 HDA_CODEC_ENTRY(0x10de0040, "GPU 40 HDMI/DP",	patch_nvhdmi),
 HDA_CODEC_ENTRY(0x10de0041, "GPU 41 HDMI/DP",	patch_nvhdmi),
 HDA_CODEC_ENTRY(0x10de0042, "GPU 42 HDMI/DP",	patch_nvhdmi),
-- 
2.17.1


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

* [PATCH v2 2/6] ALSA: hda/tegra: Hardcode GCAP ISS value on T234
  2022-02-10  6:50 ` Mohan Kumar
@ 2022-02-10  6:50   ` Mohan Kumar
  -1 siblings, 0 replies; 26+ messages in thread
From: Mohan Kumar @ 2022-02-10  6:50 UTC (permalink / raw)
  To: broonie, lgirdwood, robh+dt, thierry.reding, tiwai, jonathanh, spujar
  Cc: alsa-devel, devicetree, linux-tegra, linux-kernel, Mohan Kumar

The GCAP register on Tegra234 implies no Input Streams(ISS)
supported, but the HW output stream descriptor programming
should start with offset 0x20*4 from base stream descriptor
address. This will be a problem while calculating the offset
for output stream descriptor which will be considering input
stream also. So here output stream starts with offset 0 which
is wrong as HW register for output stream offset starts with 4.
So hardcode the input stream numbers to 4 to avoid the issue
in offset calculation.

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

diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c
index 95df52b0505b..2347d0304f93 100644
--- a/sound/pci/hda/hda_tegra.c
+++ b/sound/pci/hda/hda_tegra.c
@@ -315,6 +315,18 @@ static int hda_tegra_first_init(struct azx *chip, struct platform_device *pdev)
 	 * hardcoded value
 	 */
 	chip->capture_streams = (gcap >> 8) & 0x0f;
+
+	/* The GCAP register on Tegra234 implies no Input Streams(ISS) support,
+	 * but the HW output stream descriptor programming should start with
+	 * offset 0x20*4 from base stream descriptor address. This will be a
+	 * problem while calculating the offset for output stream descriptor
+	 * which will be considering input stream also. So here output stream
+	 * starts with offset 0 which is wrong as HW register for output stream
+	 * offset starts with 4.
+	 */
+	if (of_device_is_compatible(np, "nvidia,tegra234-hda"))
+		chip->capture_streams = 4;
+
 	chip->playback_streams = (gcap >> 12) & 0x0f;
 	if (!chip->playback_streams && !chip->capture_streams) {
 		/* gcap didn't give any info, switching to old method */
-- 
2.17.1


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

* [PATCH v2 2/6] ALSA: hda/tegra: Hardcode GCAP ISS value on T234
@ 2022-02-10  6:50   ` Mohan Kumar
  0 siblings, 0 replies; 26+ messages in thread
From: Mohan Kumar @ 2022-02-10  6:50 UTC (permalink / raw)
  To: broonie, lgirdwood, robh+dt, thierry.reding, tiwai, jonathanh, spujar
  Cc: linux-tegra, devicetree, alsa-devel, linux-kernel, Mohan Kumar

The GCAP register on Tegra234 implies no Input Streams(ISS)
supported, but the HW output stream descriptor programming
should start with offset 0x20*4 from base stream descriptor
address. This will be a problem while calculating the offset
for output stream descriptor which will be considering input
stream also. So here output stream starts with offset 0 which
is wrong as HW register for output stream offset starts with 4.
So hardcode the input stream numbers to 4 to avoid the issue
in offset calculation.

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

diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c
index 95df52b0505b..2347d0304f93 100644
--- a/sound/pci/hda/hda_tegra.c
+++ b/sound/pci/hda/hda_tegra.c
@@ -315,6 +315,18 @@ static int hda_tegra_first_init(struct azx *chip, struct platform_device *pdev)
 	 * hardcoded value
 	 */
 	chip->capture_streams = (gcap >> 8) & 0x0f;
+
+	/* The GCAP register on Tegra234 implies no Input Streams(ISS) support,
+	 * but the HW output stream descriptor programming should start with
+	 * offset 0x20*4 from base stream descriptor address. This will be a
+	 * problem while calculating the offset for output stream descriptor
+	 * which will be considering input stream also. So here output stream
+	 * starts with offset 0 which is wrong as HW register for output stream
+	 * offset starts with 4.
+	 */
+	if (of_device_is_compatible(np, "nvidia,tegra234-hda"))
+		chip->capture_streams = 4;
+
 	chip->playback_streams = (gcap >> 12) & 0x0f;
 	if (!chip->playback_streams && !chip->capture_streams) {
 		/* gcap didn't give any info, switching to old method */
-- 
2.17.1


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

* [PATCH v2 3/6] ALSA: hda/tegra: Update scratch reg. communication
  2022-02-10  6:50 ` Mohan Kumar
@ 2022-02-10  6:50   ` Mohan Kumar
  -1 siblings, 0 replies; 26+ messages in thread
From: Mohan Kumar @ 2022-02-10  6:50 UTC (permalink / raw)
  To: broonie, lgirdwood, robh+dt, thierry.reding, tiwai, jonathanh, spujar
  Cc: alsa-devel, devicetree, linux-tegra, linux-kernel, Mohan Kumar

Tegra234 chip scratch register communication between audio
and hdmi driver differs slightly in the way it triggers the
interrupt compared to legacy chips. Interrupt is triggered
by writing non-zero values to verb 0xF80 instead of 31st bit
of scratch register.

DP MST support changed the NID to be used for scratch register
read/write from audio function group NID to Converter widget NID.

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

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 879f886d2406..2eebb302a7bd 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -162,6 +162,8 @@ struct hdmi_spec {
 	bool dyn_pin_out;
 	bool dyn_pcm_assign;
 	bool dyn_pcm_no_legacy;
+	/* hdmi interrupt trigger control flag for Nvidia codec */
+	bool hdmi_intr_trig_ctrl;
 	bool intel_hsw_fixup;	/* apply Intel platform-specific fixups */
 	/*
 	 * Non-generic VIA/NVIDIA specific
@@ -3721,8 +3723,11 @@ static int patch_nvhdmi_legacy(struct hda_codec *codec)
  * +-----------------------------------|
  *
  * Note that for the trigger bit to take effect it needs to change value
- * (i.e. it needs to be toggled).
+ * (i.e. it needs to be toggled). The trigger bit is not applicable from
+ * TEGRA234 chip onwards, as new verb id 0xf80 will be used for interrupt
+ * trigger to hdmi.
  */
+#define NVIDIA_SET_HOST_INTR		0xf80
 #define NVIDIA_GET_SCRATCH0		0xfa6
 #define NVIDIA_SET_SCRATCH0_BYTE0	0xfa7
 #define NVIDIA_SET_SCRATCH0_BYTE1	0xfa8
@@ -3741,25 +3746,38 @@ static int patch_nvhdmi_legacy(struct hda_codec *codec)
  * The format parameter is the HDA audio format (see AC_FMT_*). If set to 0,
  * the format is invalidated so that the HDMI codec can be disabled.
  */
-static void tegra_hdmi_set_format(struct hda_codec *codec, unsigned int format)
+static void tegra_hdmi_set_format(struct hda_codec *codec,
+				  hda_nid_t cvt_nid,
+				  unsigned int format)
 {
 	unsigned int value;
+	unsigned int nid = NVIDIA_AFG_NID;
+	struct hdmi_spec *spec = codec->spec;
+
+	/*
+	 * Tegra HDA codec design from TEGRA234 chip onwards support DP MST.
+	 * This resulted in moving scratch registers from audio function
+	 * group to converter widget context. So CVT NID should be used for
+	 * scratch register read/write for DP MST supported Tegra HDA codec.
+	 */
+	if (codec->dp_mst)
+		nid = cvt_nid;
 
 	/* bits [31:30] contain the trigger and valid bits */
-	value = snd_hda_codec_read(codec, NVIDIA_AFG_NID, 0,
+	value = snd_hda_codec_read(codec, nid, 0,
 				   NVIDIA_GET_SCRATCH0, 0);
 	value = (value >> 24) & 0xff;
 
 	/* bits [15:0] are used to store the HDA format */
-	snd_hda_codec_write(codec, NVIDIA_AFG_NID, 0,
+	snd_hda_codec_write(codec, nid, 0,
 			    NVIDIA_SET_SCRATCH0_BYTE0,
 			    (format >> 0) & 0xff);
-	snd_hda_codec_write(codec, NVIDIA_AFG_NID, 0,
+	snd_hda_codec_write(codec, nid, 0,
 			    NVIDIA_SET_SCRATCH0_BYTE1,
 			    (format >> 8) & 0xff);
 
 	/* bits [16:24] are unused */
-	snd_hda_codec_write(codec, NVIDIA_AFG_NID, 0,
+	snd_hda_codec_write(codec, nid, 0,
 			    NVIDIA_SET_SCRATCH0_BYTE2, 0);
 
 	/*
@@ -3771,15 +3789,28 @@ static void tegra_hdmi_set_format(struct hda_codec *codec, unsigned int format)
 	else
 		value |= NVIDIA_SCRATCH_VALID;
 
-	/*
-	 * Whenever the trigger bit is toggled, an interrupt is raised in the
-	 * HDMI codec. The HDMI driver will use that as trigger to update its
-	 * configuration.
-	 */
-	value ^= NVIDIA_SCRATCH_TRIGGER;
+	if (spec->hdmi_intr_trig_ctrl) {
+		/*
+		 * For Tegra HDA Codec design from TEGRA234 onwards, the
+		 * Interrupt to hdmi driver is triggered by writing
+		 * non-zero values to verb 0xF80 instead of 31st bit of
+		 * scratch register.
+		 */
+		snd_hda_codec_write(codec, nid, 0,
+				NVIDIA_SET_SCRATCH0_BYTE3, value);
+		snd_hda_codec_write(codec, nid, 0,
+				NVIDIA_SET_HOST_INTR, 0x1);
+	} else {
+		/*
+		 * Whenever the 31st trigger bit is toggled, an interrupt is raised
+		 * in the HDMI codec. The HDMI driver will use that as trigger
+		 * to update its configuration.
+		 */
+		value ^= NVIDIA_SCRATCH_TRIGGER;
 
-	snd_hda_codec_write(codec, NVIDIA_AFG_NID, 0,
-			    NVIDIA_SET_SCRATCH0_BYTE3, value);
+		snd_hda_codec_write(codec, nid, 0,
+				NVIDIA_SET_SCRATCH0_BYTE3, value);
+	}
 }
 
 static int tegra_hdmi_pcm_prepare(struct hda_pcm_stream *hinfo,
@@ -3796,7 +3827,7 @@ static int tegra_hdmi_pcm_prepare(struct hda_pcm_stream *hinfo,
 		return err;
 
 	/* notify the HDMI codec of the format change */
-	tegra_hdmi_set_format(codec, format);
+	tegra_hdmi_set_format(codec, hinfo->nid, format);
 
 	return 0;
 }
@@ -3806,7 +3837,7 @@ static int tegra_hdmi_pcm_cleanup(struct hda_pcm_stream *hinfo,
 				  struct snd_pcm_substream *substream)
 {
 	/* invalidate the format in the HDMI codec */
-	tegra_hdmi_set_format(codec, 0);
+	tegra_hdmi_set_format(codec, hinfo->nid, 0);
 
 	return generic_hdmi_playback_pcm_cleanup(hinfo, codec, substream);
 }
@@ -3906,6 +3937,7 @@ static int patch_tegra234_hdmi(struct hda_codec *codec)
 	spec = codec->spec;
 	spec->dyn_pin_out = true;
 	spec->dyn_pcm_assign = true;
+	spec->hdmi_intr_trig_ctrl = true;
 
 	return tegra_hdmi_init(codec);
 }
-- 
2.17.1


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

* [PATCH v2 3/6] ALSA: hda/tegra: Update scratch reg. communication
@ 2022-02-10  6:50   ` Mohan Kumar
  0 siblings, 0 replies; 26+ messages in thread
From: Mohan Kumar @ 2022-02-10  6:50 UTC (permalink / raw)
  To: broonie, lgirdwood, robh+dt, thierry.reding, tiwai, jonathanh, spujar
  Cc: linux-tegra, devicetree, alsa-devel, linux-kernel, Mohan Kumar

Tegra234 chip scratch register communication between audio
and hdmi driver differs slightly in the way it triggers the
interrupt compared to legacy chips. Interrupt is triggered
by writing non-zero values to verb 0xF80 instead of 31st bit
of scratch register.

DP MST support changed the NID to be used for scratch register
read/write from audio function group NID to Converter widget NID.

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

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 879f886d2406..2eebb302a7bd 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -162,6 +162,8 @@ struct hdmi_spec {
 	bool dyn_pin_out;
 	bool dyn_pcm_assign;
 	bool dyn_pcm_no_legacy;
+	/* hdmi interrupt trigger control flag for Nvidia codec */
+	bool hdmi_intr_trig_ctrl;
 	bool intel_hsw_fixup;	/* apply Intel platform-specific fixups */
 	/*
 	 * Non-generic VIA/NVIDIA specific
@@ -3721,8 +3723,11 @@ static int patch_nvhdmi_legacy(struct hda_codec *codec)
  * +-----------------------------------|
  *
  * Note that for the trigger bit to take effect it needs to change value
- * (i.e. it needs to be toggled).
+ * (i.e. it needs to be toggled). The trigger bit is not applicable from
+ * TEGRA234 chip onwards, as new verb id 0xf80 will be used for interrupt
+ * trigger to hdmi.
  */
+#define NVIDIA_SET_HOST_INTR		0xf80
 #define NVIDIA_GET_SCRATCH0		0xfa6
 #define NVIDIA_SET_SCRATCH0_BYTE0	0xfa7
 #define NVIDIA_SET_SCRATCH0_BYTE1	0xfa8
@@ -3741,25 +3746,38 @@ static int patch_nvhdmi_legacy(struct hda_codec *codec)
  * The format parameter is the HDA audio format (see AC_FMT_*). If set to 0,
  * the format is invalidated so that the HDMI codec can be disabled.
  */
-static void tegra_hdmi_set_format(struct hda_codec *codec, unsigned int format)
+static void tegra_hdmi_set_format(struct hda_codec *codec,
+				  hda_nid_t cvt_nid,
+				  unsigned int format)
 {
 	unsigned int value;
+	unsigned int nid = NVIDIA_AFG_NID;
+	struct hdmi_spec *spec = codec->spec;
+
+	/*
+	 * Tegra HDA codec design from TEGRA234 chip onwards support DP MST.
+	 * This resulted in moving scratch registers from audio function
+	 * group to converter widget context. So CVT NID should be used for
+	 * scratch register read/write for DP MST supported Tegra HDA codec.
+	 */
+	if (codec->dp_mst)
+		nid = cvt_nid;
 
 	/* bits [31:30] contain the trigger and valid bits */
-	value = snd_hda_codec_read(codec, NVIDIA_AFG_NID, 0,
+	value = snd_hda_codec_read(codec, nid, 0,
 				   NVIDIA_GET_SCRATCH0, 0);
 	value = (value >> 24) & 0xff;
 
 	/* bits [15:0] are used to store the HDA format */
-	snd_hda_codec_write(codec, NVIDIA_AFG_NID, 0,
+	snd_hda_codec_write(codec, nid, 0,
 			    NVIDIA_SET_SCRATCH0_BYTE0,
 			    (format >> 0) & 0xff);
-	snd_hda_codec_write(codec, NVIDIA_AFG_NID, 0,
+	snd_hda_codec_write(codec, nid, 0,
 			    NVIDIA_SET_SCRATCH0_BYTE1,
 			    (format >> 8) & 0xff);
 
 	/* bits [16:24] are unused */
-	snd_hda_codec_write(codec, NVIDIA_AFG_NID, 0,
+	snd_hda_codec_write(codec, nid, 0,
 			    NVIDIA_SET_SCRATCH0_BYTE2, 0);
 
 	/*
@@ -3771,15 +3789,28 @@ static void tegra_hdmi_set_format(struct hda_codec *codec, unsigned int format)
 	else
 		value |= NVIDIA_SCRATCH_VALID;
 
-	/*
-	 * Whenever the trigger bit is toggled, an interrupt is raised in the
-	 * HDMI codec. The HDMI driver will use that as trigger to update its
-	 * configuration.
-	 */
-	value ^= NVIDIA_SCRATCH_TRIGGER;
+	if (spec->hdmi_intr_trig_ctrl) {
+		/*
+		 * For Tegra HDA Codec design from TEGRA234 onwards, the
+		 * Interrupt to hdmi driver is triggered by writing
+		 * non-zero values to verb 0xF80 instead of 31st bit of
+		 * scratch register.
+		 */
+		snd_hda_codec_write(codec, nid, 0,
+				NVIDIA_SET_SCRATCH0_BYTE3, value);
+		snd_hda_codec_write(codec, nid, 0,
+				NVIDIA_SET_HOST_INTR, 0x1);
+	} else {
+		/*
+		 * Whenever the 31st trigger bit is toggled, an interrupt is raised
+		 * in the HDMI codec. The HDMI driver will use that as trigger
+		 * to update its configuration.
+		 */
+		value ^= NVIDIA_SCRATCH_TRIGGER;
 
-	snd_hda_codec_write(codec, NVIDIA_AFG_NID, 0,
-			    NVIDIA_SET_SCRATCH0_BYTE3, value);
+		snd_hda_codec_write(codec, nid, 0,
+				NVIDIA_SET_SCRATCH0_BYTE3, value);
+	}
 }
 
 static int tegra_hdmi_pcm_prepare(struct hda_pcm_stream *hinfo,
@@ -3796,7 +3827,7 @@ static int tegra_hdmi_pcm_prepare(struct hda_pcm_stream *hinfo,
 		return err;
 
 	/* notify the HDMI codec of the format change */
-	tegra_hdmi_set_format(codec, format);
+	tegra_hdmi_set_format(codec, hinfo->nid, format);
 
 	return 0;
 }
@@ -3806,7 +3837,7 @@ static int tegra_hdmi_pcm_cleanup(struct hda_pcm_stream *hinfo,
 				  struct snd_pcm_substream *substream)
 {
 	/* invalidate the format in the HDMI codec */
-	tegra_hdmi_set_format(codec, 0);
+	tegra_hdmi_set_format(codec, hinfo->nid, 0);
 
 	return generic_hdmi_playback_pcm_cleanup(hinfo, codec, substream);
 }
@@ -3906,6 +3937,7 @@ static int patch_tegra234_hdmi(struct hda_codec *codec)
 	spec = codec->spec;
 	spec->dyn_pin_out = true;
 	spec->dyn_pcm_assign = true;
+	spec->hdmi_intr_trig_ctrl = true;
 
 	return tegra_hdmi_init(codec);
 }
-- 
2.17.1


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

* [PATCH v2 4/6] dt-bindings: Add HDA support for Tegra234
  2022-02-10  6:50 ` Mohan Kumar
@ 2022-02-10  6:50   ` Mohan Kumar
  -1 siblings, 0 replies; 26+ messages in thread
From: Mohan Kumar @ 2022-02-10  6:50 UTC (permalink / raw)
  To: broonie, lgirdwood, robh+dt, thierry.reding, tiwai, jonathanh, spujar
  Cc: alsa-devel, devicetree, linux-tegra, linux-kernel, Mohan Kumar

Add hda clocks, memory ,power and reset binding entries
for Tegra234.

Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
---
 include/dt-bindings/clock/tegra234-clock.h     | 4 ++++
 include/dt-bindings/memory/tegra234-mc.h       | 6 ++++++
 include/dt-bindings/power/tegra234-powergate.h | 9 +++++++++
 include/dt-bindings/reset/tegra234-reset.h     | 2 ++
 4 files changed, 21 insertions(+)
 create mode 100644 include/dt-bindings/power/tegra234-powergate.h

diff --git a/include/dt-bindings/clock/tegra234-clock.h b/include/dt-bindings/clock/tegra234-clock.h
index 8d7e66e1b6ef..c014269b7245 100644
--- a/include/dt-bindings/clock/tegra234-clock.h
+++ b/include/dt-bindings/clock/tegra234-clock.h
@@ -30,5 +30,9 @@
 #define TEGRA234_CLK_PLLC4			237U
 /** @brief 32K input clock provided by PMIC */
 #define TEGRA234_CLK_CLK_32K			289U
+/** @brief CLK_RST_CONTROLLER_AZA2XBITCLK_OUT_SWITCH_DIVIDER switch divider output (aza_2xbitclk) */
+#define TEGRA234_CLK_AZA_2XBIT			457U
+/** @brief aza_2xbitclk / 2 (aza_bitclk) */
+#define TEGRA234_CLK_AZA_BIT			458U
 
 #endif
diff --git a/include/dt-bindings/memory/tegra234-mc.h b/include/dt-bindings/memory/tegra234-mc.h
index 2662f70c15c6..f538fc442cee 100644
--- a/include/dt-bindings/memory/tegra234-mc.h
+++ b/include/dt-bindings/memory/tegra234-mc.h
@@ -7,6 +7,8 @@
 #define TEGRA234_SID_INVALID		0x00
 #define TEGRA234_SID_PASSTHROUGH	0x7f
 
+/* NISO0 SMMU STREAM IDs */
+#define TEGRA234_SID_NISO0_HDA		0x03
 
 /* NISO1 stream IDs */
 #define TEGRA234_SID_SDMMC4	0x02
@@ -16,6 +18,10 @@
  * memory client IDs
  */
 
+/* High-definition audio (HDA) read clients */
+#define TEGRA234_MEMORY_CLIENT_HDAR 0x15
+/* High-definition audio (HDA) write clients */
+#define TEGRA234_MEMORY_CLIENT_HDAW 0x35
 /* sdmmcd memory read client */
 #define TEGRA234_MEMORY_CLIENT_SDMMCRAB 0x63
 /* sdmmcd memory write client */
diff --git a/include/dt-bindings/power/tegra234-powergate.h b/include/dt-bindings/power/tegra234-powergate.h
new file mode 100644
index 000000000000..3c5575a51296
--- /dev/null
+++ b/include/dt-bindings/power/tegra234-powergate.h
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. */
+
+#ifndef __ABI_MACH_T234_POWERGATE_T234_H_
+#define __ABI_MACH_T234_POWERGATE_T234_H_
+
+#define TEGRA234_POWER_DOMAIN_DISP	3U
+
+#endif
diff --git a/include/dt-bindings/reset/tegra234-reset.h b/include/dt-bindings/reset/tegra234-reset.h
index 50e13bced642..2ab61c69a3d9 100644
--- a/include/dt-bindings/reset/tegra234-reset.h
+++ b/include/dt-bindings/reset/tegra234-reset.h
@@ -10,6 +10,8 @@
  * @brief Identifiers for Resets controllable by firmware
  * @{
  */
+#define TEGRA234_RESET_HDA			20U
+#define TEGRA234_RESET_HDACODEC			21U
 #define TEGRA234_RESET_SDMMC4			85U
 #define TEGRA234_RESET_UARTA			100U
 
-- 
2.17.1


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

* [PATCH v2 4/6] dt-bindings: Add HDA support for Tegra234
@ 2022-02-10  6:50   ` Mohan Kumar
  0 siblings, 0 replies; 26+ messages in thread
From: Mohan Kumar @ 2022-02-10  6:50 UTC (permalink / raw)
  To: broonie, lgirdwood, robh+dt, thierry.reding, tiwai, jonathanh, spujar
  Cc: linux-tegra, devicetree, alsa-devel, linux-kernel, Mohan Kumar

Add hda clocks, memory ,power and reset binding entries
for Tegra234.

Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
---
 include/dt-bindings/clock/tegra234-clock.h     | 4 ++++
 include/dt-bindings/memory/tegra234-mc.h       | 6 ++++++
 include/dt-bindings/power/tegra234-powergate.h | 9 +++++++++
 include/dt-bindings/reset/tegra234-reset.h     | 2 ++
 4 files changed, 21 insertions(+)
 create mode 100644 include/dt-bindings/power/tegra234-powergate.h

diff --git a/include/dt-bindings/clock/tegra234-clock.h b/include/dt-bindings/clock/tegra234-clock.h
index 8d7e66e1b6ef..c014269b7245 100644
--- a/include/dt-bindings/clock/tegra234-clock.h
+++ b/include/dt-bindings/clock/tegra234-clock.h
@@ -30,5 +30,9 @@
 #define TEGRA234_CLK_PLLC4			237U
 /** @brief 32K input clock provided by PMIC */
 #define TEGRA234_CLK_CLK_32K			289U
+/** @brief CLK_RST_CONTROLLER_AZA2XBITCLK_OUT_SWITCH_DIVIDER switch divider output (aza_2xbitclk) */
+#define TEGRA234_CLK_AZA_2XBIT			457U
+/** @brief aza_2xbitclk / 2 (aza_bitclk) */
+#define TEGRA234_CLK_AZA_BIT			458U
 
 #endif
diff --git a/include/dt-bindings/memory/tegra234-mc.h b/include/dt-bindings/memory/tegra234-mc.h
index 2662f70c15c6..f538fc442cee 100644
--- a/include/dt-bindings/memory/tegra234-mc.h
+++ b/include/dt-bindings/memory/tegra234-mc.h
@@ -7,6 +7,8 @@
 #define TEGRA234_SID_INVALID		0x00
 #define TEGRA234_SID_PASSTHROUGH	0x7f
 
+/* NISO0 SMMU STREAM IDs */
+#define TEGRA234_SID_NISO0_HDA		0x03
 
 /* NISO1 stream IDs */
 #define TEGRA234_SID_SDMMC4	0x02
@@ -16,6 +18,10 @@
  * memory client IDs
  */
 
+/* High-definition audio (HDA) read clients */
+#define TEGRA234_MEMORY_CLIENT_HDAR 0x15
+/* High-definition audio (HDA) write clients */
+#define TEGRA234_MEMORY_CLIENT_HDAW 0x35
 /* sdmmcd memory read client */
 #define TEGRA234_MEMORY_CLIENT_SDMMCRAB 0x63
 /* sdmmcd memory write client */
diff --git a/include/dt-bindings/power/tegra234-powergate.h b/include/dt-bindings/power/tegra234-powergate.h
new file mode 100644
index 000000000000..3c5575a51296
--- /dev/null
+++ b/include/dt-bindings/power/tegra234-powergate.h
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. */
+
+#ifndef __ABI_MACH_T234_POWERGATE_T234_H_
+#define __ABI_MACH_T234_POWERGATE_T234_H_
+
+#define TEGRA234_POWER_DOMAIN_DISP	3U
+
+#endif
diff --git a/include/dt-bindings/reset/tegra234-reset.h b/include/dt-bindings/reset/tegra234-reset.h
index 50e13bced642..2ab61c69a3d9 100644
--- a/include/dt-bindings/reset/tegra234-reset.h
+++ b/include/dt-bindings/reset/tegra234-reset.h
@@ -10,6 +10,8 @@
  * @brief Identifiers for Resets controllable by firmware
  * @{
  */
+#define TEGRA234_RESET_HDA			20U
+#define TEGRA234_RESET_HDACODEC			21U
 #define TEGRA234_RESET_SDMMC4			85U
 #define TEGRA234_RESET_UARTA			100U
 
-- 
2.17.1


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

* [PATCH v2 5/6] dt-bindings: Document Tegra234 HDA support
  2022-02-10  6:50 ` Mohan Kumar
@ 2022-02-10  6:50   ` Mohan Kumar
  -1 siblings, 0 replies; 26+ messages in thread
From: Mohan Kumar @ 2022-02-10  6:50 UTC (permalink / raw)
  To: broonie, lgirdwood, robh+dt, thierry.reding, tiwai, jonathanh, spujar
  Cc: alsa-devel, devicetree, linux-tegra, linux-kernel, Mohan Kumar

Update binding document for HDA support on Tegra234 chip.

Tegra234 has max of 2 clocks and 2 resets which requires to add
minItems and maxItems for clocks and resets as Tegra chips can
now have minimum of 2 and maximum of 3 clocks and reset support.

Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
---
 .../devicetree/bindings/sound/nvidia,tegra30-hda.yaml          | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.yaml b/Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.yaml
index 2c913aa44fee..12c31b4b99e1 100644
--- a/Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.yaml
+++ b/Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.yaml
@@ -23,6 +23,7 @@ properties:
       - const: nvidia,tegra30-hda
       - items:
           - enum:
+              - nvidia,tegra234-hda
               - nvidia,tegra194-hda
               - nvidia,tegra186-hda
               - nvidia,tegra210-hda
@@ -41,9 +42,11 @@ properties:
     maxItems: 1
 
   clocks:
+    minItems: 2
     maxItems: 3
 
   clock-names:
+    minItems: 2
     items:
       - const: hda
       - const: hda2hdmi
-- 
2.17.1


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

* [PATCH v2 5/6] dt-bindings: Document Tegra234 HDA support
@ 2022-02-10  6:50   ` Mohan Kumar
  0 siblings, 0 replies; 26+ messages in thread
From: Mohan Kumar @ 2022-02-10  6:50 UTC (permalink / raw)
  To: broonie, lgirdwood, robh+dt, thierry.reding, tiwai, jonathanh, spujar
  Cc: linux-tegra, devicetree, alsa-devel, linux-kernel, Mohan Kumar

Update binding document for HDA support on Tegra234 chip.

Tegra234 has max of 2 clocks and 2 resets which requires to add
minItems and maxItems for clocks and resets as Tegra chips can
now have minimum of 2 and maximum of 3 clocks and reset support.

Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
---
 .../devicetree/bindings/sound/nvidia,tegra30-hda.yaml          | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.yaml b/Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.yaml
index 2c913aa44fee..12c31b4b99e1 100644
--- a/Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.yaml
+++ b/Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.yaml
@@ -23,6 +23,7 @@ properties:
       - const: nvidia,tegra30-hda
       - items:
           - enum:
+              - nvidia,tegra234-hda
               - nvidia,tegra194-hda
               - nvidia,tegra186-hda
               - nvidia,tegra210-hda
@@ -41,9 +42,11 @@ properties:
     maxItems: 1
 
   clocks:
+    minItems: 2
     maxItems: 3
 
   clock-names:
+    minItems: 2
     items:
       - const: hda
       - const: hda2hdmi
-- 
2.17.1


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

* [PATCH v2 6/6] arm64: tegra: Add hda dts node for Tegra234
  2022-02-10  6:50 ` Mohan Kumar
@ 2022-02-10  6:50   ` Mohan Kumar
  -1 siblings, 0 replies; 26+ messages in thread
From: Mohan Kumar @ 2022-02-10  6:50 UTC (permalink / raw)
  To: broonie, lgirdwood, robh+dt, thierry.reding, tiwai, jonathanh, spujar
  Cc: alsa-devel, devicetree, linux-tegra, linux-kernel, Mohan Kumar

Add HDA dts node for Tegra234 chip and for AGX orin platform.

Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
---
 .../nvidia/tegra234-p3737-0000+p3701-0000.dts  |  6 ++++++
 arch/arm64/boot/dts/nvidia/tegra234.dtsi       | 18 ++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts
index efbbb878ba5a..792e4a8b272b 100644
--- a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts
+++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts
@@ -21,4 +21,10 @@
 	serial {
 		status = "okay";
 	};
+
+	bus@0 {
+		hda@3510000 {
+			nvidia,model = "NVIDIA Jetson AGX Orin HDA";
+		};
+	};
 };
diff --git a/arch/arm64/boot/dts/nvidia/tegra234.dtsi b/arch/arm64/boot/dts/nvidia/tegra234.dtsi
index 6b6f15804a1a..d39d41968ffb 100644
--- a/arch/arm64/boot/dts/nvidia/tegra234.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra234.dtsi
@@ -4,6 +4,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/mailbox/tegra186-hsp.h>
 #include <dt-bindings/memory/tegra234-mc.h>
+#include <dt-bindings/power/tegra234-powergate.h>
 #include <dt-bindings/reset/tegra234-reset.h>
 
 / {
@@ -261,6 +262,23 @@
 			#interrupt-cells = <3>;
 			interrupt-controller;
 		};
+
+		hda@3510000 {
+			compatible = "nvidia,tegra234-hda", "nvidia,tegra30-hda";
+			reg = <0x3510000 0x10000>;
+			interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&bpmp TEGRA234_CLK_AZA_BIT>,
+				 <&bpmp TEGRA234_CLK_AZA_2XBIT>;
+			clock-names = "hda", "hda2codec_2x";
+			resets = <&bpmp TEGRA234_RESET_HDA>,
+				 <&bpmp TEGRA234_RESET_HDACODEC>;
+			reset-names = "hda", "hda2codec_2x";
+			power-domains = <&bpmp TEGRA234_POWER_DOMAIN_DISP>;
+			interconnects = <&mc TEGRA234_MEMORY_CLIENT_HDAR &emc>,
+					<&mc TEGRA234_MEMORY_CLIENT_HDAW &emc>;
+			interconnect-names = "dma-mem", "write";
+			status = "disabled";
+		};
 	};
 
 	sram@40000000 {
-- 
2.17.1


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

* [PATCH v2 6/6] arm64: tegra: Add hda dts node for Tegra234
@ 2022-02-10  6:50   ` Mohan Kumar
  0 siblings, 0 replies; 26+ messages in thread
From: Mohan Kumar @ 2022-02-10  6:50 UTC (permalink / raw)
  To: broonie, lgirdwood, robh+dt, thierry.reding, tiwai, jonathanh, spujar
  Cc: linux-tegra, devicetree, alsa-devel, linux-kernel, Mohan Kumar

Add HDA dts node for Tegra234 chip and for AGX orin platform.

Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
---
 .../nvidia/tegra234-p3737-0000+p3701-0000.dts  |  6 ++++++
 arch/arm64/boot/dts/nvidia/tegra234.dtsi       | 18 ++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts
index efbbb878ba5a..792e4a8b272b 100644
--- a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts
+++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts
@@ -21,4 +21,10 @@
 	serial {
 		status = "okay";
 	};
+
+	bus@0 {
+		hda@3510000 {
+			nvidia,model = "NVIDIA Jetson AGX Orin HDA";
+		};
+	};
 };
diff --git a/arch/arm64/boot/dts/nvidia/tegra234.dtsi b/arch/arm64/boot/dts/nvidia/tegra234.dtsi
index 6b6f15804a1a..d39d41968ffb 100644
--- a/arch/arm64/boot/dts/nvidia/tegra234.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra234.dtsi
@@ -4,6 +4,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/mailbox/tegra186-hsp.h>
 #include <dt-bindings/memory/tegra234-mc.h>
+#include <dt-bindings/power/tegra234-powergate.h>
 #include <dt-bindings/reset/tegra234-reset.h>
 
 / {
@@ -261,6 +262,23 @@
 			#interrupt-cells = <3>;
 			interrupt-controller;
 		};
+
+		hda@3510000 {
+			compatible = "nvidia,tegra234-hda", "nvidia,tegra30-hda";
+			reg = <0x3510000 0x10000>;
+			interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&bpmp TEGRA234_CLK_AZA_BIT>,
+				 <&bpmp TEGRA234_CLK_AZA_2XBIT>;
+			clock-names = "hda", "hda2codec_2x";
+			resets = <&bpmp TEGRA234_RESET_HDA>,
+				 <&bpmp TEGRA234_RESET_HDACODEC>;
+			reset-names = "hda", "hda2codec_2x";
+			power-domains = <&bpmp TEGRA234_POWER_DOMAIN_DISP>;
+			interconnects = <&mc TEGRA234_MEMORY_CLIENT_HDAR &emc>,
+					<&mc TEGRA234_MEMORY_CLIENT_HDAW &emc>;
+			interconnect-names = "dma-mem", "write";
+			status = "disabled";
+		};
 	};
 
 	sram@40000000 {
-- 
2.17.1


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

* Re: [PATCH v2 0/6] Add Tegra234 HDA support
  2022-02-10  6:50 ` Mohan Kumar
@ 2022-02-15 13:29   ` Takashi Iwai
  -1 siblings, 0 replies; 26+ messages in thread
From: Takashi Iwai @ 2022-02-15 13:29 UTC (permalink / raw)
  To: Mohan Kumar
  Cc: broonie, lgirdwood, robh+dt, thierry.reding, tiwai, jonathanh,
	spujar, alsa-devel, devicetree, linux-tegra, linux-kernel

On Thu, 10 Feb 2022 07:50:51 +0100,
Mohan Kumar wrote:
> 
> This series add the support for TEGRA234 HDA driver support
> 
> Mohan Kumar (6):
>   ALSA: hda/tegra: Add Tegra234 hda driver support
>   ALSA: hda/tegra: Hardcode GCAP ISS value on T234
>   ALSA: hda/tegra: Update scratch reg. communication
>   dt-bindings: Add HDA support for Tegra234
>   dt-bindings: Document Tegra234 HDA support
>   arm64: tegra: Add hda dts node for Tegra234

Applied all six patches to for-next branch now.


thanks,

Takashi

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

* Re: [PATCH v2 0/6] Add Tegra234 HDA support
@ 2022-02-15 13:29   ` Takashi Iwai
  0 siblings, 0 replies; 26+ messages in thread
From: Takashi Iwai @ 2022-02-15 13:29 UTC (permalink / raw)
  To: Mohan Kumar
  Cc: devicetree, alsa-devel, linux-kernel, spujar, tiwai, lgirdwood,
	robh+dt, jonathanh, broonie, thierry.reding, linux-tegra

On Thu, 10 Feb 2022 07:50:51 +0100,
Mohan Kumar wrote:
> 
> This series add the support for TEGRA234 HDA driver support
> 
> Mohan Kumar (6):
>   ALSA: hda/tegra: Add Tegra234 hda driver support
>   ALSA: hda/tegra: Hardcode GCAP ISS value on T234
>   ALSA: hda/tegra: Update scratch reg. communication
>   dt-bindings: Add HDA support for Tegra234
>   dt-bindings: Document Tegra234 HDA support
>   arm64: tegra: Add hda dts node for Tegra234

Applied all six patches to for-next branch now.


thanks,

Takashi

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

* Re: [PATCH v2 0/6] Add Tegra234 HDA support
  2022-02-15 13:29   ` Takashi Iwai
@ 2022-02-15 13:34     ` Takashi Iwai
  -1 siblings, 0 replies; 26+ messages in thread
From: Takashi Iwai @ 2022-02-15 13:34 UTC (permalink / raw)
  To: Mohan Kumar
  Cc: broonie, lgirdwood, robh+dt, thierry.reding, tiwai, jonathanh,
	spujar, alsa-devel, devicetree, linux-tegra, linux-kernel

On Tue, 15 Feb 2022 14:29:54 +0100,
Takashi Iwai wrote:
> 
> On Thu, 10 Feb 2022 07:50:51 +0100,
> Mohan Kumar wrote:
> > 
> > This series add the support for TEGRA234 HDA driver support
> > 
> > Mohan Kumar (6):
> >   ALSA: hda/tegra: Add Tegra234 hda driver support
> >   ALSA: hda/tegra: Hardcode GCAP ISS value on T234
> >   ALSA: hda/tegra: Update scratch reg. communication
> >   dt-bindings: Add HDA support for Tegra234
> >   dt-bindings: Document Tegra234 HDA support
> >   arm64: tegra: Add hda dts node for Tegra234
> 
> Applied all six patches to for-next branch now.

... and now I realized that it's conflicting with the latest Tegra234
reset stuff on linux-next.

Maybe better to split the patches to be merged through several trees?


Takashi

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

* Re: [PATCH v2 0/6] Add Tegra234 HDA support
@ 2022-02-15 13:34     ` Takashi Iwai
  0 siblings, 0 replies; 26+ messages in thread
From: Takashi Iwai @ 2022-02-15 13:34 UTC (permalink / raw)
  To: Mohan Kumar
  Cc: devicetree, alsa-devel, linux-kernel, spujar, tiwai, lgirdwood,
	robh+dt, jonathanh, broonie, thierry.reding, linux-tegra

On Tue, 15 Feb 2022 14:29:54 +0100,
Takashi Iwai wrote:
> 
> On Thu, 10 Feb 2022 07:50:51 +0100,
> Mohan Kumar wrote:
> > 
> > This series add the support for TEGRA234 HDA driver support
> > 
> > Mohan Kumar (6):
> >   ALSA: hda/tegra: Add Tegra234 hda driver support
> >   ALSA: hda/tegra: Hardcode GCAP ISS value on T234
> >   ALSA: hda/tegra: Update scratch reg. communication
> >   dt-bindings: Add HDA support for Tegra234
> >   dt-bindings: Document Tegra234 HDA support
> >   arm64: tegra: Add hda dts node for Tegra234
> 
> Applied all six patches to for-next branch now.

... and now I realized that it's conflicting with the latest Tegra234
reset stuff on linux-next.

Maybe better to split the patches to be merged through several trees?


Takashi

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

* RE: [PATCH v2 0/6] Add Tegra234 HDA support
  2022-02-15 13:34     ` Takashi Iwai
@ 2022-02-16  7:31       ` Mohan Kumar D
  -1 siblings, 0 replies; 26+ messages in thread
From: Mohan Kumar D @ 2022-02-16  7:31 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: broonie, lgirdwood, robh+dt, thierry.reding, tiwai,
	Jonathan Hunter, Sameer Pujar, alsa-devel, devicetree,
	linux-tegra, linux-kernel

Ok, Let me resync linux-next to clear the conflict and will resend patches with v3.

-----Original Message-----
From: Takashi Iwai <tiwai@suse.de> 
Sent: Tuesday, February 15, 2022 7:04 PM
To: Mohan Kumar D <mkumard@nvidia.com>
Cc: broonie@kernel.org; lgirdwood@gmail.com; robh+dt@kernel.org; thierry.reding@gmail.com; tiwai@suse.com; Jonathan Hunter <jonathanh@nvidia.com>; Sameer Pujar <spujar@nvidia.com>; alsa-devel@alsa-project.org; devicetree@vger.kernel.org; linux-tegra@vger.kernel.org; linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 0/6] Add Tegra234 HDA support

External email: Use caution opening links or attachments


On Tue, 15 Feb 2022 14:29:54 +0100,
Takashi Iwai wrote:
>
> On Thu, 10 Feb 2022 07:50:51 +0100,
> Mohan Kumar wrote:
> >
> > This series add the support for TEGRA234 HDA driver support
> >
> > Mohan Kumar (6):
> >   ALSA: hda/tegra: Add Tegra234 hda driver support
> >   ALSA: hda/tegra: Hardcode GCAP ISS value on T234
> >   ALSA: hda/tegra: Update scratch reg. communication
> >   dt-bindings: Add HDA support for Tegra234
> >   dt-bindings: Document Tegra234 HDA support
> >   arm64: tegra: Add hda dts node for Tegra234
>
> Applied all six patches to for-next branch now.

... and now I realized that it's conflicting with the latest Tegra234 reset stuff on linux-next.

Maybe better to split the patches to be merged through several trees?


Takashi

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

* RE: [PATCH v2 0/6] Add Tegra234 HDA support
@ 2022-02-16  7:31       ` Mohan Kumar D
  0 siblings, 0 replies; 26+ messages in thread
From: Mohan Kumar D @ 2022-02-16  7:31 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: devicetree, alsa-devel, linux-kernel, Sameer Pujar, tiwai,
	lgirdwood, robh+dt, Jonathan Hunter, broonie, thierry.reding,
	linux-tegra

Ok, Let me resync linux-next to clear the conflict and will resend patches with v3.

-----Original Message-----
From: Takashi Iwai <tiwai@suse.de> 
Sent: Tuesday, February 15, 2022 7:04 PM
To: Mohan Kumar D <mkumard@nvidia.com>
Cc: broonie@kernel.org; lgirdwood@gmail.com; robh+dt@kernel.org; thierry.reding@gmail.com; tiwai@suse.com; Jonathan Hunter <jonathanh@nvidia.com>; Sameer Pujar <spujar@nvidia.com>; alsa-devel@alsa-project.org; devicetree@vger.kernel.org; linux-tegra@vger.kernel.org; linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 0/6] Add Tegra234 HDA support

External email: Use caution opening links or attachments


On Tue, 15 Feb 2022 14:29:54 +0100,
Takashi Iwai wrote:
>
> On Thu, 10 Feb 2022 07:50:51 +0100,
> Mohan Kumar wrote:
> >
> > This series add the support for TEGRA234 HDA driver support
> >
> > Mohan Kumar (6):
> >   ALSA: hda/tegra: Add Tegra234 hda driver support
> >   ALSA: hda/tegra: Hardcode GCAP ISS value on T234
> >   ALSA: hda/tegra: Update scratch reg. communication
> >   dt-bindings: Add HDA support for Tegra234
> >   dt-bindings: Document Tegra234 HDA support
> >   arm64: tegra: Add hda dts node for Tegra234
>
> Applied all six patches to for-next branch now.

... and now I realized that it's conflicting with the latest Tegra234 reset stuff on linux-next.

Maybe better to split the patches to be merged through several trees?


Takashi

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

* Re: [PATCH v2 4/6] dt-bindings: Add HDA support for Tegra234
  2022-02-10  6:50   ` Mohan Kumar
@ 2022-02-16  7:33     ` Mikko Perttunen
  -1 siblings, 0 replies; 26+ messages in thread
From: Mikko Perttunen @ 2022-02-16  7:33 UTC (permalink / raw)
  To: Mohan Kumar, broonie, lgirdwood, robh+dt, thierry.reding, tiwai,
	jonathanh, spujar
  Cc: alsa-devel, devicetree, linux-tegra, linux-kernel

On 2/10/22 08:50, Mohan Kumar wrote:
> Add hda clocks, memory ,power and reset binding entries
> for Tegra234.
> 
> Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
> ---
>   include/dt-bindings/clock/tegra234-clock.h     | 4 ++++
>   include/dt-bindings/memory/tegra234-mc.h       | 6 ++++++
>   include/dt-bindings/power/tegra234-powergate.h | 9 +++++++++
>   include/dt-bindings/reset/tegra234-reset.h     | 2 ++
>   4 files changed, 21 insertions(+)
>   create mode 100644 include/dt-bindings/power/tegra234-powergate.h
> 
> diff --git a/include/dt-bindings/clock/tegra234-clock.h b/include/dt-bindings/clock/tegra234-clock.h
> index 8d7e66e1b6ef..c014269b7245 100644
> --- a/include/dt-bindings/clock/tegra234-clock.h
> +++ b/include/dt-bindings/clock/tegra234-clock.h
> @@ -30,5 +30,9 @@
>   #define TEGRA234_CLK_PLLC4			237U
>   /** @brief 32K input clock provided by PMIC */
>   #define TEGRA234_CLK_CLK_32K			289U
> +/** @brief CLK_RST_CONTROLLER_AZA2XBITCLK_OUT_SWITCH_DIVIDER switch divider output (aza_2xbitclk) */
> +#define TEGRA234_CLK_AZA_2XBIT			457U
> +/** @brief aza_2xbitclk / 2 (aza_bitclk) */
> +#define TEGRA234_CLK_AZA_BIT			458U
>   
>   #endif
> diff --git a/include/dt-bindings/memory/tegra234-mc.h b/include/dt-bindings/memory/tegra234-mc.h
> index 2662f70c15c6..f538fc442cee 100644
> --- a/include/dt-bindings/memory/tegra234-mc.h
> +++ b/include/dt-bindings/memory/tegra234-mc.h
> @@ -7,6 +7,8 @@
>   #define TEGRA234_SID_INVALID		0x00
>   #define TEGRA234_SID_PASSTHROUGH	0x7f
>   
> +/* NISO0 SMMU STREAM IDs */
> +#define TEGRA234_SID_NISO0_HDA		0x03

Please follow the existing convention in this file.

/* NISO0 stream IDs */
#define TEGRA234_SID_HDA	0x03

>   
>   /* NISO1 stream IDs */
>   #define TEGRA234_SID_SDMMC4	0x02
> @@ -16,6 +18,10 @@
>    * memory client IDs
>    */
>   
> +/* High-definition audio (HDA) read clients */
> +#define TEGRA234_MEMORY_CLIENT_HDAR 0x15
> +/* High-definition audio (HDA) write clients */
> +#define TEGRA234_MEMORY_CLIENT_HDAW 0x35
>   /* sdmmcd memory read client */
>   #define TEGRA234_MEMORY_CLIENT_SDMMCRAB 0x63
>   /* sdmmcd memory write client */
> diff --git a/include/dt-bindings/power/tegra234-powergate.h b/include/dt-bindings/power/tegra234-powergate.h
> new file mode 100644
> index 000000000000..3c5575a51296
> --- /dev/null
> +++ b/include/dt-bindings/power/tegra234-powergate.h
> @@ -0,0 +1,9 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/* Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. */
> +
> +#ifndef __ABI_MACH_T234_POWERGATE_T234_H_
> +#define __ABI_MACH_T234_POWERGATE_T234_H_
> +
> +#define TEGRA234_POWER_DOMAIN_DISP	3U
> +
> +#endif
> diff --git a/include/dt-bindings/reset/tegra234-reset.h b/include/dt-bindings/reset/tegra234-reset.h
> index 50e13bced642..2ab61c69a3d9 100644
> --- a/include/dt-bindings/reset/tegra234-reset.h
> +++ b/include/dt-bindings/reset/tegra234-reset.h
> @@ -10,6 +10,8 @@
>    * @brief Identifiers for Resets controllable by firmware
>    * @{
>    */
> +#define TEGRA234_RESET_HDA			20U
> +#define TEGRA234_RESET_HDACODEC			21U
>   #define TEGRA234_RESET_SDMMC4			85U
>   #define TEGRA234_RESET_UARTA			100U
>   


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

* Re: [PATCH v2 4/6] dt-bindings: Add HDA support for Tegra234
@ 2022-02-16  7:33     ` Mikko Perttunen
  0 siblings, 0 replies; 26+ messages in thread
From: Mikko Perttunen @ 2022-02-16  7:33 UTC (permalink / raw)
  To: Mohan Kumar, broonie, lgirdwood, robh+dt, thierry.reding, tiwai,
	jonathanh, spujar
  Cc: linux-tegra, devicetree, alsa-devel, linux-kernel

On 2/10/22 08:50, Mohan Kumar wrote:
> Add hda clocks, memory ,power and reset binding entries
> for Tegra234.
> 
> Signed-off-by: Mohan Kumar <mkumard@nvidia.com>
> ---
>   include/dt-bindings/clock/tegra234-clock.h     | 4 ++++
>   include/dt-bindings/memory/tegra234-mc.h       | 6 ++++++
>   include/dt-bindings/power/tegra234-powergate.h | 9 +++++++++
>   include/dt-bindings/reset/tegra234-reset.h     | 2 ++
>   4 files changed, 21 insertions(+)
>   create mode 100644 include/dt-bindings/power/tegra234-powergate.h
> 
> diff --git a/include/dt-bindings/clock/tegra234-clock.h b/include/dt-bindings/clock/tegra234-clock.h
> index 8d7e66e1b6ef..c014269b7245 100644
> --- a/include/dt-bindings/clock/tegra234-clock.h
> +++ b/include/dt-bindings/clock/tegra234-clock.h
> @@ -30,5 +30,9 @@
>   #define TEGRA234_CLK_PLLC4			237U
>   /** @brief 32K input clock provided by PMIC */
>   #define TEGRA234_CLK_CLK_32K			289U
> +/** @brief CLK_RST_CONTROLLER_AZA2XBITCLK_OUT_SWITCH_DIVIDER switch divider output (aza_2xbitclk) */
> +#define TEGRA234_CLK_AZA_2XBIT			457U
> +/** @brief aza_2xbitclk / 2 (aza_bitclk) */
> +#define TEGRA234_CLK_AZA_BIT			458U
>   
>   #endif
> diff --git a/include/dt-bindings/memory/tegra234-mc.h b/include/dt-bindings/memory/tegra234-mc.h
> index 2662f70c15c6..f538fc442cee 100644
> --- a/include/dt-bindings/memory/tegra234-mc.h
> +++ b/include/dt-bindings/memory/tegra234-mc.h
> @@ -7,6 +7,8 @@
>   #define TEGRA234_SID_INVALID		0x00
>   #define TEGRA234_SID_PASSTHROUGH	0x7f
>   
> +/* NISO0 SMMU STREAM IDs */
> +#define TEGRA234_SID_NISO0_HDA		0x03

Please follow the existing convention in this file.

/* NISO0 stream IDs */
#define TEGRA234_SID_HDA	0x03

>   
>   /* NISO1 stream IDs */
>   #define TEGRA234_SID_SDMMC4	0x02
> @@ -16,6 +18,10 @@
>    * memory client IDs
>    */
>   
> +/* High-definition audio (HDA) read clients */
> +#define TEGRA234_MEMORY_CLIENT_HDAR 0x15
> +/* High-definition audio (HDA) write clients */
> +#define TEGRA234_MEMORY_CLIENT_HDAW 0x35
>   /* sdmmcd memory read client */
>   #define TEGRA234_MEMORY_CLIENT_SDMMCRAB 0x63
>   /* sdmmcd memory write client */
> diff --git a/include/dt-bindings/power/tegra234-powergate.h b/include/dt-bindings/power/tegra234-powergate.h
> new file mode 100644
> index 000000000000..3c5575a51296
> --- /dev/null
> +++ b/include/dt-bindings/power/tegra234-powergate.h
> @@ -0,0 +1,9 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/* Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. */
> +
> +#ifndef __ABI_MACH_T234_POWERGATE_T234_H_
> +#define __ABI_MACH_T234_POWERGATE_T234_H_
> +
> +#define TEGRA234_POWER_DOMAIN_DISP	3U
> +
> +#endif
> diff --git a/include/dt-bindings/reset/tegra234-reset.h b/include/dt-bindings/reset/tegra234-reset.h
> index 50e13bced642..2ab61c69a3d9 100644
> --- a/include/dt-bindings/reset/tegra234-reset.h
> +++ b/include/dt-bindings/reset/tegra234-reset.h
> @@ -10,6 +10,8 @@
>    * @brief Identifiers for Resets controllable by firmware
>    * @{
>    */
> +#define TEGRA234_RESET_HDA			20U
> +#define TEGRA234_RESET_HDACODEC			21U
>   #define TEGRA234_RESET_SDMMC4			85U
>   #define TEGRA234_RESET_UARTA			100U
>   


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

* Re: [PATCH v2 0/6] Add Tegra234 HDA support
  2022-02-15 13:34     ` Takashi Iwai
@ 2022-02-16 14:23       ` Thierry Reding
  -1 siblings, 0 replies; 26+ messages in thread
From: Thierry Reding @ 2022-02-16 14:23 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Mohan Kumar, broonie, lgirdwood, robh+dt, tiwai, jonathanh,
	spujar, alsa-devel, devicetree, linux-tegra, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1369 bytes --]

On Tue, Feb 15, 2022 at 02:34:01PM +0100, Takashi Iwai wrote:
> On Tue, 15 Feb 2022 14:29:54 +0100,
> Takashi Iwai wrote:
> > 
> > On Thu, 10 Feb 2022 07:50:51 +0100,
> > Mohan Kumar wrote:
> > > 
> > > This series add the support for TEGRA234 HDA driver support
> > > 
> > > Mohan Kumar (6):
> > >   ALSA: hda/tegra: Add Tegra234 hda driver support
> > >   ALSA: hda/tegra: Hardcode GCAP ISS value on T234
> > >   ALSA: hda/tegra: Update scratch reg. communication
> > >   dt-bindings: Add HDA support for Tegra234
> > >   dt-bindings: Document Tegra234 HDA support
> > >   arm64: tegra: Add hda dts node for Tegra234
> > 
> > Applied all six patches to for-next branch now.
> 
> ... and now I realized that it's conflicting with the latest Tegra234
> reset stuff on linux-next.
> 
> Maybe better to split the patches to be merged through several trees?

It's usually best for me to pick up at least the DT changes (patch 6)
into the Tegra tree, that way I can easily resolve conflicts there when
they arise.

The device tree bindings (patches 3 & 4) traditionally go along with
the driver changes, though.

If you prefer the patch series to be split, that's fine. For other
subsystems we usually deal with this by having one series and then the
subsystem maintainer picking up all the non-DT changes and I take the
rest.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v2 0/6] Add Tegra234 HDA support
@ 2022-02-16 14:23       ` Thierry Reding
  0 siblings, 0 replies; 26+ messages in thread
From: Thierry Reding @ 2022-02-16 14:23 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: devicetree, alsa-devel, lgirdwood, linux-kernel, spujar, tiwai,
	robh+dt, jonathanh, broonie, linux-tegra, Mohan Kumar

[-- Attachment #1: Type: text/plain, Size: 1369 bytes --]

On Tue, Feb 15, 2022 at 02:34:01PM +0100, Takashi Iwai wrote:
> On Tue, 15 Feb 2022 14:29:54 +0100,
> Takashi Iwai wrote:
> > 
> > On Thu, 10 Feb 2022 07:50:51 +0100,
> > Mohan Kumar wrote:
> > > 
> > > This series add the support for TEGRA234 HDA driver support
> > > 
> > > Mohan Kumar (6):
> > >   ALSA: hda/tegra: Add Tegra234 hda driver support
> > >   ALSA: hda/tegra: Hardcode GCAP ISS value on T234
> > >   ALSA: hda/tegra: Update scratch reg. communication
> > >   dt-bindings: Add HDA support for Tegra234
> > >   dt-bindings: Document Tegra234 HDA support
> > >   arm64: tegra: Add hda dts node for Tegra234
> > 
> > Applied all six patches to for-next branch now.
> 
> ... and now I realized that it's conflicting with the latest Tegra234
> reset stuff on linux-next.
> 
> Maybe better to split the patches to be merged through several trees?

It's usually best for me to pick up at least the DT changes (patch 6)
into the Tegra tree, that way I can easily resolve conflicts there when
they arise.

The device tree bindings (patches 3 & 4) traditionally go along with
the driver changes, though.

If you prefer the patch series to be split, that's fine. For other
subsystems we usually deal with this by having one series and then the
subsystem maintainer picking up all the non-DT changes and I take the
rest.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v2 0/6] Add Tegra234 HDA support
  2022-02-16 14:23       ` Thierry Reding
@ 2022-02-16 14:41         ` Takashi Iwai
  -1 siblings, 0 replies; 26+ messages in thread
From: Takashi Iwai @ 2022-02-16 14:41 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Mohan Kumar, broonie, lgirdwood, robh+dt, tiwai, jonathanh,
	spujar, alsa-devel, devicetree, linux-tegra, linux-kernel

On Wed, 16 Feb 2022 15:23:27 +0100,
Thierry Reding wrote:
> 
> On Tue, Feb 15, 2022 at 02:34:01PM +0100, Takashi Iwai wrote:
> > On Tue, 15 Feb 2022 14:29:54 +0100,
> > Takashi Iwai wrote:
> > > 
> > > On Thu, 10 Feb 2022 07:50:51 +0100,
> > > Mohan Kumar wrote:
> > > > 
> > > > This series add the support for TEGRA234 HDA driver support
> > > > 
> > > > Mohan Kumar (6):
> > > >   ALSA: hda/tegra: Add Tegra234 hda driver support
> > > >   ALSA: hda/tegra: Hardcode GCAP ISS value on T234
> > > >   ALSA: hda/tegra: Update scratch reg. communication
> > > >   dt-bindings: Add HDA support for Tegra234
> > > >   dt-bindings: Document Tegra234 HDA support
> > > >   arm64: tegra: Add hda dts node for Tegra234
> > > 
> > > Applied all six patches to for-next branch now.
> > 
> > ... and now I realized that it's conflicting with the latest Tegra234
> > reset stuff on linux-next.
> > 
> > Maybe better to split the patches to be merged through several trees?
> 
> It's usually best for me to pick up at least the DT changes (patch 6)
> into the Tegra tree, that way I can easily resolve conflicts there when
> they arise.
> 
> The device tree bindings (patches 3 & 4) traditionally go along with
> the driver changes, though.
> 
> If you prefer the patch series to be split, that's fine. For other
> subsystems we usually deal with this by having one series and then the
> subsystem maintainer picking up all the non-DT changes and I take the
> rest.

OK, that's fine for me.
Let's revisit the latest patchset.


thanks,

Takashi

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

* Re: [PATCH v2 0/6] Add Tegra234 HDA support
@ 2022-02-16 14:41         ` Takashi Iwai
  0 siblings, 0 replies; 26+ messages in thread
From: Takashi Iwai @ 2022-02-16 14:41 UTC (permalink / raw)
  To: Thierry Reding
  Cc: devicetree, alsa-devel, lgirdwood, linux-kernel, spujar, tiwai,
	robh+dt, jonathanh, broonie, linux-tegra, Mohan Kumar

On Wed, 16 Feb 2022 15:23:27 +0100,
Thierry Reding wrote:
> 
> On Tue, Feb 15, 2022 at 02:34:01PM +0100, Takashi Iwai wrote:
> > On Tue, 15 Feb 2022 14:29:54 +0100,
> > Takashi Iwai wrote:
> > > 
> > > On Thu, 10 Feb 2022 07:50:51 +0100,
> > > Mohan Kumar wrote:
> > > > 
> > > > This series add the support for TEGRA234 HDA driver support
> > > > 
> > > > Mohan Kumar (6):
> > > >   ALSA: hda/tegra: Add Tegra234 hda driver support
> > > >   ALSA: hda/tegra: Hardcode GCAP ISS value on T234
> > > >   ALSA: hda/tegra: Update scratch reg. communication
> > > >   dt-bindings: Add HDA support for Tegra234
> > > >   dt-bindings: Document Tegra234 HDA support
> > > >   arm64: tegra: Add hda dts node for Tegra234
> > > 
> > > Applied all six patches to for-next branch now.
> > 
> > ... and now I realized that it's conflicting with the latest Tegra234
> > reset stuff on linux-next.
> > 
> > Maybe better to split the patches to be merged through several trees?
> 
> It's usually best for me to pick up at least the DT changes (patch 6)
> into the Tegra tree, that way I can easily resolve conflicts there when
> they arise.
> 
> The device tree bindings (patches 3 & 4) traditionally go along with
> the driver changes, though.
> 
> If you prefer the patch series to be split, that's fine. For other
> subsystems we usually deal with this by having one series and then the
> subsystem maintainer picking up all the non-DT changes and I take the
> rest.

OK, that's fine for me.
Let's revisit the latest patchset.


thanks,

Takashi

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

end of thread, other threads:[~2022-02-16 14:43 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10  6:50 [PATCH v2 0/6] Add Tegra234 HDA support Mohan Kumar
2022-02-10  6:50 ` Mohan Kumar
2022-02-10  6:50 ` [PATCH v2 1/6] ALSA: hda/tegra: Add Tegra234 hda driver support Mohan Kumar
2022-02-10  6:50   ` Mohan Kumar
2022-02-10  6:50 ` [PATCH v2 2/6] ALSA: hda/tegra: Hardcode GCAP ISS value on T234 Mohan Kumar
2022-02-10  6:50   ` Mohan Kumar
2022-02-10  6:50 ` [PATCH v2 3/6] ALSA: hda/tegra: Update scratch reg. communication Mohan Kumar
2022-02-10  6:50   ` Mohan Kumar
2022-02-10  6:50 ` [PATCH v2 4/6] dt-bindings: Add HDA support for Tegra234 Mohan Kumar
2022-02-10  6:50   ` Mohan Kumar
2022-02-16  7:33   ` Mikko Perttunen
2022-02-16  7:33     ` Mikko Perttunen
2022-02-10  6:50 ` [PATCH v2 5/6] dt-bindings: Document Tegra234 HDA support Mohan Kumar
2022-02-10  6:50   ` Mohan Kumar
2022-02-10  6:50 ` [PATCH v2 6/6] arm64: tegra: Add hda dts node for Tegra234 Mohan Kumar
2022-02-10  6:50   ` Mohan Kumar
2022-02-15 13:29 ` [PATCH v2 0/6] Add Tegra234 HDA support Takashi Iwai
2022-02-15 13:29   ` Takashi Iwai
2022-02-15 13:34   ` Takashi Iwai
2022-02-15 13:34     ` Takashi Iwai
2022-02-16  7:31     ` Mohan Kumar D
2022-02-16  7:31       ` Mohan Kumar D
2022-02-16 14:23     ` Thierry Reding
2022-02-16 14:23       ` Thierry Reding
2022-02-16 14:41       ` Takashi Iwai
2022-02-16 14:41         ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.