All of lore.kernel.org
 help / color / mirror / Atom feed
* [alsa-devel] [PATCH v4 0/3] Sound support for Exynos4412 Trats2 board
@ 2015-01-23  5:03 ` Inha Song
  0 siblings, 0 replies; 29+ messages in thread
From: Inha Song @ 2015-01-23  5:03 UTC (permalink / raw)
  To: alsa-devel
  Cc: robh+dt, pawel.moll, mark.rutland, s.nawrocki, ijc+devicetree,
	galak, linux, kgene, sbkim73, lgirdwood, broonie, perex, tiwai,
	grant.likely, ideal.song, devicetree, linux-kernel,
	linux-arm-kernel, linux-samsung-soc

This patch-set adds basic sound support for the Trats2 boards.
It just support primary I2s and external speaker playback.

Changes in v4:
  - Move to clock out parent settings in exynos4412-trats2.dts
  - Remove unnecessary lines in Trats2 machine driver.
  - Change name of dai stream to more cleary.
  - Add MFD_WM8994 to select in machine driver kconfig.

Changes in v3:
  - Set clock out parent to XUSBXTI in pmu_system_controller DT node.

Changes in v2:
  - Remove unnecessary lines in Trats2 machine driver.
  - move clock enable/disable to .startup / .shutdown.
  - Fix code style issues.
  - Remove mclk DT property in Trats2 sound and add MCLK1 property in WM1811 node.
    (MCLK1 is optional property in WM8994 node - refer: Document/devicetree/bindings/sound/wm8994.txt)
  - Use mclk that defined in WM1811 DT node.
  - Add "samsung,audio-codec" property to required properties.

Inha Song (3):
  ASoC: samsung: Add machine driver for Trats2
  ASoC: samsung: Document Trats2 audio subsystem bindings
  ARM: dts: Add sound nodes for exynos4412-trats2

 .../bindings/sound/samsung,trats2-wm1811.txt       |  25 +++
 arch/arm/boot/dts/exynos4412-trats2.dts            |  42 ++++
 sound/soc/samsung/Kconfig                          |   9 +
 sound/soc/samsung/Makefile                         |   2 +
 sound/soc/samsung/trats2_wm1811.c                  | 211 +++++++++++++++++++++
 5 files changed, 289 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt
 create mode 100644 sound/soc/samsung/trats2_wm1811.c

-- 
2.0.0.390.gcb682f8


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

* [alsa-devel] [PATCH v4 0/3] Sound support for Exynos4412 Trats2 board
@ 2015-01-23  5:03 ` Inha Song
  0 siblings, 0 replies; 29+ messages in thread
From: Inha Song @ 2015-01-23  5:03 UTC (permalink / raw)
  To: linux-arm-kernel

This patch-set adds basic sound support for the Trats2 boards.
It just support primary I2s and external speaker playback.

Changes in v4:
  - Move to clock out parent settings in exynos4412-trats2.dts
  - Remove unnecessary lines in Trats2 machine driver.
  - Change name of dai stream to more cleary.
  - Add MFD_WM8994 to select in machine driver kconfig.

Changes in v3:
  - Set clock out parent to XUSBXTI in pmu_system_controller DT node.

Changes in v2:
  - Remove unnecessary lines in Trats2 machine driver.
  - move clock enable/disable to .startup / .shutdown.
  - Fix code style issues.
  - Remove mclk DT property in Trats2 sound and add MCLK1 property in WM1811 node.
    (MCLK1 is optional property in WM8994 node - refer: Document/devicetree/bindings/sound/wm8994.txt)
  - Use mclk that defined in WM1811 DT node.
  - Add "samsung,audio-codec" property to required properties.

Inha Song (3):
  ASoC: samsung: Add machine driver for Trats2
  ASoC: samsung: Document Trats2 audio subsystem bindings
  ARM: dts: Add sound nodes for exynos4412-trats2

 .../bindings/sound/samsung,trats2-wm1811.txt       |  25 +++
 arch/arm/boot/dts/exynos4412-trats2.dts            |  42 ++++
 sound/soc/samsung/Kconfig                          |   9 +
 sound/soc/samsung/Makefile                         |   2 +
 sound/soc/samsung/trats2_wm1811.c                  | 211 +++++++++++++++++++++
 5 files changed, 289 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt
 create mode 100644 sound/soc/samsung/trats2_wm1811.c

-- 
2.0.0.390.gcb682f8

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

* [alsa-devel] [PATCH v4 1/3] ASoC: samsung: Add machine driver for Trats2
  2015-01-23  5:03 ` Inha Song
@ 2015-01-23  5:03   ` Inha Song
  -1 siblings, 0 replies; 29+ messages in thread
From: Inha Song @ 2015-01-23  5:03 UTC (permalink / raw)
  To: alsa-devel
  Cc: robh+dt, pawel.moll, mark.rutland, s.nawrocki, ijc+devicetree,
	galak, linux, kgene, sbkim73, lgirdwood, broonie, perex, tiwai,
	grant.likely, ideal.song, devicetree, linux-kernel,
	linux-arm-kernel, linux-samsung-soc

This patch add the sound machine driver for Trats2 board.
The codec operate in master mode.

Signed-off-by: Inha Song <ideal.song@samsung.com>
---
 sound/soc/samsung/Kconfig         |   9 ++
 sound/soc/samsung/Makefile        |   2 +
 sound/soc/samsung/trats2_wm1811.c | 211 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 222 insertions(+)
 create mode 100644 sound/soc/samsung/trats2_wm1811.c

diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig
index fc67f97..df6734d 100644
--- a/sound/soc/samsung/Kconfig
+++ b/sound/soc/samsung/Kconfig
@@ -245,3 +245,12 @@ config SND_SOC_ARNDALE_RT5631_ALC5631
         depends on SND_SOC_SAMSUNG
         select SND_SAMSUNG_I2S
         select SND_SOC_RT5631
+
+config SND_SOC_SAMSUNG_TRATS2_WM1811
+	tristate "SoC I2S Audio support for WM1811 on Tizen Trats2 board"
+	depends on SND_SOC_SAMSUNG
+	select SND_SAMSUNG_I2S
+	select MFD_WM8994
+	select SND_SOC_WM8994
+	help
+	  Say Y if you want to add support for SoC audio on the Tizen Trats2 board.
diff --git a/sound/soc/samsung/Makefile b/sound/soc/samsung/Makefile
index 31e3dba..e2b7b1b 100644
--- a/sound/soc/samsung/Makefile
+++ b/sound/soc/samsung/Makefile
@@ -46,6 +46,7 @@ snd-soc-littlemill-objs := littlemill.o
 snd-soc-bells-objs := bells.o
 snd-soc-odroidx2-max98090-objs := odroidx2_max98090.o
 snd-soc-arndale-rt5631-objs := arndale_rt5631.o
+snd-soc-trats2-wm1811-objs := trats2_wm1811.o
 
 obj-$(CONFIG_SND_SOC_SAMSUNG_JIVE_WM8750) += snd-soc-jive-wm8750.o
 obj-$(CONFIG_SND_SOC_SAMSUNG_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o
@@ -73,3 +74,4 @@ obj-$(CONFIG_SND_SOC_LITTLEMILL) += snd-soc-littlemill.o
 obj-$(CONFIG_SND_SOC_BELLS) += snd-soc-bells.o
 obj-$(CONFIG_SND_SOC_ODROIDX2) += snd-soc-odroidx2-max98090.o
 obj-$(CONFIG_SND_SOC_ARNDALE_RT5631_ALC5631) += snd-soc-arndale-rt5631.o
+obj-$(CONFIG_SND_SOC_SAMSUNG_TRATS2_WM1811) += snd-soc-trats2-wm1811.o
diff --git a/sound/soc/samsung/trats2_wm1811.c b/sound/soc/samsung/trats2_wm1811.c
new file mode 100644
index 0000000..e87ea1f
--- /dev/null
+++ b/sound/soc/samsung/trats2_wm1811.c
@@ -0,0 +1,211 @@
+/*
+ * Copyright (C) 2015 Samsung Electronics Co., Ltd.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include <linux/of.h>
+#include <linux/module.h>
+#include <linux/clk.h>
+#include <sound/soc.h>
+#include <sound/pcm_params.h>
+#include "i2s.h"
+#include "../codecs/wm8994.h"
+
+struct trats2_machine_priv {
+	struct clk *clk_mclk;
+};
+
+static struct trats2_machine_priv trats2_wm1811_priv;
+
+static const struct snd_kcontrol_new trats2_controls[] = {
+	SOC_DAPM_PIN_SWITCH("SPK"),
+};
+
+static const struct snd_soc_dapm_widget trats2_dapm_widgets[] = {
+	SND_SOC_DAPM_SPK("SPK", NULL),
+};
+
+static int trats2_aif1_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 *codec_dai = rtd->codec_dai;
+	struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd->card);
+	unsigned int sysclk_rate;
+	unsigned int mclk_rate =
+			(unsigned int)clk_get_rate(priv->clk_mclk);
+	int ret;
+
+	/* SYSCLK must be greater than 4.096MHz */
+	if (params_rate(params) == 8000 || params_rate(params) == 11025)
+		sysclk_rate = params_rate(params) * 512;
+	else
+		sysclk_rate = params_rate(params) * 256;
+
+	/* Set the codec FLL1 */
+	ret = snd_soc_dai_set_pll(codec_dai, WM8994_FLL1, WM8994_FLL_SRC_MCLK1,
+				  mclk_rate, sysclk_rate);
+	if (ret < 0) {
+		dev_err(codec_dai->dev, "Failed to set FLL1: %d\n", ret);
+		return ret;
+	}
+
+	/* Set the codec SYSCLK */
+	ret = snd_soc_dai_set_sysclk(codec_dai, WM8994_SYSCLK_FLL1,
+				     sysclk_rate, SND_SOC_CLOCK_IN);
+	if (ret < 0) {
+		dev_err(codec_dai->dev, "Failed to set SYSCLK: %d\n", ret);
+		return ret;
+	}
+
+	return 0;
+}
+
+static int trats2_aif1_startup(struct snd_pcm_substream *substream)
+{
+	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd->card);
+	int ret;
+
+	ret = clk_prepare_enable(priv->clk_mclk);
+	if (ret) {
+		dev_err(rtd->card->dev, "Failed to enable mclk: %d\n", ret);
+		return ret;
+	}
+
+	return 0;
+}
+
+static void trats2_aif1_shutdown(struct snd_pcm_substream *substream)
+{
+	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd->card);
+
+	clk_disable_unprepare(priv->clk_mclk);
+}
+
+static const struct snd_soc_ops trats2_aif1_ops = {
+	.startup = trats2_aif1_startup,
+	.shutdown = trats2_aif1_shutdown,
+	.hw_params = trats2_aif1_hw_params,
+};
+
+static struct snd_soc_dai_link trats2_dai[] = {
+	{
+		.name		= "WM1811 AIF1",
+		.stream_name	= "HiFi Primary",
+		.codec_dai_name = "wm8994-aif1",
+		.codec_name	= "wm8994-codec",
+		.ops		= &trats2_aif1_ops,
+		.dai_fmt	= SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
+				  SND_SOC_DAIFMT_CBM_CFM,
+	},
+};
+
+static struct snd_soc_card trats2_card = {
+	.owner			= THIS_MODULE,
+
+	.dai_link		= trats2_dai,
+	.num_links		= ARRAY_SIZE(trats2_dai),
+
+	.controls		= trats2_controls,
+	.num_controls		= ARRAY_SIZE(trats2_controls),
+	.dapm_widgets		= trats2_dapm_widgets,
+	.num_dapm_widgets	= ARRAY_SIZE(trats2_dapm_widgets),
+
+	.drvdata		= &trats2_wm1811_priv,
+};
+
+static int trats2_audio_probe(struct platform_device *pdev)
+{
+	struct device_node *np = pdev->dev.of_node;
+	struct snd_soc_card *card = &trats2_card;
+	struct device_node *codec_node;
+	struct snd_soc_dai_link *dai_link = card->dai_link;
+	struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(card);
+	int ret;
+
+	card->dev = &pdev->dev;
+
+	ret = snd_soc_of_parse_card_name(card, "samsung,model");
+	if (ret) {
+		dev_err(&pdev->dev, "Card name is not provided\n");
+		return ret;
+	}
+
+	ret = snd_soc_of_parse_audio_routing(card, "samsung,audio-routing");
+	if (ret) {
+		dev_err(&pdev->dev, "Audio routing is not provided\n");
+		return ret;
+	}
+
+	dai_link->cpu_of_node = of_parse_phandle(np,
+						 "samsung,i2s-controller", 0);
+	if (dai_link->cpu_of_node == NULL) {
+		dev_err(&pdev->dev, "i2s-controller property parse error\n");
+		return -EINVAL;
+	}
+
+	dai_link->platform_of_node = dai_link->cpu_of_node;
+
+	codec_node = of_parse_phandle(np, "samsung,audio-codec", 0);
+	if (codec_node == NULL) {
+		dev_err(&pdev->dev, "audio-codec property parse error\n");
+		return -EINVAL;
+	}
+
+	priv->clk_mclk =  of_clk_get_by_name(codec_node, "MCLK1");
+	if (IS_ERR(priv->clk_mclk)) {
+		dev_err(&pdev->dev, "Failed to get mclk clock\n");
+		of_node_put(codec_node);
+		return PTR_ERR(priv->clk_mclk);
+	}
+	of_node_put(codec_node);
+
+	ret = devm_snd_soc_register_card(&pdev->dev, card);
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to register card: %d\n", ret);
+		goto clk_put;
+	}
+	return 0;
+
+clk_put:
+	clk_put(priv->clk_mclk);
+	return ret;
+}
+
+static int trats2_audio_remove(struct platform_device *pdev)
+{
+	struct snd_soc_card *card = platform_get_drvdata(pdev);
+	struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(card);
+
+	clk_put(priv->clk_mclk);
+
+	return 0;
+}
+
+static const struct of_device_id trats2_audio_of_match[] = {
+	{ .compatible	= "samsung,trats2-audio", },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, trats2_audio_of_match);
+
+static struct platform_driver trats2_audio_driver = {
+	.driver = {
+		.name		= "trats2-audio",
+		.pm		= &snd_soc_pm_ops,
+		.of_match_table	= trats2_audio_of_match,
+	},
+	.probe	= trats2_audio_probe,
+	.remove	= trats2_audio_remove,
+};
+
+module_platform_driver(trats2_audio_driver);
+
+MODULE_AUTHOR("Inha Song <ideal.song@samsung.com>");
+MODULE_DESCRIPTION("ALSA SoC Trats2 Audio Support");
+MODULE_LICENSE("GPL v2");
-- 
2.0.0.390.gcb682f8


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

* [alsa-devel] [PATCH v4 1/3] ASoC: samsung: Add machine driver for Trats2
@ 2015-01-23  5:03   ` Inha Song
  0 siblings, 0 replies; 29+ messages in thread
From: Inha Song @ 2015-01-23  5:03 UTC (permalink / raw)
  To: linux-arm-kernel

This patch add the sound machine driver for Trats2 board.
The codec operate in master mode.

Signed-off-by: Inha Song <ideal.song@samsung.com>
---
 sound/soc/samsung/Kconfig         |   9 ++
 sound/soc/samsung/Makefile        |   2 +
 sound/soc/samsung/trats2_wm1811.c | 211 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 222 insertions(+)
 create mode 100644 sound/soc/samsung/trats2_wm1811.c

diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig
index fc67f97..df6734d 100644
--- a/sound/soc/samsung/Kconfig
+++ b/sound/soc/samsung/Kconfig
@@ -245,3 +245,12 @@ config SND_SOC_ARNDALE_RT5631_ALC5631
         depends on SND_SOC_SAMSUNG
         select SND_SAMSUNG_I2S
         select SND_SOC_RT5631
+
+config SND_SOC_SAMSUNG_TRATS2_WM1811
+	tristate "SoC I2S Audio support for WM1811 on Tizen Trats2 board"
+	depends on SND_SOC_SAMSUNG
+	select SND_SAMSUNG_I2S
+	select MFD_WM8994
+	select SND_SOC_WM8994
+	help
+	  Say Y if you want to add support for SoC audio on the Tizen Trats2 board.
diff --git a/sound/soc/samsung/Makefile b/sound/soc/samsung/Makefile
index 31e3dba..e2b7b1b 100644
--- a/sound/soc/samsung/Makefile
+++ b/sound/soc/samsung/Makefile
@@ -46,6 +46,7 @@ snd-soc-littlemill-objs := littlemill.o
 snd-soc-bells-objs := bells.o
 snd-soc-odroidx2-max98090-objs := odroidx2_max98090.o
 snd-soc-arndale-rt5631-objs := arndale_rt5631.o
+snd-soc-trats2-wm1811-objs := trats2_wm1811.o
 
 obj-$(CONFIG_SND_SOC_SAMSUNG_JIVE_WM8750) += snd-soc-jive-wm8750.o
 obj-$(CONFIG_SND_SOC_SAMSUNG_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o
@@ -73,3 +74,4 @@ obj-$(CONFIG_SND_SOC_LITTLEMILL) += snd-soc-littlemill.o
 obj-$(CONFIG_SND_SOC_BELLS) += snd-soc-bells.o
 obj-$(CONFIG_SND_SOC_ODROIDX2) += snd-soc-odroidx2-max98090.o
 obj-$(CONFIG_SND_SOC_ARNDALE_RT5631_ALC5631) += snd-soc-arndale-rt5631.o
+obj-$(CONFIG_SND_SOC_SAMSUNG_TRATS2_WM1811) += snd-soc-trats2-wm1811.o
diff --git a/sound/soc/samsung/trats2_wm1811.c b/sound/soc/samsung/trats2_wm1811.c
new file mode 100644
index 0000000..e87ea1f
--- /dev/null
+++ b/sound/soc/samsung/trats2_wm1811.c
@@ -0,0 +1,211 @@
+/*
+ * Copyright (C) 2015 Samsung Electronics Co., Ltd.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include <linux/of.h>
+#include <linux/module.h>
+#include <linux/clk.h>
+#include <sound/soc.h>
+#include <sound/pcm_params.h>
+#include "i2s.h"
+#include "../codecs/wm8994.h"
+
+struct trats2_machine_priv {
+	struct clk *clk_mclk;
+};
+
+static struct trats2_machine_priv trats2_wm1811_priv;
+
+static const struct snd_kcontrol_new trats2_controls[] = {
+	SOC_DAPM_PIN_SWITCH("SPK"),
+};
+
+static const struct snd_soc_dapm_widget trats2_dapm_widgets[] = {
+	SND_SOC_DAPM_SPK("SPK", NULL),
+};
+
+static int trats2_aif1_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 *codec_dai = rtd->codec_dai;
+	struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd->card);
+	unsigned int sysclk_rate;
+	unsigned int mclk_rate =
+			(unsigned int)clk_get_rate(priv->clk_mclk);
+	int ret;
+
+	/* SYSCLK must be greater than 4.096MHz */
+	if (params_rate(params) == 8000 || params_rate(params) == 11025)
+		sysclk_rate = params_rate(params) * 512;
+	else
+		sysclk_rate = params_rate(params) * 256;
+
+	/* Set the codec FLL1 */
+	ret = snd_soc_dai_set_pll(codec_dai, WM8994_FLL1, WM8994_FLL_SRC_MCLK1,
+				  mclk_rate, sysclk_rate);
+	if (ret < 0) {
+		dev_err(codec_dai->dev, "Failed to set FLL1: %d\n", ret);
+		return ret;
+	}
+
+	/* Set the codec SYSCLK */
+	ret = snd_soc_dai_set_sysclk(codec_dai, WM8994_SYSCLK_FLL1,
+				     sysclk_rate, SND_SOC_CLOCK_IN);
+	if (ret < 0) {
+		dev_err(codec_dai->dev, "Failed to set SYSCLK: %d\n", ret);
+		return ret;
+	}
+
+	return 0;
+}
+
+static int trats2_aif1_startup(struct snd_pcm_substream *substream)
+{
+	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd->card);
+	int ret;
+
+	ret = clk_prepare_enable(priv->clk_mclk);
+	if (ret) {
+		dev_err(rtd->card->dev, "Failed to enable mclk: %d\n", ret);
+		return ret;
+	}
+
+	return 0;
+}
+
+static void trats2_aif1_shutdown(struct snd_pcm_substream *substream)
+{
+	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd->card);
+
+	clk_disable_unprepare(priv->clk_mclk);
+}
+
+static const struct snd_soc_ops trats2_aif1_ops = {
+	.startup = trats2_aif1_startup,
+	.shutdown = trats2_aif1_shutdown,
+	.hw_params = trats2_aif1_hw_params,
+};
+
+static struct snd_soc_dai_link trats2_dai[] = {
+	{
+		.name		= "WM1811 AIF1",
+		.stream_name	= "HiFi Primary",
+		.codec_dai_name = "wm8994-aif1",
+		.codec_name	= "wm8994-codec",
+		.ops		= &trats2_aif1_ops,
+		.dai_fmt	= SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
+				  SND_SOC_DAIFMT_CBM_CFM,
+	},
+};
+
+static struct snd_soc_card trats2_card = {
+	.owner			= THIS_MODULE,
+
+	.dai_link		= trats2_dai,
+	.num_links		= ARRAY_SIZE(trats2_dai),
+
+	.controls		= trats2_controls,
+	.num_controls		= ARRAY_SIZE(trats2_controls),
+	.dapm_widgets		= trats2_dapm_widgets,
+	.num_dapm_widgets	= ARRAY_SIZE(trats2_dapm_widgets),
+
+	.drvdata		= &trats2_wm1811_priv,
+};
+
+static int trats2_audio_probe(struct platform_device *pdev)
+{
+	struct device_node *np = pdev->dev.of_node;
+	struct snd_soc_card *card = &trats2_card;
+	struct device_node *codec_node;
+	struct snd_soc_dai_link *dai_link = card->dai_link;
+	struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(card);
+	int ret;
+
+	card->dev = &pdev->dev;
+
+	ret = snd_soc_of_parse_card_name(card, "samsung,model");
+	if (ret) {
+		dev_err(&pdev->dev, "Card name is not provided\n");
+		return ret;
+	}
+
+	ret = snd_soc_of_parse_audio_routing(card, "samsung,audio-routing");
+	if (ret) {
+		dev_err(&pdev->dev, "Audio routing is not provided\n");
+		return ret;
+	}
+
+	dai_link->cpu_of_node = of_parse_phandle(np,
+						 "samsung,i2s-controller", 0);
+	if (dai_link->cpu_of_node == NULL) {
+		dev_err(&pdev->dev, "i2s-controller property parse error\n");
+		return -EINVAL;
+	}
+
+	dai_link->platform_of_node = dai_link->cpu_of_node;
+
+	codec_node = of_parse_phandle(np, "samsung,audio-codec", 0);
+	if (codec_node == NULL) {
+		dev_err(&pdev->dev, "audio-codec property parse error\n");
+		return -EINVAL;
+	}
+
+	priv->clk_mclk =  of_clk_get_by_name(codec_node, "MCLK1");
+	if (IS_ERR(priv->clk_mclk)) {
+		dev_err(&pdev->dev, "Failed to get mclk clock\n");
+		of_node_put(codec_node);
+		return PTR_ERR(priv->clk_mclk);
+	}
+	of_node_put(codec_node);
+
+	ret = devm_snd_soc_register_card(&pdev->dev, card);
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to register card: %d\n", ret);
+		goto clk_put;
+	}
+	return 0;
+
+clk_put:
+	clk_put(priv->clk_mclk);
+	return ret;
+}
+
+static int trats2_audio_remove(struct platform_device *pdev)
+{
+	struct snd_soc_card *card = platform_get_drvdata(pdev);
+	struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(card);
+
+	clk_put(priv->clk_mclk);
+
+	return 0;
+}
+
+static const struct of_device_id trats2_audio_of_match[] = {
+	{ .compatible	= "samsung,trats2-audio", },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, trats2_audio_of_match);
+
+static struct platform_driver trats2_audio_driver = {
+	.driver = {
+		.name		= "trats2-audio",
+		.pm		= &snd_soc_pm_ops,
+		.of_match_table	= trats2_audio_of_match,
+	},
+	.probe	= trats2_audio_probe,
+	.remove	= trats2_audio_remove,
+};
+
+module_platform_driver(trats2_audio_driver);
+
+MODULE_AUTHOR("Inha Song <ideal.song@samsung.com>");
+MODULE_DESCRIPTION("ALSA SoC Trats2 Audio Support");
+MODULE_LICENSE("GPL v2");
-- 
2.0.0.390.gcb682f8

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

* [alsa-devel] [PATCH v4 2/3] ASoC: samsung: Document Trats2 audio subsystem bindings
  2015-01-23  5:03 ` Inha Song
@ 2015-01-23  5:03   ` Inha Song
  -1 siblings, 0 replies; 29+ messages in thread
From: Inha Song @ 2015-01-23  5:03 UTC (permalink / raw)
  To: alsa-devel
  Cc: robh+dt, pawel.moll, mark.rutland, s.nawrocki, ijc+devicetree,
	galak, linux, kgene, sbkim73, lgirdwood, broonie, perex, tiwai,
	grant.likely, ideal.song, devicetree, linux-kernel,
	linux-arm-kernel, linux-samsung-soc

This patch add Trats2 audio subsystem bindings document.

Signed-off-by: Inha Song <ideal.song@samsung.com>
---
 .../bindings/sound/samsung,trats2-wm1811.txt       | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt

diff --git a/Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt b/Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt
new file mode 100644
index 0000000..319ff07
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt
@@ -0,0 +1,25 @@
+Samsung Exynos Trats2 audio with WM1811 codec
+
+Required properties:
+
+ - compatible : Must be "samsung,trats2-audio"
+ - samsung,i2s-controller : The phandle of the I2S controller
+ - samsung,model : The user visible name of this sound
+ - samsung,audio-codec : The phandle of the WM1811 audio codec
+ - samsung,audio-routing : A list of the connections between audio
+   components. each entry is a pair of strings, the first being the
+   connection's sink, the second being the connection's source
+
+Example:
+
+sound {
+	compatible = "samsung,trats2-audio";
+	samsung,i2s-controller = <&i2s0>;
+	samsung,model = "Trats2";
+	samsung,audio-codec = <&wm1811>;
+	samsung,audio-routing =
+			"SPK", "SPKOUTLN",
+			"SPK", "SPKOUTLP",
+			"SPK", "SPKOUTRN",
+			"SPK", "SPKOUTRP";
+};
-- 
2.0.0.390.gcb682f8


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

* [alsa-devel] [PATCH v4 2/3] ASoC: samsung: Document Trats2 audio subsystem bindings
@ 2015-01-23  5:03   ` Inha Song
  0 siblings, 0 replies; 29+ messages in thread
From: Inha Song @ 2015-01-23  5:03 UTC (permalink / raw)
  To: linux-arm-kernel

This patch add Trats2 audio subsystem bindings document.

Signed-off-by: Inha Song <ideal.song@samsung.com>
---
 .../bindings/sound/samsung,trats2-wm1811.txt       | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt

diff --git a/Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt b/Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt
new file mode 100644
index 0000000..319ff07
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/samsung,trats2-wm1811.txt
@@ -0,0 +1,25 @@
+Samsung Exynos Trats2 audio with WM1811 codec
+
+Required properties:
+
+ - compatible : Must be "samsung,trats2-audio"
+ - samsung,i2s-controller : The phandle of the I2S controller
+ - samsung,model : The user visible name of this sound
+ - samsung,audio-codec : The phandle of the WM1811 audio codec
+ - samsung,audio-routing : A list of the connections between audio
+   components. each entry is a pair of strings, the first being the
+   connection's sink, the second being the connection's source
+
+Example:
+
+sound {
+	compatible = "samsung,trats2-audio";
+	samsung,i2s-controller = <&i2s0>;
+	samsung,model = "Trats2";
+	samsung,audio-codec = <&wm1811>;
+	samsung,audio-routing =
+			"SPK", "SPKOUTLN",
+			"SPK", "SPKOUTLP",
+			"SPK", "SPKOUTRN",
+			"SPK", "SPKOUTRP";
+};
-- 
2.0.0.390.gcb682f8

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

* [alsa-devel] [PATCH v4 3/3] ARM: dts: Add sound nodes for exynos4412-trats2
@ 2015-01-23  5:03   ` Inha Song
  0 siblings, 0 replies; 29+ messages in thread
From: Inha Song @ 2015-01-23  5:03 UTC (permalink / raw)
  To: alsa-devel
  Cc: robh+dt, pawel.moll, mark.rutland, s.nawrocki, ijc+devicetree,
	galak, linux, kgene, sbkim73, lgirdwood, broonie, perex, tiwai,
	grant.likely, ideal.song, devicetree, linux-kernel,
	linux-arm-kernel, linux-samsung-soc

This patch add WM1811 audio codec, I2S interface and the sound
machine nodes to enable audio on exynos4412-trats2 board.

Signed-off-by: Inha Song <ideal.song@samsung.com>
---
 arch/arm/boot/dts/exynos4412-trats2.dts | 42 +++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
index 29231b4..6205b98 100644
--- a/arch/arm/boot/dts/exynos4412-trats2.dts
+++ b/arch/arm/boot/dts/exynos4412-trats2.dts
@@ -203,6 +203,25 @@
 		};
 	};
 
+	i2c@138A0000 {
+		samsung,i2c-sda-delay = <100>;
+		samsung,i2c-slave-addr = <0x10>;
+		samsung,i2c-max-bus-freq = <100000>;
+		pinctrl-0 = <&i2c4_bus>;
+		pinctrl-names = "default";
+		status = "okay";
+
+		wm1811: wm1811@1a {
+			compatible = "wlf,wm1811";
+			reg = <0x1a>;
+			clocks = <&pmu_system_controller 0>;
+			clock-names = "MCLK1";
+			DCVDD-supply = <&ldo3_reg>;
+			DBVDD1-supply = <&ldo3_reg>;
+			wlf,ldo1ena = <&gpj0 4 0>;
+		};
+	};
+
 	i2c@138D0000 {
 		samsung,i2c-sda-delay = <100>;
 		samsung,i2c-slave-addr = <0x10>;
@@ -838,6 +857,24 @@
 		};
 	};
 
+	i2s0: i2s@03830000 {
+		pinctrl-0 = <&i2s0_bus>;
+		pinctrl-names = "default";
+		status = "okay";
+	};
+
+	sound {
+		compatible = "samsung,trats2-audio";
+		samsung,i2s-controller = <&i2s0>;
+		samsung,model = "Trats2";
+		samsung,audio-codec = <&wm1811>;
+		samsung,audio-routing =
+			"SPK", "SPKOUTLN",
+			"SPK", "SPKOUTLP",
+			"SPK", "SPKOUTRN",
+			"SPK", "SPKOUTRP";
+	};
+
 	exynos-usbphy@125B0000 {
 		status = "okay";
 	};
@@ -865,6 +902,11 @@
 	};
 };
 
+&pmu_system_controller {
+	assigned-clocks = <&pmu_system_controller 0>;
+	assigned-clock-parents =  <&clock CLK_XUSBXTI>;
+};
+
 &pinctrl_0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&sleep0>;
-- 
2.0.0.390.gcb682f8


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

* [alsa-devel] [PATCH v4 3/3] ARM: dts: Add sound nodes for exynos4412-trats2
@ 2015-01-23  5:03   ` Inha Song
  0 siblings, 0 replies; 29+ messages in thread
From: Inha Song @ 2015-01-23  5:03 UTC (permalink / raw)
  To: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-lFZ/pmaqli7XmaaqVzeoHQ,
	kgene-DgEjT+Ai2ygdnm+yROfE0A, sbkim73-Sze3O3UU22JBDgjK7y7TUQ,
	lgirdwood-Re5JQEeQqe8AvxtiuMwx3w, broonie-DgEjT+Ai2ygdnm+yROfE0A,
	perex-/Fr2/VpizcU, tiwai-l3A5Bk7waGM,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	ideal.song-Sze3O3UU22JBDgjK7y7TUQ,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA

This patch add WM1811 audio codec, I2S interface and the sound
machine nodes to enable audio on exynos4412-trats2 board.

Signed-off-by: Inha Song <ideal.song-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
 arch/arm/boot/dts/exynos4412-trats2.dts | 42 +++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
index 29231b4..6205b98 100644
--- a/arch/arm/boot/dts/exynos4412-trats2.dts
+++ b/arch/arm/boot/dts/exynos4412-trats2.dts
@@ -203,6 +203,25 @@
 		};
 	};
 
+	i2c@138A0000 {
+		samsung,i2c-sda-delay = <100>;
+		samsung,i2c-slave-addr = <0x10>;
+		samsung,i2c-max-bus-freq = <100000>;
+		pinctrl-0 = <&i2c4_bus>;
+		pinctrl-names = "default";
+		status = "okay";
+
+		wm1811: wm1811@1a {
+			compatible = "wlf,wm1811";
+			reg = <0x1a>;
+			clocks = <&pmu_system_controller 0>;
+			clock-names = "MCLK1";
+			DCVDD-supply = <&ldo3_reg>;
+			DBVDD1-supply = <&ldo3_reg>;
+			wlf,ldo1ena = <&gpj0 4 0>;
+		};
+	};
+
 	i2c@138D0000 {
 		samsung,i2c-sda-delay = <100>;
 		samsung,i2c-slave-addr = <0x10>;
@@ -838,6 +857,24 @@
 		};
 	};
 
+	i2s0: i2s@03830000 {
+		pinctrl-0 = <&i2s0_bus>;
+		pinctrl-names = "default";
+		status = "okay";
+	};
+
+	sound {
+		compatible = "samsung,trats2-audio";
+		samsung,i2s-controller = <&i2s0>;
+		samsung,model = "Trats2";
+		samsung,audio-codec = <&wm1811>;
+		samsung,audio-routing =
+			"SPK", "SPKOUTLN",
+			"SPK", "SPKOUTLP",
+			"SPK", "SPKOUTRN",
+			"SPK", "SPKOUTRP";
+	};
+
 	exynos-usbphy@125B0000 {
 		status = "okay";
 	};
@@ -865,6 +902,11 @@
 	};
 };
 
+&pmu_system_controller {
+	assigned-clocks = <&pmu_system_controller 0>;
+	assigned-clock-parents =  <&clock CLK_XUSBXTI>;
+};
+
 &pinctrl_0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&sleep0>;
-- 
2.0.0.390.gcb682f8

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [alsa-devel] [PATCH v4 3/3] ARM: dts: Add sound nodes for exynos4412-trats2
@ 2015-01-23  5:03   ` Inha Song
  0 siblings, 0 replies; 29+ messages in thread
From: Inha Song @ 2015-01-23  5:03 UTC (permalink / raw)
  To: linux-arm-kernel

This patch add WM1811 audio codec, I2S interface and the sound
machine nodes to enable audio on exynos4412-trats2 board.

Signed-off-by: Inha Song <ideal.song@samsung.com>
---
 arch/arm/boot/dts/exynos4412-trats2.dts | 42 +++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
index 29231b4..6205b98 100644
--- a/arch/arm/boot/dts/exynos4412-trats2.dts
+++ b/arch/arm/boot/dts/exynos4412-trats2.dts
@@ -203,6 +203,25 @@
 		};
 	};
 
+	i2c at 138A0000 {
+		samsung,i2c-sda-delay = <100>;
+		samsung,i2c-slave-addr = <0x10>;
+		samsung,i2c-max-bus-freq = <100000>;
+		pinctrl-0 = <&i2c4_bus>;
+		pinctrl-names = "default";
+		status = "okay";
+
+		wm1811: wm1811 at 1a {
+			compatible = "wlf,wm1811";
+			reg = <0x1a>;
+			clocks = <&pmu_system_controller 0>;
+			clock-names = "MCLK1";
+			DCVDD-supply = <&ldo3_reg>;
+			DBVDD1-supply = <&ldo3_reg>;
+			wlf,ldo1ena = <&gpj0 4 0>;
+		};
+	};
+
 	i2c at 138D0000 {
 		samsung,i2c-sda-delay = <100>;
 		samsung,i2c-slave-addr = <0x10>;
@@ -838,6 +857,24 @@
 		};
 	};
 
+	i2s0: i2s at 03830000 {
+		pinctrl-0 = <&i2s0_bus>;
+		pinctrl-names = "default";
+		status = "okay";
+	};
+
+	sound {
+		compatible = "samsung,trats2-audio";
+		samsung,i2s-controller = <&i2s0>;
+		samsung,model = "Trats2";
+		samsung,audio-codec = <&wm1811>;
+		samsung,audio-routing =
+			"SPK", "SPKOUTLN",
+			"SPK", "SPKOUTLP",
+			"SPK", "SPKOUTRN",
+			"SPK", "SPKOUTRP";
+	};
+
 	exynos-usbphy at 125B0000 {
 		status = "okay";
 	};
@@ -865,6 +902,11 @@
 	};
 };
 
+&pmu_system_controller {
+	assigned-clocks = <&pmu_system_controller 0>;
+	assigned-clock-parents =  <&clock CLK_XUSBXTI>;
+};
+
 &pinctrl_0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&sleep0>;
-- 
2.0.0.390.gcb682f8

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

* Re: [alsa-devel] [PATCH v4 3/3] ARM: dts: Add sound nodes for exynos4412-trats2
  2015-01-23  5:03   ` Inha Song
  (?)
@ 2015-01-23  6:56     ` Inha Song
  -1 siblings, 0 replies; 29+ messages in thread
From: Inha Song @ 2015-01-23  6:56 UTC (permalink / raw)
  To: kgene
  Cc: Inha Song, alsa-devel, mark.rutland, devicetree,
	linux-samsung-soc, linux, pawel.moll, ijc+devicetree, sbkim73,
	linux-kernel, broonie, lgirdwood, tiwai, robh+dt, kgene,
	s.nawrocki, galak, grant.likely, linux-arm-kernel,
	최찬우

Hi Kukjin,

Sorry, I missed to adding in Cc.

Best Regards,
Inha Song.

On Fri, 23 Jan 2015 14:03:30 +0900
Inha Song <ideal.song@samsung.com> wrote:

> This patch add WM1811 audio codec, I2S interface and the sound
> machine nodes to enable audio on exynos4412-trats2 board.
> 
> Signed-off-by: Inha Song <ideal.song@samsung.com>
> ---
>  arch/arm/boot/dts/exynos4412-trats2.dts | 42 +++++++++++++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
> index 29231b4..6205b98 100644
> --- a/arch/arm/boot/dts/exynos4412-trats2.dts
> +++ b/arch/arm/boot/dts/exynos4412-trats2.dts
> @@ -203,6 +203,25 @@
>  		};
>  	};
>  
> +	i2c@138A0000 {
> +		samsung,i2c-sda-delay = <100>;
> +		samsung,i2c-slave-addr = <0x10>;
> +		samsung,i2c-max-bus-freq = <100000>;
> +		pinctrl-0 = <&i2c4_bus>;
> +		pinctrl-names = "default";
> +		status = "okay";
> +
> +		wm1811: wm1811@1a {
> +			compatible = "wlf,wm1811";
> +			reg = <0x1a>;
> +			clocks = <&pmu_system_controller 0>;
> +			clock-names = "MCLK1";
> +			DCVDD-supply = <&ldo3_reg>;
> +			DBVDD1-supply = <&ldo3_reg>;
> +			wlf,ldo1ena = <&gpj0 4 0>;
> +		};
> +	};
> +
>  	i2c@138D0000 {
>  		samsung,i2c-sda-delay = <100>;
>  		samsung,i2c-slave-addr = <0x10>;
> @@ -838,6 +857,24 @@
>  		};
>  	};
>  
> +	i2s0: i2s@03830000 {
> +		pinctrl-0 = <&i2s0_bus>;
> +		pinctrl-names = "default";
> +		status = "okay";
> +	};
> +
> +	sound {
> +		compatible = "samsung,trats2-audio";
> +		samsung,i2s-controller = <&i2s0>;
> +		samsung,model = "Trats2";
> +		samsung,audio-codec = <&wm1811>;
> +		samsung,audio-routing =
> +			"SPK", "SPKOUTLN",
> +			"SPK", "SPKOUTLP",
> +			"SPK", "SPKOUTRN",
> +			"SPK", "SPKOUTRP";
> +	};
> +
>  	exynos-usbphy@125B0000 {
>  		status = "okay";
>  	};
> @@ -865,6 +902,11 @@
>  	};
>  };
>  
> +&pmu_system_controller {
> +	assigned-clocks = <&pmu_system_controller 0>;
> +	assigned-clock-parents =  <&clock CLK_XUSBXTI>;
> +};
> +
>  &pinctrl_0 {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&sleep0>;
> -- 
> 2.0.0.390.gcb682f8
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [alsa-devel] [PATCH v4 3/3] ARM: dts: Add sound nodes for exynos4412-trats2
@ 2015-01-23  6:56     ` Inha Song
  0 siblings, 0 replies; 29+ messages in thread
From: Inha Song @ 2015-01-23  6:56 UTC (permalink / raw)
  Cc: Inha Song, alsa-devel, mark.rutland, devicetree,
	linux-samsung-soc, linux, pawel.moll, ijc+devicetree, sbkim73,
	linux-kernel, broonie, lgirdwood, tiwai, robh+dt, kgene,
	s.nawrocki, galak, grant.likely, linux-arm-kernel,
	최찬우

Hi Kukjin,

Sorry, I missed to adding in Cc.

Best Regards,
Inha Song.

On Fri, 23 Jan 2015 14:03:30 +0900
Inha Song <ideal.song@samsung.com> wrote:

> This patch add WM1811 audio codec, I2S interface and the sound
> machine nodes to enable audio on exynos4412-trats2 board.
> 
> Signed-off-by: Inha Song <ideal.song@samsung.com>
> ---
>  arch/arm/boot/dts/exynos4412-trats2.dts | 42 +++++++++++++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
> index 29231b4..6205b98 100644
> --- a/arch/arm/boot/dts/exynos4412-trats2.dts
> +++ b/arch/arm/boot/dts/exynos4412-trats2.dts
> @@ -203,6 +203,25 @@
>  		};
>  	};
>  
> +	i2c@138A0000 {
> +		samsung,i2c-sda-delay = <100>;
> +		samsung,i2c-slave-addr = <0x10>;
> +		samsung,i2c-max-bus-freq = <100000>;
> +		pinctrl-0 = <&i2c4_bus>;
> +		pinctrl-names = "default";
> +		status = "okay";
> +
> +		wm1811: wm1811@1a {
> +			compatible = "wlf,wm1811";
> +			reg = <0x1a>;
> +			clocks = <&pmu_system_controller 0>;
> +			clock-names = "MCLK1";
> +			DCVDD-supply = <&ldo3_reg>;
> +			DBVDD1-supply = <&ldo3_reg>;
> +			wlf,ldo1ena = <&gpj0 4 0>;
> +		};
> +	};
> +
>  	i2c@138D0000 {
>  		samsung,i2c-sda-delay = <100>;
>  		samsung,i2c-slave-addr = <0x10>;
> @@ -838,6 +857,24 @@
>  		};
>  	};
>  
> +	i2s0: i2s@03830000 {
> +		pinctrl-0 = <&i2s0_bus>;
> +		pinctrl-names = "default";
> +		status = "okay";
> +	};
> +
> +	sound {
> +		compatible = "samsung,trats2-audio";
> +		samsung,i2s-controller = <&i2s0>;
> +		samsung,model = "Trats2";
> +		samsung,audio-codec = <&wm1811>;
> +		samsung,audio-routing =
> +			"SPK", "SPKOUTLN",
> +			"SPK", "SPKOUTLP",
> +			"SPK", "SPKOUTRN",
> +			"SPK", "SPKOUTRP";
> +	};
> +
>  	exynos-usbphy@125B0000 {
>  		status = "okay";
>  	};
> @@ -865,6 +902,11 @@
>  	};
>  };
>  
> +&pmu_system_controller {
> +	assigned-clocks = <&pmu_system_controller 0>;
> +	assigned-clock-parents =  <&clock CLK_XUSBXTI>;
> +};
> +
>  &pinctrl_0 {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&sleep0>;
> -- 
> 2.0.0.390.gcb682f8
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* [alsa-devel] [PATCH v4 3/3] ARM: dts: Add sound nodes for exynos4412-trats2
@ 2015-01-23  6:56     ` Inha Song
  0 siblings, 0 replies; 29+ messages in thread
From: Inha Song @ 2015-01-23  6:56 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Kukjin,

Sorry, I missed to adding in Cc.

Best Regards,
Inha Song.

On Fri, 23 Jan 2015 14:03:30 +0900
Inha Song <ideal.song@samsung.com> wrote:

> This patch add WM1811 audio codec, I2S interface and the sound
> machine nodes to enable audio on exynos4412-trats2 board.
> 
> Signed-off-by: Inha Song <ideal.song@samsung.com>
> ---
>  arch/arm/boot/dts/exynos4412-trats2.dts | 42 +++++++++++++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
> index 29231b4..6205b98 100644
> --- a/arch/arm/boot/dts/exynos4412-trats2.dts
> +++ b/arch/arm/boot/dts/exynos4412-trats2.dts
> @@ -203,6 +203,25 @@
>  		};
>  	};
>  
> +	i2c at 138A0000 {
> +		samsung,i2c-sda-delay = <100>;
> +		samsung,i2c-slave-addr = <0x10>;
> +		samsung,i2c-max-bus-freq = <100000>;
> +		pinctrl-0 = <&i2c4_bus>;
> +		pinctrl-names = "default";
> +		status = "okay";
> +
> +		wm1811: wm1811 at 1a {
> +			compatible = "wlf,wm1811";
> +			reg = <0x1a>;
> +			clocks = <&pmu_system_controller 0>;
> +			clock-names = "MCLK1";
> +			DCVDD-supply = <&ldo3_reg>;
> +			DBVDD1-supply = <&ldo3_reg>;
> +			wlf,ldo1ena = <&gpj0 4 0>;
> +		};
> +	};
> +
>  	i2c at 138D0000 {
>  		samsung,i2c-sda-delay = <100>;
>  		samsung,i2c-slave-addr = <0x10>;
> @@ -838,6 +857,24 @@
>  		};
>  	};
>  
> +	i2s0: i2s at 03830000 {
> +		pinctrl-0 = <&i2s0_bus>;
> +		pinctrl-names = "default";
> +		status = "okay";
> +	};
> +
> +	sound {
> +		compatible = "samsung,trats2-audio";
> +		samsung,i2s-controller = <&i2s0>;
> +		samsung,model = "Trats2";
> +		samsung,audio-codec = <&wm1811>;
> +		samsung,audio-routing =
> +			"SPK", "SPKOUTLN",
> +			"SPK", "SPKOUTLP",
> +			"SPK", "SPKOUTRN",
> +			"SPK", "SPKOUTRP";
> +	};
> +
>  	exynos-usbphy at 125B0000 {
>  		status = "okay";
>  	};
> @@ -865,6 +902,11 @@
>  	};
>  };
>  
> +&pmu_system_controller {
> +	assigned-clocks = <&pmu_system_controller 0>;
> +	assigned-clock-parents =  <&clock CLK_XUSBXTI>;
> +};
> +
>  &pinctrl_0 {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&sleep0>;
> -- 
> 2.0.0.390.gcb682f8
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [alsa-devel] [PATCH v4 3/3] ARM: dts: Add sound nodes for exynos4412-trats2
  2015-01-23  5:03   ` Inha Song
@ 2015-01-23 14:10     ` Sylwester Nawrocki
  -1 siblings, 0 replies; 29+ messages in thread
From: Sylwester Nawrocki @ 2015-01-23 14:10 UTC (permalink / raw)
  To: Inha Song, alsa-devel
  Cc: linux, kgene, lgirdwood, broonie, devicetree, linux-kernel,
	linux-arm-kernel, linux-samsung-soc

On 23/01/15 06:03, Inha Song wrote:
> This patch add WM1811 audio codec, I2S interface and the sound
> machine nodes to enable audio on exynos4412-trats2 board.
> 
> Signed-off-by: Inha Song <ideal.song@samsung.com>

Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>


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

* [alsa-devel] [PATCH v4 3/3] ARM: dts: Add sound nodes for exynos4412-trats2
@ 2015-01-23 14:10     ` Sylwester Nawrocki
  0 siblings, 0 replies; 29+ messages in thread
From: Sylwester Nawrocki @ 2015-01-23 14:10 UTC (permalink / raw)
  To: linux-arm-kernel

On 23/01/15 06:03, Inha Song wrote:
> This patch add WM1811 audio codec, I2S interface and the sound
> machine nodes to enable audio on exynos4412-trats2 board.
> 
> Signed-off-by: Inha Song <ideal.song@samsung.com>

Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

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

* Re: [alsa-devel] [PATCH v4 2/3] ASoC: samsung: Document Trats2 audio subsystem bindings
  2015-01-23  5:03   ` Inha Song
@ 2015-01-23 14:13     ` Sylwester Nawrocki
  -1 siblings, 0 replies; 29+ messages in thread
From: Sylwester Nawrocki @ 2015-01-23 14:13 UTC (permalink / raw)
  To: Inha Song, alsa-devel
  Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak, linux,
	kgene, sbkim73, lgirdwood, broonie, perex, tiwai, grant.likely,
	devicetree, linux-kernel, linux-arm-kernel, linux-samsung-soc

On 23/01/15 06:03, Inha Song wrote:
> This patch add Trats2 audio subsystem bindings document.
> 
> Signed-off-by: Inha Song <ideal.song@samsung.com>

Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>


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

* [alsa-devel] [PATCH v4 2/3] ASoC: samsung: Document Trats2 audio subsystem bindings
@ 2015-01-23 14:13     ` Sylwester Nawrocki
  0 siblings, 0 replies; 29+ messages in thread
From: Sylwester Nawrocki @ 2015-01-23 14:13 UTC (permalink / raw)
  To: linux-arm-kernel

On 23/01/15 06:03, Inha Song wrote:
> This patch add Trats2 audio subsystem bindings document.
> 
> Signed-off-by: Inha Song <ideal.song@samsung.com>

Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

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

* Re: [alsa-devel] [PATCH v4 1/3] ASoC: samsung: Add machine driver for Trats2
  2015-01-23  5:03   ` Inha Song
@ 2015-01-27 17:09     ` Sylwester Nawrocki
  -1 siblings, 0 replies; 29+ messages in thread
From: Sylwester Nawrocki @ 2015-01-27 17:09 UTC (permalink / raw)
  To: Inha Song
  Cc: alsa-devel, robh+dt, pawel.moll, mark.rutland, ijc+devicetree,
	galak, linux, kgene, sbkim73, lgirdwood, broonie, perex, tiwai,
	grant.likely, devicetree, linux-kernel, linux-arm-kernel,
	linux-samsung-soc

On 23/01/15 06:03, Inha Song wrote:
> +static int trats2_aif1_startup(struct snd_pcm_substream *substream)
> +{
> +	struct snd_soc_pcm_runtime *rtd = substream->private_data;
> +	struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd->card);
> +	int ret;
> +
> +	ret = clk_prepare_enable(priv->clk_mclk);
> +	if (ret) {
> +		dev_err(rtd->card->dev, "Failed to enable mclk: %d\n", ret);
> +		return ret;
> +	}
> +
> +	return 0;
> +}
> +
> +static void trats2_aif1_shutdown(struct snd_pcm_substream *substream)
> +{
> +	struct snd_soc_pcm_runtime *rtd = substream->private_data;
> +	struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd->card);
> +
> +	clk_disable_unprepare(priv->clk_mclk);
> +}
> +
> +static const struct snd_soc_ops trats2_aif1_ops = {
> +	.startup = trats2_aif1_startup,
> +	.shutdown = trats2_aif1_shutdown,
> +	.hw_params = trats2_aif1_hw_params,
> +};

> +static int trats2_audio_probe(struct platform_device *pdev)
> +{

> +	priv->clk_mclk =  of_clk_get_by_name(codec_node, "MCLK1");
> +	if (IS_ERR(priv->clk_mclk)) {
> +		dev_err(&pdev->dev, "Failed to get mclk clock\n");
> +		of_node_put(codec_node);
> +		return PTR_ERR(priv->clk_mclk);
> +	}

Wouldn't it also work if we added clock handling into the wm8994 codec
driver instead? Not sure if it is correct to retrieve the codec's clock
in the machine driver like this. Or perhaps the MCLK1 (SoC CLKOUT) clock
should be added to the sound DT node and handled only by the machine
driver, together with the other (MCLK2) clock?

> +	of_node_put(codec_node);

--
Regards,
Sylwester

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

* [alsa-devel] [PATCH v4 1/3] ASoC: samsung: Add machine driver for Trats2
@ 2015-01-27 17:09     ` Sylwester Nawrocki
  0 siblings, 0 replies; 29+ messages in thread
From: Sylwester Nawrocki @ 2015-01-27 17:09 UTC (permalink / raw)
  To: linux-arm-kernel

On 23/01/15 06:03, Inha Song wrote:
> +static int trats2_aif1_startup(struct snd_pcm_substream *substream)
> +{
> +	struct snd_soc_pcm_runtime *rtd = substream->private_data;
> +	struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd->card);
> +	int ret;
> +
> +	ret = clk_prepare_enable(priv->clk_mclk);
> +	if (ret) {
> +		dev_err(rtd->card->dev, "Failed to enable mclk: %d\n", ret);
> +		return ret;
> +	}
> +
> +	return 0;
> +}
> +
> +static void trats2_aif1_shutdown(struct snd_pcm_substream *substream)
> +{
> +	struct snd_soc_pcm_runtime *rtd = substream->private_data;
> +	struct trats2_machine_priv *priv = snd_soc_card_get_drvdata(rtd->card);
> +
> +	clk_disable_unprepare(priv->clk_mclk);
> +}
> +
> +static const struct snd_soc_ops trats2_aif1_ops = {
> +	.startup = trats2_aif1_startup,
> +	.shutdown = trats2_aif1_shutdown,
> +	.hw_params = trats2_aif1_hw_params,
> +};

> +static int trats2_audio_probe(struct platform_device *pdev)
> +{

> +	priv->clk_mclk =  of_clk_get_by_name(codec_node, "MCLK1");
> +	if (IS_ERR(priv->clk_mclk)) {
> +		dev_err(&pdev->dev, "Failed to get mclk clock\n");
> +		of_node_put(codec_node);
> +		return PTR_ERR(priv->clk_mclk);
> +	}

Wouldn't it also work if we added clock handling into the wm8994 codec
driver instead? Not sure if it is correct to retrieve the codec's clock
in the machine driver like this. Or perhaps the MCLK1 (SoC CLKOUT) clock
should be added to the sound DT node and handled only by the machine
driver, together with the other (MCLK2) clock?

> +	of_node_put(codec_node);

--
Regards,
Sylwester

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

* Re: [alsa-devel] [PATCH v4 1/3] ASoC: samsung: Add machine driver for Trats2
  2015-01-27 17:09     ` Sylwester Nawrocki
  (?)
@ 2015-01-27 18:48       ` Mark Brown
  -1 siblings, 0 replies; 29+ messages in thread
From: Mark Brown @ 2015-01-27 18:48 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: Inha Song, alsa-devel, robh+dt, pawel.moll, mark.rutland,
	ijc+devicetree, galak, linux, kgene, sbkim73, lgirdwood, perex,
	tiwai, grant.likely, devicetree, linux-kernel, linux-arm-kernel,
	linux-samsung-soc

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

On Tue, Jan 27, 2015 at 06:09:39PM +0100, Sylwester Nawrocki wrote:
> On 23/01/15 06:03, Inha Song wrote:

> > +	priv->clk_mclk =  of_clk_get_by_name(codec_node, "MCLK1");
> > +	if (IS_ERR(priv->clk_mclk)) {
> > +		dev_err(&pdev->dev, "Failed to get mclk clock\n");
> > +		of_node_put(codec_node);
> > +		return PTR_ERR(priv->clk_mclk);
> > +	}

> Wouldn't it also work if we added clock handling into the wm8994 codec
> driver instead? Not sure if it is correct to retrieve the codec's clock
> in the machine driver like this. Or perhaps the MCLK1 (SoC CLKOUT) clock
> should be added to the sound DT node and handled only by the machine
> driver, together with the other (MCLK2) clock?

That's definitely where we should end up but there are practical issues
with that approach since it involves coordination with all the machine
drivers using the device.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH v4 1/3] ASoC: samsung: Add machine driver for Trats2
@ 2015-01-27 18:48       ` Mark Brown
  0 siblings, 0 replies; 29+ messages in thread
From: Mark Brown @ 2015-01-27 18:48 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: mark.rutland, devicetree, alsa-devel, linux-samsung-soc, linux,
	pawel.moll, ijc+devicetree, sbkim73, linux-kernel, lgirdwood,
	tiwai, robh+dt, kgene, galak, grant.likely, linux-arm-kernel,
	Inha Song


[-- Attachment #1.1: Type: text/plain, Size: 858 bytes --]

On Tue, Jan 27, 2015 at 06:09:39PM +0100, Sylwester Nawrocki wrote:
> On 23/01/15 06:03, Inha Song wrote:

> > +	priv->clk_mclk =  of_clk_get_by_name(codec_node, "MCLK1");
> > +	if (IS_ERR(priv->clk_mclk)) {
> > +		dev_err(&pdev->dev, "Failed to get mclk clock\n");
> > +		of_node_put(codec_node);
> > +		return PTR_ERR(priv->clk_mclk);
> > +	}

> Wouldn't it also work if we added clock handling into the wm8994 codec
> driver instead? Not sure if it is correct to retrieve the codec's clock
> in the machine driver like this. Or perhaps the MCLK1 (SoC CLKOUT) clock
> should be added to the sound DT node and handled only by the machine
> driver, together with the other (MCLK2) clock?

That's definitely where we should end up but there are practical issues
with that approach since it involves coordination with all the machine
drivers using the device.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* [alsa-devel] [PATCH v4 1/3] ASoC: samsung: Add machine driver for Trats2
@ 2015-01-27 18:48       ` Mark Brown
  0 siblings, 0 replies; 29+ messages in thread
From: Mark Brown @ 2015-01-27 18:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 27, 2015 at 06:09:39PM +0100, Sylwester Nawrocki wrote:
> On 23/01/15 06:03, Inha Song wrote:

> > +	priv->clk_mclk =  of_clk_get_by_name(codec_node, "MCLK1");
> > +	if (IS_ERR(priv->clk_mclk)) {
> > +		dev_err(&pdev->dev, "Failed to get mclk clock\n");
> > +		of_node_put(codec_node);
> > +		return PTR_ERR(priv->clk_mclk);
> > +	}

> Wouldn't it also work if we added clock handling into the wm8994 codec
> driver instead? Not sure if it is correct to retrieve the codec's clock
> in the machine driver like this. Or perhaps the MCLK1 (SoC CLKOUT) clock
> should be added to the sound DT node and handled only by the machine
> driver, together with the other (MCLK2) clock?

That's definitely where we should end up but there are practical issues
with that approach since it involves coordination with all the machine
drivers using the device.
-------------- 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/20150127/f8e115c4/attachment.sig>

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

* Re: [alsa-devel] [PATCH v4 2/3] ASoC: samsung: Document Trats2 audio subsystem bindings
  2015-01-23  5:03   ` Inha Song
  (?)
@ 2015-01-27 18:49     ` Mark Brown
  -1 siblings, 0 replies; 29+ messages in thread
From: Mark Brown @ 2015-01-27 18:49 UTC (permalink / raw)
  To: Inha Song
  Cc: alsa-devel, robh+dt, pawel.moll, mark.rutland, s.nawrocki,
	ijc+devicetree, galak, linux, kgene, sbkim73, lgirdwood, perex,
	tiwai, grant.likely, devicetree, linux-kernel, linux-arm-kernel,
	linux-samsung-soc

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

On Fri, Jan 23, 2015 at 02:03:29PM +0900, Inha Song wrote:

> + - samsung,audio-routing : A list of the connections between audio
> +   components. each entry is a pair of strings, the first being the
> +   connection's sink, the second being the connection's source

The list of valid components should be specified here - reference the
CODEC bindings for anything on the CODEC but things on the board need to
be enumerated.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH v4 2/3] ASoC: samsung: Document Trats2 audio subsystem bindings
@ 2015-01-27 18:49     ` Mark Brown
  0 siblings, 0 replies; 29+ messages in thread
From: Mark Brown @ 2015-01-27 18:49 UTC (permalink / raw)
  To: Inha Song
  Cc: mark.rutland, devicetree, alsa-devel, linux-samsung-soc, linux,
	pawel.moll, ijc+devicetree, sbkim73, linux-kernel, lgirdwood,
	tiwai, robh+dt, kgene, s.nawrocki, galak, grant.likely,
	linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 426 bytes --]

On Fri, Jan 23, 2015 at 02:03:29PM +0900, Inha Song wrote:

> + - samsung,audio-routing : A list of the connections between audio
> +   components. each entry is a pair of strings, the first being the
> +   connection's sink, the second being the connection's source

The list of valid components should be specified here - reference the
CODEC bindings for anything on the CODEC but things on the board need to
be enumerated.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* [alsa-devel] [PATCH v4 2/3] ASoC: samsung: Document Trats2 audio subsystem bindings
@ 2015-01-27 18:49     ` Mark Brown
  0 siblings, 0 replies; 29+ messages in thread
From: Mark Brown @ 2015-01-27 18:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 23, 2015 at 02:03:29PM +0900, Inha Song wrote:

> + - samsung,audio-routing : A list of the connections between audio
> +   components. each entry is a pair of strings, the first being the
> +   connection's sink, the second being the connection's source

The list of valid components should be specified here - reference the
CODEC bindings for anything on the CODEC but things on the board need to
be enumerated.
-------------- 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/20150127/862c6c22/attachment-0001.sig>

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

* Re: [alsa-devel] [PATCH v4 1/3] ASoC: samsung: Add machine driver for Trats2
  2015-01-23  5:03   ` Inha Song
  (?)
@ 2015-01-27 18:59     ` Mark Brown
  -1 siblings, 0 replies; 29+ messages in thread
From: Mark Brown @ 2015-01-27 18:59 UTC (permalink / raw)
  To: Inha Song
  Cc: alsa-devel, robh+dt, pawel.moll, mark.rutland, s.nawrocki,
	ijc+devicetree, galak, linux, kgene, sbkim73, lgirdwood, perex,
	tiwai, grant.likely, devicetree, linux-kernel, linux-arm-kernel,
	linux-samsung-soc

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

On Fri, Jan 23, 2015 at 02:03:28PM +0900, Inha Song wrote:
> This patch add the sound machine driver for Trats2 board.
> The codec operate in master mode.

This looks like (and mostly should be) a DTified copy of the littlemill
driver.  The major differences are the fact that this lacks jack
detection, the management of the clock and the fact that instead of
picking a fixed clock frequency this tries to adjust based on
hw_params().  Ideally we'd be able to merge these drivers so we're
keeping up with best practice.

The reason we pick a fixed frequency for littlemill is that the device
supports analogue bypass paths which would be broken otherwise which
will apply here also I imagine.

> +config SND_SOC_SAMSUNG_TRATS2_WM1811
> +	tristate "SoC I2S Audio support for WM1811 on Tizen Trats2 board"
> +	depends on SND_SOC_SAMSUNG
> +	select SND_SAMSUNG_I2S
> +	select MFD_WM8994

For things outside the audio subsystem it's more common to use a depends
instead of a select - the selects are there because the drivers only
work with a machine driver and if we go outside the subsystem then since
selects aren't recursive we end up breaking elsewhere.  For example here
we'll end up not selecting MFD_CORE.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH v4 1/3] ASoC: samsung: Add machine driver for Trats2
@ 2015-01-27 18:59     ` Mark Brown
  0 siblings, 0 replies; 29+ messages in thread
From: Mark Brown @ 2015-01-27 18:59 UTC (permalink / raw)
  To: Inha Song
  Cc: mark.rutland, devicetree, alsa-devel, linux-samsung-soc, linux,
	pawel.moll, ijc+devicetree, sbkim73, linux-kernel, lgirdwood,
	tiwai, robh+dt, kgene, s.nawrocki, galak, grant.likely,
	linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1211 bytes --]

On Fri, Jan 23, 2015 at 02:03:28PM +0900, Inha Song wrote:
> This patch add the sound machine driver for Trats2 board.
> The codec operate in master mode.

This looks like (and mostly should be) a DTified copy of the littlemill
driver.  The major differences are the fact that this lacks jack
detection, the management of the clock and the fact that instead of
picking a fixed clock frequency this tries to adjust based on
hw_params().  Ideally we'd be able to merge these drivers so we're
keeping up with best practice.

The reason we pick a fixed frequency for littlemill is that the device
supports analogue bypass paths which would be broken otherwise which
will apply here also I imagine.

> +config SND_SOC_SAMSUNG_TRATS2_WM1811
> +	tristate "SoC I2S Audio support for WM1811 on Tizen Trats2 board"
> +	depends on SND_SOC_SAMSUNG
> +	select SND_SAMSUNG_I2S
> +	select MFD_WM8994

For things outside the audio subsystem it's more common to use a depends
instead of a select - the selects are there because the drivers only
work with a machine driver and if we go outside the subsystem then since
selects aren't recursive we end up breaking elsewhere.  For example here
we'll end up not selecting MFD_CORE.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* [alsa-devel] [PATCH v4 1/3] ASoC: samsung: Add machine driver for Trats2
@ 2015-01-27 18:59     ` Mark Brown
  0 siblings, 0 replies; 29+ messages in thread
From: Mark Brown @ 2015-01-27 18:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 23, 2015 at 02:03:28PM +0900, Inha Song wrote:
> This patch add the sound machine driver for Trats2 board.
> The codec operate in master mode.

This looks like (and mostly should be) a DTified copy of the littlemill
driver.  The major differences are the fact that this lacks jack
detection, the management of the clock and the fact that instead of
picking a fixed clock frequency this tries to adjust based on
hw_params().  Ideally we'd be able to merge these drivers so we're
keeping up with best practice.

The reason we pick a fixed frequency for littlemill is that the device
supports analogue bypass paths which would be broken otherwise which
will apply here also I imagine.

> +config SND_SOC_SAMSUNG_TRATS2_WM1811
> +	tristate "SoC I2S Audio support for WM1811 on Tizen Trats2 board"
> +	depends on SND_SOC_SAMSUNG
> +	select SND_SAMSUNG_I2S
> +	select MFD_WM8994

For things outside the audio subsystem it's more common to use a depends
instead of a select - the selects are there because the drivers only
work with a machine driver and if we go outside the subsystem then since
selects aren't recursive we end up breaking elsewhere.  For example here
we'll end up not selecting MFD_CORE.
-------------- 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/20150127/c4a54074/attachment.sig>

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

* RE: [alsa-devel] [PATCH v4 3/3] ARM: dts: Add sound nodes for exynos4412-trats2
  2015-01-23 14:10     ` Sylwester Nawrocki
@ 2015-02-03  4:18       ` Kukjin Kim
  -1 siblings, 0 replies; 29+ messages in thread
From: Kukjin Kim @ 2015-02-03  4:18 UTC (permalink / raw)
  To: 'Sylwester Nawrocki', 'Inha Song', alsa-devel
  Cc: linux, kgene, lgirdwood, broonie, devicetree, linux-kernel,
	linux-arm-kernel, linux-samsung-soc

Sylwester Nawrocki wrote:
> 
> On 23/01/15 06:03, Inha Song wrote:
> > This patch add WM1811 audio codec, I2S interface and the sound
> > machine nodes to enable audio on exynos4412-trats2 board.
> >
> > Signed-off-by: Inha Song <ideal.song@samsung.com>
> 
> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> 
Applied, thanks.

- Kukjin


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

* [alsa-devel] [PATCH v4 3/3] ARM: dts: Add sound nodes for exynos4412-trats2
@ 2015-02-03  4:18       ` Kukjin Kim
  0 siblings, 0 replies; 29+ messages in thread
From: Kukjin Kim @ 2015-02-03  4:18 UTC (permalink / raw)
  To: linux-arm-kernel

Sylwester Nawrocki wrote:
> 
> On 23/01/15 06:03, Inha Song wrote:
> > This patch add WM1811 audio codec, I2S interface and the sound
> > machine nodes to enable audio on exynos4412-trats2 board.
> >
> > Signed-off-by: Inha Song <ideal.song@samsung.com>
> 
> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> 
Applied, thanks.

- Kukjin

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

end of thread, other threads:[~2015-02-03  4:18 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-23  5:03 [alsa-devel] [PATCH v4 0/3] Sound support for Exynos4412 Trats2 board Inha Song
2015-01-23  5:03 ` Inha Song
2015-01-23  5:03 ` [alsa-devel] [PATCH v4 1/3] ASoC: samsung: Add machine driver for Trats2 Inha Song
2015-01-23  5:03   ` Inha Song
2015-01-27 17:09   ` Sylwester Nawrocki
2015-01-27 17:09     ` Sylwester Nawrocki
2015-01-27 18:48     ` Mark Brown
2015-01-27 18:48       ` Mark Brown
2015-01-27 18:48       ` Mark Brown
2015-01-27 18:59   ` [alsa-devel] " Mark Brown
2015-01-27 18:59     ` Mark Brown
2015-01-27 18:59     ` Mark Brown
2015-01-23  5:03 ` [alsa-devel] [PATCH v4 2/3] ASoC: samsung: Document Trats2 audio subsystem bindings Inha Song
2015-01-23  5:03   ` Inha Song
2015-01-23 14:13   ` Sylwester Nawrocki
2015-01-23 14:13     ` Sylwester Nawrocki
2015-01-27 18:49   ` Mark Brown
2015-01-27 18:49     ` Mark Brown
2015-01-27 18:49     ` Mark Brown
2015-01-23  5:03 ` [alsa-devel] [PATCH v4 3/3] ARM: dts: Add sound nodes for exynos4412-trats2 Inha Song
2015-01-23  5:03   ` Inha Song
2015-01-23  5:03   ` Inha Song
2015-01-23  6:56   ` Inha Song
2015-01-23  6:56     ` Inha Song
2015-01-23  6:56     ` Inha Song
2015-01-23 14:10   ` Sylwester Nawrocki
2015-01-23 14:10     ` Sylwester Nawrocki
2015-02-03  4:18     ` Kukjin Kim
2015-02-03  4:18       ` Kukjin Kim

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.