All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESENT PATCH v7 0/7] ASoC: rockchip: Parse dai links from dts
@ 2017-08-24  4:52 ` Jeffy Chen
  0 siblings, 0 replies; 44+ messages in thread
From: Jeffy Chen @ 2017-08-24  4:52 UTC (permalink / raw)
  To: linux-kernel, dgreid, heiko
  Cc: briannorris, mka, dianders, Jeffy Chen, Jaroslav Kysela,
	alsa-devel, Will Deacon, linux-rockchip, Mark Brown, Klaus Goger,
	Takashi Iwai, devicetree, Liam Girdwood, Rob Herring,
	Mark Rutland, Caesar Wang, Catalin Marinas, linux-arm-kernel


Currently we are using a fixed list of dai links in the driver.
This serial of patches would let the driver parse dai links from
dts, so that we can make some of them optional for future boards.

Tested on my chromebook bob(with cros 4.4 kernel), it still works
after disabled rt5514 codecs in the dts.


Changes in v7:
Rebase on the newest for-next

Changes in v6:
Add dmic wakeup delay(not used for now).

Changes in v3:
Use compatible to match audio codecs
        -- Suggested-by Matthias Kaehlcke <mka@chromium.org>

Changes in v2:
Let rockchip,codec-names be a required property, because we plan to
add more supported codecs to the fixed dai link list in the driver.

Jeffy Chen (7):
  ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp
  arm64: dts: rockchip: Add rt5514 dsp for Gru
  arm64: dts: rockchip: Update rt5514 devices' compatible for Gru
  ASoC: rockchip: Parse dai links from dts
  ASoC: rockchip: Add support for DP codec
  ASoC: rockchip: Add support for DMIC codec
  dt-bindings: ASoC: rockchip: Update description of rockchip,codec

 .../bindings/sound/rockchip,rk3399-gru-sound.txt   |   2 +-
 arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi       |   7 +-
 sound/soc/rockchip/Kconfig                         |   2 +
 sound/soc/rockchip/rk3399_gru_sound.c              | 255 +++++++++++++++------
 4 files changed, 186 insertions(+), 80 deletions(-)

-- 
2.11.0

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

* [RESENT PATCH v7 0/7] ASoC: rockchip: Parse dai links from dts
@ 2017-08-24  4:52 ` Jeffy Chen
  0 siblings, 0 replies; 44+ messages in thread
From: Jeffy Chen @ 2017-08-24  4:52 UTC (permalink / raw)
  To: linux-kernel, dgreid, heiko
  Cc: Mark Rutland, devicetree, alsa-devel, briannorris, Liam Girdwood,
	Catalin Marinas, Mark Brown, Jeffy Chen, Will Deacon, dianders,
	Rob Herring, linux-rockchip, mka, Klaus Goger, Takashi Iwai,
	linux-arm-kernel, Caesar Wang


Currently we are using a fixed list of dai links in the driver.
This serial of patches would let the driver parse dai links from
dts, so that we can make some of them optional for future boards.

Tested on my chromebook bob(with cros 4.4 kernel), it still works
after disabled rt5514 codecs in the dts.


Changes in v7:
Rebase on the newest for-next

Changes in v6:
Add dmic wakeup delay(not used for now).

Changes in v3:
Use compatible to match audio codecs
        -- Suggested-by Matthias Kaehlcke <mka@chromium.org>

Changes in v2:
Let rockchip,codec-names be a required property, because we plan to
add more supported codecs to the fixed dai link list in the driver.

Jeffy Chen (7):
  ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp
  arm64: dts: rockchip: Add rt5514 dsp for Gru
  arm64: dts: rockchip: Update rt5514 devices' compatible for Gru
  ASoC: rockchip: Parse dai links from dts
  ASoC: rockchip: Add support for DP codec
  ASoC: rockchip: Add support for DMIC codec
  dt-bindings: ASoC: rockchip: Update description of rockchip,codec

 .../bindings/sound/rockchip,rk3399-gru-sound.txt   |   2 +-
 arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi       |   7 +-
 sound/soc/rockchip/Kconfig                         |   2 +
 sound/soc/rockchip/rk3399_gru_sound.c              | 255 +++++++++++++++------
 4 files changed, 186 insertions(+), 80 deletions(-)

-- 
2.11.0

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

* [RESENT PATCH v7 0/7] ASoC: rockchip: Parse dai links from dts
@ 2017-08-24  4:52 ` Jeffy Chen
  0 siblings, 0 replies; 44+ messages in thread
From: Jeffy Chen @ 2017-08-24  4:52 UTC (permalink / raw)
  To: linux-arm-kernel


Currently we are using a fixed list of dai links in the driver.
This serial of patches would let the driver parse dai links from
dts, so that we can make some of them optional for future boards.

Tested on my chromebook bob(with cros 4.4 kernel), it still works
after disabled rt5514 codecs in the dts.


Changes in v7:
Rebase on the newest for-next

Changes in v6:
Add dmic wakeup delay(not used for now).

Changes in v3:
Use compatible to match audio codecs
        -- Suggested-by Matthias Kaehlcke <mka@chromium.org>

Changes in v2:
Let rockchip,codec-names be a required property, because we plan to
add more supported codecs to the fixed dai link list in the driver.

Jeffy Chen (7):
  ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp
  arm64: dts: rockchip: Add rt5514 dsp for Gru
  arm64: dts: rockchip: Update rt5514 devices' compatible for Gru
  ASoC: rockchip: Parse dai links from dts
  ASoC: rockchip: Add support for DP codec
  ASoC: rockchip: Add support for DMIC codec
  dt-bindings: ASoC: rockchip: Update description of rockchip,codec

 .../bindings/sound/rockchip,rk3399-gru-sound.txt   |   2 +-
 arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi       |   7 +-
 sound/soc/rockchip/Kconfig                         |   2 +
 sound/soc/rockchip/rk3399_gru_sound.c              | 255 +++++++++++++++------
 4 files changed, 186 insertions(+), 80 deletions(-)

-- 
2.11.0

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

* [RESENT PATCH v7 1/7] ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp
  2017-08-24  4:52 ` Jeffy Chen
@ 2017-08-24  4:52   ` Jeffy Chen
  -1 siblings, 0 replies; 44+ messages in thread
From: Jeffy Chen @ 2017-08-24  4:52 UTC (permalink / raw)
  To: linux-kernel, dgreid, heiko
  Cc: briannorris, mka, dianders, Jeffy Chen, Jaroslav Kysela,
	alsa-devel, linux-rockchip, Mark Brown, Takashi Iwai,
	Liam Girdwood, linux-arm-kernel

Currently we are using codec name for rt5514 dsp dai link, use codec
of_node instead.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

Changes in v7:
Rebase on the newest for-next

Changes in v6: None
Changes in v3: None
Changes in v2: None

 sound/soc/rockchip/rk3399_gru_sound.c | 34 ++--------------------------------
 1 file changed, 2 insertions(+), 32 deletions(-)

diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index 566ccb39fb31..cd2fdba922f1 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -247,8 +247,6 @@ enum {
 	DAILINK_RT5514_DSP,
 };
 
-#define DAILINK_ENTITIES	(DAILINK_DA7219 + 1)
-
 static struct snd_soc_dai_link rockchip_dailinks[] = {
 	[DAILINK_MAX98357A] = {
 		.name = "MAX98357A",
@@ -282,8 +280,7 @@ static struct snd_soc_dai_link rockchip_dailinks[] = {
 	[DAILINK_RT5514_DSP] = {
 		.name = "RT5514 DSP",
 		.stream_name = "Wake on Voice",
-		.codec_name = "snd-soc-dummy",
-		.codec_dai_name = "snd-soc-dummy-dai",
+		.codec_dai_name = "rt5514-dsp-cpu-dai",
 	},
 };
 
@@ -300,17 +297,10 @@ static struct snd_soc_card rockchip_sound_card = {
 	.num_controls = ARRAY_SIZE(rockchip_controls),
 };
 
-static int rockchip_sound_match_stub(struct device *dev, void *data)
-{
-	return 1;
-}
-
 static int rockchip_sound_probe(struct platform_device *pdev)
 {
 	struct snd_soc_card *card = &rockchip_sound_card;
 	struct device_node *cpu_node;
-	struct device *dev;
-	struct device_driver *drv;
 	int i, ret;
 
 	cpu_node = of_parse_phandle(pdev->dev.of_node, "rockchip,cpu", 0);
@@ -319,7 +309,7 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	for (i = 0; i < DAILINK_ENTITIES; i++) {
+	for (i = 0; i < ARRAY_SIZE(rockchip_dailinks); i++) {
 		rockchip_dailinks[i].platform_of_node = cpu_node;
 		rockchip_dailinks[i].cpu_of_node = cpu_node;
 
@@ -332,22 +322,6 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 		}
 	}
 
-	/**
-	 * To acquire the spi driver of the rt5514 and set the dai-links names
-	 * for soc_bind_dai_link
-	 */
-	drv = driver_find("rt5514", &spi_bus_type);
-	if (!drv) {
-		dev_err(&pdev->dev, "Can not find the rt5514 driver at the spi bus\n");
-		return -EINVAL;
-	}
-
-	dev = driver_find_device(drv, NULL, NULL, rockchip_sound_match_stub);
-	if (!dev) {
-		dev_err(&pdev->dev, "Can not find the rt5514 device\n");
-		return -ENODEV;
-	}
-
 	/* Set DMIC wakeup delay */
 	ret = device_property_read_u32(&pdev->dev, "dmic-wakeup-delay-ms",
 					&dmic_wakeup_delay);
@@ -357,10 +331,6 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 			"no optional property 'dmic-wakeup-delay-ms' found, default: no delay\n");
 	}
 
-	rockchip_dailinks[DAILINK_RT5514_DSP].cpu_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
-	rockchip_dailinks[DAILINK_RT5514_DSP].cpu_dai_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
-	rockchip_dailinks[DAILINK_RT5514_DSP].platform_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
-
 	card->dev = &pdev->dev;
 
 	ret = devm_snd_soc_register_card(&pdev->dev, card);
-- 
2.11.0

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

* [RESENT PATCH v7 1/7] ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp
@ 2017-08-24  4:52   ` Jeffy Chen
  0 siblings, 0 replies; 44+ messages in thread
From: Jeffy Chen @ 2017-08-24  4:52 UTC (permalink / raw)
  To: linux-arm-kernel

Currently we are using codec name for rt5514 dsp dai link, use codec
of_node instead.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

Changes in v7:
Rebase on the newest for-next

Changes in v6: None
Changes in v3: None
Changes in v2: None

 sound/soc/rockchip/rk3399_gru_sound.c | 34 ++--------------------------------
 1 file changed, 2 insertions(+), 32 deletions(-)

diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index 566ccb39fb31..cd2fdba922f1 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -247,8 +247,6 @@ enum {
 	DAILINK_RT5514_DSP,
 };
 
-#define DAILINK_ENTITIES	(DAILINK_DA7219 + 1)
-
 static struct snd_soc_dai_link rockchip_dailinks[] = {
 	[DAILINK_MAX98357A] = {
 		.name = "MAX98357A",
@@ -282,8 +280,7 @@ static struct snd_soc_dai_link rockchip_dailinks[] = {
 	[DAILINK_RT5514_DSP] = {
 		.name = "RT5514 DSP",
 		.stream_name = "Wake on Voice",
-		.codec_name = "snd-soc-dummy",
-		.codec_dai_name = "snd-soc-dummy-dai",
+		.codec_dai_name = "rt5514-dsp-cpu-dai",
 	},
 };
 
@@ -300,17 +297,10 @@ static struct snd_soc_card rockchip_sound_card = {
 	.num_controls = ARRAY_SIZE(rockchip_controls),
 };
 
-static int rockchip_sound_match_stub(struct device *dev, void *data)
-{
-	return 1;
-}
-
 static int rockchip_sound_probe(struct platform_device *pdev)
 {
 	struct snd_soc_card *card = &rockchip_sound_card;
 	struct device_node *cpu_node;
-	struct device *dev;
-	struct device_driver *drv;
 	int i, ret;
 
 	cpu_node = of_parse_phandle(pdev->dev.of_node, "rockchip,cpu", 0);
@@ -319,7 +309,7 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	for (i = 0; i < DAILINK_ENTITIES; i++) {
+	for (i = 0; i < ARRAY_SIZE(rockchip_dailinks); i++) {
 		rockchip_dailinks[i].platform_of_node = cpu_node;
 		rockchip_dailinks[i].cpu_of_node = cpu_node;
 
@@ -332,22 +322,6 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 		}
 	}
 
-	/**
-	 * To acquire the spi driver of the rt5514 and set the dai-links names
-	 * for soc_bind_dai_link
-	 */
-	drv = driver_find("rt5514", &spi_bus_type);
-	if (!drv) {
-		dev_err(&pdev->dev, "Can not find the rt5514 driver at the spi bus\n");
-		return -EINVAL;
-	}
-
-	dev = driver_find_device(drv, NULL, NULL, rockchip_sound_match_stub);
-	if (!dev) {
-		dev_err(&pdev->dev, "Can not find the rt5514 device\n");
-		return -ENODEV;
-	}
-
 	/* Set DMIC wakeup delay */
 	ret = device_property_read_u32(&pdev->dev, "dmic-wakeup-delay-ms",
 					&dmic_wakeup_delay);
@@ -357,10 +331,6 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 			"no optional property 'dmic-wakeup-delay-ms' found, default: no delay\n");
 	}
 
-	rockchip_dailinks[DAILINK_RT5514_DSP].cpu_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
-	rockchip_dailinks[DAILINK_RT5514_DSP].cpu_dai_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
-	rockchip_dailinks[DAILINK_RT5514_DSP].platform_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
-
 	card->dev = &pdev->dev;
 
 	ret = devm_snd_soc_register_card(&pdev->dev, card);
-- 
2.11.0

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

* [RESENT PATCH v7 2/7] arm64: dts: rockchip: Add rt5514 dsp for Gru
  2017-08-24  4:52 ` Jeffy Chen
@ 2017-08-24  4:52   ` Jeffy Chen
  -1 siblings, 0 replies; 44+ messages in thread
From: Jeffy Chen @ 2017-08-24  4:52 UTC (permalink / raw)
  To: linux-kernel, dgreid, heiko
  Cc: briannorris, mka, dianders, Jeffy Chen, devicetree, Klaus Goger,
	linux-rockchip, Rob Herring, linux-arm-kernel, Will Deacon,
	Mark Rutland, Caesar Wang, Catalin Marinas

Add rt5514 dsp of_node to codec list for Gru boards.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

Changes in v7: None
Changes in v6: None
Changes in v3: None
Changes in v2: None

 arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
index 199a5118b20d..5772c52fbfd3 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
@@ -514,7 +514,8 @@
 	sound {
 		compatible = "rockchip,rk3399-gru-sound";
 		rockchip,cpu = <&i2s0 &i2s2>;
-		rockchip,codec = <&max98357a &headsetcodec &codec>;
+		rockchip,codec = <&max98357a &headsetcodec
+				  &codec &wacky_spi_audio>;
 	};
 };
 
-- 
2.11.0

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

* [RESENT PATCH v7 2/7] arm64: dts: rockchip: Add rt5514 dsp for Gru
@ 2017-08-24  4:52   ` Jeffy Chen
  0 siblings, 0 replies; 44+ messages in thread
From: Jeffy Chen @ 2017-08-24  4:52 UTC (permalink / raw)
  To: linux-arm-kernel

Add rt5514 dsp of_node to codec list for Gru boards.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

Changes in v7: None
Changes in v6: None
Changes in v3: None
Changes in v2: None

 arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
index 199a5118b20d..5772c52fbfd3 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
@@ -514,7 +514,8 @@
 	sound {
 		compatible = "rockchip,rk3399-gru-sound";
 		rockchip,cpu = <&i2s0 &i2s2>;
-		rockchip,codec = <&max98357a &headsetcodec &codec>;
+		rockchip,codec = <&max98357a &headsetcodec
+				  &codec &wacky_spi_audio>;
 	};
 };
 
-- 
2.11.0

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

* [RESENT PATCH v7 3/7] arm64: dts: rockchip: Update rt5514 devices' compatible for Gru
  2017-08-24  4:52 ` Jeffy Chen
@ 2017-08-24  4:52   ` Jeffy Chen
  -1 siblings, 0 replies; 44+ messages in thread
From: Jeffy Chen @ 2017-08-24  4:52 UTC (permalink / raw)
  To: linux-kernel, dgreid, heiko
  Cc: briannorris, mka, dianders, Jeffy Chen, devicetree, Klaus Goger,
	linux-rockchip, Rob Herring, linux-arm-kernel, Will Deacon,
	Mark Rutland, Caesar Wang, Catalin Marinas

Currently the rt5514 i2c driver and rt5514 spi driver are using the same
compatible string.

Add additional unused compatible strings to identify them for Gru
boards.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

Changes in v7: None
Changes in v6: None
Changes in v3: None
Changes in v2: None

 arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
index 5772c52fbfd3..50fb11ad9f17 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
@@ -611,7 +611,7 @@ ap_i2c_mic: &i2c1 {
 	i2c-scl-rising-time-ns = <300>;
 
 	headsetcodec: rt5514@57 {
-		compatible = "realtek,rt5514";
+		compatible = "realtek,rt5514", "realtek,rt5514-i2c";
 		reg = <0x57>;
 		realtek,dmic-init-delay-ms = <20>;
 	};
@@ -820,7 +820,7 @@ ap_i2c_audio: &i2c8 {
 	status = "okay";
 
 	wacky_spi_audio: spi2@0 {
-		compatible = "realtek,rt5514";
+		compatible = "realtek,rt5514", "realtek,rt5514-spi";
 		reg = <0>;
 		interrupt-parent = <&gpio1>;
 		interrupts = <13 IRQ_TYPE_LEVEL_HIGH>;
-- 
2.11.0

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

* [RESENT PATCH v7 3/7] arm64: dts: rockchip: Update rt5514 devices' compatible for Gru
@ 2017-08-24  4:52   ` Jeffy Chen
  0 siblings, 0 replies; 44+ messages in thread
From: Jeffy Chen @ 2017-08-24  4:52 UTC (permalink / raw)
  To: linux-arm-kernel

Currently the rt5514 i2c driver and rt5514 spi driver are using the same
compatible string.

Add additional unused compatible strings to identify them for Gru
boards.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

Changes in v7: None
Changes in v6: None
Changes in v3: None
Changes in v2: None

 arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
index 5772c52fbfd3..50fb11ad9f17 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
@@ -611,7 +611,7 @@ ap_i2c_mic: &i2c1 {
 	i2c-scl-rising-time-ns = <300>;
 
 	headsetcodec: rt5514 at 57 {
-		compatible = "realtek,rt5514";
+		compatible = "realtek,rt5514", "realtek,rt5514-i2c";
 		reg = <0x57>;
 		realtek,dmic-init-delay-ms = <20>;
 	};
@@ -820,7 +820,7 @@ ap_i2c_audio: &i2c8 {
 	status = "okay";
 
 	wacky_spi_audio: spi2 at 0 {
-		compatible = "realtek,rt5514";
+		compatible = "realtek,rt5514", "realtek,rt5514-spi";
 		reg = <0>;
 		interrupt-parent = <&gpio1>;
 		interrupts = <13 IRQ_TYPE_LEVEL_HIGH>;
-- 
2.11.0

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

* [RESENT PATCH v7 4/7] ASoC: rockchip: Parse dai links from dts
  2017-08-24  4:52 ` Jeffy Chen
@ 2017-08-24  4:52   ` Jeffy Chen
  -1 siblings, 0 replies; 44+ messages in thread
From: Jeffy Chen @ 2017-08-24  4:52 UTC (permalink / raw)
  To: linux-kernel, dgreid, heiko
  Cc: briannorris, mka, dianders, Jeffy Chen, Jaroslav Kysela,
	alsa-devel, linux-rockchip, Mark Brown, Takashi Iwai,
	Liam Girdwood, linux-arm-kernel

Refactor rockchip_sound_probe, parse dai links from dts instead of
hard coding them.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
---

Changes in v7: None
Changes in v6: None
Changes in v3:
Use compatible to match audio codecs
        -- Suggested-by Matthias Kaehlcke <mka@chromium.org>

Changes in v2:
Let rockchip,codec-names be a required property, because we plan to
add more supported codecs to the fixed dai link list in the driver.

 sound/soc/rockchip/rk3399_gru_sound.c | 140 ++++++++++++++++++++++------------
 1 file changed, 91 insertions(+), 49 deletions(-)

diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index cd2fdba922f1..347c34d0db4c 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -240,14 +240,42 @@ static const struct snd_soc_ops rockchip_sound_da7219_ops = {
 	.hw_params = rockchip_sound_da7219_hw_params,
 };
 
+static struct snd_soc_card rockchip_sound_card = {
+	.name = "rk3399-gru-sound",
+	.owner = THIS_MODULE,
+	.dapm_widgets = rockchip_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(rockchip_dapm_widgets),
+	.dapm_routes = rockchip_dapm_routes,
+	.num_dapm_routes = ARRAY_SIZE(rockchip_dapm_routes),
+	.controls = rockchip_controls,
+	.num_controls = ARRAY_SIZE(rockchip_controls),
+};
+
 enum {
+	DAILINK_DA7219,
 	DAILINK_MAX98357A,
 	DAILINK_RT5514,
-	DAILINK_DA7219,
 	DAILINK_RT5514_DSP,
 };
 
-static struct snd_soc_dai_link rockchip_dailinks[] = {
+static const char * const dailink_compat[] = {
+	[DAILINK_DA7219] = "dlg,da7219",
+	[DAILINK_MAX98357A] = "maxim,max98357a",
+	[DAILINK_RT5514] = "realtek,rt5514-i2c",
+	[DAILINK_RT5514_DSP] = "realtek,rt5514-spi",
+};
+
+static const struct snd_soc_dai_link rockchip_dais[] = {
+	[DAILINK_DA7219] = {
+		.name = "DA7219",
+		.stream_name = "DA7219 PCM",
+		.codec_dai_name = "da7219-hifi",
+		.init = rockchip_sound_da7219_init,
+		.ops = &rockchip_sound_da7219_ops,
+		/* set da7219 as slave */
+		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
+			SND_SOC_DAIFMT_CBS_CFS,
+	},
 	[DAILINK_MAX98357A] = {
 		.name = "MAX98357A",
 		.stream_name = "MAX98357A PCM",
@@ -266,16 +294,6 @@ static struct snd_soc_dai_link rockchip_dailinks[] = {
 		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
 			SND_SOC_DAIFMT_CBS_CFS,
 	},
-	[DAILINK_DA7219] = {
-		.name = "DA7219",
-		.stream_name = "DA7219 PCM",
-		.codec_dai_name = "da7219-hifi",
-		.init = rockchip_sound_da7219_init,
-		.ops = &rockchip_sound_da7219_ops,
-		/* set da7219 as slave */
-		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
-			SND_SOC_DAIFMT_CBS_CFS,
-	},
 	/* RT5514 DSP for voice wakeup via spi bus */
 	[DAILINK_RT5514_DSP] = {
 		.name = "RT5514 DSP",
@@ -284,42 +302,72 @@ static struct snd_soc_dai_link rockchip_dailinks[] = {
 	},
 };
 
-static struct snd_soc_card rockchip_sound_card = {
-	.name = "rk3399-gru-sound",
-	.owner = THIS_MODULE,
-	.dai_link = rockchip_dailinks,
-	.num_links =  ARRAY_SIZE(rockchip_dailinks),
-	.dapm_widgets = rockchip_dapm_widgets,
-	.num_dapm_widgets = ARRAY_SIZE(rockchip_dapm_widgets),
-	.dapm_routes = rockchip_dapm_routes,
-	.num_dapm_routes = ARRAY_SIZE(rockchip_dapm_routes),
-	.controls = rockchip_controls,
-	.num_controls = ARRAY_SIZE(rockchip_controls),
-};
-
-static int rockchip_sound_probe(struct platform_device *pdev)
+static int rockchip_sound_codec_node_match(struct device_node *np_codec)
 {
-	struct snd_soc_card *card = &rockchip_sound_card;
-	struct device_node *cpu_node;
-	int i, ret;
+	int i;
 
-	cpu_node = of_parse_phandle(pdev->dev.of_node, "rockchip,cpu", 0);
-	if (!cpu_node) {
-		dev_err(&pdev->dev, "Property 'rockchip,cpu' missing or invalid\n");
-		return -EINVAL;
+	for (i = 0; i < ARRAY_SIZE(dailink_compat); i++) {
+		if (of_device_is_compatible(np_codec, dailink_compat[i]))
+			return i;
 	}
+	return -1;
+}
 
-	for (i = 0; i < ARRAY_SIZE(rockchip_dailinks); i++) {
-		rockchip_dailinks[i].platform_of_node = cpu_node;
-		rockchip_dailinks[i].cpu_of_node = cpu_node;
-
-		rockchip_dailinks[i].codec_of_node =
-			of_parse_phandle(pdev->dev.of_node, "rockchip,codec", i);
-		if (!rockchip_dailinks[i].codec_of_node) {
-			dev_err(&pdev->dev,
-				"Property[%d] 'rockchip,codec' missing or invalid\n", i);
+static int rockchip_sound_of_parse_dais(struct device *dev,
+					struct snd_soc_card *card)
+{
+	struct device_node *np_cpu;
+	struct device_node *np_codec;
+	struct snd_soc_dai_link *dai;
+	int i, index;
+
+	card->dai_link = devm_kzalloc(dev, sizeof(rockchip_dais),
+				      GFP_KERNEL);
+	if (!card->dai_link)
+		return -ENOMEM;
+
+	np_cpu = of_parse_phandle(dev->of_node, "rockchip,cpu", 0);
+
+	card->num_links = 0;
+	for (i = 0; i < ARRAY_SIZE(rockchip_dais); i++) {
+		np_codec = of_parse_phandle(dev->of_node,
+					    "rockchip,codec", i);
+		if (!np_codec)
+			break;
+
+		if (!of_device_is_available(np_codec))
+			continue;
+
+		index = rockchip_sound_codec_node_match(np_codec);
+		if (index < 0)
+			continue;
+
+		if (!np_cpu) {
+			dev_err(dev, "Missing 'rockchip,cpu' for %s\n",
+				rockchip_dais[index].name);
 			return -EINVAL;
 		}
+
+		dai = &card->dai_link[card->num_links++];
+		*dai = rockchip_dais[index];
+
+		dai->codec_of_node = np_codec;
+		dai->platform_of_node = np_cpu;
+		dai->cpu_of_node = np_cpu;
+	}
+
+	return 0;
+}
+
+static int rockchip_sound_probe(struct platform_device *pdev)
+{
+	struct snd_soc_card *card = &rockchip_sound_card;
+	int ret;
+
+	ret = rockchip_sound_of_parse_dais(&pdev->dev, card);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "Failed to parse dais: %d\n", ret);
+		return ret;
 	}
 
 	/* Set DMIC wakeup delay */
@@ -332,13 +380,7 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 	}
 
 	card->dev = &pdev->dev;
-
-	ret = devm_snd_soc_register_card(&pdev->dev, card);
-	if (ret)
-		dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n",
-			__func__, ret);
-
-	return ret;
+	return devm_snd_soc_register_card(&pdev->dev, card);
 }
 
 static const struct of_device_id rockchip_sound_of_match[] = {
-- 
2.11.0

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

* [RESENT PATCH v7 4/7] ASoC: rockchip: Parse dai links from dts
@ 2017-08-24  4:52   ` Jeffy Chen
  0 siblings, 0 replies; 44+ messages in thread
From: Jeffy Chen @ 2017-08-24  4:52 UTC (permalink / raw)
  To: linux-arm-kernel

Refactor rockchip_sound_probe, parse dai links from dts instead of
hard coding them.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
---

Changes in v7: None
Changes in v6: None
Changes in v3:
Use compatible to match audio codecs
        -- Suggested-by Matthias Kaehlcke <mka@chromium.org>

Changes in v2:
Let rockchip,codec-names be a required property, because we plan to
add more supported codecs to the fixed dai link list in the driver.

 sound/soc/rockchip/rk3399_gru_sound.c | 140 ++++++++++++++++++++++------------
 1 file changed, 91 insertions(+), 49 deletions(-)

diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index cd2fdba922f1..347c34d0db4c 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -240,14 +240,42 @@ static const struct snd_soc_ops rockchip_sound_da7219_ops = {
 	.hw_params = rockchip_sound_da7219_hw_params,
 };
 
+static struct snd_soc_card rockchip_sound_card = {
+	.name = "rk3399-gru-sound",
+	.owner = THIS_MODULE,
+	.dapm_widgets = rockchip_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(rockchip_dapm_widgets),
+	.dapm_routes = rockchip_dapm_routes,
+	.num_dapm_routes = ARRAY_SIZE(rockchip_dapm_routes),
+	.controls = rockchip_controls,
+	.num_controls = ARRAY_SIZE(rockchip_controls),
+};
+
 enum {
+	DAILINK_DA7219,
 	DAILINK_MAX98357A,
 	DAILINK_RT5514,
-	DAILINK_DA7219,
 	DAILINK_RT5514_DSP,
 };
 
-static struct snd_soc_dai_link rockchip_dailinks[] = {
+static const char * const dailink_compat[] = {
+	[DAILINK_DA7219] = "dlg,da7219",
+	[DAILINK_MAX98357A] = "maxim,max98357a",
+	[DAILINK_RT5514] = "realtek,rt5514-i2c",
+	[DAILINK_RT5514_DSP] = "realtek,rt5514-spi",
+};
+
+static const struct snd_soc_dai_link rockchip_dais[] = {
+	[DAILINK_DA7219] = {
+		.name = "DA7219",
+		.stream_name = "DA7219 PCM",
+		.codec_dai_name = "da7219-hifi",
+		.init = rockchip_sound_da7219_init,
+		.ops = &rockchip_sound_da7219_ops,
+		/* set da7219 as slave */
+		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
+			SND_SOC_DAIFMT_CBS_CFS,
+	},
 	[DAILINK_MAX98357A] = {
 		.name = "MAX98357A",
 		.stream_name = "MAX98357A PCM",
@@ -266,16 +294,6 @@ static struct snd_soc_dai_link rockchip_dailinks[] = {
 		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
 			SND_SOC_DAIFMT_CBS_CFS,
 	},
-	[DAILINK_DA7219] = {
-		.name = "DA7219",
-		.stream_name = "DA7219 PCM",
-		.codec_dai_name = "da7219-hifi",
-		.init = rockchip_sound_da7219_init,
-		.ops = &rockchip_sound_da7219_ops,
-		/* set da7219 as slave */
-		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
-			SND_SOC_DAIFMT_CBS_CFS,
-	},
 	/* RT5514 DSP for voice wakeup via spi bus */
 	[DAILINK_RT5514_DSP] = {
 		.name = "RT5514 DSP",
@@ -284,42 +302,72 @@ static struct snd_soc_dai_link rockchip_dailinks[] = {
 	},
 };
 
-static struct snd_soc_card rockchip_sound_card = {
-	.name = "rk3399-gru-sound",
-	.owner = THIS_MODULE,
-	.dai_link = rockchip_dailinks,
-	.num_links =  ARRAY_SIZE(rockchip_dailinks),
-	.dapm_widgets = rockchip_dapm_widgets,
-	.num_dapm_widgets = ARRAY_SIZE(rockchip_dapm_widgets),
-	.dapm_routes = rockchip_dapm_routes,
-	.num_dapm_routes = ARRAY_SIZE(rockchip_dapm_routes),
-	.controls = rockchip_controls,
-	.num_controls = ARRAY_SIZE(rockchip_controls),
-};
-
-static int rockchip_sound_probe(struct platform_device *pdev)
+static int rockchip_sound_codec_node_match(struct device_node *np_codec)
 {
-	struct snd_soc_card *card = &rockchip_sound_card;
-	struct device_node *cpu_node;
-	int i, ret;
+	int i;
 
-	cpu_node = of_parse_phandle(pdev->dev.of_node, "rockchip,cpu", 0);
-	if (!cpu_node) {
-		dev_err(&pdev->dev, "Property 'rockchip,cpu' missing or invalid\n");
-		return -EINVAL;
+	for (i = 0; i < ARRAY_SIZE(dailink_compat); i++) {
+		if (of_device_is_compatible(np_codec, dailink_compat[i]))
+			return i;
 	}
+	return -1;
+}
 
-	for (i = 0; i < ARRAY_SIZE(rockchip_dailinks); i++) {
-		rockchip_dailinks[i].platform_of_node = cpu_node;
-		rockchip_dailinks[i].cpu_of_node = cpu_node;
-
-		rockchip_dailinks[i].codec_of_node =
-			of_parse_phandle(pdev->dev.of_node, "rockchip,codec", i);
-		if (!rockchip_dailinks[i].codec_of_node) {
-			dev_err(&pdev->dev,
-				"Property[%d] 'rockchip,codec' missing or invalid\n", i);
+static int rockchip_sound_of_parse_dais(struct device *dev,
+					struct snd_soc_card *card)
+{
+	struct device_node *np_cpu;
+	struct device_node *np_codec;
+	struct snd_soc_dai_link *dai;
+	int i, index;
+
+	card->dai_link = devm_kzalloc(dev, sizeof(rockchip_dais),
+				      GFP_KERNEL);
+	if (!card->dai_link)
+		return -ENOMEM;
+
+	np_cpu = of_parse_phandle(dev->of_node, "rockchip,cpu", 0);
+
+	card->num_links = 0;
+	for (i = 0; i < ARRAY_SIZE(rockchip_dais); i++) {
+		np_codec = of_parse_phandle(dev->of_node,
+					    "rockchip,codec", i);
+		if (!np_codec)
+			break;
+
+		if (!of_device_is_available(np_codec))
+			continue;
+
+		index = rockchip_sound_codec_node_match(np_codec);
+		if (index < 0)
+			continue;
+
+		if (!np_cpu) {
+			dev_err(dev, "Missing 'rockchip,cpu' for %s\n",
+				rockchip_dais[index].name);
 			return -EINVAL;
 		}
+
+		dai = &card->dai_link[card->num_links++];
+		*dai = rockchip_dais[index];
+
+		dai->codec_of_node = np_codec;
+		dai->platform_of_node = np_cpu;
+		dai->cpu_of_node = np_cpu;
+	}
+
+	return 0;
+}
+
+static int rockchip_sound_probe(struct platform_device *pdev)
+{
+	struct snd_soc_card *card = &rockchip_sound_card;
+	int ret;
+
+	ret = rockchip_sound_of_parse_dais(&pdev->dev, card);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "Failed to parse dais: %d\n", ret);
+		return ret;
 	}
 
 	/* Set DMIC wakeup delay */
@@ -332,13 +380,7 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 	}
 
 	card->dev = &pdev->dev;
-
-	ret = devm_snd_soc_register_card(&pdev->dev, card);
-	if (ret)
-		dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n",
-			__func__, ret);
-
-	return ret;
+	return devm_snd_soc_register_card(&pdev->dev, card);
 }
 
 static const struct of_device_id rockchip_sound_of_match[] = {
-- 
2.11.0

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

* [RESENT PATCH v7 5/7] ASoC: rockchip: Add support for DP codec
  2017-08-24  4:52 ` Jeffy Chen
@ 2017-08-24  4:52   ` Jeffy Chen
  -1 siblings, 0 replies; 44+ messages in thread
From: Jeffy Chen @ 2017-08-24  4:52 UTC (permalink / raw)
  To: linux-kernel, dgreid, heiko
  Cc: briannorris, mka, dianders, Jeffy Chen, Jaroslav Kysela,
	alsa-devel, linux-rockchip, Mark Brown, Takashi Iwai,
	Liam Girdwood, linux-arm-kernel

Add support for optional cdn dp codec.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

Changes in v7: None
Changes in v6: None
Changes in v3: None
Changes in v2: None

 sound/soc/rockchip/Kconfig            |  1 +
 sound/soc/rockchip/rk3399_gru_sound.c | 59 +++++++++++++++++++++++++++++++++--
 2 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/sound/soc/rockchip/Kconfig b/sound/soc/rockchip/Kconfig
index c84487805876..8f0d0d8d34e6 100644
--- a/sound/soc/rockchip/Kconfig
+++ b/sound/soc/rockchip/Kconfig
@@ -68,6 +68,7 @@ config SND_SOC_RK3399_GRU_SOUND
 	select SND_SOC_RT5514
 	select SND_SOC_DA7219
 	select SND_SOC_RT5514_SPI
+	select SND_SOC_HDMI_CODEC
 	help
 	  Say Y or M here if you want to add support multiple codecs for SoC
 	  audio on Rockchip RK3399 GRU boards.
diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index 347c34d0db4c..91aab5c18f3b 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -228,6 +228,45 @@ static int rockchip_sound_da7219_init(struct snd_soc_pcm_runtime *rtd)
 	return 0;
 }
 
+static int rockchip_sound_cdndp_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;
+	struct snd_soc_dai *codec_dai = rtd->codec_dai;
+	int mclk, ret;
+
+	/* in bypass mode, the mclk has to be one of the frequencies below */
+	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_sysclk(cpu_dai, 0, mclk,
+				     SND_SOC_CLOCK_OUT);
+	if (ret < 0) {
+		dev_err(codec_dai->dev, "Can't set cpu clock out %d\n", ret);
+		return ret;
+	}
+
+	return 0;
+}
+
 static const struct snd_soc_ops rockchip_sound_max98357a_ops = {
 	.hw_params = rockchip_sound_max98357a_hw_params,
 };
@@ -240,6 +279,10 @@ static const struct snd_soc_ops rockchip_sound_da7219_ops = {
 	.hw_params = rockchip_sound_da7219_hw_params,
 };
 
+static struct snd_soc_ops rockchip_sound_cdndp_ops = {
+	.hw_params = rockchip_sound_cdndp_hw_params,
+};
+
 static struct snd_soc_card rockchip_sound_card = {
 	.name = "rk3399-gru-sound",
 	.owner = THIS_MODULE,
@@ -252,6 +295,7 @@ static struct snd_soc_card rockchip_sound_card = {
 };
 
 enum {
+	DAILINK_CDNDP,
 	DAILINK_DA7219,
 	DAILINK_MAX98357A,
 	DAILINK_RT5514,
@@ -259,6 +303,7 @@ enum {
 };
 
 static const char * const dailink_compat[] = {
+	[DAILINK_CDNDP] = "rockchip,rk3399-cdn-dp",
 	[DAILINK_DA7219] = "dlg,da7219",
 	[DAILINK_MAX98357A] = "maxim,max98357a",
 	[DAILINK_RT5514] = "realtek,rt5514-i2c",
@@ -266,6 +311,14 @@ static const char * const dailink_compat[] = {
 };
 
 static const struct snd_soc_dai_link rockchip_dais[] = {
+	[DAILINK_CDNDP] = {
+		.name = "DP",
+		.stream_name = "DP PCM",
+		.codec_dai_name = "i2s-hifi",
+		.ops = &rockchip_sound_cdndp_ops,
+		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
+			SND_SOC_DAIFMT_CBS_CFS,
+	},
 	[DAILINK_DA7219] = {
 		.name = "DA7219",
 		.stream_name = "DA7219 PCM",
@@ -316,7 +369,7 @@ static int rockchip_sound_codec_node_match(struct device_node *np_codec)
 static int rockchip_sound_of_parse_dais(struct device *dev,
 					struct snd_soc_card *card)
 {
-	struct device_node *np_cpu;
+	struct device_node *np_cpu, *np_cpu0, *np_cpu1;
 	struct device_node *np_codec;
 	struct snd_soc_dai_link *dai;
 	int i, index;
@@ -326,7 +379,8 @@ static int rockchip_sound_of_parse_dais(struct device *dev,
 	if (!card->dai_link)
 		return -ENOMEM;
 
-	np_cpu = of_parse_phandle(dev->of_node, "rockchip,cpu", 0);
+	np_cpu0 = of_parse_phandle(dev->of_node, "rockchip,cpu", 0);
+	np_cpu1 = of_parse_phandle(dev->of_node, "rockchip,cpu", 1);
 
 	card->num_links = 0;
 	for (i = 0; i < ARRAY_SIZE(rockchip_dais); i++) {
@@ -342,6 +396,7 @@ static int rockchip_sound_of_parse_dais(struct device *dev,
 		if (index < 0)
 			continue;
 
+		np_cpu = (index == DAILINK_CDNDP) ? np_cpu1 : np_cpu0;
 		if (!np_cpu) {
 			dev_err(dev, "Missing 'rockchip,cpu' for %s\n",
 				rockchip_dais[index].name);
-- 
2.11.0

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

* [RESENT PATCH v7 5/7] ASoC: rockchip: Add support for DP codec
@ 2017-08-24  4:52   ` Jeffy Chen
  0 siblings, 0 replies; 44+ messages in thread
From: Jeffy Chen @ 2017-08-24  4:52 UTC (permalink / raw)
  To: linux-arm-kernel

Add support for optional cdn dp codec.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

Changes in v7: None
Changes in v6: None
Changes in v3: None
Changes in v2: None

 sound/soc/rockchip/Kconfig            |  1 +
 sound/soc/rockchip/rk3399_gru_sound.c | 59 +++++++++++++++++++++++++++++++++--
 2 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/sound/soc/rockchip/Kconfig b/sound/soc/rockchip/Kconfig
index c84487805876..8f0d0d8d34e6 100644
--- a/sound/soc/rockchip/Kconfig
+++ b/sound/soc/rockchip/Kconfig
@@ -68,6 +68,7 @@ config SND_SOC_RK3399_GRU_SOUND
 	select SND_SOC_RT5514
 	select SND_SOC_DA7219
 	select SND_SOC_RT5514_SPI
+	select SND_SOC_HDMI_CODEC
 	help
 	  Say Y or M here if you want to add support multiple codecs for SoC
 	  audio on Rockchip RK3399 GRU boards.
diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index 347c34d0db4c..91aab5c18f3b 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -228,6 +228,45 @@ static int rockchip_sound_da7219_init(struct snd_soc_pcm_runtime *rtd)
 	return 0;
 }
 
+static int rockchip_sound_cdndp_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;
+	struct snd_soc_dai *codec_dai = rtd->codec_dai;
+	int mclk, ret;
+
+	/* in bypass mode, the mclk has to be one of the frequencies below */
+	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_sysclk(cpu_dai, 0, mclk,
+				     SND_SOC_CLOCK_OUT);
+	if (ret < 0) {
+		dev_err(codec_dai->dev, "Can't set cpu clock out %d\n", ret);
+		return ret;
+	}
+
+	return 0;
+}
+
 static const struct snd_soc_ops rockchip_sound_max98357a_ops = {
 	.hw_params = rockchip_sound_max98357a_hw_params,
 };
@@ -240,6 +279,10 @@ static const struct snd_soc_ops rockchip_sound_da7219_ops = {
 	.hw_params = rockchip_sound_da7219_hw_params,
 };
 
+static struct snd_soc_ops rockchip_sound_cdndp_ops = {
+	.hw_params = rockchip_sound_cdndp_hw_params,
+};
+
 static struct snd_soc_card rockchip_sound_card = {
 	.name = "rk3399-gru-sound",
 	.owner = THIS_MODULE,
@@ -252,6 +295,7 @@ static struct snd_soc_card rockchip_sound_card = {
 };
 
 enum {
+	DAILINK_CDNDP,
 	DAILINK_DA7219,
 	DAILINK_MAX98357A,
 	DAILINK_RT5514,
@@ -259,6 +303,7 @@ enum {
 };
 
 static const char * const dailink_compat[] = {
+	[DAILINK_CDNDP] = "rockchip,rk3399-cdn-dp",
 	[DAILINK_DA7219] = "dlg,da7219",
 	[DAILINK_MAX98357A] = "maxim,max98357a",
 	[DAILINK_RT5514] = "realtek,rt5514-i2c",
@@ -266,6 +311,14 @@ static const char * const dailink_compat[] = {
 };
 
 static const struct snd_soc_dai_link rockchip_dais[] = {
+	[DAILINK_CDNDP] = {
+		.name = "DP",
+		.stream_name = "DP PCM",
+		.codec_dai_name = "i2s-hifi",
+		.ops = &rockchip_sound_cdndp_ops,
+		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
+			SND_SOC_DAIFMT_CBS_CFS,
+	},
 	[DAILINK_DA7219] = {
 		.name = "DA7219",
 		.stream_name = "DA7219 PCM",
@@ -316,7 +369,7 @@ static int rockchip_sound_codec_node_match(struct device_node *np_codec)
 static int rockchip_sound_of_parse_dais(struct device *dev,
 					struct snd_soc_card *card)
 {
-	struct device_node *np_cpu;
+	struct device_node *np_cpu, *np_cpu0, *np_cpu1;
 	struct device_node *np_codec;
 	struct snd_soc_dai_link *dai;
 	int i, index;
@@ -326,7 +379,8 @@ static int rockchip_sound_of_parse_dais(struct device *dev,
 	if (!card->dai_link)
 		return -ENOMEM;
 
-	np_cpu = of_parse_phandle(dev->of_node, "rockchip,cpu", 0);
+	np_cpu0 = of_parse_phandle(dev->of_node, "rockchip,cpu", 0);
+	np_cpu1 = of_parse_phandle(dev->of_node, "rockchip,cpu", 1);
 
 	card->num_links = 0;
 	for (i = 0; i < ARRAY_SIZE(rockchip_dais); i++) {
@@ -342,6 +396,7 @@ static int rockchip_sound_of_parse_dais(struct device *dev,
 		if (index < 0)
 			continue;
 
+		np_cpu = (index == DAILINK_CDNDP) ? np_cpu1 : np_cpu0;
 		if (!np_cpu) {
 			dev_err(dev, "Missing 'rockchip,cpu' for %s\n",
 				rockchip_dais[index].name);
-- 
2.11.0

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

* [RESENT PATCH v7 6/7] ASoC: rockchip: Add support for DMIC codec
  2017-08-24  4:52 ` Jeffy Chen
@ 2017-08-24  4:52   ` Jeffy Chen
  -1 siblings, 0 replies; 44+ messages in thread
From: Jeffy Chen @ 2017-08-24  4:52 UTC (permalink / raw)
  To: linux-kernel, dgreid, heiko
  Cc: briannorris, mka, dianders, Jeffy Chen, Jaroslav Kysela,
	alsa-devel, linux-rockchip, Mark Brown, Takashi Iwai,
	Liam Girdwood, linux-arm-kernel

Add support for optional dmic codec.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

Changes in v7: None
Changes in v6:
Add dmic wakeup delay(not used for now).

Changes in v3: None
Changes in v2: None

 sound/soc/rockchip/Kconfig            |  1 +
 sound/soc/rockchip/rk3399_gru_sound.c | 36 +++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/sound/soc/rockchip/Kconfig b/sound/soc/rockchip/Kconfig
index 8f0d0d8d34e6..b0825370d262 100644
--- a/sound/soc/rockchip/Kconfig
+++ b/sound/soc/rockchip/Kconfig
@@ -69,6 +69,7 @@ config SND_SOC_RK3399_GRU_SOUND
 	select SND_SOC_DA7219
 	select SND_SOC_RT5514_SPI
 	select SND_SOC_HDMI_CODEC
+	select SND_SOC_DMIC
 	help
 	  Say Y or M here if you want to add support multiple codecs for SoC
 	  audio on Rockchip RK3399 GRU boards.
diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index 91aab5c18f3b..5ab25962cabd 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -267,6 +267,28 @@ static int rockchip_sound_cdndp_hw_params(struct snd_pcm_substream *substream,
 	return 0;
 }
 
+static int rockchip_sound_dmic_hw_params(struct snd_pcm_substream *substream,
+			     struct snd_pcm_hw_params *params)
+{
+	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	unsigned int mclk;
+	int ret;
+
+	mclk = params_rate(params) * SOUND_FS;
+
+	ret = snd_soc_dai_set_sysclk(rtd->cpu_dai, 0, mclk, 0);
+	if (ret) {
+		dev_err(rtd->card->dev, "%s() error setting sysclk to %u: %d\n",
+				__func__, mclk, ret);
+		return ret;
+	}
+
+	/* Wait for DMIC stable */
+	msleep(dmic_wakeup_delay);
+
+	return 0;
+}
+
 static const struct snd_soc_ops rockchip_sound_max98357a_ops = {
 	.hw_params = rockchip_sound_max98357a_hw_params,
 };
@@ -283,6 +305,10 @@ static struct snd_soc_ops rockchip_sound_cdndp_ops = {
 	.hw_params = rockchip_sound_cdndp_hw_params,
 };
 
+static struct snd_soc_ops rockchip_sound_dmic_ops = {
+	.hw_params = rockchip_sound_dmic_hw_params,
+};
+
 static struct snd_soc_card rockchip_sound_card = {
 	.name = "rk3399-gru-sound",
 	.owner = THIS_MODULE,
@@ -297,6 +323,7 @@ static struct snd_soc_card rockchip_sound_card = {
 enum {
 	DAILINK_CDNDP,
 	DAILINK_DA7219,
+	DAILINK_DMIC,
 	DAILINK_MAX98357A,
 	DAILINK_RT5514,
 	DAILINK_RT5514_DSP,
@@ -305,6 +332,7 @@ enum {
 static const char * const dailink_compat[] = {
 	[DAILINK_CDNDP] = "rockchip,rk3399-cdn-dp",
 	[DAILINK_DA7219] = "dlg,da7219",
+	[DAILINK_DMIC] = "dmic-codec",
 	[DAILINK_MAX98357A] = "maxim,max98357a",
 	[DAILINK_RT5514] = "realtek,rt5514-i2c",
 	[DAILINK_RT5514_DSP] = "realtek,rt5514-spi",
@@ -329,6 +357,14 @@ static const struct snd_soc_dai_link rockchip_dais[] = {
 		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
 			SND_SOC_DAIFMT_CBS_CFS,
 	},
+	[DAILINK_DMIC] = {
+		.name = "DMIC",
+		.stream_name = "DMIC PCM",
+		.codec_dai_name = "dmic-hifi",
+		.ops = &rockchip_sound_dmic_ops,
+		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
+			SND_SOC_DAIFMT_CBS_CFS,
+	},
 	[DAILINK_MAX98357A] = {
 		.name = "MAX98357A",
 		.stream_name = "MAX98357A PCM",
-- 
2.11.0

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

* [RESENT PATCH v7 6/7] ASoC: rockchip: Add support for DMIC codec
@ 2017-08-24  4:52   ` Jeffy Chen
  0 siblings, 0 replies; 44+ messages in thread
From: Jeffy Chen @ 2017-08-24  4:52 UTC (permalink / raw)
  To: linux-arm-kernel

Add support for optional dmic codec.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

Changes in v7: None
Changes in v6:
Add dmic wakeup delay(not used for now).

Changes in v3: None
Changes in v2: None

 sound/soc/rockchip/Kconfig            |  1 +
 sound/soc/rockchip/rk3399_gru_sound.c | 36 +++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/sound/soc/rockchip/Kconfig b/sound/soc/rockchip/Kconfig
index 8f0d0d8d34e6..b0825370d262 100644
--- a/sound/soc/rockchip/Kconfig
+++ b/sound/soc/rockchip/Kconfig
@@ -69,6 +69,7 @@ config SND_SOC_RK3399_GRU_SOUND
 	select SND_SOC_DA7219
 	select SND_SOC_RT5514_SPI
 	select SND_SOC_HDMI_CODEC
+	select SND_SOC_DMIC
 	help
 	  Say Y or M here if you want to add support multiple codecs for SoC
 	  audio on Rockchip RK3399 GRU boards.
diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index 91aab5c18f3b..5ab25962cabd 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -267,6 +267,28 @@ static int rockchip_sound_cdndp_hw_params(struct snd_pcm_substream *substream,
 	return 0;
 }
 
+static int rockchip_sound_dmic_hw_params(struct snd_pcm_substream *substream,
+			     struct snd_pcm_hw_params *params)
+{
+	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	unsigned int mclk;
+	int ret;
+
+	mclk = params_rate(params) * SOUND_FS;
+
+	ret = snd_soc_dai_set_sysclk(rtd->cpu_dai, 0, mclk, 0);
+	if (ret) {
+		dev_err(rtd->card->dev, "%s() error setting sysclk to %u: %d\n",
+				__func__, mclk, ret);
+		return ret;
+	}
+
+	/* Wait for DMIC stable */
+	msleep(dmic_wakeup_delay);
+
+	return 0;
+}
+
 static const struct snd_soc_ops rockchip_sound_max98357a_ops = {
 	.hw_params = rockchip_sound_max98357a_hw_params,
 };
@@ -283,6 +305,10 @@ static struct snd_soc_ops rockchip_sound_cdndp_ops = {
 	.hw_params = rockchip_sound_cdndp_hw_params,
 };
 
+static struct snd_soc_ops rockchip_sound_dmic_ops = {
+	.hw_params = rockchip_sound_dmic_hw_params,
+};
+
 static struct snd_soc_card rockchip_sound_card = {
 	.name = "rk3399-gru-sound",
 	.owner = THIS_MODULE,
@@ -297,6 +323,7 @@ static struct snd_soc_card rockchip_sound_card = {
 enum {
 	DAILINK_CDNDP,
 	DAILINK_DA7219,
+	DAILINK_DMIC,
 	DAILINK_MAX98357A,
 	DAILINK_RT5514,
 	DAILINK_RT5514_DSP,
@@ -305,6 +332,7 @@ enum {
 static const char * const dailink_compat[] = {
 	[DAILINK_CDNDP] = "rockchip,rk3399-cdn-dp",
 	[DAILINK_DA7219] = "dlg,da7219",
+	[DAILINK_DMIC] = "dmic-codec",
 	[DAILINK_MAX98357A] = "maxim,max98357a",
 	[DAILINK_RT5514] = "realtek,rt5514-i2c",
 	[DAILINK_RT5514_DSP] = "realtek,rt5514-spi",
@@ -329,6 +357,14 @@ static const struct snd_soc_dai_link rockchip_dais[] = {
 		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
 			SND_SOC_DAIFMT_CBS_CFS,
 	},
+	[DAILINK_DMIC] = {
+		.name = "DMIC",
+		.stream_name = "DMIC PCM",
+		.codec_dai_name = "dmic-hifi",
+		.ops = &rockchip_sound_dmic_ops,
+		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
+			SND_SOC_DAIFMT_CBS_CFS,
+	},
 	[DAILINK_MAX98357A] = {
 		.name = "MAX98357A",
 		.stream_name = "MAX98357A PCM",
-- 
2.11.0

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

* [RESENT PATCH v7 7/7] dt-bindings: ASoC: rockchip: Update description of rockchip,codec
  2017-08-24  4:52 ` Jeffy Chen
@ 2017-08-24  4:52   ` Jeffy Chen
  -1 siblings, 0 replies; 44+ messages in thread
From: Jeffy Chen @ 2017-08-24  4:52 UTC (permalink / raw)
  To: linux-kernel, dgreid, heiko
  Cc: briannorris, mka, dianders, Jeffy Chen, devicetree, alsa-devel,
	Liam Girdwood, Mark Brown, linux-rockchip, Rob Herring,
	Mark Rutland, linux-arm-kernel

Update description for newly added optional audio codecs.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
---

Changes in v7: None
Changes in v6: None
Changes in v3: None
Changes in v2: None

 Documentation/devicetree/bindings/sound/rockchip,rk3399-gru-sound.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/sound/rockchip,rk3399-gru-sound.txt b/Documentation/devicetree/bindings/sound/rockchip,rk3399-gru-sound.txt
index eac91db07178..72d3cf4c2606 100644
--- a/Documentation/devicetree/bindings/sound/rockchip,rk3399-gru-sound.txt
+++ b/Documentation/devicetree/bindings/sound/rockchip,rk3399-gru-sound.txt
@@ -4,7 +4,7 @@ Required properties:
 - compatible: "rockchip,rk3399-gru-sound"
 - rockchip,cpu: The phandle of the Rockchip I2S controller that's
   connected to the codecs
-- rockchip,codec: The phandle of the MAX98357A/RT5514/DA7219 codecs
+- rockchip,codec: The phandle of the audio codecs
 
 Optional properties:
 - dmic-wakeup-delay-ms : specify delay time (ms) for DMIC ready.
-- 
2.11.0

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

* [RESENT PATCH v7 7/7] dt-bindings: ASoC: rockchip: Update description of rockchip, codec
@ 2017-08-24  4:52   ` Jeffy Chen
  0 siblings, 0 replies; 44+ messages in thread
From: Jeffy Chen @ 2017-08-24  4:52 UTC (permalink / raw)
  To: linux-arm-kernel

Update description for newly added optional audio codecs.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
---

Changes in v7: None
Changes in v6: None
Changes in v3: None
Changes in v2: None

 Documentation/devicetree/bindings/sound/rockchip,rk3399-gru-sound.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/sound/rockchip,rk3399-gru-sound.txt b/Documentation/devicetree/bindings/sound/rockchip,rk3399-gru-sound.txt
index eac91db07178..72d3cf4c2606 100644
--- a/Documentation/devicetree/bindings/sound/rockchip,rk3399-gru-sound.txt
+++ b/Documentation/devicetree/bindings/sound/rockchip,rk3399-gru-sound.txt
@@ -4,7 +4,7 @@ Required properties:
 - compatible: "rockchip,rk3399-gru-sound"
 - rockchip,cpu: The phandle of the Rockchip I2S controller that's
   connected to the codecs
-- rockchip,codec: The phandle of the MAX98357A/RT5514/DA7219 codecs
+- rockchip,codec: The phandle of the audio codecs
 
 Optional properties:
 - dmic-wakeup-delay-ms : specify delay time (ms) for DMIC ready.
-- 
2.11.0

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

* Re: [RESENT PATCH v7 1/7] ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp
  2017-08-24  4:52   ` Jeffy Chen
@ 2017-08-24 21:19     ` Matthias Kaehlcke
  -1 siblings, 0 replies; 44+ messages in thread
From: Matthias Kaehlcke @ 2017-08-24 21:19 UTC (permalink / raw)
  To: Jeffy Chen
  Cc: linux-kernel, dgreid, heiko, briannorris, dianders,
	Jaroslav Kysela, alsa-devel, linux-rockchip, Mark Brown,
	Takashi Iwai, Liam Girdwood, linux-arm-kernel

El Thu, Aug 24, 2017 at 12:52:21PM +0800 Jeffy Chen ha dit:

> Currently we are using codec name for rt5514 dsp dai link, use codec
> of_node instead.
> 
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> ---

Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
(The codec is still 'detected' on kevin, with the name spi32765.0)

> Changes in v7:
> Rebase on the newest for-next
> 
> Changes in v6: None
> Changes in v3: None
> Changes in v2: None
> 
>  sound/soc/rockchip/rk3399_gru_sound.c | 34 ++--------------------------------
>  1 file changed, 2 insertions(+), 32 deletions(-)
> 
> diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
> index 566ccb39fb31..cd2fdba922f1 100644
> --- a/sound/soc/rockchip/rk3399_gru_sound.c
> +++ b/sound/soc/rockchip/rk3399_gru_sound.c
> @@ -247,8 +247,6 @@ enum {
>  	DAILINK_RT5514_DSP,
>  };
>  
> -#define DAILINK_ENTITIES	(DAILINK_DA7219 + 1)
> -
>  static struct snd_soc_dai_link rockchip_dailinks[] = {
>  	[DAILINK_MAX98357A] = {
>  		.name = "MAX98357A",
> @@ -282,8 +280,7 @@ static struct snd_soc_dai_link rockchip_dailinks[] = {
>  	[DAILINK_RT5514_DSP] = {
>  		.name = "RT5514 DSP",
>  		.stream_name = "Wake on Voice",
> -		.codec_name = "snd-soc-dummy",
> -		.codec_dai_name = "snd-soc-dummy-dai",
> +		.codec_dai_name = "rt5514-dsp-cpu-dai",
>  	},
>  };
>  
> @@ -300,17 +297,10 @@ static struct snd_soc_card rockchip_sound_card = {
>  	.num_controls = ARRAY_SIZE(rockchip_controls),
>  };
>  
> -static int rockchip_sound_match_stub(struct device *dev, void *data)
> -{
> -	return 1;
> -}
> -
>  static int rockchip_sound_probe(struct platform_device *pdev)
>  {
>  	struct snd_soc_card *card = &rockchip_sound_card;
>  	struct device_node *cpu_node;
> -	struct device *dev;
> -	struct device_driver *drv;
>  	int i, ret;
>  
>  	cpu_node = of_parse_phandle(pdev->dev.of_node, "rockchip,cpu", 0);
> @@ -319,7 +309,7 @@ static int rockchip_sound_probe(struct platform_device *pdev)
>  		return -EINVAL;
>  	}
>  
> -	for (i = 0; i < DAILINK_ENTITIES; i++) {
> +	for (i = 0; i < ARRAY_SIZE(rockchip_dailinks); i++) {
>  		rockchip_dailinks[i].platform_of_node = cpu_node;
>  		rockchip_dailinks[i].cpu_of_node = cpu_node;
>  
> @@ -332,22 +322,6 @@ static int rockchip_sound_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> -	/**
> -	 * To acquire the spi driver of the rt5514 and set the dai-links names
> -	 * for soc_bind_dai_link
> -	 */
> -	drv = driver_find("rt5514", &spi_bus_type);
> -	if (!drv) {
> -		dev_err(&pdev->dev, "Can not find the rt5514 driver at the spi bus\n");
> -		return -EINVAL;
> -	}
> -
> -	dev = driver_find_device(drv, NULL, NULL, rockchip_sound_match_stub);
> -	if (!dev) {
> -		dev_err(&pdev->dev, "Can not find the rt5514 device\n");
> -		return -ENODEV;
> -	}
> -
>  	/* Set DMIC wakeup delay */
>  	ret = device_property_read_u32(&pdev->dev, "dmic-wakeup-delay-ms",
>  					&dmic_wakeup_delay);
> @@ -357,10 +331,6 @@ static int rockchip_sound_probe(struct platform_device *pdev)
>  			"no optional property 'dmic-wakeup-delay-ms' found, default: no delay\n");
>  	}
>  
> -	rockchip_dailinks[DAILINK_RT5514_DSP].cpu_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
> -	rockchip_dailinks[DAILINK_RT5514_DSP].cpu_dai_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
> -	rockchip_dailinks[DAILINK_RT5514_DSP].platform_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
> -
>  	card->dev = &pdev->dev;
>  
>  	ret = devm_snd_soc_register_card(&pdev->dev, card);

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

* [RESENT PATCH v7 1/7] ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp
@ 2017-08-24 21:19     ` Matthias Kaehlcke
  0 siblings, 0 replies; 44+ messages in thread
From: Matthias Kaehlcke @ 2017-08-24 21:19 UTC (permalink / raw)
  To: linux-arm-kernel

El Thu, Aug 24, 2017 at 12:52:21PM +0800 Jeffy Chen ha dit:

> Currently we are using codec name for rt5514 dsp dai link, use codec
> of_node instead.
> 
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> ---

Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
(The codec is still 'detected' on kevin, with the name spi32765.0)

> Changes in v7:
> Rebase on the newest for-next
> 
> Changes in v6: None
> Changes in v3: None
> Changes in v2: None
> 
>  sound/soc/rockchip/rk3399_gru_sound.c | 34 ++--------------------------------
>  1 file changed, 2 insertions(+), 32 deletions(-)
> 
> diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
> index 566ccb39fb31..cd2fdba922f1 100644
> --- a/sound/soc/rockchip/rk3399_gru_sound.c
> +++ b/sound/soc/rockchip/rk3399_gru_sound.c
> @@ -247,8 +247,6 @@ enum {
>  	DAILINK_RT5514_DSP,
>  };
>  
> -#define DAILINK_ENTITIES	(DAILINK_DA7219 + 1)
> -
>  static struct snd_soc_dai_link rockchip_dailinks[] = {
>  	[DAILINK_MAX98357A] = {
>  		.name = "MAX98357A",
> @@ -282,8 +280,7 @@ static struct snd_soc_dai_link rockchip_dailinks[] = {
>  	[DAILINK_RT5514_DSP] = {
>  		.name = "RT5514 DSP",
>  		.stream_name = "Wake on Voice",
> -		.codec_name = "snd-soc-dummy",
> -		.codec_dai_name = "snd-soc-dummy-dai",
> +		.codec_dai_name = "rt5514-dsp-cpu-dai",
>  	},
>  };
>  
> @@ -300,17 +297,10 @@ static struct snd_soc_card rockchip_sound_card = {
>  	.num_controls = ARRAY_SIZE(rockchip_controls),
>  };
>  
> -static int rockchip_sound_match_stub(struct device *dev, void *data)
> -{
> -	return 1;
> -}
> -
>  static int rockchip_sound_probe(struct platform_device *pdev)
>  {
>  	struct snd_soc_card *card = &rockchip_sound_card;
>  	struct device_node *cpu_node;
> -	struct device *dev;
> -	struct device_driver *drv;
>  	int i, ret;
>  
>  	cpu_node = of_parse_phandle(pdev->dev.of_node, "rockchip,cpu", 0);
> @@ -319,7 +309,7 @@ static int rockchip_sound_probe(struct platform_device *pdev)
>  		return -EINVAL;
>  	}
>  
> -	for (i = 0; i < DAILINK_ENTITIES; i++) {
> +	for (i = 0; i < ARRAY_SIZE(rockchip_dailinks); i++) {
>  		rockchip_dailinks[i].platform_of_node = cpu_node;
>  		rockchip_dailinks[i].cpu_of_node = cpu_node;
>  
> @@ -332,22 +322,6 @@ static int rockchip_sound_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> -	/**
> -	 * To acquire the spi driver of the rt5514 and set the dai-links names
> -	 * for soc_bind_dai_link
> -	 */
> -	drv = driver_find("rt5514", &spi_bus_type);
> -	if (!drv) {
> -		dev_err(&pdev->dev, "Can not find the rt5514 driver at the spi bus\n");
> -		return -EINVAL;
> -	}
> -
> -	dev = driver_find_device(drv, NULL, NULL, rockchip_sound_match_stub);
> -	if (!dev) {
> -		dev_err(&pdev->dev, "Can not find the rt5514 device\n");
> -		return -ENODEV;
> -	}
> -
>  	/* Set DMIC wakeup delay */
>  	ret = device_property_read_u32(&pdev->dev, "dmic-wakeup-delay-ms",
>  					&dmic_wakeup_delay);
> @@ -357,10 +331,6 @@ static int rockchip_sound_probe(struct platform_device *pdev)
>  			"no optional property 'dmic-wakeup-delay-ms' found, default: no delay\n");
>  	}
>  
> -	rockchip_dailinks[DAILINK_RT5514_DSP].cpu_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
> -	rockchip_dailinks[DAILINK_RT5514_DSP].cpu_dai_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
> -	rockchip_dailinks[DAILINK_RT5514_DSP].platform_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
> -
>  	card->dev = &pdev->dev;
>  
>  	ret = devm_snd_soc_register_card(&pdev->dev, card);

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

* Applied "ASoC: rockchip: Parse dai links from dts" to the asoc tree
  2017-08-24  4:52   ` Jeffy Chen
  (?)
  (?)
@ 2017-08-29 19:28     ` Mark Brown
  -1 siblings, 0 replies; 44+ messages in thread
From: Mark Brown @ 2017-08-29 19:28 UTC (permalink / raw)
  To: Jeffy Chen
  Cc: Matthias Kaehlcke, Mark Brown, linux-kernel, dgreid, heiko,
	alsa-devel, briannorris, Liam Girdwood, Mark Brown, dianders,
	linux-rockchip, mka, Takashi Iwai, linux-arm-kernel, alsa-devel

The patch

   ASoC: rockchip: Parse dai links from dts

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 0d52954ffe80b051ab79a105bd801485c4bbe20a Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Thu, 24 Aug 2017 12:52:24 +0800
Subject: [PATCH] ASoC: rockchip: Parse dai links from dts

Refactor rockchip_sound_probe, parse dai links from dts instead of
hard coding them.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/rockchip/rk3399_gru_sound.c | 140 ++++++++++++++++++++++------------
 1 file changed, 91 insertions(+), 49 deletions(-)

diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index cd2fdba922f1..347c34d0db4c 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -240,14 +240,42 @@ static const struct snd_soc_ops rockchip_sound_da7219_ops = {
 	.hw_params = rockchip_sound_da7219_hw_params,
 };
 
+static struct snd_soc_card rockchip_sound_card = {
+	.name = "rk3399-gru-sound",
+	.owner = THIS_MODULE,
+	.dapm_widgets = rockchip_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(rockchip_dapm_widgets),
+	.dapm_routes = rockchip_dapm_routes,
+	.num_dapm_routes = ARRAY_SIZE(rockchip_dapm_routes),
+	.controls = rockchip_controls,
+	.num_controls = ARRAY_SIZE(rockchip_controls),
+};
+
 enum {
+	DAILINK_DA7219,
 	DAILINK_MAX98357A,
 	DAILINK_RT5514,
-	DAILINK_DA7219,
 	DAILINK_RT5514_DSP,
 };
 
-static struct snd_soc_dai_link rockchip_dailinks[] = {
+static const char * const dailink_compat[] = {
+	[DAILINK_DA7219] = "dlg,da7219",
+	[DAILINK_MAX98357A] = "maxim,max98357a",
+	[DAILINK_RT5514] = "realtek,rt5514-i2c",
+	[DAILINK_RT5514_DSP] = "realtek,rt5514-spi",
+};
+
+static const struct snd_soc_dai_link rockchip_dais[] = {
+	[DAILINK_DA7219] = {
+		.name = "DA7219",
+		.stream_name = "DA7219 PCM",
+		.codec_dai_name = "da7219-hifi",
+		.init = rockchip_sound_da7219_init,
+		.ops = &rockchip_sound_da7219_ops,
+		/* set da7219 as slave */
+		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
+			SND_SOC_DAIFMT_CBS_CFS,
+	},
 	[DAILINK_MAX98357A] = {
 		.name = "MAX98357A",
 		.stream_name = "MAX98357A PCM",
@@ -266,16 +294,6 @@ static struct snd_soc_dai_link rockchip_dailinks[] = {
 		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
 			SND_SOC_DAIFMT_CBS_CFS,
 	},
-	[DAILINK_DA7219] = {
-		.name = "DA7219",
-		.stream_name = "DA7219 PCM",
-		.codec_dai_name = "da7219-hifi",
-		.init = rockchip_sound_da7219_init,
-		.ops = &rockchip_sound_da7219_ops,
-		/* set da7219 as slave */
-		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
-			SND_SOC_DAIFMT_CBS_CFS,
-	},
 	/* RT5514 DSP for voice wakeup via spi bus */
 	[DAILINK_RT5514_DSP] = {
 		.name = "RT5514 DSP",
@@ -284,42 +302,72 @@ static struct snd_soc_dai_link rockchip_dailinks[] = {
 	},
 };
 
-static struct snd_soc_card rockchip_sound_card = {
-	.name = "rk3399-gru-sound",
-	.owner = THIS_MODULE,
-	.dai_link = rockchip_dailinks,
-	.num_links =  ARRAY_SIZE(rockchip_dailinks),
-	.dapm_widgets = rockchip_dapm_widgets,
-	.num_dapm_widgets = ARRAY_SIZE(rockchip_dapm_widgets),
-	.dapm_routes = rockchip_dapm_routes,
-	.num_dapm_routes = ARRAY_SIZE(rockchip_dapm_routes),
-	.controls = rockchip_controls,
-	.num_controls = ARRAY_SIZE(rockchip_controls),
-};
-
-static int rockchip_sound_probe(struct platform_device *pdev)
+static int rockchip_sound_codec_node_match(struct device_node *np_codec)
 {
-	struct snd_soc_card *card = &rockchip_sound_card;
-	struct device_node *cpu_node;
-	int i, ret;
+	int i;
 
-	cpu_node = of_parse_phandle(pdev->dev.of_node, "rockchip,cpu", 0);
-	if (!cpu_node) {
-		dev_err(&pdev->dev, "Property 'rockchip,cpu' missing or invalid\n");
-		return -EINVAL;
+	for (i = 0; i < ARRAY_SIZE(dailink_compat); i++) {
+		if (of_device_is_compatible(np_codec, dailink_compat[i]))
+			return i;
 	}
+	return -1;
+}
 
-	for (i = 0; i < ARRAY_SIZE(rockchip_dailinks); i++) {
-		rockchip_dailinks[i].platform_of_node = cpu_node;
-		rockchip_dailinks[i].cpu_of_node = cpu_node;
-
-		rockchip_dailinks[i].codec_of_node =
-			of_parse_phandle(pdev->dev.of_node, "rockchip,codec", i);
-		if (!rockchip_dailinks[i].codec_of_node) {
-			dev_err(&pdev->dev,
-				"Property[%d] 'rockchip,codec' missing or invalid\n", i);
+static int rockchip_sound_of_parse_dais(struct device *dev,
+					struct snd_soc_card *card)
+{
+	struct device_node *np_cpu;
+	struct device_node *np_codec;
+	struct snd_soc_dai_link *dai;
+	int i, index;
+
+	card->dai_link = devm_kzalloc(dev, sizeof(rockchip_dais),
+				      GFP_KERNEL);
+	if (!card->dai_link)
+		return -ENOMEM;
+
+	np_cpu = of_parse_phandle(dev->of_node, "rockchip,cpu", 0);
+
+	card->num_links = 0;
+	for (i = 0; i < ARRAY_SIZE(rockchip_dais); i++) {
+		np_codec = of_parse_phandle(dev->of_node,
+					    "rockchip,codec", i);
+		if (!np_codec)
+			break;
+
+		if (!of_device_is_available(np_codec))
+			continue;
+
+		index = rockchip_sound_codec_node_match(np_codec);
+		if (index < 0)
+			continue;
+
+		if (!np_cpu) {
+			dev_err(dev, "Missing 'rockchip,cpu' for %s\n",
+				rockchip_dais[index].name);
 			return -EINVAL;
 		}
+
+		dai = &card->dai_link[card->num_links++];
+		*dai = rockchip_dais[index];
+
+		dai->codec_of_node = np_codec;
+		dai->platform_of_node = np_cpu;
+		dai->cpu_of_node = np_cpu;
+	}
+
+	return 0;
+}
+
+static int rockchip_sound_probe(struct platform_device *pdev)
+{
+	struct snd_soc_card *card = &rockchip_sound_card;
+	int ret;
+
+	ret = rockchip_sound_of_parse_dais(&pdev->dev, card);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "Failed to parse dais: %d\n", ret);
+		return ret;
 	}
 
 	/* Set DMIC wakeup delay */
@@ -332,13 +380,7 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 	}
 
 	card->dev = &pdev->dev;
-
-	ret = devm_snd_soc_register_card(&pdev->dev, card);
-	if (ret)
-		dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n",
-			__func__, ret);
-
-	return ret;
+	return devm_snd_soc_register_card(&pdev->dev, card);
 }
 
 static const struct of_device_id rockchip_sound_of_match[] = {
-- 
2.13.2

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

* Applied "ASoC: rockchip: Parse dai links from dts" to the asoc tree
@ 2017-08-29 19:28     ` Mark Brown
  0 siblings, 0 replies; 44+ messages in thread
From: Mark Brown @ 2017-08-29 19:28 UTC (permalink / raw)
  To: Jeffy Chen
  Cc: alsa-devel, dianders, heiko, briannorris, linux-kernel,
	Liam Girdwood, linux-rockchip, Mark Brown, Takashi Iwai, dgreid,
	mka, linux-arm-kernel

The patch

   ASoC: rockchip: Parse dai links from dts

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 0d52954ffe80b051ab79a105bd801485c4bbe20a Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Thu, 24 Aug 2017 12:52:24 +0800
Subject: [PATCH] ASoC: rockchip: Parse dai links from dts

Refactor rockchip_sound_probe, parse dai links from dts instead of
hard coding them.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/rockchip/rk3399_gru_sound.c | 140 ++++++++++++++++++++++------------
 1 file changed, 91 insertions(+), 49 deletions(-)

diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index cd2fdba922f1..347c34d0db4c 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -240,14 +240,42 @@ static const struct snd_soc_ops rockchip_sound_da7219_ops = {
 	.hw_params = rockchip_sound_da7219_hw_params,
 };
 
+static struct snd_soc_card rockchip_sound_card = {
+	.name = "rk3399-gru-sound",
+	.owner = THIS_MODULE,
+	.dapm_widgets = rockchip_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(rockchip_dapm_widgets),
+	.dapm_routes = rockchip_dapm_routes,
+	.num_dapm_routes = ARRAY_SIZE(rockchip_dapm_routes),
+	.controls = rockchip_controls,
+	.num_controls = ARRAY_SIZE(rockchip_controls),
+};
+
 enum {
+	DAILINK_DA7219,
 	DAILINK_MAX98357A,
 	DAILINK_RT5514,
-	DAILINK_DA7219,
 	DAILINK_RT5514_DSP,
 };
 
-static struct snd_soc_dai_link rockchip_dailinks[] = {
+static const char * const dailink_compat[] = {
+	[DAILINK_DA7219] = "dlg,da7219",
+	[DAILINK_MAX98357A] = "maxim,max98357a",
+	[DAILINK_RT5514] = "realtek,rt5514-i2c",
+	[DAILINK_RT5514_DSP] = "realtek,rt5514-spi",
+};
+
+static const struct snd_soc_dai_link rockchip_dais[] = {
+	[DAILINK_DA7219] = {
+		.name = "DA7219",
+		.stream_name = "DA7219 PCM",
+		.codec_dai_name = "da7219-hifi",
+		.init = rockchip_sound_da7219_init,
+		.ops = &rockchip_sound_da7219_ops,
+		/* set da7219 as slave */
+		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
+			SND_SOC_DAIFMT_CBS_CFS,
+	},
 	[DAILINK_MAX98357A] = {
 		.name = "MAX98357A",
 		.stream_name = "MAX98357A PCM",
@@ -266,16 +294,6 @@ static struct snd_soc_dai_link rockchip_dailinks[] = {
 		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
 			SND_SOC_DAIFMT_CBS_CFS,
 	},
-	[DAILINK_DA7219] = {
-		.name = "DA7219",
-		.stream_name = "DA7219 PCM",
-		.codec_dai_name = "da7219-hifi",
-		.init = rockchip_sound_da7219_init,
-		.ops = &rockchip_sound_da7219_ops,
-		/* set da7219 as slave */
-		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
-			SND_SOC_DAIFMT_CBS_CFS,
-	},
 	/* RT5514 DSP for voice wakeup via spi bus */
 	[DAILINK_RT5514_DSP] = {
 		.name = "RT5514 DSP",
@@ -284,42 +302,72 @@ static struct snd_soc_dai_link rockchip_dailinks[] = {
 	},
 };
 
-static struct snd_soc_card rockchip_sound_card = {
-	.name = "rk3399-gru-sound",
-	.owner = THIS_MODULE,
-	.dai_link = rockchip_dailinks,
-	.num_links =  ARRAY_SIZE(rockchip_dailinks),
-	.dapm_widgets = rockchip_dapm_widgets,
-	.num_dapm_widgets = ARRAY_SIZE(rockchip_dapm_widgets),
-	.dapm_routes = rockchip_dapm_routes,
-	.num_dapm_routes = ARRAY_SIZE(rockchip_dapm_routes),
-	.controls = rockchip_controls,
-	.num_controls = ARRAY_SIZE(rockchip_controls),
-};
-
-static int rockchip_sound_probe(struct platform_device *pdev)
+static int rockchip_sound_codec_node_match(struct device_node *np_codec)
 {
-	struct snd_soc_card *card = &rockchip_sound_card;
-	struct device_node *cpu_node;
-	int i, ret;
+	int i;
 
-	cpu_node = of_parse_phandle(pdev->dev.of_node, "rockchip,cpu", 0);
-	if (!cpu_node) {
-		dev_err(&pdev->dev, "Property 'rockchip,cpu' missing or invalid\n");
-		return -EINVAL;
+	for (i = 0; i < ARRAY_SIZE(dailink_compat); i++) {
+		if (of_device_is_compatible(np_codec, dailink_compat[i]))
+			return i;
 	}
+	return -1;
+}
 
-	for (i = 0; i < ARRAY_SIZE(rockchip_dailinks); i++) {
-		rockchip_dailinks[i].platform_of_node = cpu_node;
-		rockchip_dailinks[i].cpu_of_node = cpu_node;
-
-		rockchip_dailinks[i].codec_of_node =
-			of_parse_phandle(pdev->dev.of_node, "rockchip,codec", i);
-		if (!rockchip_dailinks[i].codec_of_node) {
-			dev_err(&pdev->dev,
-				"Property[%d] 'rockchip,codec' missing or invalid\n", i);
+static int rockchip_sound_of_parse_dais(struct device *dev,
+					struct snd_soc_card *card)
+{
+	struct device_node *np_cpu;
+	struct device_node *np_codec;
+	struct snd_soc_dai_link *dai;
+	int i, index;
+
+	card->dai_link = devm_kzalloc(dev, sizeof(rockchip_dais),
+				      GFP_KERNEL);
+	if (!card->dai_link)
+		return -ENOMEM;
+
+	np_cpu = of_parse_phandle(dev->of_node, "rockchip,cpu", 0);
+
+	card->num_links = 0;
+	for (i = 0; i < ARRAY_SIZE(rockchip_dais); i++) {
+		np_codec = of_parse_phandle(dev->of_node,
+					    "rockchip,codec", i);
+		if (!np_codec)
+			break;
+
+		if (!of_device_is_available(np_codec))
+			continue;
+
+		index = rockchip_sound_codec_node_match(np_codec);
+		if (index < 0)
+			continue;
+
+		if (!np_cpu) {
+			dev_err(dev, "Missing 'rockchip,cpu' for %s\n",
+				rockchip_dais[index].name);
 			return -EINVAL;
 		}
+
+		dai = &card->dai_link[card->num_links++];
+		*dai = rockchip_dais[index];
+
+		dai->codec_of_node = np_codec;
+		dai->platform_of_node = np_cpu;
+		dai->cpu_of_node = np_cpu;
+	}
+
+	return 0;
+}
+
+static int rockchip_sound_probe(struct platform_device *pdev)
+{
+	struct snd_soc_card *card = &rockchip_sound_card;
+	int ret;
+
+	ret = rockchip_sound_of_parse_dais(&pdev->dev, card);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "Failed to parse dais: %d\n", ret);
+		return ret;
 	}
 
 	/* Set DMIC wakeup delay */
@@ -332,13 +380,7 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 	}
 
 	card->dev = &pdev->dev;
-
-	ret = devm_snd_soc_register_card(&pdev->dev, card);
-	if (ret)
-		dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n",
-			__func__, ret);
-
-	return ret;
+	return devm_snd_soc_register_card(&pdev->dev, card);
 }
 
 static const struct of_device_id rockchip_sound_of_match[] = {
-- 
2.13.2

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

* Applied "ASoC: rockchip: Parse dai links from dts" to the asoc tree
@ 2017-08-29 19:28     ` Mark Brown
  0 siblings, 0 replies; 44+ messages in thread
From: Mark Brown @ 2017-08-29 19:28 UTC (permalink / raw)
  To: Jeffy Chen
  Cc: alsa-devel, dianders, heiko, briannorris, linux-kernel,
	Liam Girdwood, linux-rockchip, Mark Brown, Takashi Iwai, dgreid,
	mka, linux-arm-kernel

The patch

   ASoC: rockchip: Parse dai links from dts

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 0d52954ffe80b051ab79a105bd801485c4bbe20a Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Thu, 24 Aug 2017 12:52:24 +0800
Subject: [PATCH] ASoC: rockchip: Parse dai links from dts

Refactor rockchip_sound_probe, parse dai links from dts instead of
hard coding them.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/rockchip/rk3399_gru_sound.c | 140 ++++++++++++++++++++++------------
 1 file changed, 91 insertions(+), 49 deletions(-)

diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index cd2fdba922f1..347c34d0db4c 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -240,14 +240,42 @@ static const struct snd_soc_ops rockchip_sound_da7219_ops = {
 	.hw_params = rockchip_sound_da7219_hw_params,
 };
 
+static struct snd_soc_card rockchip_sound_card = {
+	.name = "rk3399-gru-sound",
+	.owner = THIS_MODULE,
+	.dapm_widgets = rockchip_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(rockchip_dapm_widgets),
+	.dapm_routes = rockchip_dapm_routes,
+	.num_dapm_routes = ARRAY_SIZE(rockchip_dapm_routes),
+	.controls = rockchip_controls,
+	.num_controls = ARRAY_SIZE(rockchip_controls),
+};
+
 enum {
+	DAILINK_DA7219,
 	DAILINK_MAX98357A,
 	DAILINK_RT5514,
-	DAILINK_DA7219,
 	DAILINK_RT5514_DSP,
 };
 
-static struct snd_soc_dai_link rockchip_dailinks[] = {
+static const char * const dailink_compat[] = {
+	[DAILINK_DA7219] = "dlg,da7219",
+	[DAILINK_MAX98357A] = "maxim,max98357a",
+	[DAILINK_RT5514] = "realtek,rt5514-i2c",
+	[DAILINK_RT5514_DSP] = "realtek,rt5514-spi",
+};
+
+static const struct snd_soc_dai_link rockchip_dais[] = {
+	[DAILINK_DA7219] = {
+		.name = "DA7219",
+		.stream_name = "DA7219 PCM",
+		.codec_dai_name = "da7219-hifi",
+		.init = rockchip_sound_da7219_init,
+		.ops = &rockchip_sound_da7219_ops,
+		/* set da7219 as slave */
+		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
+			SND_SOC_DAIFMT_CBS_CFS,
+	},
 	[DAILINK_MAX98357A] = {
 		.name = "MAX98357A",
 		.stream_name = "MAX98357A PCM",
@@ -266,16 +294,6 @@ static struct snd_soc_dai_link rockchip_dailinks[] = {
 		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
 			SND_SOC_DAIFMT_CBS_CFS,
 	},
-	[DAILINK_DA7219] = {
-		.name = "DA7219",
-		.stream_name = "DA7219 PCM",
-		.codec_dai_name = "da7219-hifi",
-		.init = rockchip_sound_da7219_init,
-		.ops = &rockchip_sound_da7219_ops,
-		/* set da7219 as slave */
-		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
-			SND_SOC_DAIFMT_CBS_CFS,
-	},
 	/* RT5514 DSP for voice wakeup via spi bus */
 	[DAILINK_RT5514_DSP] = {
 		.name = "RT5514 DSP",
@@ -284,42 +302,72 @@ static struct snd_soc_dai_link rockchip_dailinks[] = {
 	},
 };
 
-static struct snd_soc_card rockchip_sound_card = {
-	.name = "rk3399-gru-sound",
-	.owner = THIS_MODULE,
-	.dai_link = rockchip_dailinks,
-	.num_links =  ARRAY_SIZE(rockchip_dailinks),
-	.dapm_widgets = rockchip_dapm_widgets,
-	.num_dapm_widgets = ARRAY_SIZE(rockchip_dapm_widgets),
-	.dapm_routes = rockchip_dapm_routes,
-	.num_dapm_routes = ARRAY_SIZE(rockchip_dapm_routes),
-	.controls = rockchip_controls,
-	.num_controls = ARRAY_SIZE(rockchip_controls),
-};
-
-static int rockchip_sound_probe(struct platform_device *pdev)
+static int rockchip_sound_codec_node_match(struct device_node *np_codec)
 {
-	struct snd_soc_card *card = &rockchip_sound_card;
-	struct device_node *cpu_node;
-	int i, ret;
+	int i;
 
-	cpu_node = of_parse_phandle(pdev->dev.of_node, "rockchip,cpu", 0);
-	if (!cpu_node) {
-		dev_err(&pdev->dev, "Property 'rockchip,cpu' missing or invalid\n");
-		return -EINVAL;
+	for (i = 0; i < ARRAY_SIZE(dailink_compat); i++) {
+		if (of_device_is_compatible(np_codec, dailink_compat[i]))
+			return i;
 	}
+	return -1;
+}
 
-	for (i = 0; i < ARRAY_SIZE(rockchip_dailinks); i++) {
-		rockchip_dailinks[i].platform_of_node = cpu_node;
-		rockchip_dailinks[i].cpu_of_node = cpu_node;
-
-		rockchip_dailinks[i].codec_of_node =
-			of_parse_phandle(pdev->dev.of_node, "rockchip,codec", i);
-		if (!rockchip_dailinks[i].codec_of_node) {
-			dev_err(&pdev->dev,
-				"Property[%d] 'rockchip,codec' missing or invalid\n", i);
+static int rockchip_sound_of_parse_dais(struct device *dev,
+					struct snd_soc_card *card)
+{
+	struct device_node *np_cpu;
+	struct device_node *np_codec;
+	struct snd_soc_dai_link *dai;
+	int i, index;
+
+	card->dai_link = devm_kzalloc(dev, sizeof(rockchip_dais),
+				      GFP_KERNEL);
+	if (!card->dai_link)
+		return -ENOMEM;
+
+	np_cpu = of_parse_phandle(dev->of_node, "rockchip,cpu", 0);
+
+	card->num_links = 0;
+	for (i = 0; i < ARRAY_SIZE(rockchip_dais); i++) {
+		np_codec = of_parse_phandle(dev->of_node,
+					    "rockchip,codec", i);
+		if (!np_codec)
+			break;
+
+		if (!of_device_is_available(np_codec))
+			continue;
+
+		index = rockchip_sound_codec_node_match(np_codec);
+		if (index < 0)
+			continue;
+
+		if (!np_cpu) {
+			dev_err(dev, "Missing 'rockchip,cpu' for %s\n",
+				rockchip_dais[index].name);
 			return -EINVAL;
 		}
+
+		dai = &card->dai_link[card->num_links++];
+		*dai = rockchip_dais[index];
+
+		dai->codec_of_node = np_codec;
+		dai->platform_of_node = np_cpu;
+		dai->cpu_of_node = np_cpu;
+	}
+
+	return 0;
+}
+
+static int rockchip_sound_probe(struct platform_device *pdev)
+{
+	struct snd_soc_card *card = &rockchip_sound_card;
+	int ret;
+
+	ret = rockchip_sound_of_parse_dais(&pdev->dev, card);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "Failed to parse dais: %d\n", ret);
+		return ret;
 	}
 
 	/* Set DMIC wakeup delay */
@@ -332,13 +380,7 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 	}
 
 	card->dev = &pdev->dev;
-
-	ret = devm_snd_soc_register_card(&pdev->dev, card);
-	if (ret)
-		dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n",
-			__func__, ret);
-
-	return ret;
+	return devm_snd_soc_register_card(&pdev->dev, card);
 }
 
 static const struct of_device_id rockchip_sound_of_match[] = {
-- 
2.13.2

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

* Applied "ASoC: rockchip: Parse dai links from dts" to the asoc tree
@ 2017-08-29 19:28     ` Mark Brown
  0 siblings, 0 replies; 44+ messages in thread
From: Mark Brown @ 2017-08-29 19:28 UTC (permalink / raw)
  To: linux-arm-kernel

The patch

   ASoC: rockchip: Parse dai links from dts

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 0d52954ffe80b051ab79a105bd801485c4bbe20a Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Thu, 24 Aug 2017 12:52:24 +0800
Subject: [PATCH] ASoC: rockchip: Parse dai links from dts

Refactor rockchip_sound_probe, parse dai links from dts instead of
hard coding them.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/rockchip/rk3399_gru_sound.c | 140 ++++++++++++++++++++++------------
 1 file changed, 91 insertions(+), 49 deletions(-)

diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index cd2fdba922f1..347c34d0db4c 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -240,14 +240,42 @@ static const struct snd_soc_ops rockchip_sound_da7219_ops = {
 	.hw_params = rockchip_sound_da7219_hw_params,
 };
 
+static struct snd_soc_card rockchip_sound_card = {
+	.name = "rk3399-gru-sound",
+	.owner = THIS_MODULE,
+	.dapm_widgets = rockchip_dapm_widgets,
+	.num_dapm_widgets = ARRAY_SIZE(rockchip_dapm_widgets),
+	.dapm_routes = rockchip_dapm_routes,
+	.num_dapm_routes = ARRAY_SIZE(rockchip_dapm_routes),
+	.controls = rockchip_controls,
+	.num_controls = ARRAY_SIZE(rockchip_controls),
+};
+
 enum {
+	DAILINK_DA7219,
 	DAILINK_MAX98357A,
 	DAILINK_RT5514,
-	DAILINK_DA7219,
 	DAILINK_RT5514_DSP,
 };
 
-static struct snd_soc_dai_link rockchip_dailinks[] = {
+static const char * const dailink_compat[] = {
+	[DAILINK_DA7219] = "dlg,da7219",
+	[DAILINK_MAX98357A] = "maxim,max98357a",
+	[DAILINK_RT5514] = "realtek,rt5514-i2c",
+	[DAILINK_RT5514_DSP] = "realtek,rt5514-spi",
+};
+
+static const struct snd_soc_dai_link rockchip_dais[] = {
+	[DAILINK_DA7219] = {
+		.name = "DA7219",
+		.stream_name = "DA7219 PCM",
+		.codec_dai_name = "da7219-hifi",
+		.init = rockchip_sound_da7219_init,
+		.ops = &rockchip_sound_da7219_ops,
+		/* set da7219 as slave */
+		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
+			SND_SOC_DAIFMT_CBS_CFS,
+	},
 	[DAILINK_MAX98357A] = {
 		.name = "MAX98357A",
 		.stream_name = "MAX98357A PCM",
@@ -266,16 +294,6 @@ static struct snd_soc_dai_link rockchip_dailinks[] = {
 		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
 			SND_SOC_DAIFMT_CBS_CFS,
 	},
-	[DAILINK_DA7219] = {
-		.name = "DA7219",
-		.stream_name = "DA7219 PCM",
-		.codec_dai_name = "da7219-hifi",
-		.init = rockchip_sound_da7219_init,
-		.ops = &rockchip_sound_da7219_ops,
-		/* set da7219 as slave */
-		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
-			SND_SOC_DAIFMT_CBS_CFS,
-	},
 	/* RT5514 DSP for voice wakeup via spi bus */
 	[DAILINK_RT5514_DSP] = {
 		.name = "RT5514 DSP",
@@ -284,42 +302,72 @@ static struct snd_soc_dai_link rockchip_dailinks[] = {
 	},
 };
 
-static struct snd_soc_card rockchip_sound_card = {
-	.name = "rk3399-gru-sound",
-	.owner = THIS_MODULE,
-	.dai_link = rockchip_dailinks,
-	.num_links =  ARRAY_SIZE(rockchip_dailinks),
-	.dapm_widgets = rockchip_dapm_widgets,
-	.num_dapm_widgets = ARRAY_SIZE(rockchip_dapm_widgets),
-	.dapm_routes = rockchip_dapm_routes,
-	.num_dapm_routes = ARRAY_SIZE(rockchip_dapm_routes),
-	.controls = rockchip_controls,
-	.num_controls = ARRAY_SIZE(rockchip_controls),
-};
-
-static int rockchip_sound_probe(struct platform_device *pdev)
+static int rockchip_sound_codec_node_match(struct device_node *np_codec)
 {
-	struct snd_soc_card *card = &rockchip_sound_card;
-	struct device_node *cpu_node;
-	int i, ret;
+	int i;
 
-	cpu_node = of_parse_phandle(pdev->dev.of_node, "rockchip,cpu", 0);
-	if (!cpu_node) {
-		dev_err(&pdev->dev, "Property 'rockchip,cpu' missing or invalid\n");
-		return -EINVAL;
+	for (i = 0; i < ARRAY_SIZE(dailink_compat); i++) {
+		if (of_device_is_compatible(np_codec, dailink_compat[i]))
+			return i;
 	}
+	return -1;
+}
 
-	for (i = 0; i < ARRAY_SIZE(rockchip_dailinks); i++) {
-		rockchip_dailinks[i].platform_of_node = cpu_node;
-		rockchip_dailinks[i].cpu_of_node = cpu_node;
-
-		rockchip_dailinks[i].codec_of_node =
-			of_parse_phandle(pdev->dev.of_node, "rockchip,codec", i);
-		if (!rockchip_dailinks[i].codec_of_node) {
-			dev_err(&pdev->dev,
-				"Property[%d] 'rockchip,codec' missing or invalid\n", i);
+static int rockchip_sound_of_parse_dais(struct device *dev,
+					struct snd_soc_card *card)
+{
+	struct device_node *np_cpu;
+	struct device_node *np_codec;
+	struct snd_soc_dai_link *dai;
+	int i, index;
+
+	card->dai_link = devm_kzalloc(dev, sizeof(rockchip_dais),
+				      GFP_KERNEL);
+	if (!card->dai_link)
+		return -ENOMEM;
+
+	np_cpu = of_parse_phandle(dev->of_node, "rockchip,cpu", 0);
+
+	card->num_links = 0;
+	for (i = 0; i < ARRAY_SIZE(rockchip_dais); i++) {
+		np_codec = of_parse_phandle(dev->of_node,
+					    "rockchip,codec", i);
+		if (!np_codec)
+			break;
+
+		if (!of_device_is_available(np_codec))
+			continue;
+
+		index = rockchip_sound_codec_node_match(np_codec);
+		if (index < 0)
+			continue;
+
+		if (!np_cpu) {
+			dev_err(dev, "Missing 'rockchip,cpu' for %s\n",
+				rockchip_dais[index].name);
 			return -EINVAL;
 		}
+
+		dai = &card->dai_link[card->num_links++];
+		*dai = rockchip_dais[index];
+
+		dai->codec_of_node = np_codec;
+		dai->platform_of_node = np_cpu;
+		dai->cpu_of_node = np_cpu;
+	}
+
+	return 0;
+}
+
+static int rockchip_sound_probe(struct platform_device *pdev)
+{
+	struct snd_soc_card *card = &rockchip_sound_card;
+	int ret;
+
+	ret = rockchip_sound_of_parse_dais(&pdev->dev, card);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "Failed to parse dais: %d\n", ret);
+		return ret;
 	}
 
 	/* Set DMIC wakeup delay */
@@ -332,13 +380,7 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 	}
 
 	card->dev = &pdev->dev;
-
-	ret = devm_snd_soc_register_card(&pdev->dev, card);
-	if (ret)
-		dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n",
-			__func__, ret);
-
-	return ret;
+	return devm_snd_soc_register_card(&pdev->dev, card);
 }
 
 static const struct of_device_id rockchip_sound_of_match[] = {
-- 
2.13.2

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

* Applied "ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp" to the asoc tree
  2017-08-24  4:52   ` Jeffy Chen
  (?)
  (?)
@ 2017-08-29 19:29     ` Mark Brown
  -1 siblings, 0 replies; 44+ messages in thread
From: Mark Brown @ 2017-08-29 19:29 UTC (permalink / raw)
  To: Jeffy Chen
  Cc: Matthias Kaehlcke, Mark Brown, linux-kernel, dgreid, heiko,
	alsa-devel, briannorris, Liam Girdwood, Mark Brown, dianders,
	linux-rockchip, mka, Takashi Iwai, linux-arm-kernel, alsa-devel

The patch

   ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 72cfb0f20c75c1e580597c164b9d74426e583f37 Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Thu, 24 Aug 2017 12:52:21 +0800
Subject: [PATCH] ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp

Currently we are using codec name for rt5514 dsp dai link, use codec
of_node instead.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/rockchip/rk3399_gru_sound.c | 34 ++--------------------------------
 1 file changed, 2 insertions(+), 32 deletions(-)

diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index 566ccb39fb31..cd2fdba922f1 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -247,8 +247,6 @@ enum {
 	DAILINK_RT5514_DSP,
 };
 
-#define DAILINK_ENTITIES	(DAILINK_DA7219 + 1)
-
 static struct snd_soc_dai_link rockchip_dailinks[] = {
 	[DAILINK_MAX98357A] = {
 		.name = "MAX98357A",
@@ -282,8 +280,7 @@ static struct snd_soc_dai_link rockchip_dailinks[] = {
 	[DAILINK_RT5514_DSP] = {
 		.name = "RT5514 DSP",
 		.stream_name = "Wake on Voice",
-		.codec_name = "snd-soc-dummy",
-		.codec_dai_name = "snd-soc-dummy-dai",
+		.codec_dai_name = "rt5514-dsp-cpu-dai",
 	},
 };
 
@@ -300,17 +297,10 @@ static struct snd_soc_card rockchip_sound_card = {
 	.num_controls = ARRAY_SIZE(rockchip_controls),
 };
 
-static int rockchip_sound_match_stub(struct device *dev, void *data)
-{
-	return 1;
-}
-
 static int rockchip_sound_probe(struct platform_device *pdev)
 {
 	struct snd_soc_card *card = &rockchip_sound_card;
 	struct device_node *cpu_node;
-	struct device *dev;
-	struct device_driver *drv;
 	int i, ret;
 
 	cpu_node = of_parse_phandle(pdev->dev.of_node, "rockchip,cpu", 0);
@@ -319,7 +309,7 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	for (i = 0; i < DAILINK_ENTITIES; i++) {
+	for (i = 0; i < ARRAY_SIZE(rockchip_dailinks); i++) {
 		rockchip_dailinks[i].platform_of_node = cpu_node;
 		rockchip_dailinks[i].cpu_of_node = cpu_node;
 
@@ -332,22 +322,6 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 		}
 	}
 
-	/**
-	 * To acquire the spi driver of the rt5514 and set the dai-links names
-	 * for soc_bind_dai_link
-	 */
-	drv = driver_find("rt5514", &spi_bus_type);
-	if (!drv) {
-		dev_err(&pdev->dev, "Can not find the rt5514 driver at the spi bus\n");
-		return -EINVAL;
-	}
-
-	dev = driver_find_device(drv, NULL, NULL, rockchip_sound_match_stub);
-	if (!dev) {
-		dev_err(&pdev->dev, "Can not find the rt5514 device\n");
-		return -ENODEV;
-	}
-
 	/* Set DMIC wakeup delay */
 	ret = device_property_read_u32(&pdev->dev, "dmic-wakeup-delay-ms",
 					&dmic_wakeup_delay);
@@ -357,10 +331,6 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 			"no optional property 'dmic-wakeup-delay-ms' found, default: no delay\n");
 	}
 
-	rockchip_dailinks[DAILINK_RT5514_DSP].cpu_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
-	rockchip_dailinks[DAILINK_RT5514_DSP].cpu_dai_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
-	rockchip_dailinks[DAILINK_RT5514_DSP].platform_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
-
 	card->dev = &pdev->dev;
 
 	ret = devm_snd_soc_register_card(&pdev->dev, card);
-- 
2.13.2

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

* Applied "ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp" to the asoc tree
@ 2017-08-29 19:29     ` Mark Brown
  0 siblings, 0 replies; 44+ messages in thread
From: Mark Brown @ 2017-08-29 19:29 UTC (permalink / raw)
  To: Jeffy Chen
  Cc: Matthias Kaehlcke, Mark Brown, linux-kernel, dgreid, heiko,
	alsa-devel, briannorris, Liam Girdwood

The patch

   ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 72cfb0f20c75c1e580597c164b9d74426e583f37 Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Thu, 24 Aug 2017 12:52:21 +0800
Subject: [PATCH] ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp

Currently we are using codec name for rt5514 dsp dai link, use codec
of_node instead.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/rockchip/rk3399_gru_sound.c | 34 ++--------------------------------
 1 file changed, 2 insertions(+), 32 deletions(-)

diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index 566ccb39fb31..cd2fdba922f1 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -247,8 +247,6 @@ enum {
 	DAILINK_RT5514_DSP,
 };
 
-#define DAILINK_ENTITIES	(DAILINK_DA7219 + 1)
-
 static struct snd_soc_dai_link rockchip_dailinks[] = {
 	[DAILINK_MAX98357A] = {
 		.name = "MAX98357A",
@@ -282,8 +280,7 @@ static struct snd_soc_dai_link rockchip_dailinks[] = {
 	[DAILINK_RT5514_DSP] = {
 		.name = "RT5514 DSP",
 		.stream_name = "Wake on Voice",
-		.codec_name = "snd-soc-dummy",
-		.codec_dai_name = "snd-soc-dummy-dai",
+		.codec_dai_name = "rt5514-dsp-cpu-dai",
 	},
 };
 
@@ -300,17 +297,10 @@ static struct snd_soc_card rockchip_sound_card = {
 	.num_controls = ARRAY_SIZE(rockchip_controls),
 };
 
-static int rockchip_sound_match_stub(struct device *dev, void *data)
-{
-	return 1;
-}
-
 static int rockchip_sound_probe(struct platform_device *pdev)
 {
 	struct snd_soc_card *card = &rockchip_sound_card;
 	struct device_node *cpu_node;
-	struct device *dev;
-	struct device_driver *drv;
 	int i, ret;
 
 	cpu_node = of_parse_phandle(pdev->dev.of_node, "rockchip,cpu", 0);
@@ -319,7 +309,7 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	for (i = 0; i < DAILINK_ENTITIES; i++) {
+	for (i = 0; i < ARRAY_SIZE(rockchip_dailinks); i++) {
 		rockchip_dailinks[i].platform_of_node = cpu_node;
 		rockchip_dailinks[i].cpu_of_node = cpu_node;
 
@@ -332,22 +322,6 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 		}
 	}
 
-	/**
-	 * To acquire the spi driver of the rt5514 and set the dai-links names
-	 * for soc_bind_dai_link
-	 */
-	drv = driver_find("rt5514", &spi_bus_type);
-	if (!drv) {
-		dev_err(&pdev->dev, "Can not find the rt5514 driver at the spi bus\n");
-		return -EINVAL;
-	}
-
-	dev = driver_find_device(drv, NULL, NULL, rockchip_sound_match_stub);
-	if (!dev) {
-		dev_err(&pdev->dev, "Can not find the rt5514 device\n");
-		return -ENODEV;
-	}
-
 	/* Set DMIC wakeup delay */
 	ret = device_property_read_u32(&pdev->dev, "dmic-wakeup-delay-ms",
 					&dmic_wakeup_delay);
@@ -357,10 +331,6 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 			"no optional property 'dmic-wakeup-delay-ms' found, default: no delay\n");
 	}
 
-	rockchip_dailinks[DAILINK_RT5514_DSP].cpu_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
-	rockchip_dailinks[DAILINK_RT5514_DSP].cpu_dai_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
-	rockchip_dailinks[DAILINK_RT5514_DSP].platform_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
-
 	card->dev = &pdev->dev;
 
 	ret = devm_snd_soc_register_card(&pdev->dev, card);
-- 
2.13.2

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

* Applied "ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp" to the asoc tree
@ 2017-08-29 19:29     ` Mark Brown
  0 siblings, 0 replies; 44+ messages in thread
From: Mark Brown @ 2017-08-29 19:29 UTC (permalink / raw)
  To: Jeffy Chen
  Cc: Matthias Kaehlcke, Mark Brown, linux-kernel, dgreid, heiko,
	alsa-devel, briannorris, Liam Girdwood

The patch

   ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 72cfb0f20c75c1e580597c164b9d74426e583f37 Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Thu, 24 Aug 2017 12:52:21 +0800
Subject: [PATCH] ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp

Currently we are using codec name for rt5514 dsp dai link, use codec
of_node instead.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/rockchip/rk3399_gru_sound.c | 34 ++--------------------------------
 1 file changed, 2 insertions(+), 32 deletions(-)

diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index 566ccb39fb31..cd2fdba922f1 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -247,8 +247,6 @@ enum {
 	DAILINK_RT5514_DSP,
 };
 
-#define DAILINK_ENTITIES	(DAILINK_DA7219 + 1)
-
 static struct snd_soc_dai_link rockchip_dailinks[] = {
 	[DAILINK_MAX98357A] = {
 		.name = "MAX98357A",
@@ -282,8 +280,7 @@ static struct snd_soc_dai_link rockchip_dailinks[] = {
 	[DAILINK_RT5514_DSP] = {
 		.name = "RT5514 DSP",
 		.stream_name = "Wake on Voice",
-		.codec_name = "snd-soc-dummy",
-		.codec_dai_name = "snd-soc-dummy-dai",
+		.codec_dai_name = "rt5514-dsp-cpu-dai",
 	},
 };
 
@@ -300,17 +297,10 @@ static struct snd_soc_card rockchip_sound_card = {
 	.num_controls = ARRAY_SIZE(rockchip_controls),
 };
 
-static int rockchip_sound_match_stub(struct device *dev, void *data)
-{
-	return 1;
-}
-
 static int rockchip_sound_probe(struct platform_device *pdev)
 {
 	struct snd_soc_card *card = &rockchip_sound_card;
 	struct device_node *cpu_node;
-	struct device *dev;
-	struct device_driver *drv;
 	int i, ret;
 
 	cpu_node = of_parse_phandle(pdev->dev.of_node, "rockchip,cpu", 0);
@@ -319,7 +309,7 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	for (i = 0; i < DAILINK_ENTITIES; i++) {
+	for (i = 0; i < ARRAY_SIZE(rockchip_dailinks); i++) {
 		rockchip_dailinks[i].platform_of_node = cpu_node;
 		rockchip_dailinks[i].cpu_of_node = cpu_node;
 
@@ -332,22 +322,6 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 		}
 	}
 
-	/**
-	 * To acquire the spi driver of the rt5514 and set the dai-links names
-	 * for soc_bind_dai_link
-	 */
-	drv = driver_find("rt5514", &spi_bus_type);
-	if (!drv) {
-		dev_err(&pdev->dev, "Can not find the rt5514 driver at the spi bus\n");
-		return -EINVAL;
-	}
-
-	dev = driver_find_device(drv, NULL, NULL, rockchip_sound_match_stub);
-	if (!dev) {
-		dev_err(&pdev->dev, "Can not find the rt5514 device\n");
-		return -ENODEV;
-	}
-
 	/* Set DMIC wakeup delay */
 	ret = device_property_read_u32(&pdev->dev, "dmic-wakeup-delay-ms",
 					&dmic_wakeup_delay);
@@ -357,10 +331,6 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 			"no optional property 'dmic-wakeup-delay-ms' found, default: no delay\n");
 	}
 
-	rockchip_dailinks[DAILINK_RT5514_DSP].cpu_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
-	rockchip_dailinks[DAILINK_RT5514_DSP].cpu_dai_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
-	rockchip_dailinks[DAILINK_RT5514_DSP].platform_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
-
 	card->dev = &pdev->dev;
 
 	ret = devm_snd_soc_register_card(&pdev->dev, card);
-- 
2.13.2

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

* Applied "ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp" to the asoc tree
@ 2017-08-29 19:29     ` Mark Brown
  0 siblings, 0 replies; 44+ messages in thread
From: Mark Brown @ 2017-08-29 19:29 UTC (permalink / raw)
  To: linux-arm-kernel

The patch

   ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 72cfb0f20c75c1e580597c164b9d74426e583f37 Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Thu, 24 Aug 2017 12:52:21 +0800
Subject: [PATCH] ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp

Currently we are using codec name for rt5514 dsp dai link, use codec
of_node instead.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/rockchip/rk3399_gru_sound.c | 34 ++--------------------------------
 1 file changed, 2 insertions(+), 32 deletions(-)

diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index 566ccb39fb31..cd2fdba922f1 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -247,8 +247,6 @@ enum {
 	DAILINK_RT5514_DSP,
 };
 
-#define DAILINK_ENTITIES	(DAILINK_DA7219 + 1)
-
 static struct snd_soc_dai_link rockchip_dailinks[] = {
 	[DAILINK_MAX98357A] = {
 		.name = "MAX98357A",
@@ -282,8 +280,7 @@ static struct snd_soc_dai_link rockchip_dailinks[] = {
 	[DAILINK_RT5514_DSP] = {
 		.name = "RT5514 DSP",
 		.stream_name = "Wake on Voice",
-		.codec_name = "snd-soc-dummy",
-		.codec_dai_name = "snd-soc-dummy-dai",
+		.codec_dai_name = "rt5514-dsp-cpu-dai",
 	},
 };
 
@@ -300,17 +297,10 @@ static struct snd_soc_card rockchip_sound_card = {
 	.num_controls = ARRAY_SIZE(rockchip_controls),
 };
 
-static int rockchip_sound_match_stub(struct device *dev, void *data)
-{
-	return 1;
-}
-
 static int rockchip_sound_probe(struct platform_device *pdev)
 {
 	struct snd_soc_card *card = &rockchip_sound_card;
 	struct device_node *cpu_node;
-	struct device *dev;
-	struct device_driver *drv;
 	int i, ret;
 
 	cpu_node = of_parse_phandle(pdev->dev.of_node, "rockchip,cpu", 0);
@@ -319,7 +309,7 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	for (i = 0; i < DAILINK_ENTITIES; i++) {
+	for (i = 0; i < ARRAY_SIZE(rockchip_dailinks); i++) {
 		rockchip_dailinks[i].platform_of_node = cpu_node;
 		rockchip_dailinks[i].cpu_of_node = cpu_node;
 
@@ -332,22 +322,6 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 		}
 	}
 
-	/**
-	 * To acquire the spi driver of the rt5514 and set the dai-links names
-	 * for soc_bind_dai_link
-	 */
-	drv = driver_find("rt5514", &spi_bus_type);
-	if (!drv) {
-		dev_err(&pdev->dev, "Can not find the rt5514 driver at the spi bus\n");
-		return -EINVAL;
-	}
-
-	dev = driver_find_device(drv, NULL, NULL, rockchip_sound_match_stub);
-	if (!dev) {
-		dev_err(&pdev->dev, "Can not find the rt5514 device\n");
-		return -ENODEV;
-	}
-
 	/* Set DMIC wakeup delay */
 	ret = device_property_read_u32(&pdev->dev, "dmic-wakeup-delay-ms",
 					&dmic_wakeup_delay);
@@ -357,10 +331,6 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 			"no optional property 'dmic-wakeup-delay-ms' found, default: no delay\n");
 	}
 
-	rockchip_dailinks[DAILINK_RT5514_DSP].cpu_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
-	rockchip_dailinks[DAILINK_RT5514_DSP].cpu_dai_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
-	rockchip_dailinks[DAILINK_RT5514_DSP].platform_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
-
 	card->dev = &pdev->dev;
 
 	ret = devm_snd_soc_register_card(&pdev->dev, card);
-- 
2.13.2

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

* Re: [RESENT PATCH v7 3/7] arm64: dts: rockchip: Update rt5514 devices' compatible for Gru
@ 2017-08-30 13:30     ` Heiko Stübner
  0 siblings, 0 replies; 44+ messages in thread
From: Heiko Stübner @ 2017-08-30 13:30 UTC (permalink / raw)
  To: Jeffy Chen
  Cc: linux-kernel, dgreid, briannorris, mka, dianders, devicetree,
	Klaus Goger, linux-rockchip, Rob Herring, linux-arm-kernel,
	Will Deacon, Mark Rutland, Caesar Wang, Catalin Marinas

Hi Jeffy,

Am Donnerstag, 24. August 2017, 12:52:23 CEST schrieb Jeffy Chen:
> Currently the rt5514 i2c driver and rt5514 spi driver are using the same
> compatible string.
> 
> Add additional unused compatible strings to identify them for Gru
> boards.
> 
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> ---
> 
> Changes in v7: None
> Changes in v6: None
> Changes in v3: None
> Changes in v2: None
> 
>  arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
> b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi index
> 5772c52fbfd3..50fb11ad9f17 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
> @@ -611,7 +611,7 @@ ap_i2c_mic: &i2c1 {
>  	i2c-scl-rising-time-ns = <300>;
> 
>  	headsetcodec: rt5514@57 {
> -		compatible = "realtek,rt5514";
> +		compatible = "realtek,rt5514", "realtek,rt5514-i2c";

the rt5514-i2c and -spi compatibles should be documented in the binding-txt
of the chip, but I haven't found any mention of this.


Heiko

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

* Re: [RESENT PATCH v7 3/7] arm64: dts: rockchip: Update rt5514 devices' compatible for Gru
@ 2017-08-30 13:30     ` Heiko Stübner
  0 siblings, 0 replies; 44+ messages in thread
From: Heiko Stübner @ 2017-08-30 13:30 UTC (permalink / raw)
  To: Jeffy Chen
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dgreid-F7+t8E8rja9g9hUCZPvPmw,
	briannorris-F7+t8E8rja9g9hUCZPvPmw, mka-F7+t8E8rja9g9hUCZPvPmw,
	dianders-F7+t8E8rja9g9hUCZPvPmw,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Klaus Goger,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Rob Herring,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Will Deacon,
	Mark Rutland, Caesar Wang, Catalin Marinas

Hi Jeffy,

Am Donnerstag, 24. August 2017, 12:52:23 CEST schrieb Jeffy Chen:
> Currently the rt5514 i2c driver and rt5514 spi driver are using the same
> compatible string.
> 
> Add additional unused compatible strings to identify them for Gru
> boards.
> 
> Signed-off-by: Jeffy Chen <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> ---
> 
> Changes in v7: None
> Changes in v6: None
> Changes in v3: None
> Changes in v2: None
> 
>  arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
> b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi index
> 5772c52fbfd3..50fb11ad9f17 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
> @@ -611,7 +611,7 @@ ap_i2c_mic: &i2c1 {
>  	i2c-scl-rising-time-ns = <300>;
> 
>  	headsetcodec: rt5514@57 {
> -		compatible = "realtek,rt5514";
> +		compatible = "realtek,rt5514", "realtek,rt5514-i2c";

the rt5514-i2c and -spi compatibles should be documented in the binding-txt
of the chip, but I haven't found any mention of this.


Heiko

--
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	[flat|nested] 44+ messages in thread

* [RESENT PATCH v7 3/7] arm64: dts: rockchip: Update rt5514 devices' compatible for Gru
@ 2017-08-30 13:30     ` Heiko Stübner
  0 siblings, 0 replies; 44+ messages in thread
From: Heiko Stübner @ 2017-08-30 13:30 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Jeffy,

Am Donnerstag, 24. August 2017, 12:52:23 CEST schrieb Jeffy Chen:
> Currently the rt5514 i2c driver and rt5514 spi driver are using the same
> compatible string.
> 
> Add additional unused compatible strings to identify them for Gru
> boards.
> 
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> ---
> 
> Changes in v7: None
> Changes in v6: None
> Changes in v3: None
> Changes in v2: None
> 
>  arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
> b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi index
> 5772c52fbfd3..50fb11ad9f17 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
> @@ -611,7 +611,7 @@ ap_i2c_mic: &i2c1 {
>  	i2c-scl-rising-time-ns = <300>;
> 
>  	headsetcodec: rt5514 at 57 {
> -		compatible = "realtek,rt5514";
> +		compatible = "realtek,rt5514", "realtek,rt5514-i2c";

the rt5514-i2c and -spi compatibles should be documented in the binding-txt
of the chip, but I haven't found any mention of this.


Heiko

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

* Re: [RESENT PATCH v7 3/7] arm64: dts: rockchip: Update rt5514 devices' compatible for Gru
  2017-08-30 13:30     ` Heiko Stübner
  (?)
@ 2017-08-30 17:00       ` jeffy
  -1 siblings, 0 replies; 44+ messages in thread
From: jeffy @ 2017-08-30 17:00 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: linux-kernel, dgreid, briannorris, mka, dianders, devicetree,
	Klaus Goger, linux-rockchip, Rob Herring, linux-arm-kernel,
	Will Deacon, Mark Rutland, Caesar Wang, Catalin Marinas,
	Rob Herring

Hi Heiko,

thanks for your reply.

On 08/30/2017 09:30 PM, Heiko Stübner wrote:
>> >-		compatible = "realtek,rt5514";
>> >+		compatible = "realtek,rt5514", "realtek,rt5514-i2c";
> the rt5514-i2c and -spi compatibles should be documented in the binding-txt
> of the chip, but I haven't found any mention of this.
>
>
> Heiko

these compatibles are only used for our snd driver to detect rt5514 i2c 
driver and rt5514 spi driver, suggested by Matthias at 
https://patchwork.kernel.org/patch/9904731/

should i add it in the rockchip,rk3399-gru-sound.txt or rt5514 binding 
document?

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

* Re: [RESENT PATCH v7 3/7] arm64: dts: rockchip: Update rt5514 devices' compatible for Gru
@ 2017-08-30 17:00       ` jeffy
  0 siblings, 0 replies; 44+ messages in thread
From: jeffy @ 2017-08-30 17:00 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: linux-kernel, dgreid, briannorris, mka, dianders, devicetree,
	Klaus Goger, linux-rockchip, Rob Herring, linux-arm-kernel,
	Will Deacon, Mark Rutland, Caesar Wang, Catalin Marinas

Hi Heiko,

thanks for your reply.

On 08/30/2017 09:30 PM, Heiko Stübner wrote:
>> >-		compatible = "realtek,rt5514";
>> >+		compatible = "realtek,rt5514", "realtek,rt5514-i2c";
> the rt5514-i2c and -spi compatibles should be documented in the binding-txt
> of the chip, but I haven't found any mention of this.
>
>
> Heiko

these compatibles are only used for our snd driver to detect rt5514 i2c 
driver and rt5514 spi driver, suggested by Matthias at 
https://patchwork.kernel.org/patch/9904731/

should i add it in the rockchip,rk3399-gru-sound.txt or rt5514 binding 
document?

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

* [RESENT PATCH v7 3/7] arm64: dts: rockchip: Update rt5514 devices' compatible for Gru
@ 2017-08-30 17:00       ` jeffy
  0 siblings, 0 replies; 44+ messages in thread
From: jeffy @ 2017-08-30 17:00 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Heiko,

thanks for your reply.

On 08/30/2017 09:30 PM, Heiko St?bner wrote:
>> >-		compatible = "realtek,rt5514";
>> >+		compatible = "realtek,rt5514", "realtek,rt5514-i2c";
> the rt5514-i2c and -spi compatibles should be documented in the binding-txt
> of the chip, but I haven't found any mention of this.
>
>
> Heiko

these compatibles are only used for our snd driver to detect rt5514 i2c 
driver and rt5514 spi driver, suggested by Matthias at 
https://patchwork.kernel.org/patch/9904731/

should i add it in the rockchip,rk3399-gru-sound.txt or rt5514 binding 
document?

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

* Re: [RESENT PATCH v7 3/7] arm64: dts: rockchip: Update rt5514 devices' compatible for Gru
@ 2017-09-04 22:33         ` Heiko Stübner
  0 siblings, 0 replies; 44+ messages in thread
From: Heiko Stübner @ 2017-09-04 22:33 UTC (permalink / raw)
  To: jeffy
  Cc: linux-kernel, dgreid, briannorris, mka, dianders, devicetree,
	Klaus Goger, linux-rockchip, Rob Herring, linux-arm-kernel,
	Will Deacon, Mark Rutland, Caesar Wang, Catalin Marinas

Am Donnerstag, 31. August 2017, 01:00:44 CEST schrieb jeffy:
> On 08/30/2017 09:30 PM, Heiko Stübner wrote:
> >> >-		compatible = "realtek,rt5514";
> >> >+		compatible = "realtek,rt5514", "realtek,rt5514-i2c";
> > 
> > the rt5514-i2c and -spi compatibles should be documented in the
> > binding-txt
> > of the chip, but I haven't found any mention of this.
> > 
> > 
> > Heiko
> 
> these compatibles are only used for our snd driver to detect rt5514 i2c
> driver and rt5514 spi driver, suggested by Matthias at
> https://patchwork.kernel.org/patch/9904731/
> 
> should i add it in the rockchip,rk3399-gru-sound.txt or rt5514 binding
> document?

You're introducing new bindings for the codec, so they should of course
part of the rt5514 binding.


Heiko

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

* Re: [RESENT PATCH v7 3/7] arm64: dts: rockchip: Update rt5514 devices' compatible for Gru
@ 2017-09-04 22:33         ` Heiko Stübner
  0 siblings, 0 replies; 44+ messages in thread
From: Heiko Stübner @ 2017-09-04 22:33 UTC (permalink / raw)
  To: jeffy
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dgreid-F7+t8E8rja9g9hUCZPvPmw,
	briannorris-F7+t8E8rja9g9hUCZPvPmw, mka-F7+t8E8rja9g9hUCZPvPmw,
	dianders-F7+t8E8rja9g9hUCZPvPmw,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Klaus Goger,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Rob Herring,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Will Deacon,
	Mark Rutland, Caesar Wang, Catalin Marinas

Am Donnerstag, 31. August 2017, 01:00:44 CEST schrieb jeffy:
> On 08/30/2017 09:30 PM, Heiko Stübner wrote:
> >> >-		compatible = "realtek,rt5514";
> >> >+		compatible = "realtek,rt5514", "realtek,rt5514-i2c";
> > 
> > the rt5514-i2c and -spi compatibles should be documented in the
> > binding-txt
> > of the chip, but I haven't found any mention of this.
> > 
> > 
> > Heiko
> 
> these compatibles are only used for our snd driver to detect rt5514 i2c
> driver and rt5514 spi driver, suggested by Matthias at
> https://patchwork.kernel.org/patch/9904731/
> 
> should i add it in the rockchip,rk3399-gru-sound.txt or rt5514 binding
> document?

You're introducing new bindings for the codec, so they should of course
part of the rt5514 binding.


Heiko

--
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	[flat|nested] 44+ messages in thread

* [RESENT PATCH v7 3/7] arm64: dts: rockchip: Update rt5514 devices' compatible for Gru
@ 2017-09-04 22:33         ` Heiko Stübner
  0 siblings, 0 replies; 44+ messages in thread
From: Heiko Stübner @ 2017-09-04 22:33 UTC (permalink / raw)
  To: linux-arm-kernel

Am Donnerstag, 31. August 2017, 01:00:44 CEST schrieb jeffy:
> On 08/30/2017 09:30 PM, Heiko St?bner wrote:
> >> >-		compatible = "realtek,rt5514";
> >> >+		compatible = "realtek,rt5514", "realtek,rt5514-i2c";
> > 
> > the rt5514-i2c and -spi compatibles should be documented in the
> > binding-txt
> > of the chip, but I haven't found any mention of this.
> > 
> > 
> > Heiko
> 
> these compatibles are only used for our snd driver to detect rt5514 i2c
> driver and rt5514 spi driver, suggested by Matthias at
> https://patchwork.kernel.org/patch/9904731/
> 
> should i add it in the rockchip,rk3399-gru-sound.txt or rt5514 binding
> document?

You're introducing new bindings for the codec, so they should of course
part of the rt5514 binding.


Heiko

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

* Re: [RESENT PATCH v7 3/7] arm64: dts: rockchip: Update rt5514 devices' compatible for Gru
  2017-09-04 22:33         ` Heiko Stübner
@ 2017-09-05  4:26           ` jeffy
  -1 siblings, 0 replies; 44+ messages in thread
From: jeffy @ 2017-09-05  4:26 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: linux-kernel, dgreid, briannorris, mka, dianders, devicetree,
	Klaus Goger, linux-rockchip, Rob Herring, linux-arm-kernel,
	Will Deacon, Mark Rutland, Caesar Wang, Catalin Marinas

Hi Heiko,

On 09/05/2017 06:33 AM, Heiko Stübner wrote:
> Am Donnerstag, 31. August 2017, 01:00:44 CEST schrieb jeffy:
>> On 08/30/2017 09:30 PM, Heiko Stübner wrote:
>>>>> -		compatible = "realtek,rt5514";
>>>>> +		compatible = "realtek,rt5514", "realtek,rt5514-i2c";
>>>
>>> the rt5514-i2c and -spi compatibles should be documented in the
>>> binding-txt
>>> of the chip, but I haven't found any mention of this.
>>>
>>>
>>> Heiko
>>
>> these compatibles are only used for our snd driver to detect rt5514 i2c
>> driver and rt5514 spi driver, suggested by Matthias at
>> https://patchwork.kernel.org/patch/9904731/
>>
>> should i add it in the rockchip,rk3399-gru-sound.txt or rt5514 binding
>> document?
>
> You're introducing new bindings for the codec, so they should of course
> part of the rt5514 binding.
ok, will do that.
and it looks like there's no binding for rt5514-spi, will add it too :)
>
>
> Heiko
>
>
>
>

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

* [RESENT PATCH v7 3/7] arm64: dts: rockchip: Update rt5514 devices' compatible for Gru
@ 2017-09-05  4:26           ` jeffy
  0 siblings, 0 replies; 44+ messages in thread
From: jeffy @ 2017-09-05  4:26 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Heiko,

On 09/05/2017 06:33 AM, Heiko St?bner wrote:
> Am Donnerstag, 31. August 2017, 01:00:44 CEST schrieb jeffy:
>> On 08/30/2017 09:30 PM, Heiko St?bner wrote:
>>>>> -		compatible = "realtek,rt5514";
>>>>> +		compatible = "realtek,rt5514", "realtek,rt5514-i2c";
>>>
>>> the rt5514-i2c and -spi compatibles should be documented in the
>>> binding-txt
>>> of the chip, but I haven't found any mention of this.
>>>
>>>
>>> Heiko
>>
>> these compatibles are only used for our snd driver to detect rt5514 i2c
>> driver and rt5514 spi driver, suggested by Matthias at
>> https://patchwork.kernel.org/patch/9904731/
>>
>> should i add it in the rockchip,rk3399-gru-sound.txt or rt5514 binding
>> document?
>
> You're introducing new bindings for the codec, so they should of course
> part of the rt5514 binding.
ok, will do that.
and it looks like there's no binding for rt5514-spi, will add it too :)
>
>
> Heiko
>
>
>
>

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

* Re: [RESENT PATCH v7 2/7] arm64: dts: rockchip: Add rt5514 dsp for Gru
@ 2017-09-09 11:13     ` Heiko Stuebner
  0 siblings, 0 replies; 44+ messages in thread
From: Heiko Stuebner @ 2017-09-09 11:13 UTC (permalink / raw)
  To: Jeffy Chen
  Cc: linux-kernel, dgreid, briannorris, mka, dianders, devicetree,
	Klaus Goger, linux-rockchip, Rob Herring, linux-arm-kernel,
	Will Deacon, Mark Rutland, Caesar Wang, Catalin Marinas

Am Donnerstag, 24. August 2017, 12:52:22 CEST schrieb Jeffy Chen:
> Add rt5514 dsp of_node to codec list for Gru boards.
> 
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>

applied for 4.15
Second patch needs to wait a bit more for the binding to get accepted.


Thanks
Heiko

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

* Re: [RESENT PATCH v7 2/7] arm64: dts: rockchip: Add rt5514 dsp for Gru
@ 2017-09-09 11:13     ` Heiko Stuebner
  0 siblings, 0 replies; 44+ messages in thread
From: Heiko Stuebner @ 2017-09-09 11:13 UTC (permalink / raw)
  To: Jeffy Chen
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dgreid-F7+t8E8rja9g9hUCZPvPmw,
	briannorris-F7+t8E8rja9g9hUCZPvPmw, mka-F7+t8E8rja9g9hUCZPvPmw,
	dianders-F7+t8E8rja9g9hUCZPvPmw,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Klaus Goger,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Rob Herring,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Will Deacon,
	Mark Rutland, Caesar Wang, Catalin Marinas

Am Donnerstag, 24. August 2017, 12:52:22 CEST schrieb Jeffy Chen:
> Add rt5514 dsp of_node to codec list for Gru boards.
> 
> Signed-off-by: Jeffy Chen <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>

applied for 4.15
Second patch needs to wait a bit more for the binding to get accepted.


Thanks
Heiko
--
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	[flat|nested] 44+ messages in thread

* [RESENT PATCH v7 2/7] arm64: dts: rockchip: Add rt5514 dsp for Gru
@ 2017-09-09 11:13     ` Heiko Stuebner
  0 siblings, 0 replies; 44+ messages in thread
From: Heiko Stuebner @ 2017-09-09 11:13 UTC (permalink / raw)
  To: linux-arm-kernel

Am Donnerstag, 24. August 2017, 12:52:22 CEST schrieb Jeffy Chen:
> Add rt5514 dsp of_node to codec list for Gru boards.
> 
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>

applied for 4.15
Second patch needs to wait a bit more for the binding to get accepted.


Thanks
Heiko

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

* Re: [RESENT PATCH v7 2/7] arm64: dts: rockchip: Add rt5514 dsp for Gru
  2017-09-09 11:13     ` Heiko Stuebner
  (?)
@ 2017-09-09 11:45       ` Heiko Stuebner
  -1 siblings, 0 replies; 44+ messages in thread
From: Heiko Stuebner @ 2017-09-09 11:45 UTC (permalink / raw)
  To: Jeffy Chen
  Cc: linux-kernel, dgreid, briannorris, mka, dianders, devicetree,
	Klaus Goger, linux-rockchip, Rob Herring, linux-arm-kernel,
	Will Deacon, Mark Rutland, Caesar Wang, Catalin Marinas

Am Samstag, 9. September 2017, 13:13:01 CEST schrieb Heiko Stuebner:
> Am Donnerstag, 24. August 2017, 12:52:22 CEST schrieb Jeffy Chen:
> > Add rt5514 dsp of_node to codec list for Gru boards.
> > 
> > Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> 
> applied for 4.15
> Second patch needs to wait a bit more for the binding to get accepted.

just realized that
	[PATCH v7 3/7] arm64: dts: rockchip: Update rt5514 devices' compatible for Gru

is also part of the 2-patch series adding the compatible, so I don't need
to track it here anymore, so nevermind the comment above.


Heiko

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

* Re: [RESENT PATCH v7 2/7] arm64: dts: rockchip: Add rt5514 dsp for Gru
@ 2017-09-09 11:45       ` Heiko Stuebner
  0 siblings, 0 replies; 44+ messages in thread
From: Heiko Stuebner @ 2017-09-09 11:45 UTC (permalink / raw)
  To: Jeffy Chen
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dgreid-F7+t8E8rja9g9hUCZPvPmw,
	briannorris-F7+t8E8rja9g9hUCZPvPmw, mka-F7+t8E8rja9g9hUCZPvPmw,
	dianders-F7+t8E8rja9g9hUCZPvPmw,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Klaus Goger,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Rob Herring,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Will Deacon,
	Mark Rutland, Caesar Wang, Catalin Marinas

Am Samstag, 9. September 2017, 13:13:01 CEST schrieb Heiko Stuebner:
> Am Donnerstag, 24. August 2017, 12:52:22 CEST schrieb Jeffy Chen:
> > Add rt5514 dsp of_node to codec list for Gru boards.
> > 
> > Signed-off-by: Jeffy Chen <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> 
> applied for 4.15
> Second patch needs to wait a bit more for the binding to get accepted.

just realized that
	[PATCH v7 3/7] arm64: dts: rockchip: Update rt5514 devices' compatible for Gru

is also part of the 2-patch series adding the compatible, so I don't need
to track it here anymore, so nevermind the comment above.


Heiko
--
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	[flat|nested] 44+ messages in thread

* [RESENT PATCH v7 2/7] arm64: dts: rockchip: Add rt5514 dsp for Gru
@ 2017-09-09 11:45       ` Heiko Stuebner
  0 siblings, 0 replies; 44+ messages in thread
From: Heiko Stuebner @ 2017-09-09 11:45 UTC (permalink / raw)
  To: linux-arm-kernel

Am Samstag, 9. September 2017, 13:13:01 CEST schrieb Heiko Stuebner:
> Am Donnerstag, 24. August 2017, 12:52:22 CEST schrieb Jeffy Chen:
> > Add rt5514 dsp of_node to codec list for Gru boards.
> > 
> > Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> 
> applied for 4.15
> Second patch needs to wait a bit more for the binding to get accepted.

just realized that
	[PATCH v7 3/7] arm64: dts: rockchip: Update rt5514 devices' compatible for Gru

is also part of the 2-patch series adding the compatible, so I don't need
to track it here anymore, so nevermind the comment above.


Heiko

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

end of thread, other threads:[~2017-09-09 11:45 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-24  4:52 [RESENT PATCH v7 0/7] ASoC: rockchip: Parse dai links from dts Jeffy Chen
2017-08-24  4:52 ` Jeffy Chen
2017-08-24  4:52 ` Jeffy Chen
2017-08-24  4:52 ` [RESENT PATCH v7 1/7] ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp Jeffy Chen
2017-08-24  4:52   ` Jeffy Chen
2017-08-24 21:19   ` Matthias Kaehlcke
2017-08-24 21:19     ` Matthias Kaehlcke
2017-08-29 19:29   ` Applied "ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp" to the asoc tree Mark Brown
2017-08-29 19:29     ` Mark Brown
2017-08-29 19:29     ` Mark Brown
2017-08-29 19:29     ` Mark Brown
2017-08-24  4:52 ` [RESENT PATCH v7 2/7] arm64: dts: rockchip: Add rt5514 dsp for Gru Jeffy Chen
2017-08-24  4:52   ` Jeffy Chen
2017-09-09 11:13   ` Heiko Stuebner
2017-09-09 11:13     ` Heiko Stuebner
2017-09-09 11:13     ` Heiko Stuebner
2017-09-09 11:45     ` Heiko Stuebner
2017-09-09 11:45       ` Heiko Stuebner
2017-09-09 11:45       ` Heiko Stuebner
2017-08-24  4:52 ` [RESENT PATCH v7 3/7] arm64: dts: rockchip: Update rt5514 devices' compatible " Jeffy Chen
2017-08-24  4:52   ` Jeffy Chen
2017-08-30 13:30   ` Heiko Stübner
2017-08-30 13:30     ` Heiko Stübner
2017-08-30 13:30     ` Heiko Stübner
2017-08-30 17:00     ` jeffy
2017-08-30 17:00       ` jeffy
2017-08-30 17:00       ` jeffy
2017-09-04 22:33       ` Heiko Stübner
2017-09-04 22:33         ` Heiko Stübner
2017-09-04 22:33         ` Heiko Stübner
2017-09-05  4:26         ` jeffy
2017-09-05  4:26           ` jeffy
2017-08-24  4:52 ` [RESENT PATCH v7 4/7] ASoC: rockchip: Parse dai links from dts Jeffy Chen
2017-08-24  4:52   ` Jeffy Chen
2017-08-29 19:28   ` Applied "ASoC: rockchip: Parse dai links from dts" to the asoc tree Mark Brown
2017-08-29 19:28     ` Mark Brown
2017-08-29 19:28     ` Mark Brown
2017-08-29 19:28     ` Mark Brown
2017-08-24  4:52 ` [RESENT PATCH v7 5/7] ASoC: rockchip: Add support for DP codec Jeffy Chen
2017-08-24  4:52   ` Jeffy Chen
2017-08-24  4:52 ` [RESENT PATCH v7 6/7] ASoC: rockchip: Add support for DMIC codec Jeffy Chen
2017-08-24  4:52   ` Jeffy Chen
2017-08-24  4:52 ` [RESENT PATCH v7 7/7] dt-bindings: ASoC: rockchip: Update description of rockchip,codec Jeffy Chen
2017-08-24  4:52   ` [RESENT PATCH v7 7/7] dt-bindings: ASoC: rockchip: Update description of rockchip, codec Jeffy Chen

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.