devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/9] ASoC: rockchip: Parse dai links from dts
@ 2017-08-18  3:11 Jeffy Chen
  2017-08-18  3:11 ` [PATCH v4 2/9] ASoC: rockchip: Remove obsolete dmic-delay Jeffy Chen
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Jeffy Chen @ 2017-08-18  3:11 UTC (permalink / raw)
  To: linux-kernel, dgreid, heiko
  Cc: briannorris, mka, dianders, Jeffy Chen, Jaroslav Kysela,
	devicetree, alsa-devel, Will Deacon, linux-rockchip, Mark Brown,
	Klaus Goger, Oder Chiou, Takashi Iwai, Liam Girdwood, Rob Herring,
	Mark Rutland, Bard Liao, 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 v4:
Use non-zero drv id to avoid legacy dai naming instead of switching to
snd_soc_register_codec.

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 (9):
  ASoC: rt5514: Avoid legacy dai naming
  ASoC: rockchip: Remove obsolete dmic-delay
  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   |   9 +-
 arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi       |   7 +-
 sound/soc/codecs/rt5514-spi.c                      |   2 +-
 sound/soc/rockchip/Kconfig                         |   2 +
 sound/soc/rockchip/rk3399_gru_sound.c              | 263 ++++++++++++++-------
 5 files changed, 183 insertions(+), 100 deletions(-)

-- 
2.11.0

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

* [PATCH v4 2/9] ASoC: rockchip: Remove obsolete dmic-delay
  2017-08-18  3:11 [PATCH v4 0/9] ASoC: rockchip: Parse dai links from dts Jeffy Chen
@ 2017-08-18  3:11 ` Jeffy Chen
  2017-08-22  2:42   ` Rob Herring
       [not found] ` <20170818031147.16810-1-jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Jeffy Chen @ 2017-08-18  3:11 UTC (permalink / raw)
  To: linux-kernel, dgreid, heiko
  Cc: briannorris, mka, dianders, Jeffy Chen, Jaroslav Kysela,
	devicetree, alsa-devel, linux-rockchip, Liam Girdwood, Mark Brown,
	Takashi Iwai, Rob Herring, Mark Rutland, linux-arm-kernel

This property is no longer used.

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

Changes in v4: None
Changes in v3: None
Changes in v2: None

 .../bindings/sound/rockchip,rk3399-gru-sound.txt           |  7 -------
 sound/soc/rockchip/rk3399_gru_sound.c                      | 14 --------------
 2 files changed, 21 deletions(-)

diff --git a/Documentation/devicetree/bindings/sound/rockchip,rk3399-gru-sound.txt b/Documentation/devicetree/bindings/sound/rockchip,rk3399-gru-sound.txt
index eac91db07178..f19b6c830a34 100644
--- a/Documentation/devicetree/bindings/sound/rockchip,rk3399-gru-sound.txt
+++ b/Documentation/devicetree/bindings/sound/rockchip,rk3399-gru-sound.txt
@@ -6,17 +6,10 @@ Required properties:
   connected to the codecs
 - rockchip,codec: The phandle of the MAX98357A/RT5514/DA7219 codecs
 
-Optional properties:
-- dmic-wakeup-delay-ms : specify delay time (ms) for DMIC ready.
-  If this option is specified, which means it's required dmic need
-  delay for DMIC to ready so that rt5514 can avoid recording before
-  DMIC send valid data
-
 Example:
 
 sound {
 	compatible = "rockchip,rk3399-gru-sound";
 	rockchip,cpu = <&i2s0>;
 	rockchip,codec = <&max98357a &rt5514 &da7219>;
-	dmic-wakeup-delay-ms = <20>;
 };
diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index 3475c61a5fa0..70876d3c34e6 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -38,8 +38,6 @@
 
 #define SOUND_FS	256
 
-static unsigned int rt5514_dmic_delay;
-
 static struct snd_soc_jack rockchip_sound_jack;
 
 static const struct snd_soc_dapm_widget rockchip_dapm_widgets[] = {
@@ -125,9 +123,6 @@ static int rockchip_sound_rt5514_hw_params(struct snd_pcm_substream *substream,
 		return ret;
 	}
 
-	/* Wait for DMIC stable */
-	msleep(rt5514_dmic_delay);
-
 	return 0;
 }
 
@@ -348,15 +343,6 @@ static int rockchip_sound_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
-	/* Set DMIC delay */
-	ret = device_property_read_u32(&pdev->dev, "dmic-delay",
-					&rt5514_dmic_delay);
-	if (ret) {
-		rt5514_dmic_delay = 0;
-		dev_dbg(&pdev->dev,
-			"no optional property 'dmic-delay' 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);
-- 
2.11.0

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

* [PATCH v4 4/9] arm64: dts: rockchip: Add rt5514 dsp for Gru
       [not found] ` <20170818031147.16810-1-jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
@ 2017-08-18  3:11   ` Jeffy Chen
  0 siblings, 0 replies; 6+ messages in thread
From: Jeffy Chen @ 2017-08-18  3:11 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dgreid-F7+t8E8rja9g9hUCZPvPmw, heiko-4mtYJXux2i+zQB+pC5nmwQ
  Cc: briannorris-F7+t8E8rja9g9hUCZPvPmw, mka-F7+t8E8rja9g9hUCZPvPmw,
	dianders-F7+t8E8rja9g9hUCZPvPmw, Jeffy Chen,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Klaus Goger,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Rob Herring,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Will Deacon,
	Mark Rutland, Catalin Marinas

Add rt5514 dsp of_node to codec list for Gru boards.

Signed-off-by: Jeffy Chen <jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
---

Changes in v4: 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 690a43f46641..72717e77a0fc 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


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

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

* [PATCH v4 5/9] arm64: dts: rockchip: Update rt5514 devices' compatible for Gru
  2017-08-18  3:11 [PATCH v4 0/9] ASoC: rockchip: Parse dai links from dts Jeffy Chen
  2017-08-18  3:11 ` [PATCH v4 2/9] ASoC: rockchip: Remove obsolete dmic-delay Jeffy Chen
       [not found] ` <20170818031147.16810-1-jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
@ 2017-08-18  3:11 ` Jeffy Chen
  2017-08-18  3:11 ` [PATCH v4 9/9] dt-bindings: ASoC: rockchip: Update description of rockchip,codec Jeffy Chen
  3 siblings, 0 replies; 6+ messages in thread
From: Jeffy Chen @ 2017-08-18  3:11 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, 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 v4: 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 72717e77a0fc..c489c78b2b5b 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>;
 		interrupt-parent = <&gpio1>;
 		interrupts = <13 IRQ_TYPE_LEVEL_HIGH>;
@@ -828,7 +828,7 @@ ap_i2c_audio: &i2c8 {
 	status = "okay";
 
 	wacky_spi_audio: spi2@0 {
-		compatible = "realtek,rt5514";
+		compatible = "realtek,rt5514", "realtek,rt5514-spi";
 		reg = <0>;
 
 		/* May run faster once verified. */
-- 
2.11.0

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

* [PATCH v4 9/9] dt-bindings: ASoC: rockchip: Update description of rockchip,codec
  2017-08-18  3:11 [PATCH v4 0/9] ASoC: rockchip: Parse dai links from dts Jeffy Chen
                   ` (2 preceding siblings ...)
  2017-08-18  3:11 ` [PATCH v4 5/9] arm64: dts: rockchip: Update rt5514 devices' compatible " Jeffy Chen
@ 2017-08-18  3:11 ` Jeffy Chen
  3 siblings, 0 replies; 6+ messages in thread
From: Jeffy Chen @ 2017-08-18  3:11 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 v4: 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 f19b6c830a34..f54b4e91e97c 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
 
 Example:
 
-- 
2.11.0

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

* Re: [PATCH v4 2/9] ASoC: rockchip: Remove obsolete dmic-delay
  2017-08-18  3:11 ` [PATCH v4 2/9] ASoC: rockchip: Remove obsolete dmic-delay Jeffy Chen
@ 2017-08-22  2:42   ` Rob Herring
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2017-08-22  2:42 UTC (permalink / raw)
  To: Jeffy Chen
  Cc: linux-kernel, dgreid, heiko, briannorris, mka, dianders,
	Jaroslav Kysela, devicetree, alsa-devel, linux-rockchip,
	Liam Girdwood, Mark Brown, Takashi Iwai, Mark Rutland,
	linux-arm-kernel

On Fri, Aug 18, 2017 at 11:11:40AM +0800, Jeffy Chen wrote:
> This property is no longer used.
> 
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> ---
> 
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
> 
>  .../bindings/sound/rockchip,rk3399-gru-sound.txt           |  7 -------
>  sound/soc/rockchip/rk3399_gru_sound.c                      | 14 --------------
>  2 files changed, 21 deletions(-)

Well, obviously not used since they don't even match.

Acked-by: Rob Herring <robh@kernel.org>

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

end of thread, other threads:[~2017-08-22  2:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-18  3:11 [PATCH v4 0/9] ASoC: rockchip: Parse dai links from dts Jeffy Chen
2017-08-18  3:11 ` [PATCH v4 2/9] ASoC: rockchip: Remove obsolete dmic-delay Jeffy Chen
2017-08-22  2:42   ` Rob Herring
     [not found] ` <20170818031147.16810-1-jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-08-18  3:11   ` [PATCH v4 4/9] arm64: dts: rockchip: Add rt5514 dsp for Gru Jeffy Chen
2017-08-18  3:11 ` [PATCH v4 5/9] arm64: dts: rockchip: Update rt5514 devices' compatible " Jeffy Chen
2017-08-18  3:11 ` [PATCH v4 9/9] dt-bindings: ASoC: rockchip: Update description of rockchip,codec Jeffy Chen

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