devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Add SPDIF support for rockchip
@ 2015-08-04 11:18 Sjoerd Simons
  2015-08-04 11:18 ` [PATCH v2 1/4] ASoC: dt-bindings: add rockchip tranceiver bindings Sjoerd Simons
       [not found] ` <1438687099-14282-1-git-send-email-sjoerd.simons-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
  0 siblings, 2 replies; 7+ messages in thread
From: Sjoerd Simons @ 2015-08-04 11:18 UTC (permalink / raw)
  To: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: Jaroslav Kysela, devicetree-u79uwXL29TY76Z2rM5mHXA,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, Heiko Stuebner, Takashi Iwai,
	Liam Girdwood, Mark Brown, Kumar Gala,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Ian Campbell, Rob Herring,
	Pawel Moll, Mark Rutland, Russell King,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

This patchset adds support for the Rockchip SPDIF transceiver as present
on RK3066, RK3188 and RK3288 boards and enables it on a Radxa rock pro.
Tested on a Radxa Rock Pro board.

Changes in v2:
- Remove platform: module alias as it was unused
- Call MODULE_DEVICE_TABLE(of, ) right after the of match table
- use rk_spdif as a prefix consistenly throughout the driver
- Check return code of regmap_update and bubble it up
- Sort the spdif node properties
- Drop the 0x prefix from the node name
- Rename the spdif@ node to sound@

Sjoerd Simons (4):
  ASoC: dt-bindings: add rockchip tranceiver bindings
  ASoc: rockchip: Add rockchip SPDIF transceiver driver
  ARM: dts: rockchip: Add SPDIF transceiver for RK3188
  ARM: dts: rockchip: Add SPDIF optical out on Radxa Rock

 .../devicetree/bindings/sound/rockchip-spdif.txt   |  41 +++
 arch/arm/boot/dts/rk3188-radxarock.dts             |  19 +
 arch/arm/boot/dts/rk3188.dtsi                      |  22 ++
 sound/soc/rockchip/Kconfig                         |   8 +
 sound/soc/rockchip/Makefile                        |   2 +
 sound/soc/rockchip/rockchip_spdif.c                | 381 +++++++++++++++++++++
 sound/soc/rockchip/rockchip_spdif.h                |  63 ++++
 7 files changed, 536 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/rockchip-spdif.txt
 create mode 100644 sound/soc/rockchip/rockchip_spdif.c
 create mode 100644 sound/soc/rockchip/rockchip_spdif.h

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

* [PATCH v2 1/4] ASoC: dt-bindings: add rockchip tranceiver bindings
  2015-08-04 11:18 [PATCH v2 0/4] Add SPDIF support for rockchip Sjoerd Simons
@ 2015-08-04 11:18 ` Sjoerd Simons
       [not found] ` <1438687099-14282-1-git-send-email-sjoerd.simons-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
  1 sibling, 0 replies; 7+ messages in thread
From: Sjoerd Simons @ 2015-08-04 11:18 UTC (permalink / raw)
  To: linux-rockchip
  Cc: devicetree, Heiko Stuebner, Kumar Gala, linux-kernel,
	Ian Campbell, Rob Herring, Pawel Moll, Mark Rutland,
	linux-arm-kernel

Add devicetree bindings for the spdif tranceiver found on
found on rk3066, rk3188 and rk3288 SoCs

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
---

Changes in v2: None

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

diff --git a/Documentation/devicetree/bindings/sound/rockchip-spdif.txt b/Documentation/devicetree/bindings/sound/rockchip-spdif.txt
new file mode 100644
index 0000000..2da8a09
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/rockchip-spdif.txt
@@ -0,0 +1,41 @@
+* Rockchip SPDIF transceiver
+
+The S/PDIF audio block is a stereo transceiver that allows the
+processor to receive and transmit digital audio via an coaxial cable or
+a fibre cable.
+
+Required properties:
+
+- compatible: should be one of the following:
+   - "rockchip,rk3066-spdif": for rk3066
+   - "rockchip,rk3188-spdif", "rockchip,rk3066-spdif": for rk3188
+   - "rockchip,rk3288-spdif", "rockchip,rk3066-spdif": for rk3288
+- reg: physical base address of the controller and length of memory mapped
+  region.
+- interrupts: should contain the SPDIF interrupt.
+- #address-cells: should be 1.
+- #size-cells: should be 0.
+- dmas: DMA specifiers for tx dma. See the DMA client binding,
+  Documentation/devicetree/bindings/dma/dma.txt
+- dma-names: should be "tx"
+- clocks: a list of phandle + clock-specifier pairs, one for each entry
+  in clock-names.
+- clock-names: should contain following:
+   - "spdif_hclk": clock for SPPIF controller
+   - "spdif_clk" : clock for SPDIF bus
+
+Example for the rk3188 SPDIF controller:
+
+spdif: spdif@0x1011e000 {
+	compatible = "rockchip,rk3188-spdif", "rockchip,rk3066-spdif";
+	reg = <0x1011e000 0x2000>;
+	interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+	dmas = <&dmac1_s 8>;
+	dma-names = "tx";
+	clock-names = "spdif_hclk", "spdif_clk";
+	clocks = <&cru HCLK_SPDIF>, <&cru SCLK_SPDIF>;
+	status = "disabled";
+	#sound-dai-cells = <0>;
+};
-- 
2.5.0

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

* [PATCH v2 3/4] ARM: dts: rockchip: Add SPDIF transceiver for RK3188
       [not found] ` <1438687099-14282-1-git-send-email-sjoerd.simons-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
@ 2015-08-04 11:18   ` Sjoerd Simons
  2015-08-04 11:18   ` [PATCH v2 4/4] ARM: dts: rockchip: Add SPDIF optical out on Radxa Rock Sjoerd Simons
  2015-08-04 15:36   ` [PATCH v2 0/4] Add SPDIF support for rockchip Mark Brown
  2 siblings, 0 replies; 7+ messages in thread
From: Sjoerd Simons @ 2015-08-04 11:18 UTC (permalink / raw)
  To: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA, Russell King,
	Heiko Stuebner, Pawel Moll, Ian Campbell,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Rob Herring, Kumar Gala,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Add the SPDIF transceiver controller and pin for RK3188

Signed-off-by: Sjoerd Simons <sjoerd.simons-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>

---

Changes in v2:
- Sort the spdif node properties
- Drop the 0x prefix from the node name
- Rename the spdif@ node to sound@

 arch/arm/boot/dts/rk3188.dtsi | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/boot/dts/rk3188.dtsi b/arch/arm/boot/dts/rk3188.dtsi
index 0f23aed..abdb5bc 100644
--- a/arch/arm/boot/dts/rk3188.dtsi
+++ b/arch/arm/boot/dts/rk3188.dtsi
@@ -121,6 +121,22 @@
 		status = "disabled";
 	};
 
+	spdif: sound@1011e000 {
+		compatible = "rockchip,rk3188-spdif", "rockchip,rk3066-spdif";
+		reg = <0x1011e000 0x2000>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		#sound-dai-cells = <0>;
+		clock-names = "spdif_hclk", "spdif_clk";
+		clocks = <&cru HCLK_SPDIF>, <&cru SCLK_SPDIF>;
+		dmas = <&dmac1_s 8>;
+		dma-names = "tx";
+		interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&spdif_tx>;
+		status = "disabled";
+	};
+
 	cru: clock-controller@20000000 {
 		compatible = "rockchip,rk3188-cru";
 		reg = <0x20000000 0x1000>;
@@ -462,6 +478,12 @@
 						<RK_GPIO1 21 RK_FUNC_1 &pcfg_pull_none>;
 			};
 		};
+
+		spdif {
+			spdif_tx: spdif-tx {
+				rockchip,pins = <RK_GPIO1 14 RK_FUNC_1 &pcfg_pull_none>;
+			};
+		};
 	};
 };
 
-- 
2.5.0

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

* [PATCH v2 4/4] ARM: dts: rockchip: Add SPDIF optical out on Radxa Rock
       [not found] ` <1438687099-14282-1-git-send-email-sjoerd.simons-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
  2015-08-04 11:18   ` [PATCH v2 3/4] ARM: dts: rockchip: Add SPDIF transceiver for RK3188 Sjoerd Simons
@ 2015-08-04 11:18   ` Sjoerd Simons
  2015-08-04 15:36   ` [PATCH v2 0/4] Add SPDIF support for rockchip Mark Brown
  2 siblings, 0 replies; 7+ messages in thread
From: Sjoerd Simons @ 2015-08-04 11:18 UTC (permalink / raw)
  To: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA, Russell King,
	Heiko Stuebner, Pawel Moll, Ian Campbell,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Rob Herring, Kumar Gala,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

This enables the SPDIF optical audio output on the Radxa Rock

Signed-off-by: Sjoerd Simons <sjoerd.simons-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>

---

Changes in v2: None

 arch/arm/boot/dts/rk3188-radxarock.dts | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/arch/arm/boot/dts/rk3188-radxarock.dts b/arch/arm/boot/dts/rk3188-radxarock.dts
index 4bb014d..dea020c 100644
--- a/arch/arm/boot/dts/rk3188-radxarock.dts
+++ b/arch/arm/boot/dts/rk3188-radxarock.dts
@@ -90,6 +90,21 @@
 		};
 	};
 
+	sound {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "SPDIF";
+
+		simple-audio-card,dai-link@1 {  /* S/PDIF - S/PDIF */
+			cpu { sound-dai = <&spdif>; };
+			codec { sound-dai = <&spdif_out>; };
+		};
+	};
+
+	spdif_out: spdif-out {
+		compatible = "linux,spdif-dit";
+		#sound-dai-cells = <0>;
+	};
+
 	ir_recv: gpio-ir-receiver {
 		compatible = "gpio-ir-receiver";
 		gpios = <&gpio0 10 1>;
@@ -343,6 +358,10 @@
 	};
 };
 
+&spdif {
+	status = "okay";
+};
+
 &uart0 {
 	status = "okay";
 };
-- 
2.5.0

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

* Re: [PATCH v2 0/4] Add SPDIF support for rockchip
       [not found] ` <1438687099-14282-1-git-send-email-sjoerd.simons-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
  2015-08-04 11:18   ` [PATCH v2 3/4] ARM: dts: rockchip: Add SPDIF transceiver for RK3188 Sjoerd Simons
  2015-08-04 11:18   ` [PATCH v2 4/4] ARM: dts: rockchip: Add SPDIF optical out on Radxa Rock Sjoerd Simons
@ 2015-08-04 15:36   ` Mark Brown
  2015-08-05  6:42     ` Sjoerd Simons
  2 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2015-08-04 15:36 UTC (permalink / raw)
  To: Sjoerd Simons
  Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Jaroslav Kysela,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, Heiko Stuebner, Takashi Iwai,
	Liam Girdwood, Kumar Gala, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	Ian Campbell, Rob Herring, Pawel Moll, Mark Rutland, Russell King,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

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

On Tue, Aug 04, 2015 at 01:18:15PM +0200, Sjoerd Simons wrote:

> Sjoerd Simons (4):
>   ASoC: dt-bindings: add rockchip tranceiver bindings
>   ASoc: rockchip: Add rockchip SPDIF transceiver driver

I only appear to have patch 2 (with the misspelt subject), not the
binding documentation.

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

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

* Re: [PATCH v2 0/4] Add SPDIF support for rockchip
  2015-08-04 15:36   ` [PATCH v2 0/4] Add SPDIF support for rockchip Mark Brown
@ 2015-08-05  6:42     ` Sjoerd Simons
  2015-08-05 11:59       ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Sjoerd Simons @ 2015-08-05  6:42 UTC (permalink / raw)
  To: Mark Brown
  Cc: Mark Rutland, devicetree, alsa-devel, Russell King,
	Heiko Stuebner, Pawel Moll, Liam Girdwood, linux-kernel,
	Ian Campbell, Takashi Iwai, Jaroslav Kysela, linux-rockchip,
	Rob Herring, Kumar Gala, linux-arm-kernel

On Tue, 2015-08-04 at 16:36 +0100, Mark Brown wrote:
> On Tue, Aug 04, 2015 at 01:18:15PM +0200, Sjoerd Simons wrote:
> 
> > Sjoerd Simons (4):
> >   ASoC: dt-bindings: add rockchip tranceiver bindings
> >   ASoc: rockchip: Add rockchip SPDIF transceiver driver
> 
> I only appear to have patch 2 (with the misspelt subject), not the
> binding documentation.

Applogies, Send that patch specifically to you now.

Seems get_maintainers.pl didn't include you in the list (nor the other
asoc maintainers in the list), I guess it might be good to add
Documentation/devicetree/bindings/sounds/ to the ASoC file list in
MAINTAINTERS ?

-- 
Sjoerd Simons
Collabora Ltd.

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

* Re: [PATCH v2 0/4] Add SPDIF support for rockchip
  2015-08-05  6:42     ` Sjoerd Simons
@ 2015-08-05 11:59       ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2015-08-05 11:59 UTC (permalink / raw)
  To: Sjoerd Simons
  Cc: Mark Rutland, devicetree, alsa-devel, Russell King,
	Heiko Stuebner, Pawel Moll, Liam Girdwood, linux-kernel,
	Ian Campbell, Takashi Iwai, Jaroslav Kysela, linux-rockchip,
	Rob Herring, Kumar Gala, linux-arm-kernel

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

On Wed, Aug 05, 2015 at 08:42:01AM +0200, Sjoerd Simons wrote:
> On Tue, 2015-08-04 at 16:36 +0100, Mark Brown wrote:

> > I only appear to have patch 2 (with the misspelt subject), not the
> > binding documentation.

> Applogies, Send that patch specifically to you now.

And I deleted it unread because it was just some random off list patch
with no context.  :(

> Seems get_maintainers.pl didn't include you in the list (nor the other
> asoc maintainers in the list), I guess it might be good to add
> Documentation/devicetree/bindings/sounds/ to the ASoC file list in
> MAINTAINTERS ?

Please follow the process covered in SubmittingPatches for making kernel
changes, but note that there's generic sound drivers as well as ASoC
ones.

In general it is a very bad idea to rely on get_maintainers, it is prone
to both false positives and missing relevant people.  It can be useful
to look at but you need to think about what it's telling you.  In this
case it should be fairly easy to tell that you ought to send the binding
documentation along with the driver.

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

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

end of thread, other threads:[~2015-08-05 11:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-04 11:18 [PATCH v2 0/4] Add SPDIF support for rockchip Sjoerd Simons
2015-08-04 11:18 ` [PATCH v2 1/4] ASoC: dt-bindings: add rockchip tranceiver bindings Sjoerd Simons
     [not found] ` <1438687099-14282-1-git-send-email-sjoerd.simons-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
2015-08-04 11:18   ` [PATCH v2 3/4] ARM: dts: rockchip: Add SPDIF transceiver for RK3188 Sjoerd Simons
2015-08-04 11:18   ` [PATCH v2 4/4] ARM: dts: rockchip: Add SPDIF optical out on Radxa Rock Sjoerd Simons
2015-08-04 15:36   ` [PATCH v2 0/4] Add SPDIF support for rockchip Mark Brown
2015-08-05  6:42     ` Sjoerd Simons
2015-08-05 11:59       ` Mark Brown

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