linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/6] Those patches is used for dw_hdmi audio.
@ 2014-12-15  2:11 Yakir Yang
  2014-12-15  2:11 ` [PATCH 4/6] ASoC: rockchip-hdmi-audio: add sound driver for hdmi audio Yakir Yang
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: Yakir Yang @ 2014-12-15  2:11 UTC (permalink / raw)
  To: linux-arm-kernel


rk3288 use Designware HDMI IP, Designware HDMI supports four interfaces to
config hdmi audio(I2S, S/PDIF, Generic Parallel Audio, AHB Audio DMA), but
rk3288 only support two ways to config hdmi audio(I2S, S/PDIF), So we take
I2S as hdmi audio operation interfaces, and then treat hdmi audio as an
standard ALSA devices(only got platback function).

Four things we have done:
1. modify the audio part of dw_hdmi drivers for rk3288 platform specific.
2. add codec driver for hdmi audio, and creat codec device dynamically in
   hdmi driver probe function, using platform_register_device_full way, so
   that hdmi codec driver can connected with hdmi driver.
3. add sound driver for hdmi audio, creat hdmi audio sound card.
4. add dt-bings file and add hdmi_audio node to corresponding dt file.

[Explanation]:
those patch is depend on patch by Andy Yan
drm: bridge/dw_hdmi: add rockchip rk3288 support
see https://patchwork.kernel.org/patch/5442361/


Yakir Yang (6):
  drm: bridge/dw_hdmi: add hdmi audio config interfaces
  drm: bridge/bridge: add support for rk3288 hdmi-audio
  ASoC: dw-hdmi-audio: add codec driver for dw hdmi audio
  ASoC: rockchip-hdmi-audio: add sound driver for hdmi audio
  dt-bindings: Add documentation for Rockchip hdmi-audio
  ARM: dts: rockchip: add hdmi audio nodes

 .../sound/rockchip,rockchip-hdmi-audio.txt         |  16 +
 arch/arm/boot/dts/rk3288-evb.dtsi                  |  11 +
 arch/arm/boot/dts/rk3288.dtsi                      |   8 +
 drivers/gpu/drm/bridge/dw_hdmi.c                   |  32 +-
 include/drm/bridge/dw_hdmi.h                       |  12 +
 sound/soc/codecs/Kconfig                           |   4 +
 sound/soc/codecs/Makefile                          |   2 +
 sound/soc/codecs/dw-hdmi-audio.c                   | 371 +++++++++++++++++++++
 sound/soc/codecs/dw-hdmi-audio.h                   |  82 +++++
 sound/soc/rockchip/Kconfig                         |   9 +
 sound/soc/rockchip/Makefile                        |   2 +
 sound/soc/rockchip/rockchip_hdmi_audio.c           | 208 ++++++++++++
 12 files changed, 756 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/sound/rockchip,rockchip-hdmi-audio.txt
 create mode 100644 sound/soc/codecs/dw-hdmi-audio.c
 create mode 100644 sound/soc/codecs/dw-hdmi-audio.h
 create mode 100644 sound/soc/rockchip/rockchip_hdmi_audio.c

-- 
2.1.2

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

* [PATCH 4/6] ASoC: rockchip-hdmi-audio: add sound driver for hdmi audio
  2014-12-15  2:11 [RFC PATCH 0/6] Those patches is used for dw_hdmi audio Yakir Yang
@ 2014-12-15  2:11 ` Yakir Yang
  2014-12-15  2:55 ` [PATCH 5/6] dt-bindings: Add documentation for Rockchip hdmi-audio Yakir Yang
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 20+ messages in thread
From: Yakir Yang @ 2014-12-15  2:11 UTC (permalink / raw)
  To: linux-arm-kernel

Adds a sound driver that combines rockchip-i2s cpu_dai and dw-hdmi-codec
as codec_dai to provide hdmi audio output on rk3288 platforms.

Signed-off-by: Yakir Yang <ykk@rock-chips.com>
---

 sound/soc/rockchip/Kconfig               |   9 ++
 sound/soc/rockchip/Makefile              |   2 +
 sound/soc/rockchip/rockchip_hdmi_audio.c | 208 +++++++++++++++++++++++++++++++
 3 files changed, 219 insertions(+)
 create mode 100644 sound/soc/rockchip/rockchip_hdmi_audio.c

diff --git a/sound/soc/rockchip/Kconfig b/sound/soc/rockchip/Kconfig
index e181826..ed2b7f0 100644
--- a/sound/soc/rockchip/Kconfig
+++ b/sound/soc/rockchip/Kconfig
@@ -14,3 +14,12 @@ config SND_SOC_ROCKCHIP_I2S
 	  Say Y or M if you want to add support for I2S driver for
 	  Rockchip I2S device. The device supports upto maximum of
 	  8 channels each for play and record.
+
+config SND_SOC_ROCKCHIP_HDMI_AUDIO
+	tristate "ASoC support for Rockchip HDMI audio"
+	depends on SND_SOC_ROCKCHIP
+	select SND_SOC_ROCKCHIP_I2S
+	select SND_SOC_DW_HDMI_AUDIO
+	help
+	  Say Y or M here if you want to add support for SoC audio on Rockchip
+	  HDMI, such as rk3288 hdmi.
diff --git a/sound/soc/rockchip/Makefile b/sound/soc/rockchip/Makefile
index b921909..b9185b3 100644
--- a/sound/soc/rockchip/Makefile
+++ b/sound/soc/rockchip/Makefile
@@ -1,4 +1,6 @@
 # ROCKCHIP Platform Support
 snd-soc-i2s-objs := rockchip_i2s.o
+snd-soc-rockchip-hdmi-audio-objs := rockchip_hdmi_audio.o
 
 obj-$(CONFIG_SND_SOC_ROCKCHIP_I2S) += snd-soc-i2s.o
+obj-$(CONFIG_SND_SOC_ROCKCHIP_HDMI_AUDIO) += snd-soc-rockchip-hdmi-audio.o
diff --git a/sound/soc/rockchip/rockchip_hdmi_audio.c b/sound/soc/rockchip/rockchip_hdmi_audio.c
new file mode 100644
index 0000000..a1a9c75
--- /dev/null
+++ b/sound/soc/rockchip/rockchip_hdmi_audio.c
@@ -0,0 +1,208 @@
+/*
+ * rockchip-hdmi-card.c
+ *
+ * ROCKCHIP ALSA SoC DAI driver for HDMI audio on rockchip processors.
+ * Copyright (c) 2014, ROCKCHIP CORPORATION. All rights reserved.
+ * Authors: Yakir Yang <ykk@rock-chips.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.*
+ *
+ */
+#include <linux/module.h>
+#include <linux/platform_device.h>
+
+#include <sound/soc.h>
+#include <sound/pcm.h>
+#include <sound/jack.h>
+#include <sound/core.h>
+#include <sound/pcm_params.h>
+
+#include "rockchip_i2s.h"
+#include "../codecs/dw-hdmi-audio.h"
+
+#define DRV_NAME "rockchip-hdmi-audio"
+
+struct hdmi_audio_private {
+	struct snd_soc_jack hdmi_jack;
+};
+
+static int rockchip_hdmi_audio_hw_params(struct snd_pcm_substream *substream,
+					struct snd_pcm_hw_params *params)
+{
+	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
+	unsigned int dai_fmt = rtd->dai_link->dai_fmt;
+	int mclk, ret;
+
+	switch (params_rate(params)) {
+	case 8000:
+	case 16000:
+	case 24000:
+	case 32000:
+	case 48000:
+	case 64000:
+	case 96000:
+		mclk = 12288000;
+		break;
+	case 11025:
+	case 22050:
+	case 44100:
+	case 88200:
+		mclk = 11289600;
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	ret = snd_soc_dai_set_fmt(cpu_dai, dai_fmt);
+	if (ret < 0) {
+		dev_err(cpu_dai->dev, "failed to set cpu_dai fmt.\n");
+		return ret;
+	}
+
+	ret = snd_soc_dai_set_sysclk(cpu_dai, 0, mclk, SND_SOC_CLOCK_OUT);
+	if (ret < 0) {
+		dev_err(cpu_dai->dev, "failed to set cpu_dai sysclk.\n");
+		return ret;
+	}
+
+	return 0;
+}
+
+static int hdmi_audio_dai_init(struct snd_soc_pcm_runtime *runtime)
+{
+	struct snd_soc_codec *codec = runtime->codec;
+	struct snd_soc_card *card = runtime->card;
+	struct hdmi_audio_private *drv = snd_soc_card_get_drvdata(card);
+
+	/* Enable headphone jack detection */
+	snd_soc_jack_new(codec, "HDMI Jack", SND_JACK_LINEOUT,
+			 &drv->hdmi_jack);
+
+	return dw_hdmi_jack_detect(codec, &drv->hdmi_jack);
+}
+
+static struct snd_soc_ops hdmi_audio_dai_ops = {
+	.hw_params = rockchip_hdmi_audio_hw_params,
+};
+
+static struct snd_soc_dai_link hdmi_audio_dai = {
+	.name = "RockchipHDMI",
+	.stream_name = "RockchipHDMI",
+	.init = hdmi_audio_dai_init,
+	.ops = &hdmi_audio_dai_ops,
+	.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
+		   SND_SOC_DAIFMT_CBS_CFS,
+};
+
+static struct snd_soc_card rockchip_hdmi_audio_card = {
+	.name = "RockchipHDMI",
+	.owner = THIS_MODULE,
+	.dai_link = &hdmi_audio_dai,
+	.num_links = 1,
+};
+
+static int rockchip_hdmi_audio_probe(struct platform_device *pdev)
+{
+	struct snd_soc_card *card = &rockchip_hdmi_audio_card;
+	struct device_node *np = pdev->dev.of_node;
+	struct hdmi_audio_private *drv;
+	int ret;
+
+	drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL);
+	if (!drv)
+		return -ENOMEM;
+
+	card->dev = &pdev->dev;
+	platform_set_drvdata(pdev, &card);
+	snd_soc_card_set_drvdata(card, drv);
+
+	of_property_read_string(np, "codec-name", &hdmi_audio_dai.codec_name);
+	if (!hdmi_audio_dai.codec_name) {
+		dev_err(&pdev->dev, "Property 'codec-name' missing !\n");
+		goto free_priv_data;
+	}
+
+	of_property_read_string(np, "codec-dai-name",
+				&hdmi_audio_dai.codec_dai_name);
+	if (!hdmi_audio_dai.codec_dai_name) {
+		dev_err(&pdev->dev, "Property 'codec-dai-name' missing !\n");
+		goto free_codec_name;
+	}
+
+	hdmi_audio_dai.cpu_of_node = of_parse_phandle(np, "cpu-of-node", 0);
+	if (!hdmi_audio_dai.cpu_of_node) {
+		dev_err(&pdev->dev, "Property 'cpu-of-node' missing !\n");
+		goto free_codec_dai_name;
+	}
+
+	hdmi_audio_dai.platform_of_node = hdmi_audio_dai.cpu_of_node;
+
+	ret = snd_soc_register_card(card);
+	if (ret) {
+		dev_err(&pdev->dev, "register card failed (%d)\n", ret);
+		card->dev = NULL;
+		goto free_cpu_of_node;
+	}
+
+	dev_info(&pdev->dev, "hdmi audio init success.\n");
+
+	return 0;
+
+free_cpu_of_node:
+	hdmi_audio_dai.cpu_of_node = NULL;
+	hdmi_audio_dai.platform_of_node = NULL;
+free_codec_dai_name:
+	hdmi_audio_dai.codec_dai_name = NULL;
+free_codec_name:
+	hdmi_audio_dai.codec_name = NULL;
+free_priv_data:
+	platform_set_drvdata(pdev, NULL);
+	devm_kfree(&pdev->dev, drv);
+	card->dev = NULL;
+
+	return ret;
+}
+
+static int rockchip_hdmi_audio_remove(struct platform_device *pdev)
+{
+	struct snd_soc_card *card = platform_get_drvdata(pdev);
+
+	snd_soc_unregister_card(card);
+	platform_set_drvdata(pdev, NULL);
+	card->dev = NULL;
+
+	return 0;
+}
+
+static const struct of_device_id rockchip_hdmi_audio_of_match[] = {
+	{ .compatible = "rockchip,rk3288-hdmi-audio", },
+	{},
+};
+
+static struct platform_driver rockchip_hdmi_audio_driver = {
+	.driver = {
+		.name = DRV_NAME,
+		.owner = THIS_MODULE,
+		.of_match_table = rockchip_hdmi_audio_of_match,
+	},
+	.probe = rockchip_hdmi_audio_probe,
+	.remove = rockchip_hdmi_audio_remove,
+};
+module_platform_driver(rockchip_hdmi_audio_driver);
+
+MODULE_AUTHOR("Yakir Yang <ykk@rock-chips.com>");
+MODULE_DESCRIPTION("Rockchip HDMI Audio ASoC Interface");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:" DRV_NAME);
+MODULE_DEVICE_TABLE(of, rockchip_hdmi_audio_of_match);
-- 
2.1.2

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

* [PATCH 5/6] dt-bindings: Add documentation for Rockchip hdmi-audio
  2014-12-15  2:11 [RFC PATCH 0/6] Those patches is used for dw_hdmi audio Yakir Yang
  2014-12-15  2:11 ` [PATCH 4/6] ASoC: rockchip-hdmi-audio: add sound driver for hdmi audio Yakir Yang
@ 2014-12-15  2:55 ` Yakir Yang
  2014-12-15  9:02   ` Lars-Peter Clausen
  2014-12-15 10:40   ` Russell King - ARM Linux
  2014-12-15  2:56 ` [PATCH 6/6] ARM: dts: rockchip: add hdmi audio nodes Yakir Yang
  2014-12-15 10:38 ` [RFC PATCH 0/6] Those patches is used for dw_hdmi audio Russell King - ARM Linux
  3 siblings, 2 replies; 20+ messages in thread
From: Yakir Yang @ 2014-12-15  2:55 UTC (permalink / raw)
  To: linux-arm-kernel

Required properties:
- compatible: platform specific
- cpu-of-node: the device node of cpu_dai
- codec-name: the dw-hdmi codec's device name
- codec-dai-name: the dw-hdmi codec's dai name

Signed-off-by: Yakir Yang <ykk@rock-chips.com>
---

 .../bindings/sound/rockchip,rockchip-hdmi-audio.txt      | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/rockchip,rockchip-hdmi-audio.txt

diff --git a/Documentation/devicetree/bindings/sound/rockchip,rockchip-hdmi-audio.txt b/Documentation/devicetree/bindings/sound/rockchip,rockchip-hdmi-audio.txt
new file mode 100644
index 0000000..674cff0
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/rockchip,rockchip-hdmi-audio.txt
@@ -0,0 +1,16 @@
+Rockchip hdmi audio bindings
+
+Required properties:
+- compatible: platform specific
+- cpu-of-node: the device node of cpu_dai
+- codec-name: the dw-hdmi codec's device name
+- codec-dai-name: the dw-hdmi codec's dai name
+
+Example:
+
+sound {
+	compatible = "rockchip,rk3288-hdmi-audio";
+	cpu-of-node = <&i2s>;
+	codec-name = "dw-hdmi-audio";
+	codec-dai-name = "dw-hdmi-hifi";
+};
-- 
2.1.2

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

* [PATCH 6/6] ARM: dts: rockchip: add hdmi audio nodes
  2014-12-15  2:11 [RFC PATCH 0/6] Those patches is used for dw_hdmi audio Yakir Yang
  2014-12-15  2:11 ` [PATCH 4/6] ASoC: rockchip-hdmi-audio: add sound driver for hdmi audio Yakir Yang
  2014-12-15  2:55 ` [PATCH 5/6] dt-bindings: Add documentation for Rockchip hdmi-audio Yakir Yang
@ 2014-12-15  2:56 ` Yakir Yang
  2014-12-15 10:38 ` [RFC PATCH 0/6] Those patches is used for dw_hdmi audio Russell King - ARM Linux
  3 siblings, 0 replies; 20+ messages in thread
From: Yakir Yang @ 2014-12-15  2:56 UTC (permalink / raw)
  To: linux-arm-kernel

Add hdmi_audio to rk3288.dtsi, enable hdmi_audio in rk3288-evb.dts

Signed-off-by: Yakir Yang <ykk@rock-chips.com>

series-cc: Dominik Behr <dbehr@chromium.org>

---

 arch/arm/boot/dts/rk3288-evb.dtsi | 11 +++++++++++
 arch/arm/boot/dts/rk3288.dtsi     |  8 ++++++++
 2 files changed, 19 insertions(+)

diff --git a/arch/arm/boot/dts/rk3288-evb.dtsi b/arch/arm/boot/dts/rk3288-evb.dtsi
index 3e067dd..53115d4 100644
--- a/arch/arm/boot/dts/rk3288-evb.dtsi
+++ b/arch/arm/boot/dts/rk3288-evb.dtsi
@@ -120,6 +120,17 @@
 	status = "okay";
 };
 
+&i2s {
+	status = "okay";
+	clock-names = "i2s_hclk", "i2s_clk", "i2s_clk_out";
+	clocks = <&cru HCLK_I2S0>, <&cru SCLK_I2S0>,
+		 <&cru SCLK_I2S0_OUT>;
+};
+
+&hdmi_audio {
+	status = "okay";
+};
+
 &wdt {
 	status = "okay";
 };
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index fd19f00..3eeba16 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -588,6 +588,14 @@
 		interrupts = <GIC_PPI 9 0xf04>;
 	};
 
+	hdmi_audio: hdmi_audio {
+		compatible = "rockchip,rk3288-hdmi-audio";
+		cpu-of-node = <&i2s>;
+		codec-name = "dw-hdmi-audio";
+		codec-dai-name = "dw-hdmi-hifi";
+		status = "disable";
+	};
+
 	pinctrl: pinctrl {
 		compatible = "rockchip,rk3288-pinctrl";
 		rockchip,grf = <&grf>;
-- 
2.1.2

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

* [PATCH 5/6] dt-bindings: Add documentation for Rockchip hdmi-audio
  2014-12-15  2:55 ` [PATCH 5/6] dt-bindings: Add documentation for Rockchip hdmi-audio Yakir Yang
@ 2014-12-15  9:02   ` Lars-Peter Clausen
  2014-12-15  9:46     ` Kuankuan.Yang
  2014-12-15 10:40   ` Russell King - ARM Linux
  1 sibling, 1 reply; 20+ messages in thread
From: Lars-Peter Clausen @ 2014-12-15  9:02 UTC (permalink / raw)
  To: linux-arm-kernel

On 12/15/2014 03:55 AM, Yakir Yang wrote:
[...]
> +- codec-name: the dw-hdmi codec's device name
> +- codec-dai-name: the dw-hdmi codec's dai name

Please you phandles for this, the names are Linux driver and framework 
specific details. That should not leak into the DT bindings.

[..]

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

* [PATCH 5/6] dt-bindings: Add documentation for Rockchip hdmi-audio
  2014-12-15  9:02   ` Lars-Peter Clausen
@ 2014-12-15  9:46     ` Kuankuan.Yang
  0 siblings, 0 replies; 20+ messages in thread
From: Kuankuan.Yang @ 2014-12-15  9:46 UTC (permalink / raw)
  To: linux-arm-kernel

Hi lars:

thks for your review, I will move it to hdmi audio driver, give the 
codec_name & codec_dai_name an const string.

Best Regards.

? 2014?12?15? 17:02, Lars-Peter Clausen ??:
> On 12/15/2014 03:55 AM, Yakir Yang wrote:
> [...]
>> +- codec-name: the dw-hdmi codec's device name
>> +- codec-dai-name: the dw-hdmi codec's dai name
>
> Please you phandles for this, the names are Linux driver and framework 
> specific details. That should not leak into the DT bindings.
>
> [..]
>
>
>

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

* [RFC PATCH 0/6] Those patches is used for dw_hdmi audio.
  2014-12-15  2:11 [RFC PATCH 0/6] Those patches is used for dw_hdmi audio Yakir Yang
                   ` (2 preceding siblings ...)
  2014-12-15  2:56 ` [PATCH 6/6] ARM: dts: rockchip: add hdmi audio nodes Yakir Yang
@ 2014-12-15 10:38 ` Russell King - ARM Linux
       [not found]   ` <548EC9E1.5040206@rock-chips.com>
  3 siblings, 1 reply; 20+ messages in thread
From: Russell King - ARM Linux @ 2014-12-15 10:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 15, 2014 at 10:11:28AM +0800, Yakir Yang wrote:
> 
> rk3288 use Designware HDMI IP, Designware HDMI supports four interfaces to
> config hdmi audio(I2S, S/PDIF, Generic Parallel Audio, AHB Audio DMA), but
> rk3288 only support two ways to config hdmi audio(I2S, S/PDIF), So we take
> I2S as hdmi audio operation interfaces, and then treat hdmi audio as an
> standard ALSA devices(only got platback function).

There is no need for dw-hdmi audio to be implemented as an ASoC
device - as I've already sent patches to Andy with my ALSA driver
which has been around for the last two years, and works well, and
doesn't require any additional DT description.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

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

* [PATCH 5/6] dt-bindings: Add documentation for Rockchip hdmi-audio
  2014-12-15  2:55 ` [PATCH 5/6] dt-bindings: Add documentation for Rockchip hdmi-audio Yakir Yang
  2014-12-15  9:02   ` Lars-Peter Clausen
@ 2014-12-15 10:40   ` Russell King - ARM Linux
  2014-12-15 12:02     ` Mark Brown
  1 sibling, 1 reply; 20+ messages in thread
From: Russell King - ARM Linux @ 2014-12-15 10:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 15, 2014 at 10:55:14AM +0800, Yakir Yang wrote:
> Required properties:
> - compatible: platform specific
> - cpu-of-node: the device node of cpu_dai
> - codec-name: the dw-hdmi codec's device name
> - codec-dai-name: the dw-hdmi codec's dai name

This is not actually a separate physical device from the main dw-hdmi
device.  What you are doing is merely describing the Linux kernel
internals in DT, which is not what DT is supposed to be about.  DT is
supposed to describe the hardware in an operating system independent
manner.

Including details like this (because ASoC needs a separate DT node) is
the wrong approach.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

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

* [RFC PATCH 0/6] Those patches is used for dw_hdmi audio.
       [not found]   ` <548EC9E1.5040206@rock-chips.com>
@ 2014-12-15 11:52     ` Kuankuan.Yang
  2014-12-15 12:00       ` Russell King - ARM Linux
  0 siblings, 1 reply; 20+ messages in thread
From: Kuankuan.Yang @ 2014-12-15 11:52 UTC (permalink / raw)
  To: linux-arm-kernel

  Hi Russell:

      thks for your replay, actually you also have send me those 
dw-hdmi-audio.c patches, and I also agree it's an beautiful way to make 
hdmi-audio works. Beside,
  I try to reuse it into our platform, and actually the system have 
created the DW_HDMI sound card successfully, but i cannot play any 
sound  with this sound card.
      After dump the registers, I found the part of "Audio DMA 
Registers" cannot write and always read with 0x00.  So I searching the 
document  "Designware Core
  HDMI Transmitter Controller Databook", and found that  "Audio DMA 
Registers" only present when the hardware configuration parameter 
AUDIO_IF is set to
  AHBAUDDMA. Than I communicate with our IC colleagues, they told me 
that our cpu rk3288 only support two way to  transmit audio data( I2S & 
SPDIF ), in that
way we do not support AHB_DMA, it's very sad, and this it why i give up 
this way, also it's my bad that i should replay to u first in the before 
mail.


Best Regards.
> ? 2014?12?15? 18:38, Russell King - ARM Linux ??:
>> On Mon, Dec 15, 2014 at 10:11:28AM +0800, Yakir Yang wrote:
>>> rk3288 use Designware HDMI IP, Designware HDMI supports four interfaces to
>>> config hdmi audio(I2S, S/PDIF, Generic Parallel Audio, AHB Audio DMA), but
>>> rk3288 only support two ways to config hdmi audio(I2S, S/PDIF), So we take
>>> I2S as hdmi audio operation interfaces, and then treat hdmi audio as an
>>> standard ALSA devices(only got platback function).
>> There is no need for dw-hdmi audio to be implemented as an ASoC
>> device - as I've already sent patches to Andy with my ALSA driver
>> which has been around for the last two years, and works well, and
>> doesn't require any additional DT description.
>>
>

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

* [RFC PATCH 0/6] Those patches is used for dw_hdmi audio.
  2014-12-15 11:52     ` Kuankuan.Yang
@ 2014-12-15 12:00       ` Russell King - ARM Linux
  2014-12-15 12:46         ` Kuankuan.Yang
  2014-12-15 15:48         ` Jean-Francois Moine
  0 siblings, 2 replies; 20+ messages in thread
From: Russell King - ARM Linux @ 2014-12-15 12:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 15, 2014 at 07:52:06PM +0800, Kuankuan.Yang wrote:
>  Hi Russell:
> 
>      thks for your replay, actually you also have send me those
> dw-hdmi-audio.c patches, and I also agree it's an beautiful way to make
> hdmi-audio works. Beside,
>  I try to reuse it into our platform, and actually the system have created
> the DW_HDMI sound card successfully, but i cannot play any sound  with this
> sound card.
>      After dump the registers, I found the part of "Audio DMA Registers"
> cannot write and always read with 0x00.  So I searching the document
> "Designware Core
>  HDMI Transmitter Controller Databook", and found that  "Audio DMA
> Registers" only present when the hardware configuration parameter AUDIO_IF
> is set to
>  AHBAUDDMA. Than I communicate with our IC colleagues, they told me that our
> cpu rk3288 only support two way to  transmit audio data( I2S & SPDIF ), in
> that
> way we do not support AHB_DMA, it's very sad, and this it why i give up this
> way, also it's my bad that i should replay to u first in the before mail.

Okay, that means there is some work to be done to figure out how to
support this correctly so that both the iMX and Rockchip code can
co-exist together in the mainline kernel - that means we _both_ need
to work together on this problem _before_ this code gets merged, so
that we have a common approach between the two code bases.

I really don't want to end up in another cocked up situation like
what happened with the Dove audio, where it became politically
impossible for the SolidRun platform to be properly supported by
mainline kernels.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

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

* [PATCH 5/6] dt-bindings: Add documentation for Rockchip hdmi-audio
  2014-12-15 10:40   ` Russell King - ARM Linux
@ 2014-12-15 12:02     ` Mark Brown
  2014-12-15 13:10       ` Kuankuan.Yang
  0 siblings, 1 reply; 20+ messages in thread
From: Mark Brown @ 2014-12-15 12:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 15, 2014 at 10:40:29AM +0000, Russell King - ARM Linux wrote:

> Including details like this (because ASoC needs a separate DT node) is
> the wrong approach.

And indeed there should be no Linux-internal reason for that - we should
be able to use whatever DT node makes sense, if there's some reason
that's not possible we should fix that (we do have several drivers doing
this sort of thing already though).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141215/c37dc47a/attachment.sig>

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

* [RFC PATCH 0/6] Those patches is used for dw_hdmi audio.
  2014-12-15 12:00       ` Russell King - ARM Linux
@ 2014-12-15 12:46         ` Kuankuan.Yang
  2014-12-15 15:48         ` Jean-Francois Moine
  1 sibling, 0 replies; 20+ messages in thread
From: Kuankuan.Yang @ 2014-12-15 12:46 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Russell:

I got an idea that we can split the pcm dma part code out, after that we 
can chose the buffer transmit way (AUD_DMA or I2S).
In that way i will make another i2s driver to transmit those buffer, but 
in the mainline kernel already lanched an rockchip i2s driver
(rockchip_i2s.c), so seams it maybe not an good way.

what's your opinion, russell?

Best Regards.

? 2014?12?15? 20:00, Russell King - ARM Linux ??:
> On Mon, Dec 15, 2014 at 07:52:06PM +0800, Kuankuan.Yang wrote:
>>   Hi Russell:
>>
>>       thks for your replay, actually you also have send me those
>> dw-hdmi-audio.c patches, and I also agree it's an beautiful way to make
>> hdmi-audio works. Beside,
>>   I try to reuse it into our platform, and actually the system have created
>> the DW_HDMI sound card successfully, but i cannot play any sound  with this
>> sound card.
>>       After dump the registers, I found the part of "Audio DMA Registers"
>> cannot write and always read with 0x00.  So I searching the document
>> "Designware Core
>>   HDMI Transmitter Controller Databook", and found that  "Audio DMA
>> Registers" only present when the hardware configuration parameter AUDIO_IF
>> is set to
>>   AHBAUDDMA. Than I communicate with our IC colleagues, they told me that our
>> cpu rk3288 only support two way to  transmit audio data( I2S & SPDIF ), in
>> that
>> way we do not support AHB_DMA, it's very sad, and this it why i give up this
>> way, also it's my bad that i should replay to u first in the before mail.
> Okay, that means there is some work to be done to figure out how to
> support this correctly so that both the iMX and Rockchip code can
> co-exist together in the mainline kernel - that means we _both_ need
> to work together on this problem _before_ this code gets merged, so
> that we have a common approach between the two code bases.
>
> I really don't want to end up in another cocked up situation like
> what happened with the Dove audio, where it became politically
> impossible for the SolidRun platform to be properly supported by
> mainline kernels.
>

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

* [PATCH 5/6] dt-bindings: Add documentation for Rockchip hdmi-audio
  2014-12-15 12:02     ` Mark Brown
@ 2014-12-15 13:10       ` Kuankuan.Yang
  2014-12-15 16:18         ` Mark Brown
  0 siblings, 1 reply; 20+ messages in thread
From: Kuankuan.Yang @ 2014-12-15 13:10 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Mark & Russell:

thanks for your replay, what your say is right, those dt is merely 
describing the Linux kernel internals.
Instead of transmit cpu-of-node & codec-name & codec-dai-name through 
dt, i can give those an const
name to rockchip-hdmi-audio.c .

In that way, dt will only need compatible for creating sound device. is 
it ok  ?
sound {
     compatible = "rockchip,rk3288-hdmi-audio";
     status = "okay";
}
could you give me some advises.


Best Regards.

? 2014?12?15? 20:02, Mark Brown ??:
> On Mon, Dec 15, 2014 at 10:40:29AM +0000, Russell King - ARM Linux wrote:
>
>> Including details like this (because ASoC needs a separate DT node) is
>> the wrong approach.
> And indeed there should be no Linux-internal reason for that - we should
> be able to use whatever DT node makes sense, if there's some reason
> that's not possible we should fix that (we do have several drivers doing
> this sort of thing already though).

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

* [RFC PATCH 0/6] Those patches is used for dw_hdmi audio.
  2014-12-15 12:00       ` Russell King - ARM Linux
  2014-12-15 12:46         ` Kuankuan.Yang
@ 2014-12-15 15:48         ` Jean-Francois Moine
  1 sibling, 0 replies; 20+ messages in thread
From: Jean-Francois Moine @ 2014-12-15 15:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 15 Dec 2014 12:00:13 +0000
Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:

> I really don't want to end up in another cocked up situation like
> what happened with the Dove audio, where it became politically
> impossible for the SolidRun platform to be properly supported by
> mainline kernels.

Hi Russell,

I don't see what you mean. The last patches I proposed for the TDA998x
and the HDMI CODEC do exactly what you wanted: S/PDIF out from the
kirkwood audio device towards both S/PDIF optical and HDMI output2 by
default.

-- 
Ken ar c'henta?	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

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

* [PATCH 5/6] dt-bindings: Add documentation for Rockchip hdmi-audio
  2014-12-15 13:10       ` Kuankuan.Yang
@ 2014-12-15 16:18         ` Mark Brown
  2014-12-16  2:14           ` Kuankuan.Yang
                             ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Mark Brown @ 2014-12-15 16:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 15, 2014 at 09:10:26PM +0800, Kuankuan.Yang wrote:
> Hi Mark & Russell:

Please don't top post, that way people have some context for what you're
saying - look at how people normally format their mails on thelist.

> In that way, dt will only need compatible for creating sound device. is it
> ok  ?
> sound {
>     compatible = "rockchip,rk3288-hdmi-audio";
>     status = "okay";
> }
> could you give me some advises.

That'd be good, though the other question is if this can be made to use
simple-card so we can avoid having a custom driver for this.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141215/31851b77/attachment.sig>

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

* [PATCH 5/6] dt-bindings: Add documentation for Rockchip hdmi-audio
  2014-12-15 16:18         ` Mark Brown
@ 2014-12-16  2:14           ` Kuankuan.Yang
  2014-12-16  2:38           ` Kuankuan.Yang
  2014-12-16  6:17           ` Kuankuan.Yang
  2 siblings, 0 replies; 20+ messages in thread
From: Kuankuan.Yang @ 2014-12-16  2:14 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Mark :

Got it, it will be good to use simple-card. i will try it in next version.

Best Regards.

? 2014?12?16? 00:18, Mark Brown ??:
> On Mon, Dec 15, 2014 at 09:10:26PM +0800, Kuankuan.Yang wrote:
>> Hi Mark & Russell:
> Please don't top post, that way people have some context for what you're
> saying - look at how people normally format their mails on thelist.
>
>> In that way, dt will only need compatible for creating sound device. is it
>> ok  ?
>> sound {
>>      compatible = "rockchip,rk3288-hdmi-audio";
>>      status = "okay";
>> }
>> could you give me some advises.
> That'd be good, though the other question is if this can be made to use
> simple-card so we can avoid having a custom driver for this.

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

* [PATCH 5/6] dt-bindings: Add documentation for Rockchip hdmi-audio
  2014-12-15 16:18         ` Mark Brown
  2014-12-16  2:14           ` Kuankuan.Yang
@ 2014-12-16  2:38           ` Kuankuan.Yang
  2014-12-16  6:17           ` Kuankuan.Yang
  2 siblings, 0 replies; 20+ messages in thread
From: Kuankuan.Yang @ 2014-12-16  2:38 UTC (permalink / raw)
  To: linux-arm-kernel


? 2014?12?16? 00:18, Mark Brown ??:
> On Mon, Dec 15, 2014 at 09:10:26PM +0800, Kuankuan.Yang wrote:
>> Hi Mark & Russell:
> Please don't top post, that way people have some context for what you're
> saying - look at how people normally format their mails on thelist.

got it,  thanks for your remind.

>> In that way, dt will only need compatible for creating sound device. is it
>> ok  ?
>> sound {
>>      compatible = "rockchip,rk3288-hdmi-audio";
>>      status = "okay";
>> }
>> could you give me some advises.
> That'd be good, though the other question is if this can be made to use
> simple-card so we can avoid having a custom driver for this.

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

* [PATCH 5/6] dt-bindings: Add documentation for Rockchip hdmi-audio
  2014-12-15 16:18         ` Mark Brown
  2014-12-16  2:14           ` Kuankuan.Yang
  2014-12-16  2:38           ` Kuankuan.Yang
@ 2014-12-16  6:17           ` Kuankuan.Yang
  2014-12-16  9:34             ` Russell King - ARM Linux
  2 siblings, 1 reply; 20+ messages in thread
From: Kuankuan.Yang @ 2014-12-16  6:17 UTC (permalink / raw)
  To: linux-arm-kernel


? 2014?12?16? 00:18, Mark Brown ??:
> On Mon, Dec 15, 2014 at 09:10:26PM +0800, Kuankuan.Yang wrote:
>> Hi Mark & Russell:
> Please don't top post, that way people have some context for what you're
> saying - look at how people normally format their mails on thelist.
>
>> In that way, dt will only need compatible for creating sound device. is it
>> ok  ?
>> sound {
>>      compatible = "rockchip,rk3288-hdmi-audio";
>>      status = "okay";
>> }
>> could you give me some advises.
> That'd be good, though the other question is if this can be made to use
> simple-card so we can avoid having a custom driver for this.
Hi Russell  & Mark:

hdmi-audio driver share irq with dw_hdmi driver,  for continuing 
AHBAUDDMA or for detecting hdmi insert.
So maybe it's hard to switch to simple-card way,  Russell what's your 
opinion ?

Best Regards.

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

* [PATCH 5/6] dt-bindings: Add documentation for Rockchip hdmi-audio
  2014-12-16  6:17           ` Kuankuan.Yang
@ 2014-12-16  9:34             ` Russell King - ARM Linux
  2014-12-16  9:48               ` Kuankuan.Yang
  0 siblings, 1 reply; 20+ messages in thread
From: Russell King - ARM Linux @ 2014-12-16  9:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Dec 16, 2014 at 02:17:51PM +0800, Kuankuan.Yang wrote:
> hdmi-audio driver share irq with dw_hdmi driver,  for continuing AHBAUDDMA
> or for detecting hdmi insert.
> So maybe it's hard to switch to simple-card way,  Russell what's your
> opinion ?

My "opinion" is that I need to spend some time looking in depth at both
your code and my code before I can form an idea of how to proceed.

However, since I seem to be spending a lot of time chasing regressions
which have appeared in v3.18, I don't have a lot of time to look at this
right now.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

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

* [PATCH 5/6] dt-bindings: Add documentation for Rockchip hdmi-audio
  2014-12-16  9:34             ` Russell King - ARM Linux
@ 2014-12-16  9:48               ` Kuankuan.Yang
  0 siblings, 0 replies; 20+ messages in thread
From: Kuankuan.Yang @ 2014-12-16  9:48 UTC (permalink / raw)
  To: linux-arm-kernel


? 2014?12?16? 17:34, Russell King - ARM Linux ??:
> On Tue, Dec 16, 2014 at 02:17:51PM +0800, Kuankuan.Yang wrote:
>> hdmi-audio driver share irq with dw_hdmi driver,  for continuing AHBAUDDMA
>> or for detecting hdmi insert.
>> So maybe it's hard to switch to simple-card way,  Russell what's your
>> opinion ?
> My "opinion" is that I need to spend some time looking in depth at both
> your code and my code before I can form an idea of how to proceed.
>
> However, since I seem to be spending a lot of time chasing regressions
> which have appeared in v3.18, I don't have a lot of time to look at this
> right now.
>
okay, if u got any ideas, wish u can let me know, thks.

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

end of thread, other threads:[~2014-12-16  9:48 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-15  2:11 [RFC PATCH 0/6] Those patches is used for dw_hdmi audio Yakir Yang
2014-12-15  2:11 ` [PATCH 4/6] ASoC: rockchip-hdmi-audio: add sound driver for hdmi audio Yakir Yang
2014-12-15  2:55 ` [PATCH 5/6] dt-bindings: Add documentation for Rockchip hdmi-audio Yakir Yang
2014-12-15  9:02   ` Lars-Peter Clausen
2014-12-15  9:46     ` Kuankuan.Yang
2014-12-15 10:40   ` Russell King - ARM Linux
2014-12-15 12:02     ` Mark Brown
2014-12-15 13:10       ` Kuankuan.Yang
2014-12-15 16:18         ` Mark Brown
2014-12-16  2:14           ` Kuankuan.Yang
2014-12-16  2:38           ` Kuankuan.Yang
2014-12-16  6:17           ` Kuankuan.Yang
2014-12-16  9:34             ` Russell King - ARM Linux
2014-12-16  9:48               ` Kuankuan.Yang
2014-12-15  2:56 ` [PATCH 6/6] ARM: dts: rockchip: add hdmi audio nodes Yakir Yang
2014-12-15 10:38 ` [RFC PATCH 0/6] Those patches is used for dw_hdmi audio Russell King - ARM Linux
     [not found]   ` <548EC9E1.5040206@rock-chips.com>
2014-12-15 11:52     ` Kuankuan.Yang
2014-12-15 12:00       ` Russell King - ARM Linux
2014-12-15 12:46         ` Kuankuan.Yang
2014-12-15 15:48         ` Jean-Francois Moine

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).