Skip to contentSkip to conversation

MIPS: jz4780: Allow access to jz4740-i2s

PATCH In review Mathieu Malaterre 2 participants 9 messages Jun 6, 2018 – Oct 17, 2018

Subsystems (5)
Device tree bindings Sound MIPS ASoC +1 more subsystems
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 MIPS: jz4780: Allow access to jz4740-i2s

Make it possible to select SND_JZ4740_SOC_I2S on MACH_JZ4780

---
 sound/soc/jz4740/Kconfig | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
sound/soc/jz4740/Kconfig +5 -5
index 1a354a6b6e87..35d82d96e781 100644
@@ -1,20 +1,20 @@
 config SND_JZ4740_SOC
-	tristate "SoC Audio for Ingenic JZ4740 SoC"
-	depends on MACH_JZ4740 || COMPILE_TEST
+	tristate "SoC Audio for Ingenic JZ4740/JZ4780 SoC"
+	depends on MACH_JZ4740 || MACH_JZ4780 || COMPILE_TEST
 	select SND_SOC_GENERIC_DMAENGINE_PCM
 	help
 	  Say Y or M if you want to add support for codecs attached to
-	  the JZ4740 I2S interface. You will also need to select the audio
+	  the JZ4740/JZ4780 I2S interface. You will also need to select the audio
 	  interfaces to support below.
 
 if SND_JZ4740_SOC
 
 config SND_JZ4740_SOC_I2S
-	tristate "SoC Audio (I2S protocol) for Ingenic JZ4740 SoC"
+	tristate "SoC Audio (I2S protocol) for Ingenic JZ4740/JZ4780 SoC"
 	depends on HAS_IOMEM
 	help
 	  Say Y if you want to use I2S protocol and I2S codec on Ingenic JZ4740
-	  based boards.
+	  or JZ4780 based boards.
 
 config SND_JZ4740_SOC_QI_LB60
 	tristate "SoC Audio support for Qi LB60"
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/3 MIPS: Ci20: Enable SND_JZ4740_SOC driver

Update the Ci20's defconfig to enable the JZ4780's SND driver.

---
 arch/mips/configs/ci20_defconfig | 4 ++++
 1 file changed, 4 insertions(+)
arch/mips/configs/ci20_defconfig +4 -0
index e1c14f6af824..0c08c7675b42 100644
@@ -104,6 +104,10 @@ CONFIG_REGULATOR=y
 CONFIG_REGULATOR_DEBUG=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
 # CONFIG_VGA_CONSOLE is not set
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SOC=y
+CONFIG_SND_JZ4740_SOC=y
 # CONFIG_HID is not set
 # CONFIG_USB_SUPPORT is not set
 CONFIG_MMC=y
Signature · 1 line
2.11.0
#3 lore raw

PATCH 3/3 MIPS: jz4780: DTS: Probe the jz4740-i2s driver from devicetree

In reply to Mathieu Malaterre

Since commit 967beb2e8777 ("ASoC: jz4740: Add jz4780 support"), jz4740-i2s driver supports jz4780 hardware. Use proper compatible string.

---
 arch/mips/boot/dts/ingenic/jz4780.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/mips/boot/dts/ingenic/jz4780.dtsi +12 -0
index ae57976bc016..308079ee8dd3 100644
@@ -57,6 +57,18 @@
 		clock-names = "rtc";
 	};
 
+	i2s: i2s@10020000 {
+		compatible = "ingenic,jz4780-i2s";
+		reg = <0x10020000 0x94>;
+
+		clocks = <&cgu JZ4780_CLK_AIC>, <&cgu JZ4780_CLK_I2SPLL>;
+		clock-names = "aic", "i2s";
+
+		dmas = <&dma 0 JZ4780_DMA_I2S0_RX 0xffffffff>,
+		       <&dma JZ4780_DMA_I2S0_TX 0 0xffffffff>;
+		dma-names = "rx" , "tx";
+	};
+
 	pinctrl: pin-controller@10010000 {
 		compatible = "ingenic,jz4780-pinctrl";
 		reg = <0x10010000 0x600>;
Signature · 1 line
2.11.0
#4 lore raw
In reply to Mathieu Malaterre

Hi Matthieu,

sound/soc/jz4740/Kconfig line 3

Quoted 10 lines · Mathieu Malaterre
sound/soc/jz4740/Kconfig +2 -2
index 1a354a6b6e87..35d82d96e781 100644
@@ -1,20 +1,20 @@
 config SND_JZ4740_SOC
-	tristate "SoC Audio for Ingenic JZ4740 SoC"
-	depends on MACH_JZ4740 || COMPILE_TEST
+	tristate "SoC Audio for Ingenic JZ4740/JZ4780 SoC"
+	depends on MACH_JZ4740 || MACH_JZ4780 || COMPILE_TEST

Perhaps this could be MACH_INGENIC, or even just MIPS?

Thanks,
Paul

#5 lore raw

Hi Matthieu,

Quoted 13 lines · Paul Burton

sound/soc/jz4740/Kconfig line 3

Quoted 10 lines · Mathieu Malaterre
sound/soc/jz4740/Kconfig +2 -2
index 1a354a6b6e87..35d82d96e781 100644
@@ -1,20 +1,20 @@
 config SND_JZ4740_SOC
-	tristate "SoC Audio for Ingenic JZ4740 SoC"
-	depends on MACH_JZ4740 || COMPILE_TEST
+	tristate "SoC Audio for Ingenic JZ4740/JZ4780 SoC"
+	depends on MACH_JZ4740 || MACH_JZ4780 || COMPILE_TEST

Perhaps this could be MACH_INGENIC, or even just MIPS?

Further to that, this series doesn't seem to work for me. With v4.19-rc1, with the patch from [1] & then this series applied I see the following when booting a ci20_defconfig kernel:

  [    0.846684] ALSA device list:
  [    0.849642]   No soundcards found.

Nothing else looks obviously relevant, but here's the full boot log for reference:

https://gist.github.com/paulburton/336fa3a6ed756f9bbb587f01dcd520e5/6a5042a258348ed5e5d3d0cb1a72076abf31d85b

Thanks,
Paul

#6 lore raw
Quoted 6 lines · Paul Burton

Further to that, this series doesn't seem to work for me. With v4.19-rc1, with the patch from [1] & then this series applied I see the following when booting a ci20_defconfig kernel:

  [    0.846684] ALSA device list:
  [    0.849642]   No soundcards found.

D'oh! Apparently I haven't drunk enough coffee today - missing link can be found below:

[1] https://www.spinics.net/lists/linux-gpio/msg31965.html

Thanks,
Paul

#7 lore raw
Quoted 6 lines · Paul Burton
Quoted 4 lines · Paul Burton

Further to that, this series doesn't seem to work for me. With v4.19-rc1, with the patch from [1] & then this series applied I see the following when booting a ci20_defconfig kernel:

Quoted 7 lines
Quoted 2 lines
  [    0.846684] ALSA device list:
  [    0.849642]   No soundcards found.

D'oh! Apparently I haven't drunk enough coffee today - missing link can be found below:

[1] https://www.spinics.net/lists/linux-gpio/msg31965.html

Awesome, thanks for testing. I'll return to this series once I receive replacement for my laptop hard drive.

thanks,
-M

#8 lore raw

Paul,

Quoted 11 lines · Mathieu Malaterre
Quoted 9 lines · Paul Burton
Quoted 6 lines · Paul Burton

Further to that, this series doesn't seem to work for me. With v4.19-rc1, with the patch from [1] & then this series applied I see the following when booting a ci20_defconfig kernel:

  [    0.846684] ALSA device list:
  [    0.849642]   No soundcards found.
Quoted 7 lines
Quoted 4 lines

D'oh! Apparently I haven't drunk enough coffee today - missing link can be found below:

[1] https://www.spinics.net/lists/linux-gpio/msg31965.html

Awesome, thanks for testing. I'll return to this series once I receive replacement for my laptop hard drive.

I see it now :

[    0.289701] bus: 'platform': really_probe: probing driver
jz4740-i2s with device 10020000.i2s
[    0.289713] jz4740-i2s 10020000.i2s: no pinctrl handle
[    0.289782] OF: /i2s@10020000: could not find phandle

I'll try to make sense of this.

Quoted 2 lines

thanks,
-M

#2 lore raw

Re: [PATCH 2/3] MIPS: Ci20: Enable SND_JZ4740_SOC driver

In reply to Mathieu Malaterre
Quoted 13 lines · Mathieu Malaterre

Update the Ci20's defconfig to enable the JZ4780's SND driver.

---
 arch/mips/configs/ci20_defconfig | 4 ++++
 1 file changed, 4 insertions(+)
arch/mips/configs/ci20_defconfig +0 -0
index e1c14f6af824..0c08c7675b42 100644

arch/mips/configs/ci20_defconfig CONFIG_REGULATOR=y · line 110

Quoted 7 lines
arch/mips/configs/ci20_defconfig +4 -0
@@ -104,6 +104,10 @@ CONFIG_REGULATOR=y
 CONFIG_REGULATOR_DEBUG=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
 # CONFIG_VGA_CONSOLE is not set
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SOC=y
+CONFIG_SND_JZ4740_SOC=y

technically I am also missing: CONFIG_SND_JZ4740_SOC_I2S=y

Quoted 6 lines
arch/mips/configs/ci20_defconfig +0 -1
 # CONFIG_HID is not set
 # CONFIG_USB_SUPPORT is not set
 CONFIG_MMC=y
--

2.11.0