Skip to contentSkip to conversation

pinctrl: sun4i: add spdif to pin description

PATCH Superseded codekipper at gmail.com 3 participants 4 messages Aug 12, 2015 – Aug 13, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 pinctrl: sun4i: add spdif to pin description

From: Marcus Cooper <[email protected]>

The Allwinner A20(sun7i) SoC is pin to pin compatible with the Allwinner A10(sun4i) SoC. However the user manual for the A10 devices does not make any reference to the SPDIF whereas the pins, clocks, DMAs and Interrupts are mentioned in the A20 documentation.

As products exist based on the A10 with an SPDIF transmitter and with the code exposed then it is safe to assume that we can include SPDIF in the pin definitions.

We can also look at the fex file of such a device where the SPDIF pin is defined.
For example
https://github.com/linux-sunxi/sunxi-boards/blob/master/sys_config/a10/mele_a1000.fex#L822
shows
spdif_dout = port:PB13<4><1><default><default>.

Referring to the http://sunxi.org/Fex_Guide#Port_Definitions this shows that the spdif out pin is PB13 using multiplex function 4. The enabling of the pull up will be done in the device tree includes and this will be delivered in a future patch series.

Changes in v2:
-Add comments to highlight that the spdif pins are not officially documented.

Marcus Cooper (1):
pinctrl: sun4i: add spdif to pin description.

 drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
Signature · 1 line
2.5.0
#1 lore raw

PATCH v2 1/1 pinctrl: sun4i: add spdif to pin description.

From: Marcus Cooper <[email protected]>

---
 drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c +14 -3
index 7376a97..862a096 100644
@@ -135,7 +135,14 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
 		  SUNXI_FUNCTION(0x0, "gpio_in"),
 		  SUNXI_FUNCTION(0x1, "gpio_out"),
-		  SUNXI_FUNCTION(0x2, "ir0")),		/* TX */
+		  SUNXI_FUNCTION(0x2, "ir0"),		/* TX */
+		/*
+		 * The SPDIF block is not referenced at all in the A10 user
+		 * manual. However it is described in the code leaked and the
+		 * pin descriptions are declared in the A20 user manual which
+		 * is pin compatible with this device.
+		 */
+		  SUNXI_FUNCTION(0x4, "spdif")),        /* SPDIF MCLK */
 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 4),
 		  SUNXI_FUNCTION(0x0, "gpio_in"),
 		  SUNXI_FUNCTION(0x1, "gpio_out"),
@@ -176,11 +183,15 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
 		  SUNXI_FUNCTION(0x0, "gpio_in"),
 		  SUNXI_FUNCTION(0x1, "gpio_out"),
 		  SUNXI_FUNCTION(0x2, "i2s"),		/* DI */
-		  SUNXI_FUNCTION(0x3, "ac97")),		/* DI */
+		  SUNXI_FUNCTION(0x3, "ac97"),		/* DI */
+		/* Undocumented mux function - See SPDIF MCLK above */
+		  SUNXI_FUNCTION(0x4, "spdif")),        /* SPDIF IN */
 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 13),
 		  SUNXI_FUNCTION(0x0, "gpio_in"),
 		  SUNXI_FUNCTION(0x1, "gpio_out"),
-		  SUNXI_FUNCTION(0x2, "spi2")),		/* CS1 */
+		  SUNXI_FUNCTION(0x2, "spi2"),		/* CS1 */
+		/* Undocumented mux function - See SPDIF MCLK above */
+		  SUNXI_FUNCTION(0x4, "spdif")),        /* SPDIF OUT */
 	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 14),
 		  SUNXI_FUNCTION(0x0, "gpio_in"),
 		  SUNXI_FUNCTION(0x1, "gpio_out"),
Signature · 1 line
2.5.0
#2 lore raw

PATCH v2 1/1 pinctrl: sun4i: add spdif to pin description.

Hi,

Quoted 3 lines · codekipper at gmail.com

From: Marcus Cooper <[email protected]>

LGTM:

Regards,

Hans

Quoted 43 lines
---
  drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c | 17 ++++++++++++++---
  1 file changed, 14 insertions(+), 3 deletions(-)
drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c +14 -3
index 7376a97..862a096 100644
@@ -135,7 +135,14 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
  	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 3),
  		  SUNXI_FUNCTION(0x0, "gpio_in"),
  		  SUNXI_FUNCTION(0x1, "gpio_out"),
-		  SUNXI_FUNCTION(0x2, "ir0")),		/* TX */
+		  SUNXI_FUNCTION(0x2, "ir0"),		/* TX */
+		/*
+		 * The SPDIF block is not referenced at all in the A10 user
+		 * manual. However it is described in the code leaked and the
+		 * pin descriptions are declared in the A20 user manual which
+		 * is pin compatible with this device.
+		 */
+		  SUNXI_FUNCTION(0x4, "spdif")),        /* SPDIF MCLK */
  	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 4),
  		  SUNXI_FUNCTION(0x0, "gpio_in"),
  		  SUNXI_FUNCTION(0x1, "gpio_out"),
@@ -176,11 +183,15 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
  		  SUNXI_FUNCTION(0x0, "gpio_in"),
  		  SUNXI_FUNCTION(0x1, "gpio_out"),
  		  SUNXI_FUNCTION(0x2, "i2s"),		/* DI */
-		  SUNXI_FUNCTION(0x3, "ac97")),		/* DI */
+		  SUNXI_FUNCTION(0x3, "ac97"),		/* DI */
+		/* Undocumented mux function - See SPDIF MCLK above */
+		  SUNXI_FUNCTION(0x4, "spdif")),        /* SPDIF IN */
  	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 13),
  		  SUNXI_FUNCTION(0x0, "gpio_in"),
  		  SUNXI_FUNCTION(0x1, "gpio_out"),
-		  SUNXI_FUNCTION(0x2, "spi2")),		/* CS1 */
+		  SUNXI_FUNCTION(0x2, "spi2"),		/* CS1 */
+		/* Undocumented mux function - See SPDIF MCLK above */
+		  SUNXI_FUNCTION(0x4, "spdif")),        /* SPDIF OUT */
  	SUNXI_PIN(SUNXI_PINCTRL_PIN(B, 14),
  		  SUNXI_FUNCTION(0x0, "gpio_in"),
  		  SUNXI_FUNCTION(0x1, "gpio_out"),