Sound support for at91sam9x5-wm8731 based boards
Subsystems (5)
v2 cover Sound support for at91sam9x5-wm8731 based boards
Hi,
This patchset add sound on the at91sam9x5ek board.
It's based on Nicolas Ferre's work in the 2.6.39 atmel patch for sam9x5:
https://github.com/linux4sam/linux-at91/commit/0aa157c9e71ccccf3abc30fa37eb5c95b392978d
It needs Bo Chen's patchset on the generic dmaengine (topic/atmel branch on Mark's sound tree) and the SSC interrupts disabled (cf
http://www.spinics.net/lists/arm-kernel/msg256901.html)
Tested on at91sam9g35ek.
patches applies on next-20130708
[I let the original signed-off from Nicolas and Uwe in place, I don't know if I should replace them by something like "originaly-signed-off-by" since the code has been changed.]
[Sorry if it's too late for 3.11]
Changes from V1-RFC:
* drop patches on SSC since Bo Chen already did the work
* reorder patches to have the machine driver first
* drop code already handled by the ASoC framework
* drop unneeded SND_ATMEL_SOC_PDC config selection
* use static snd_soc_card and snd_soc_dai_link structures.
Best regards,
Richard.
Nicolas Ferre (1):
sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
Richard Genoud (4):
ARM: AT91: DTS: sam9x5: add SSC DMA parameters
ARM: AT91: DTS: sam9x5ek: add WM8731 codec
ARM: AT91: DTS: sam9x5ek: add sound configuration
ARM: AT91: DTS: sam9x5ek: enable SSC
arch/arm/boot/dts/at91sam9x5.dtsi | 3 + arch/arm/boot/dts/at91sam9x5ek.dtsi | 27 +++++ sound/soc/atmel/Kconfig | 10 ++ sound/soc/atmel/Makefile | 2 + sound/soc/atmel/sam9x5_wm8731.c | 206 +++++++++++++++++++++++++++++++++++ 5 files changed, 248 insertions(+) create mode 100644 sound/soc/atmel/sam9x5_wm8731.c
Signature · 1 line
1.7.10.4
PATCH v2 1/5 sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
From: Nicolas Ferre <[email protected]>
Description of the Asoc machine driver for an at91sam9x5 based board with a wm8731 audio DAC. Wm8731 is clocked by a crystal and used as a master on the SSC/I2S interface. Its connections are a headphone jack and an Line input jack.
[Richard: this is based on an old patch from Nicolas that I forward ported and reworked to use only device tree]
--- sound/soc/atmel/Kconfig | 10 ++ sound/soc/atmel/Makefile | 2 + sound/soc/atmel/sam9x5_wm8731.c | 206 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 218 insertions(+) create mode 100644 sound/soc/atmel/sam9x5_wm8731.c
sound/soc/atmel/Kconfig +10 -0
@@ -33,6 +33,16 @@ config SND_AT91_SOC_SAM9G20_WM8731 Say Y if you want to add support for SoC audio on WM8731-based AT91sam9g20 evaluation board. +config SND_AT91_SOC_SAM9X5_WM8731 + tristate "SoC Audio support for WM8731-based at91sam9x5 board" + depends on ATMEL_SSC && SND_ATMEL_SOC && SOC_AT91SAM9X5 + select SND_ATMEL_SOC_SSC + select SND_ATMEL_SOC_DMA + select SND_SOC_WM8731 + help + Say Y if you want to add support for audio SoC on an + at91sam9x5 based board that is using WM8731 codec. + config SND_AT91_SOC_AFEB9260 tristate "SoC Audio support for AFEB9260 board" depends on ARCH_AT91 && ATMEL_SSC && ARCH_AT91 && MACH_AFEB9260 && SND_ATMEL_SOC
sound/soc/atmel/Makefile +2 -0
@@ -11,6 +11,8 @@ obj-$(CONFIG_SND_ATMEL_SOC_SSC) += snd-soc-atmel_ssc_dai.o # AT91 Machine Support snd-soc-sam9g20-wm8731-objs := sam9g20_wm8731.o +snd-soc-sam9x5-wm8731-objs := sam9x5_wm8731.o obj-$(CONFIG_SND_AT91_SOC_SAM9G20_WM8731) += snd-soc-sam9g20-wm8731.o +obj-$(CONFIG_SND_AT91_SOC_SAM9X5_WM8731) += snd-soc-sam9x5-wm8731.o obj-$(CONFIG_SND_AT91_SOC_AFEB9260) += snd-soc-afeb9260.o
sound/soc/atmel/sam9x5_wm8731.c new file +206 -0
206 lines not on this page · raw message
Signature · 6 lines
1.7.10.4 _______________________________________________ devicetree-discuss mailing list [email protected] https://lists.ozlabs.org/listinfo/devicetree-discuss
PATCH v2 2/5 ARM: AT91: DTS: sam9x5: add SSC DMA parameters
In reply to Richard Genoud--- arch/arm/boot/dts/at91sam9x5.dtsi | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/boot/dts/at91sam9x5.dtsi +3 -0
@@ -542,6 +542,9 @@ compatible = "atmel,at91sam9g45-ssc"; reg = <0xf0010000 0x4000>; interrupts = <28 IRQ_TYPE_LEVEL_HIGH 5>; + dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(13)>, + <&dma0 1 AT91_DMA_CFG_PER_ID(14)>; + dma-names = "tx", "rx"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; status = "disabled";
Signature · 1 line
1.7.10.4
PATCH v2 3/5 ARM: AT91: DTS: sam9x5ek: add WM8731 codec
In reply to Richard GenoudThe WM8731 codec on sam9x5ek board is on i2c, address 1A
--- arch/arm/boot/dts/at91sam9x5ek.dtsi | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm/boot/dts/at91sam9x5ek.dtsi +5 -0
@@ -59,6 +59,11 @@ i2c0: i2c@f8010000 { status = "okay"; + + wm8731: wm8731@1a { + compatible = "wm8731"; + reg = <0x1a>; + }; }; pinctrl@fffff400 {
Signature · 1 line
1.7.10.4
PATCH v2 4/5 ARM: AT91: DTS: sam9x5ek: add sound configuration
In reply to Richard GenoudThe sam9x5ek board has 2 jacks:
headphone wired on RHPOUT/LHPOUT of the wm8731
line in wired on LLINEIN/RLINEIN of the wm8731
--- arch/arm/boot/dts/at91sam9x5ek.dtsi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
arch/arm/boot/dts/at91sam9x5ek.dtsi +18 -0
@@ -109,4 +109,22 @@ status = "okay"; }; }; + + sound { + compatible = "atmel,sam9x5-audio-wm8731"; + + atmel,model = "wm8731 @ AT91SAM9X5EK"; + + atmel,audio-routing = + "Headphone Jack", "RHPOUT", + "Headphone Jack", "LHPOUT", + "LLINEIN", "Line In Jack", + "RLINEIN", "Line In Jack"; + + atmel,ssc-controller = <&ssc0>; + atmel,audio-codec = <&wm8731>; + atmel,format = "i2s"; + atmel,bitclock-master; + atmel,frame-master; + }; };
Signature · 1 line
1.7.10.4
PATCH v2 5/5 ARM: AT91: DTS: sam9x5ek: enable SSC
In reply to Richard GenoudEnable the SSC needed for the WM8731 codec
--- arch/arm/boot/dts/at91sam9x5ek.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/boot/dts/at91sam9x5ek.dtsi +4 -0
@@ -95,6 +95,10 @@ watchdog@fffffe40 { status = "okay"; }; + + ssc0: ssc@f0010000 { + status = "okay"; + }; }; usb0: ohci@00600000 {
Signature · 1 line
1.7.10.4
On 08/07/2013 15:29, Richard Genoud :
Quoted 11 lines
Hi,
This patchset add sound on the at91sam9x5ek board.
It's based on Nicolas Ferre's work in the 2.6.39 atmel patch for sam9x5:
https://github.com/linux4sam/linux-at91/commit/0aa157c9e71ccccf3abc30fa37eb5c95b392978dIt needs Bo Chen's patchset on the generic dmaengine (topic/atmel branch on Mark's sound tree) and the SSC interrupts disabled (cf
http://www.spinics.net/lists/arm-kernel/msg256901.html)
Quoted 7 lines
Tested on at91sam9g35ek.
patches applies on next-20130708
[I let the original signed-off from Nicolas and Uwe in place, I don't know if I should replace them by something like "originaly-signed-off-by" since the code has been changed.]
I am happy to give my "signed-off" to this patch. I guess that Uwe's one was more an integration signed-off when he imported the code to his git tree.
Quoted 1 line
[Sorry if it's too late for 3.11]
Do not be sorry. Good work is always appreciated at any time!
Quoted 10 lines
Changes from V1-RFC:
* drop patches on SSC since Bo Chen already did the work
* reorder patches to have the machine driver first
* drop code already handled by the ASoC framework
* drop unneededSND_ATMEL_SOC_PDCconfig selection
* use staticsnd_soc_cardandsnd_soc_dai_linkstructures.Best regards,
Richard.
Quoted 8 lines
Nicolas Ferre (1):
sound:sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boardsRichard Genoud (4):
ARM: AT91: DTS: sam9x5: add SSC DMA parameters
ARM: AT91: DTS: sam9x5ek: add WM8731 codec
ARM: AT91: DTS: sam9x5ek: add sound configuration
ARM: AT91: DTS: sam9x5ek: enable SSC
Maybe we will have to split the series and let these DT patches go with arm-soc.
Quoted 8 lines
arch/arm/boot/dts/at91sam9x5.dtsi | 3 + arch/arm/boot/dts/at91sam9x5ek.dtsi | 27 +++++ sound/soc/atmel/Kconfig | 10 ++ sound/soc/atmel/Makefile | 2 + sound/soc/atmel/sam9x5_wm8731.c | 206 +++++++++++++++++++++++++++++++++++ 5 files changed, 248 insertions(+)create mode 100644
sound/soc/atmel/sam9x5_wm8731.c
Thanks, bye,
Signature · 1 line
Nicolas Ferre
Re: [alsa-devel] [PATCH v2 3/5] ARM: AT91: DTS: sam9x5ek: add WM8731 codec
In reply to Richard GenoudQuoted 3 lines · Richard Genoud
The WM8731 codec on sam9x5ek board is on i2c, address 1A
Signed-off-by Richard Genoud <[email protected]>
This should go via arm-soc.
_______________________________________________
devicetree-discuss mailing list devicetree-discuss-uLR06cmDAlY/[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss
Re: [alsa-devel] [PATCH v2 1/5] sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
In reply to Richard GenoudOn 07/08/2013 03:29 PM, Richard Genoud wrote:
[...]
Quoted 5 lines
sound/soc/atmel/sam9x5_wm8731.c new file +5
-0+/* +* Logic for a wm8731 as connected on a at91sam9x5 based board. +*/ +static int at91sam9x5ek_wm8731_init (struct snd_soc_pcm_runtime *rtd) +{
[...]
sound/soc/atmel/sam9x5_wm8731.c line 61
Quoted 8 lines
sound/soc/atmel/sam9x5_wm8731.c new file +8
-0+ codec_dai->driver->playback.rates &=SNDRV_PCM_RATE_8000 | +SNDRV_PCM_RATE_32000 | +SNDRV_PCM_RATE_48000 | +SNDRV_PCM_RATE_96000 ; + codec_dai->driver->capture.rates &=SNDRV_PCM_RATE_8000 | +SNDRV_PCM_RATE_32000 | +SNDRV_PCM_RATE_48000 | +SNDRV_PCM_RATE_96000 ;
That's not right. The driver structure is shared between all instances of the codec, a single instance should not modify it. If you need to constrain the list of supported rates use snd_pcm_hw_constraint_list().
sound/soc/atmel/sam9x5_wm8731.c line 72
Quoted 11 lines
sound/soc/atmel/sam9x5_wm8731.c new file +11
-0+ +/* set the codec system clock for DAC and ADC */ + ret =snd_soc_dai_set_sysclk (codec_dai,WM8731_SYSCLK_XTAL , +MCLK_RATE ,SND_SOC_CLOCK_IN ); +if (ret <0 ) { +dev_err (dev,"ASoC: Failed to set WM8731 SYSCLK: %d\n" , ret); +return ret; + } + +/* signal a DAPM event */ +snd_soc_dapm_sync (dapm);
This should not be necessary.
Quoted 2 lines
(quoted diff) +2
-0+ return 0; +}
Mark Brown
maintainerRe: [PATCH v2 1/5] sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
In reply to Richard GenoudQuoted 4 lines · Richard Genoud
+ * Nicolas Ferre <[email protected]>
+ *
+ * Based onsam9g20_wm8731.cby:
+ * Sedji Gaouaou <[email protected]>
The obvious question here is of course if we can use the same driver for both of them.
sound/soc/atmel/sam9x5_wm8731.c line 61
Quoted 8 lines
sound/soc/atmel/sam9x5_wm8731.c new file +8
-0+ codec_dai->driver->playback.rates &=SNDRV_PCM_RATE_8000 | +SNDRV_PCM_RATE_32000 | +SNDRV_PCM_RATE_48000 | +SNDRV_PCM_RATE_96000 ; + codec_dai->driver->capture.rates &=SNDRV_PCM_RATE_8000 | +SNDRV_PCM_RATE_32000 | +SNDRV_PCM_RATE_48000 | +SNDRV_PCM_RATE_96000 ;
You definitely shouldn't be fiddling with a driver's constant static data. You want to be using snd_pcm_hw_constraint() APIs to set additional constraints intead.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Mark Brown
maintainerRe: [PATCH v2 2/5] ARM: AT91: DTS: sam9x5: add SSC DMA parameters
In reply to Richard GenoudQuoted 3 lines · Richard Genoud
Signed-off-by Richard Genoud <[email protected]>--- arch/arm/boot/dts/at91sam9x5.dtsi | 3 +++
There was no binding document in your first patch - there should be one for any new DT bindings.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [alsa-devel] [PATCH v2 1/5] sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
In reply to Lars-Peter Clausen2013/7/8 Lars-Peter Clausen <[email protected]>:
Quoted 17 lines · Richard Genoud
[...]
Quoted 5 lines
sound/soc/atmel/sam9x5_wm8731.c new file +5
-0+/* +* Logic for a wm8731 as connected on a at91sam9x5 based board. +*/ +static int at91sam9x5ek_wm8731_init (struct snd_soc_pcm_runtime *rtd) +{[...]
sound/soc/atmel/sam9x5_wm8731.c line 61
Quoted 8 lines
sound/soc/atmel/sam9x5_wm8731.c new file +8
-0+ codec_dai->driver->playback.rates &=SNDRV_PCM_RATE_8000 | +SNDRV_PCM_RATE_32000 | +SNDRV_PCM_RATE_48000 | +SNDRV_PCM_RATE_96000 ; + codec_dai->driver->capture.rates &=SNDRV_PCM_RATE_8000 | +SNDRV_PCM_RATE_32000 | +SNDRV_PCM_RATE_48000 | +SNDRV_PCM_RATE_96000 ;
Quoted 3 lines
That's not right. The driver structure is shared between all instances of the codec, a single instance should not modify it. If you need to constrain the list of supported rates use
snd_pcm_hw_constraint_list().
Ok, I'll do that.
Quoted 14 lines
sound/soc/atmel/sam9x5_wm8731.c line 72
Quoted 12 lines
sound/soc/atmel/sam9x5_wm8731.c new file +11
-0+ +/* set the codec system clock for DAC and ADC */ + ret =snd_soc_dai_set_sysclk (codec_dai,WM8731_SYSCLK_XTAL , +MCLK_RATE ,SND_SOC_CLOCK_IN ); +if (ret <0 ) { +dev_err (dev,"ASoC: Failed to set WM8731 SYSCLK: %d\n" , ret); +return ret; + } + +/* signal a DAPM event */ +snd_soc_dapm_sync (dapm);This should not be necessary.
ok
Quoted 4 lines
Review
Quoted 3 lines
(quoted diff) +2
-0+ return 0; +}
Thanks !
Signature · 1 line
for me, ck means con kolivas and not calvin klein... does it mean I'm a geek ?
Re: [PATCH v2 1/5] sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
In reply to Mark Brown2013/7/8 Mark Brown <[email protected]>:
Quoted 9 lines · Richard Genoud
Quoted 5 lines
+ * Nicolas Ferre <[email protected]>
+ *
+ * Based onsam9g20_wm8731.cby:
+ * Sedji Gaouaou <[email protected]>The obvious question here is of course if we can use the same driver for both of them.
I haven't got a g20 to test that, but that's the goal.
For now, g20 is still non-DT, so I think it's best to have a DT-only driver like this one for the 9x5 family (9g15, 9g25, 9x25, 9g35, 9x25).
When the g20 will move to DT completely, we can drop sam9g20_wm8731.c and adjust sam9x5_wm8731.c (mainly master clock and widgets it seems) By the way, maybe g45 could use that also (and SAMA5 ?)
Quoted 10 lines
sound/soc/atmel/sam9x5_wm8731.c line 61
Quoted 9 lines
sound/soc/atmel/sam9x5_wm8731.c new file +8
-0+ codec_dai->driver->playback.rates &=SNDRV_PCM_RATE_8000 | +SNDRV_PCM_RATE_32000 | +SNDRV_PCM_RATE_48000 | +SNDRV_PCM_RATE_96000 ; + codec_dai->driver->capture.rates &=SNDRV_PCM_RATE_8000 | +SNDRV_PCM_RATE_32000 | +SNDRV_PCM_RATE_48000 | +SNDRV_PCM_RATE_96000 ;
Quoted 3 lines
You definitely shouldn't be fiddling with a driver's constant static data. You want to be using
snd_pcm_hw_constraint()APIs to set additional constraints intead.
Ok, I'll change that.
Thanks !
Signature · 1 line
for me, ck means con kolivas and not calvin klein... does it mean I'm a geek ?
Re: [PATCH v2 2/5] ARM: AT91: DTS: sam9x5: add SSC DMA parameters
In reply to Mark Brown2013/7/8 Mark Brown <[email protected]>:
Quoted 7 lines · Richard Genoud
Quoted 3 lines
Signed-off-by Richard Genoud <[email protected]>--- arch/arm/boot/dts/at91sam9x5.dtsi | 3 +++There was no binding document in your first patch - there should be one for any new DT bindings.
The dma binding is documented here Documentation/devicetree/bindings/dma/atmel-dma.txt But you're right, I shoud update Documentation/devicetree/bindings/misc/atmel-ssc.txt.
Thanks
Signature · 1 line
for me, ck means con kolivas and not calvin klein... does it mean I'm a geek ?
Re: [PATCH v2 1/5] sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
In reply to Richard GenoudHi Richard,
Quoted 8 lines · Richard Genoud
2013/7/8 Mark Brown <[email protected]>:
Quoted 7 lines · Richard Genoud
Quoted 5 lines
+ * Nicolas Ferre <[email protected]>
+ *
+ * Based onsam9g20_wm8731.cby:
+ * Sedji Gaouaou <[email protected]>
Quoted 8 lines
Quoted 2 lines
The obvious question here is of course if we can use the same driver for both of them.
I haven't got a g20 to test that, but that's the goal.
For now, g20 is still non-DT, so I think it's best to have a DT-only driver like this one for the 9x5 family (9g15, 9g25, 9x25, 9g35, 9x25).
When the g20 will move to DT completely, we can dropsam9g20_wm8731.cand adjustsam9x5_wm8731.c(mainly master clock and widgets it seems)
The at91sam9g20ek board can work in DT mode, and the sound has support in DT mode already.
Sure, the mainly thing we need deal with is the master clock and widgets. If put them together will make code ugly or need many many #ifdef, I suggest to keep them separately.
Quoted 1 line
By the way, maybe g45 could use that also (and SAMA5 ?)
For g45ek board, it use AC97 interface, not the case.
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
sound/soc/atmel/sam9x5_wm8731.c new file +8
-0+ codec_dai->driver->playback.rates &=SNDRV_PCM_RATE_8000 | +SNDRV_PCM_RATE_32000 | +SNDRV_PCM_RATE_48000 | +SNDRV_PCM_RATE_96000 ; + codec_dai->driver->capture.rates &=SNDRV_PCM_RATE_8000 | +SNDRV_PCM_RATE_32000 | +SNDRV_PCM_RATE_48000 | +SNDRV_PCM_RATE_96000 ;
Quoted 8 lines
Quoted 3 lines
You definitely shouldn't be fiddling with a driver's constant static data. You want to be using
snd_pcm_hw_constraint()APIs to set additional constraints intead.Ok, I'll change that.
Thanks !
Best Regards,
Bo Shen
Mark Brown
maintainerRe: [PATCH v2 1/5] sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
In reply to Richard GenoudQuoted 6 lines · Richard Genoud
2013/7/8 Mark Brown <[email protected]>:
Quoted 2 lines
The obvious question here is of course if we can use the same driver for both of them.
I haven't got a g20 to test that, but that's the goal.
I think I do somewhere.
Quoted 6 lines
For now, g20 is still non-DT, so I think it's best to have a DT-only driver like this one for the 9x5 family (9g15, 9g25, 9x25, 9g35, 9x25).
When the g20 will move to DT completely, we can dropsam9g20_wm8731.cand adjustsam9x5_wm8731.c(mainly master clock and widgets it seems) By the way, maybe g45 could use that also (and SAMA5 ?)
If this is the goal then this driver needs a more generic name.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Mark Brown
maintainerRe: [PATCH v2 2/5] ARM: AT91: DTS: sam9x5: add SSC DMA parameters
In reply to Richard GenoudQuoted 4 lines · Richard Genoud
The dma binding is documented here
Documentation/devicetree/bindings/dma/atmel-dma.txtBut you're right, I shoud updateDocumentation/devicetree/bindings/misc/atmel-ssc.txt.
No, you need to write a binding for this machine driver - the DMA and
SSC need to be documented as well but so too does the audio driver that
pulls them together with the CODEC.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130709/b95f65f1/attachment.sig>
Re: [PATCH v2 2/5] ARM: AT91: DTS: sam9x5: add SSC DMA parameters
2013/7/9 Mark Brown <[email protected]>:
Quoted 10 lines · Richard Genoud
Quoted 5 lines
The dma binding is documented here
Documentation/devicetree/bindings/dma/atmel-dma.txtBut you're right, I shoud updateDocumentation/devicetree/bindings/misc/atmel-ssc.txt.No, you need to write a binding for this machine driver - the DMA and SSC need to be documented as well but so too does the audio driver that pulls them together with the CODEC.
Ok, I understand !
Richard.
Re: [PATCH v2 1/5] sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
In reply to Mark Brown2013/7/9 Mark Brown <[email protected]>:
Quoted 10 lines · Richard Genoud
Quoted 6 lines
2013/7/8 Mark Brown <[email protected]>:
Quoted 2 lines
The obvious question here is of course if we can use the same driver for both of them.
I haven't got a g20 to test that, but that's the goal.
I think I do somewhere.
Quoted 8 lines
Quoted 6 lines
For now, g20 is still non-DT, so I think it's best to have a DT-only driver like this one for the 9x5 family (9g15, 9g25, 9x25, 9g35, 9x25).
When the g20 will move to DT completely, we can dropsam9g20_wm8731.cand adjustsam9x5_wm8731.c(mainly master clock and widgets it seems) By the way, maybe g45 could use that also (and SAMA5 ?)If this is the goal then this driver needs a more generic name.
Hum. I guess we could call it atmel-ssc-sound.c, since the ultimate goal would be to make it codec agnostic, but there's quite some work to achieve that (handle the widgets, mclk and rates by DT). But I really don't know if it's better to keep this name as long as g20 is not supported, and change it after or have a name that is not reflecting what the machine driver is doing right now. Maybe Bo or Nicolas can give their feeling on that (since I'm not Atmel, I don't know every SoC or what their Big Plan is for sound machine drivers)
Richard.
Signature · 1 line
for me, ck means con kolivas and not calvin klein... does it mean I'm a geek ?
v3 cover Sound support for at91sam9x5-wm8731 based boards
In reply to Richard GenoudHi,
This patchset add sound on the at91sam9x5ek board.
It's based on Nicolas Ferre's work in the 2.6.39 atmel patch for sam9x5:
https://github.com/linux4sam/linux-at91/commit/0aa157c9e71ccccf3abc30fa37eb5c95b392978d
It needs Bo Chen's patchset on the generic dmaengine (topic/atmel branch on Mark's sound tree) and the SSC interrupts disabled (cf
http://www.spinics.net/lists/arm-kernel/msg256901.html)
Outstanding issue:
If this machine driver will support more SoCs maybe we should name it differently.
It has been tested on at91sam9g35ek, and should work on g15, g25, x25 and x35 also.
patches applies on next-20130708
[I let the original signed-off from Nicolas and Uwe in place, I don't know if I should replace them by something like "originaly-signed-off-by" since the code has been changed.]
Changes from v2:
* Change atmel,sam9x5-audio-wm8731 to atmel,sam9x5-wm8731-audio for
consistency with sam9g20 machine driver.
* Use the snd_pcm_hw_constraint() API as suggested by Mark and Lars-Peter.
* Remove the unnecessary snd_soc_dapm_sync() call as Lars-Peter suggested.
* Add documentation for machine driver DT binding.
* Update atmel-ssc DT binding documentation.
* Add GPL license instead of just the "GPL" word (hope that's ok !)
Changes from v1-RFC:
* drop patches on SSC since Bo Chen already did the work
* reorder patches to have the machine driver first
* drop code already handled by the ASoC framework
* drop unneeded SND_ATMEL_SOC_PDC config selection
* use static snd_soc_card and snd_soc_dai_link structures.
Best regards,
Richard.
Nicolas Ferre (1):
sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
Richard Genoud (6):
Documentation: DT: add sam9x5ek-wm8731 machine driver
Documentation: DT: update atmel SSC with DMA binding
ARM: AT91: DTS: sam9x5: add SSC DMA parameters
ARM: AT91: DTS: sam9x5ek: add WM8731 codec
ARM: AT91: DTS: sam9x5ek: add sound configuration
ARM: AT91: DTS: sam9x5ek: enable SSC
.../devicetree/bindings/misc/atmel-ssc.txt | 24 +- .../bindings/sound/atmel-sam9x5-wm8731-audio.txt | 30 +++ arch/arm/boot/dts/at91sam9x5.dtsi | 3 + arch/arm/boot/dts/at91sam9x5ek.dtsi | 27 +++ sound/soc/atmel/Kconfig | 10 + sound/soc/atmel/Makefile | 2 + sound/soc/atmel/sam9x5_wm8731.c | 238 ++++++++++++++++++++ 7 files changed, 332 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/atmel-sam9x5-wm8731-audio.txt create mode 100644 sound/soc/atmel/sam9x5_wm8731.c
Signature · 1 line
1.7.10.4
PATCH v3 1/7 sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
From: Nicolas Ferre <[email protected]>
Description of the Asoc machine driver for an at91sam9x5 based board with a wm8731 audio DAC. Wm8731 is clocked by a crystal and used as a master on the SSC/I2S interface. Its connections are a headphone jack and an Line input jack.
[Richard: this is based on an old patch from Nicolas that I forward ported and reworked to use only device tree]
--- sound/soc/atmel/Kconfig | 10 ++ sound/soc/atmel/Makefile | 2 + sound/soc/atmel/sam9x5_wm8731.c | 238 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 250 insertions(+) create mode 100644 sound/soc/atmel/sam9x5_wm8731.c
sound/soc/atmel/Kconfig +10 -0
@@ -33,6 +33,16 @@ config SND_AT91_SOC_SAM9G20_WM8731 Say Y if you want to add support for SoC audio on WM8731-based AT91sam9g20 evaluation board. +config SND_AT91_SOC_SAM9X5_WM8731 + tristate "SoC Audio support for WM8731-based at91sam9x5 board" + depends on ATMEL_SSC && SND_ATMEL_SOC && SOC_AT91SAM9X5 + select SND_ATMEL_SOC_SSC + select SND_ATMEL_SOC_DMA + select SND_SOC_WM8731 + help + Say Y if you want to add support for audio SoC on an + at91sam9x5 based board that is using WM8731 codec. + config SND_AT91_SOC_AFEB9260 tristate "SoC Audio support for AFEB9260 board" depends on ARCH_AT91 && ATMEL_SSC && ARCH_AT91 && MACH_AFEB9260 && SND_ATMEL_SOC
sound/soc/atmel/Makefile +2 -0
@@ -11,6 +11,8 @@ obj-$(CONFIG_SND_ATMEL_SOC_SSC) += snd-soc-atmel_ssc_dai.o # AT91 Machine Support snd-soc-sam9g20-wm8731-objs := sam9g20_wm8731.o +snd-soc-sam9x5-wm8731-objs := sam9x5_wm8731.o obj-$(CONFIG_SND_AT91_SOC_SAM9G20_WM8731) += snd-soc-sam9g20-wm8731.o +obj-$(CONFIG_SND_AT91_SOC_SAM9X5_WM8731) += snd-soc-sam9x5-wm8731.o obj-$(CONFIG_SND_AT91_SOC_AFEB9260) += snd-soc-afeb9260.o
sound/soc/atmel/sam9x5_wm8731.c new file +238 -0
238 lines not on this page · raw message
Signature · 6 lines
1.7.10.4 _______________________________________________ devicetree-discuss mailing list [email protected] https://lists.ozlabs.org/listinfo/devicetree-discuss
PATCH v3 2/7 Documentation: DT: add sam9x5ek-wm8731 machine driver
In reply to Richard GenoudThis add the sound DT binding for sam9x5ek-wm8731 machine driver
--- .../bindings/sound/atmel-sam9x5-wm8731-audio.txt | 30 ++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/atmel-sam9x5-wm8731-audio.txt
Documentation/devicetree/bindings/sound/atmel-sam9x5-wm8731-audio.txt new file +30 -0
@@ -0,0 +1,30 @@ +* Atmel at91sam9x5ek wm8731 audio complex + +Required properties: + - compatible: "atmel,at91sam9x5ek-wm8731-audio" + - atmel,model: The user-visible name of this sound complex. + - atmel,audio-routing: A list of the connections between audio components. + - atmel,ssc-controller: The phandle of the SSC controller + - atmel,audio-codec: The phandle of the WM8731 audio codec + - atmel,format: DAI format. Must be "i2s" + - atmel,bitclock-master: DAI clock master + - atmel,frame-master: DAI frame master + +Example: +sound { + compatible = "atmel,sam9x5-wm8731-audio"; + + atmel,model = "wm8731 @ AT91SAM9X5EK"; + + atmel,audio-routing = + "Headphone Jack", "RHPOUT", + "Headphone Jack", "LHPOUT", + "LLINEIN", "Line In Jack", + "RLINEIN", "Line In Jack"; + + atmel,ssc-controller = <&ssc0>; + atmel,audio-codec = <&wm8731>; + atmel,format = "i2s"; + atmel,bitclock-master; + atmel,frame-master; +};
Signature · 1 line
1.7.10.4
PATCH v3 3/7 Documentation: DT: update atmel SSC with DMA binding
In reply to Richard GenoudAs atmel-ssc can be used with DMA, the documentation should be updated. Also, a configuration DMA example is given.
--- .../devicetree/bindings/misc/atmel-ssc.txt | 24 ++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/misc/atmel-ssc.txt +22 -2
@@ -6,10 +6,30 @@ Required properties: - atmel,at91sam9g45-ssc: support dma transfer - reg: Should contain SSC registers location and length - interrupts: Should contain SSC interrupt +For dma transfer: +- dmas: DMA specifier, consisting of a phandle to DMA controller node, + the memory interface and SSC DMA channel ID (for tx and rx). + See Documentation/devicetree/bindings/dma/atmel-dma.txt for details. +- dma-names: Must be "tx", "rx". -Example: + +Examples: ssc0: ssc@fffbc000 { compatible = "atmel,at91rm9200-ssc"; reg = <0xfffbc000 0x4000>; - interrupts = <14 4 5>; + interrupts = <14 IRQ_TYPE_LEVEL_HIGH 5>; }; + + +ssc0: ssc@f0010000 { + compatible = "atmel,at91sam9g45-ssc"; + reg = <0xf0010000 0x4000>; + interrupts = <28 IRQ_TYPE_LEVEL_HIGH 5>; + dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(13)>, + <&dma0 1 AT91_DMA_CFG_PER_ID(14)>; + dma-names = "tx", "rx"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; + status = "disabled"; +}; +
Signature · 1 line
1.7.10.4
PATCH v3 4/7 ARM: AT91: DTS: sam9x5: add SSC DMA parameters
In reply to Richard Genoud--- arch/arm/boot/dts/at91sam9x5.dtsi | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/boot/dts/at91sam9x5.dtsi +3 -0
@@ -542,6 +542,9 @@ compatible = "atmel,at91sam9g45-ssc"; reg = <0xf0010000 0x4000>; interrupts = <28 IRQ_TYPE_LEVEL_HIGH 5>; + dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(13)>, + <&dma0 1 AT91_DMA_CFG_PER_ID(14)>; + dma-names = "tx", "rx"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; status = "disabled";
Signature · 1 line
1.7.10.4
PATCH v3 5/7 ARM: AT91: DTS: sam9x5ek: add WM8731 codec
In reply to Richard GenoudThe WM8731 codec on sam9x5ek board is on i2c, address 1A
--- arch/arm/boot/dts/at91sam9x5ek.dtsi | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm/boot/dts/at91sam9x5ek.dtsi +5 -0
@@ -59,6 +59,11 @@ i2c0: i2c@f8010000 { status = "okay"; + + wm8731: wm8731@1a { + compatible = "wm8731"; + reg = <0x1a>; + }; }; pinctrl@fffff400 {
Signature · 1 line
1.7.10.4
PATCH v3 6/7 ARM: AT91: DTS: sam9x5ek: add sound configuration
In reply to Richard GenoudThe sam9x5ek board has 2 jacks:
headphone wired on RHPOUT/LHPOUT of the wm8731
line in wired on LLINEIN/RLINEIN of the wm8731
--- arch/arm/boot/dts/at91sam9x5ek.dtsi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
arch/arm/boot/dts/at91sam9x5ek.dtsi +18 -0
@@ -109,4 +109,22 @@ status = "okay"; }; }; + + sound { + compatible = "atmel,sam9x5-wm8731-audio"; + + atmel,model = "wm8731 @ AT91SAM9X5EK"; + + atmel,audio-routing = + "Headphone Jack", "RHPOUT", + "Headphone Jack", "LHPOUT", + "LLINEIN", "Line In Jack", + "RLINEIN", "Line In Jack"; + + atmel,ssc-controller = <&ssc0>; + atmel,audio-codec = <&wm8731>; + atmel,format = "i2s"; + atmel,bitclock-master; + atmel,frame-master; + }; };
Signature · 1 line
1.7.10.4
PATCH v3 7/7 ARM: AT91: DTS: sam9x5ek: enable SSC
In reply to Richard GenoudEnable the SSC needed for the WM8731 codec
--- arch/arm/boot/dts/at91sam9x5ek.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/boot/dts/at91sam9x5ek.dtsi +4 -0
@@ -95,6 +95,10 @@ watchdog@fffffe40 { status = "okay"; }; + + ssc0: ssc@f0010000 { + status = "okay"; + }; }; usb0: ohci@00600000 {
Signature · 1 line
1.7.10.4
Re: [PATCH v3 3/7] Documentation: DT: update atmel SSC with DMA binding
In reply to Richard Genoud2013/7/9 Richard Genoud <[email protected]>:
Quoted 20 lines
As atmel-ssc can be used with DMA, the documentation should be updated. Also, a configuration DMA example is given.
Signed-off-by Richard Genoud <[email protected]>--- .../devicetree/bindings/misc/atmel-ssc.txt | 24 ++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)Documentation/devicetree/bindings/misc/atmel-ssc.txt +4
-0@@ -6,10 +6,30 @@ Required properties: - atmel,at91sam9g45-ssc: support dma transfer - reg: Should contain SSC registers location and length - interrupts: Should contain SSC interrupt +For dma transfer: +- dmas: DMA specifier, consisting of a phandle to DMA controller node, + the memory interface and SSC DMA channel ID (for tx and rx). + See Documentation/devicetree/bindings/dma/atmel-dma.txt for details.
Documentation/devicetree/bindings/misc/atmel-ssc.txt Required properties: · line 20
Quoted 10 lines
Documentation/devicetree/bindings/misc/atmel-ssc.txt +4
-2+- dma-names: Must be "tx", "rx". -Example: + +Examples: ssc0: ssc@fffbc000 { compatible = "atmel,at91rm9200-ssc"; reg = <0xfffbc000 0x4000>; - interrupts = <14 4 5>; + interrupts = <14 IRQ_TYPE_LEVEL_HIGH 5>;
maybe I should not use macro in the documentation (not sure if I should or not).
Documentation/devicetree/bindings/misc/atmel-ssc.txt Required properties: · line 29
Quoted 9 lines
Documentation/devicetree/bindings/misc/atmel-ssc.txt +8
-0}; + + +ssc0: ssc@f0010000 { + compatible = "atmel,at91sam9g45-ssc"; + reg = <0xf0010000 0x4000>; + interrupts = <28 IRQ_TYPE_LEVEL_HIGH 5>; + dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(13)>, + <&dma0 1 AT91_DMA_CFG_PER_ID(14)>;
same here
Quoted 9 lines
Documentation/devicetree/bindings/misc/atmel-ssc.txt +6
-1+ dma-names = "tx", "rx"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; + status = "disabled"; +}; + --1.7.10.4
Signature · 1 line
for me, ck means con kolivas and not calvin klein... does it mean I'm a geek ?
Re: [PATCH v3 3/7] Documentation: DT: update atmel SSC with DMA binding
On 09/07/2013 15:19, Richard Genoud :
Quoted 23 lines
2013/7/9 Richard Genoud <[email protected]>:
Quoted 22 lines
As atmel-ssc can be used with DMA, the documentation should be updated. Also, a configuration DMA example is given.
Signed-off-by Richard Genoud <[email protected]>--- .../devicetree/bindings/misc/atmel-ssc.txt | 24 ++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)Documentation/devicetree/bindings/misc/atmel-ssc.txt +5
-0@@ -6,10 +6,30 @@ Required properties: - atmel,at91sam9g45-ssc: support dma transfer - reg: Should contain SSC registers location and length - interrupts: Should contain SSC interrupt +For dma transfer: +- dmas: DMA specifier, consisting of a phandle to DMA controller node, + the memory interface and SSC DMA channel ID (for tx and rx). + See Documentation/devicetree/bindings/dma/atmel-dma.txt for details. +- dma-names: Must be "tx", "rx".
Quoted 9 lines
Documentation/devicetree/bindings/misc/atmel-ssc.txt Required properties: · line 20
Quoted 8 lines
Documentation/devicetree/bindings/misc/atmel-ssc.txt +3
-2-Example: + +Examples: ssc0: ssc@fffbc000 { compatible = "atmel,at91rm9200-ssc"; reg = <0xfffbc000 0x4000>; - interrupts = <14 4 5>; + interrupts = <14 IRQ_TYPE_LEVEL_HIGH 5>;maybe I should not use macro in the documentation (not sure if I should or not).
absolutely.
Quoted 22 lines
Documentation/devicetree/bindings/misc/atmel-ssc.txt Required properties: · line 29
Quoted 9 lines
Documentation/devicetree/bindings/misc/atmel-ssc.txt +8
-0}; + + +ssc0: ssc@f0010000 { + compatible = "atmel,at91sam9g45-ssc"; + reg = <0xf0010000 0x4000>; + interrupts = <28 IRQ_TYPE_LEVEL_HIGH 5>; + dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(13)>, + <&dma0 1 AT91_DMA_CFG_PER_ID(14)>;same here
Quoted 9 lines
Documentation/devicetree/bindings/misc/atmel-ssc.txt +6
-1+ dma-names = "tx", "rx"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; + status = "disabled"; +}; + --1.7.10.4
Signature · 1 line
Nicolas Ferre
Re: [PATCH v3 3/7] Documentation: DT: update atmel SSC with DMA binding
2013/7/9 Nicolas Ferre <[email protected]>:
Quoted 41 lines
On 09/07/2013 15:19, Richard Genoud :
Quoted 26 lines
2013/7/9 Richard Genoud <[email protected]>:
Quoted 25 lines
As atmel-ssc can be used with DMA, the documentation should be updated. Also, a configuration DMA example is given.
Signed-off-by Richard Genoud <[email protected]>--- .../devicetree/bindings/misc/atmel-ssc.txt | 24 ++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)Documentation/devicetree/bindings/misc/atmel-ssc.txt +5
-0@@ -6,10 +6,30 @@ Required properties: - atmel,at91sam9g45-ssc: support dma transfer - reg: Should contain SSC registers location and length - interrupts: Should contain SSC interrupt +For dma transfer: +- dmas: DMA specifier, consisting of a phandle to DMA controller node, + the memory interface and SSC DMA channel ID (for tx and rx). + See Documentation/devicetree/bindings/dma/atmel-dma.txt for details. +- dma-names: Must be "tx", "rx".Quoted 11 lines
Documentation/devicetree/bindings/misc/atmel-ssc.txt Required properties: · line 20
Quoted 8 lines
Documentation/devicetree/bindings/misc/atmel-ssc.txt +3
-2-Example: + +Examples: ssc0: ssc@fffbc000 { compatible = "atmel,at91rm9200-ssc"; reg = <0xfffbc000 0x4000>; - interrupts = <14 4 5>; + interrupts = <14 IRQ_TYPE_LEVEL_HIGH 5>;maybe I should not use macro in the documentation (not sure if I should or not).
Quoted 1 line
absolutely.
ok, thanks, changing that in next version.
v4 cover Sound support for at91sam9x5-wm8731 based boards
In reply to Richard Genoud[I've just seen that I forgot to cc Uwe to the cover letter, sorry for that.]
Hi,
This patchset add sound on the at91sam9x5ek board.
It's based on Nicolas Ferre's work in the 2.6.39 atmel patch for sam9x5:
https://github.com/linux4sam/linux-at91/commit/0aa157c9e71ccccf3abc30fa37eb5c95b392978d
It needs Bo Chen's patchset on the generic dmaengine (topic/atmel branch on Mark's sound tree) and the SSC interrupts disabled (cf
http://www.spinics.net/lists/arm-kernel/msg256901.html)
Outstanding issue:
If this machine driver will support more SoCs maybe we should name it differently.
It has been tested on at91sam9g35ek, and should work on g15, g25, x25 and x35 also.
patches applies on next-20130708
[I let the original signed-off from Nicolas and Uwe in place, I don't know if I should replace them by something like "originaly-signed-off-by" since the code has been changed.]
Changes from v3:
* Remove the use of macros in device tree documentation.
Changes from v2:
* Change atmel,sam9x5-audio-wm8731 to atmel,sam9x5-wm8731-audio for
consistency with sam9g20 machine driver.
* Use the snd_pcm_hw_constraint() API as suggested by Mark and Lars-Peter.
* Remove the unnecessary snd_soc_dapm_sync() call as Lars-Peter suggested.
* Add documentation for machine driver DT binding.
* Update atmel-ssc DT binding documentation.
* Add GPL license instead of just the "GPL" word (hope that's ok !)
Changes from v1-RFC:
* drop patches on SSC since Bo Chen already did the work
* reorder patches to have the machine driver first
* drop code already handled by the ASoC framework
* drop unneeded SND_ATMEL_SOC_PDC config selection
* use static snd_soc_card and snd_soc_dai_link structures.
Best regards,
Richard.
Nicolas Ferre (1):
sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
Richard Genoud (6):
Documentation: DT: add sam9x5ek-wm8731 machine driver
Documentation: DT: update atmel SSC with DMA binding
ARM: AT91: DTS: sam9x5: add SSC DMA parameters
ARM: AT91: DTS: sam9x5ek: add WM8731 codec
ARM: AT91: DTS: sam9x5ek: add sound configuration
ARM: AT91: DTS: sam9x5ek: enable SSC
.../devicetree/bindings/misc/atmel-ssc.txt | 20 +- .../bindings/sound/atmel-sam9x5-wm8731-audio.txt | 30 +++ arch/arm/boot/dts/at91sam9x5.dtsi | 3 + arch/arm/boot/dts/at91sam9x5ek.dtsi | 27 +++ sound/soc/atmel/Kconfig | 10 + sound/soc/atmel/Makefile | 2 + sound/soc/atmel/sam9x5_wm8731.c | 238 ++++++++++++++++++++ 7 files changed, 329 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/sound/atmel-sam9x5-wm8731-audio.txt create mode 100644 sound/soc/atmel/sam9x5_wm8731.c
Signature · 1 line
1.7.10.4
PATCH v4 1/7 sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
From: Nicolas Ferre <[email protected]>
Description of the Asoc machine driver for an at91sam9x5 based board with a wm8731 audio DAC. Wm8731 is clocked by a crystal and used as a master on the SSC/I2S interface. Its connections are a headphone jack and an Line input jack.
[Richard: this is based on an old patch from Nicolas that I forward ported and reworked to use only device tree]
--- sound/soc/atmel/Kconfig | 10 ++ sound/soc/atmel/Makefile | 2 + sound/soc/atmel/sam9x5_wm8731.c | 238 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 250 insertions(+) create mode 100644 sound/soc/atmel/sam9x5_wm8731.c
sound/soc/atmel/Kconfig +10 -0
@@ -33,6 +33,16 @@ config SND_AT91_SOC_SAM9G20_WM8731 Say Y if you want to add support for SoC audio on WM8731-based AT91sam9g20 evaluation board. +config SND_AT91_SOC_SAM9X5_WM8731 + tristate "SoC Audio support for WM8731-based at91sam9x5 board" + depends on ATMEL_SSC && SND_ATMEL_SOC && SOC_AT91SAM9X5 + select SND_ATMEL_SOC_SSC + select SND_ATMEL_SOC_DMA + select SND_SOC_WM8731 + help + Say Y if you want to add support for audio SoC on an + at91sam9x5 based board that is using WM8731 codec. + config SND_AT91_SOC_AFEB9260 tristate "SoC Audio support for AFEB9260 board" depends on ARCH_AT91 && ATMEL_SSC && ARCH_AT91 && MACH_AFEB9260 && SND_ATMEL_SOC
sound/soc/atmel/Makefile +2 -0
@@ -11,6 +11,8 @@ obj-$(CONFIG_SND_ATMEL_SOC_SSC) += snd-soc-atmel_ssc_dai.o # AT91 Machine Support snd-soc-sam9g20-wm8731-objs := sam9g20_wm8731.o +snd-soc-sam9x5-wm8731-objs := sam9x5_wm8731.o obj-$(CONFIG_SND_AT91_SOC_SAM9G20_WM8731) += snd-soc-sam9g20-wm8731.o +obj-$(CONFIG_SND_AT91_SOC_SAM9X5_WM8731) += snd-soc-sam9x5-wm8731.o obj-$(CONFIG_SND_AT91_SOC_AFEB9260) += snd-soc-afeb9260.o
sound/soc/atmel/sam9x5_wm8731.c new file +238 -0
238 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH v4 2/7 Documentation: DT: add sam9x5ek-wm8731 machine driver
In reply to Richard GenoudThis add the sound DT binding for sam9x5ek-wm8731 machine driver
--- .../bindings/sound/atmel-sam9x5-wm8731-audio.txt | 30 ++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/atmel-sam9x5-wm8731-audio.txt
Documentation/devicetree/bindings/sound/atmel-sam9x5-wm8731-audio.txt new file +30 -0
@@ -0,0 +1,30 @@ +* Atmel at91sam9x5ek wm8731 audio complex + +Required properties: + - compatible: "atmel,at91sam9x5ek-wm8731-audio" + - atmel,model: The user-visible name of this sound complex. + - atmel,audio-routing: A list of the connections between audio components. + - atmel,ssc-controller: The phandle of the SSC controller + - atmel,audio-codec: The phandle of the WM8731 audio codec + - atmel,format: DAI format. Must be "i2s" + - atmel,bitclock-master: DAI clock master + - atmel,frame-master: DAI frame master + +Example: +sound { + compatible = "atmel,sam9x5-wm8731-audio"; + + atmel,model = "wm8731 @ AT91SAM9X5EK"; + + atmel,audio-routing = + "Headphone Jack", "RHPOUT", + "Headphone Jack", "LHPOUT", + "LLINEIN", "Line In Jack", + "RLINEIN", "Line In Jack"; + + atmel,ssc-controller = <&ssc0>; + atmel,audio-codec = <&wm8731>; + atmel,format = "i2s"; + atmel,bitclock-master; + atmel,frame-master; +};
Signature · 1 line
1.7.10.4
PATCH v4 3/7 Documentation: DT: update atmel SSC with DMA binding
In reply to Richard GenoudAs atmel-ssc can be used with DMA, the documentation should be updated. Also, a configuration DMA example is given.
--- .../devicetree/bindings/misc/atmel-ssc.txt | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/misc/atmel-ssc.txt +19 -1
@@ -6,10 +6,28 @@ Required properties: - atmel,at91sam9g45-ssc: support dma transfer - reg: Should contain SSC registers location and length - interrupts: Should contain SSC interrupt +For dma transfer: +- dmas: DMA specifier, consisting of a phandle to DMA controller node, + the memory interface and SSC DMA channel ID (for tx and rx). + See Documentation/devicetree/bindings/dma/atmel-dma.txt for details. +- dma-names: Must be "tx", "rx". -Example: +Examples: ssc0: ssc@fffbc000 { compatible = "atmel,at91rm9200-ssc"; reg = <0xfffbc000 0x4000>; interrupts = <14 4 5>; }; + + +ssc0: ssc@f0010000 { + compatible = "atmel,at91sam9g45-ssc"; + reg = <0xf0010000 0x4000>; + interrupts = <28 4 5>; + dmas = <&dma0 1 13>, + <&dma0 1 14>; + dma-names = "tx", "rx"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; + status = "disabled"; +};
Signature · 1 line
1.7.10.4
PATCH v4 4/7 ARM: AT91: DTS: sam9x5: add SSC DMA parameters
In reply to Richard Genoud--- arch/arm/boot/dts/at91sam9x5.dtsi | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/boot/dts/at91sam9x5.dtsi +3 -0
@@ -542,6 +542,9 @@ compatible = "atmel,at91sam9g45-ssc"; reg = <0xf0010000 0x4000>; interrupts = <28 IRQ_TYPE_LEVEL_HIGH 5>; + dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(13)>, + <&dma0 1 AT91_DMA_CFG_PER_ID(14)>; + dma-names = "tx", "rx"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; status = "disabled";
Signature · 1 line
1.7.10.4
PATCH v4 5/7 ARM: AT91: DTS: sam9x5ek: add WM8731 codec
In reply to Richard GenoudThe WM8731 codec on sam9x5ek board is on i2c, address 1A
--- arch/arm/boot/dts/at91sam9x5ek.dtsi | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm/boot/dts/at91sam9x5ek.dtsi +5 -0
@@ -59,6 +59,11 @@ i2c0: i2c@f8010000 { status = "okay"; + + wm8731: wm8731@1a { + compatible = "wm8731"; + reg = <0x1a>; + }; }; pinctrl@fffff400 {
Signature · 1 line
1.7.10.4
PATCH v4 6/7 ARM: AT91: DTS: sam9x5ek: add sound configuration
In reply to Richard GenoudThe sam9x5ek board has 2 jacks:
headphone wired on RHPOUT/LHPOUT of the wm8731
line in wired on LLINEIN/RLINEIN of the wm8731
--- arch/arm/boot/dts/at91sam9x5ek.dtsi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
arch/arm/boot/dts/at91sam9x5ek.dtsi +18 -0
@@ -109,4 +109,22 @@ status = "okay"; }; }; + + sound { + compatible = "atmel,sam9x5-wm8731-audio"; + + atmel,model = "wm8731 @ AT91SAM9X5EK"; + + atmel,audio-routing = + "Headphone Jack", "RHPOUT", + "Headphone Jack", "LHPOUT", + "LLINEIN", "Line In Jack", + "RLINEIN", "Line In Jack"; + + atmel,ssc-controller = <&ssc0>; + atmel,audio-codec = <&wm8731>; + atmel,format = "i2s"; + atmel,bitclock-master; + atmel,frame-master; + }; };
Signature · 1 line
1.7.10.4
PATCH v4 7/7 ARM: AT91: DTS: sam9x5ek: enable SSC
In reply to Richard GenoudEnable the SSC needed for the WM8731 codec
--- arch/arm/boot/dts/at91sam9x5ek.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/boot/dts/at91sam9x5ek.dtsi +4 -0
@@ -95,6 +95,10 @@ watchdog@fffffe40 { status = "okay"; }; + + ssc0: ssc@f0010000 { + status = "okay"; + }; }; usb0: ohci@00600000 {
Signature · 1 line
1.7.10.4
Mark Brown
maintainerQuoted 1 line · Richard Genoud
[I've just seen that I forgot to cc Uwe to the cover letter, sorry for that.]
This is the second or third copy of this patch set I've been sent *today*. Worse, everything seems to be being sent in reply to the same thread increasing the nesting substantially. Please slow down, it's flooding my mailbox and discouraging me from looking since it seems likely that there will just be another resend.
2013/7/9 Mark Brown <[email protected]>:
Quoted 8 lines · Richard Genoud
Quoted 1 line
[I've just seen that I forgot to cc Uwe to the cover letter, sorry for that.]
This is the second or third copy of this patch set I've been sent *today*. Worse, everything seems to be being sent in reply to the same thread increasing the nesting substantially. Please slow down, it's flooding my mailbox and discouraging me from looking since it seems likely that there will just be another resend.
Sorry Mark, I didn't want to be pushy...
I still need to learn what should and what shouldn't be done on a linux-ML
Best regards,
Richard.
Mark Brown
maintainerRe: [PATCH v4 1/7] sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
In reply to Richard GenoudQuoted 4 lines · Richard Genoud
sound/soc/atmel/sam9x5_wm8731.c new file +4
-0+/* +* Authorized rates are: +* Rate = MCLK_RATE / (n * 2) +* Where n is in [1..4095]
sound/soc/atmel/sam9x5_wm8731.c line 62
Quoted 10 lines
sound/soc/atmel/sam9x5_wm8731.c new file +10
-0+* (cf register SSC_CMR) +*/ +static unsigned int rates[] = { +8000 , +16000 , +32000 , +48000 , +64000 , +96000 , +};
Shouldn't the SSC driver be enforcing this constraint if it comes from the SSC hardware? If the clock is reprogrammable the usual convention for drivers is to not constrain if the clock is set to zero so a machine driver could remove the constraint.
sound/soc/atmel/sam9x5_wm8731.c line 152
Quoted 6 lines
sound/soc/atmel/sam9x5_wm8731.c new file +6
-0+ ret =atmel_ssc_set_audio (0 ); +if (ret !=0 ) { +dev_err (&pdev->dev, +"ASoC: Failed to set SSC 0 for audio: %d\n" , ret); +return ret; + }
Shouldn't this be a parameter in the DT too?
sound/soc/atmel/sam9x5_wm8731.c line 181
Quoted 8 lines
sound/soc/atmel/sam9x5_wm8731.c new file +8
-0+ cpu_np =of_parse_phandle (np,"atmel,ssc-controller" ,0 ); +if (!cpu_np) { +dev_err (&pdev->dev,"ssc controller node missing\n" ); + ret = -EINVAL ; + goto out; + } + at91sam9x5ek_dai.cpu_of_node = cpu_np; + at91sam9x5ek_dai.platform_of_node = cpu_np;
After all we're looking things up in the DT...
sound/soc/atmel/sam9x5_wm8731.c line 186
Quoted 1 line
sound/soc/atmel/sam9x5_wm8731.c new file +1
-0+ at91sam9x5ek_dai.dai_fmt =snd_soc_of_parse_daifmt (np,"atmel," );
Is this really something that machines would want to reconfigure? If so why?
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Mark Brown
maintainerRe: [PATCH v4 2/7] Documentation: DT: add sam9x5ek-wm8731 machine driver
In reply to Richard GenoudQuoted 5 lines · Richard Genoud
This add the sound DT binding for sam9x5ek-wm8731 machine driver
Signed-off-by Richard Genoud <[email protected]>--- .../bindings/sound/atmel-sam9x5-wm8731-audio.txt | 30 ++++++++++++++++++++
Put new binding documents in the same patch that reads them, this makes review easier.
Quoted 1 line
+ - atmel,audio-routing: A list of the connections between audio components.
This needs to be more specific and list the available board specific nodes for routing. For the CODEC you can just refer to the CODEC binding documentation.
Quoted 1 line
+ - atmel,format: DAI format. Must be "i2s"
So why not just omit this then?
Documentation/devicetree/bindings/sound/atmel-sam9x5-wm8731-audio.txt line 11
Quoted 2 lines
Documentation/devicetree/bindings/sound/atmel-sam9x5-wm8731-audio.txt new file +2
-0+ - atmel,bitclock-master: DAI clock master + - atmel,frame-master: DAI frame master
The driver isn't handling these and there's no information on how to set
them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130709/dcbf9701/attachment.sig>
Mark Brown
maintainerRe: [PATCH v4 3/7] Documentation: DT: update atmel SSC with DMA binding
In reply to Richard GenoudDocumentation/devicetree/bindings/misc/atmel-ssc.txt Required properties: · line 13
Quoted 7 lines · Richard Genoud
- reg: Should contain SSC registers location and length
- interrupts: Should contain SSC interruptDocumentation/devicetree/bindings/misc/atmel-ssc.txt +5
-0+For dma transfer: +- dmas: DMA specifier, consisting of a phandle to DMA controller node, + the memory interface and SSC DMA channel ID (for tx and rx). + See Documentation/devicetree/bindings/dma/atmel-dma.txt for details. +- dma-names: Must be "tx", "rx".
This is added as a required property so...
Documentation/devicetree/bindings/misc/atmel-ssc.txt Required properties: · line 20
Quoted 7 lines
Documentation/devicetree/bindings/misc/atmel-ssc.txt +1
-1-Example: +Examples: ssc0: ssc at fffbc000 { compatible = "atmel,at91rm9200-ssc"; reg = <0xfffbc000 0x4000>; interrupts = <14 4 5>; };
...this first example is now invalid and should probably just be being
extended with the new required properties.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130709/614c2105/attachment.sig>
Re: [PATCH v4 1/7] sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
In reply to Richard GenoudHi Richard,
On 7/9/2013 22:25, Richard Genoud wrote:
[snip]
Quoted 13 lines
sound/soc/atmel/sam9x5_wm8731.c new file +13
-0+#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/kernel.h> +#include <linux/clk.h> +#include <linux/timer.h> +#include <linux/interrupt.h> +#include <linux/platform_device.h> +#include <linux/i2c.h> + +#include <linux/atmel-ssc.h> + +#include <sound/core.h> +#include <sound/pcm.h>
sound/soc/atmel/sam9x5_wm8731.c line 43
Quoted 10 lines
sound/soc/atmel/sam9x5_wm8731.c new file +10
-0+#include <sound/pcm_params.h> +#include <sound/soc.h> + +#include <asm/mach-types.h> +#include <mach/hardware.h> +#include <mach/gpio.h> + +#include "../codecs/wm8731.h" +#include "atmel-pcm.h" +#include "atmel_ssc_dai.h"
I think some of the header file include is not needed. I keep them as simple as following:
---8>---
#include <linux/clk.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/pinctrl/consumer.h>
#include <sound/soc.h>
#include "../codecs/wm8731.h"
#include "atmel_ssc_dai.h"
---<8---
Quoted 8 lines
sound/soc/atmel/sam9x5_wm8731.c new file +8
-0+#define MCLK_RATE 12288000 + +#define DRV_NAME "sam9x5-snd-wm8731" + +/* +* Authorized rates are: +* Rate = MCLK_RATE / (n * 2) +* Where n is in [1..4095]
sound/soc/atmel/sam9x5_wm8731.c line 62
Quoted 10 lines
sound/soc/atmel/sam9x5_wm8731.c new file +10
-0+* (cf register SSC_CMR) +*/ +static unsigned int rates[] = { +8000 , +16000 , +32000 , +48000 , +64000 , +96000 , +};
This is decided by the codec, while not ssc when ssc in slave mode.
Quoted 5 lines
sound/soc/atmel/sam9x5_wm8731.c new file +5
-0+static struct snd_pcm_hw_constraint_list hw_rates = { + .count =ARRAY_SIZE (rates), + .list = rates, +}; +
[snip]
Review
Quoted 2 lines
(quoted diff) +2
-0+ + at91sam9x5ek_dai.dai_fmt = snd_soc_of_parse_daifmt(np, "atmel,");
We can put this into at91sam9x5ek_dai directly, not need to parse it then. example as following:
---8>---
.dai_fmt = SND_SOC_DAIFMT_I2S
| SND_SOC_DAIFMT_NB_NF
| SND_SOC_DAIFMT_CBM_CFM,
---<8---
Best Regards,
Bo Shen
Re: [PATCH v4 1/7] sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
In reply to Mark Brown2013/7/9 Mark Brown <[email protected]>:
Quoted 13 lines · Richard Genoud
Quoted 12 lines
sound/soc/atmel/sam9x5_wm8731.c new file +11
-0+/* +* Authorized rates are: +* Rate = MCLK_RATE / (n * 2) +* Where n is in [1..4095] +* (cf register SSC_CMR) +*/ +static unsigned int rates[] = { +8000 , +16000 , +32000 , +48000 ,
Quoted 8 lines
sound/soc/atmel/sam9x5_wm8731.c line 62
Quoted 3 lines
sound/soc/atmel/sam9x5_wm8731.c new file +3
-0+64000 , + 96000, +};Shouldn't the SSC driver be enforcing this constraint if it comes from the SSC hardware? If the clock is reprogrammable the usual convention for drivers is to not constrain if the clock is set to zero so a machine driver could remove the constraint.
Actually, my comment is buggy here (or at least, unrelated to the authorized rates).
The "MCLK_RATE" is the master clock of the wm8731 codec (a 12.288MHz crystal). According to the datasheet of wm8731, when a 12.288 crystal is used, the authorized rates are 8, 32, 48 and 96kHz (I have to remove 16 and 64kHz).
So, is this the right place for the rates ?
Quoted 8 lines
sound/soc/atmel/sam9x5_wm8731.c line 152
Quoted 6 lines
sound/soc/atmel/sam9x5_wm8731.c new file +6
-0+ ret =atmel_ssc_set_audio (0 ); +if (ret !=0 ) { +dev_err (&pdev->dev, +"ASoC: Failed to set SSC 0 for audio: %d\n" , ret); +return ret; + }Shouldn't this be a parameter in the DT too?
Yes, I'll add that to the DT.
Quoted 9 lines
sound/soc/atmel/sam9x5_wm8731.c line 181
Quoted 8 lines
sound/soc/atmel/sam9x5_wm8731.c new file +8
-0+ cpu_np =of_parse_phandle (np,"atmel,ssc-controller" ,0 ); +if (!cpu_np) { +dev_err (&pdev->dev,"ssc controller node missing\n" ); + ret = -EINVAL ; + goto out; + } + at91sam9x5ek_dai.cpu_of_node = cpu_np; + at91sam9x5ek_dai.platform_of_node = cpu_np;
Quoted 6 lines
After all we're looking things up in the DT...
Quoted 1 line
+ at91sam9x5ek_dai.dai_fmt =
snd_soc_of_parse_daifmt(np, "atmel,");Is this really something that machines would want to reconfigure? If so why?
That's right. There's no point reconfiguring that because I2S is the only possible interface.
Thanks for your comments !
Richard.
Re: [PATCH v4 1/7] sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
In reply to Bo Shen2013/7/10 Bo Shen <[email protected]>:
Quoted 1 line
Hi Richard,
Hi !
Quoted 38 lines · Richard Genoud
[snip]
Quoted 13 lines
sound/soc/atmel/sam9x5_wm8731.c new file +13
-0+#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/kernel.h> +#include <linux/clk.h> +#include <linux/timer.h> +#include <linux/interrupt.h> +#include <linux/platform_device.h> +#include <linux/i2c.h> + +#include <linux/atmel-ssc.h> + +#include <sound/core.h> +#include <sound/pcm.h> sound/soc/atmel/sam9x5_wm8731.c line 43
Quoted 10 lines
sound/soc/atmel/sam9x5_wm8731.c new file +10
-0+#include <sound/pcm_params.h> +#include <sound/soc.h> + +#include <asm/mach-types.h> +#include <mach/hardware.h> +#include <mach/gpio.h> + +#include "../codecs/wm8731.h" +#include "atmel-pcm.h" +#include "atmel_ssc_dai.h" I think some of the header file include is not needed. I keep them as simple as following:
---8>---
#include <linux/clk.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/pinctrl/consumer.h>
Quoted 5 lines
#include <
sound/soc.h>#include "
../codecs/wm8731.h"
#include "atmel_ssc_dai.h"
---<8---
ooopps ! I forgot to do some cleaning in those after the file rework. Thanks !
Quoted 14 lines
Quoted 14 lines
sound/soc/atmel/sam9x5_wm8731.c new file +13
-0+#define MCLK_RATE 12288000 + +#define DRV_NAME "sam9x5-snd-wm8731" + +/* +* Authorized rates are: +* Rate = MCLK_RATE / (n * 2) +* Where n is in [1..4095] +* (cf register SSC_CMR) +*/ +static unsigned int rates[] = { +8000 , +16000 ,
Quoted 8 lines
sound/soc/atmel/sam9x5_wm8731.c line 62
Quoted 5 lines
sound/soc/atmel/sam9x5_wm8731.c new file +5
-0+32000 , +48000 , +64000 , + 96000, +};This is decided by the codec, while not ssc when ssc in slave mode.
yes.
Quoted 14 lines
Quoted 5 lines
sound/soc/atmel/sam9x5_wm8731.c new file +5
-0+static struct snd_pcm_hw_constraint_list hw_rates = { + .count =ARRAY_SIZE (rates), + .list = rates, +}; +[snip]
Review
Quoted 2 lines
(quoted diff) +2
-0+ + at91sam9x5ek_dai.dai_fmt = snd_soc_of_parse_daifmt(np, "atmel,");
Quoted 7 lines
We can put this into
at91sam9x5ek_daidirectly, not need to parse it then. example as following:
---8>---
.dai_fmt =SND_SOC_DAIFMT_I2S
|SND_SOC_DAIFMT_NB_NF
|SND_SOC_DAIFMT_CBM_CFM,
---<8---
yes, I removed that for the older machine driver, without thinking that much. It's better hardcorded like that.
Thanks for your comments !
Re: [PATCH v4 2/7] Documentation: DT: add sam9x5ek-wm8731 machine driver
In reply to Mark Brown2013/7/9 Mark Brown <[email protected]>:
Quoted 9 lines · Richard Genoud
Quoted 5 lines
This add the sound DT binding for sam9x5ek-wm8731 machine driver
Signed-off-by Richard Genoud <[email protected]>--- .../bindings/sound/atmel-sam9x5-wm8731-audio.txt | 30 ++++++++++++++++++++Put new binding documents in the same patch that reads them, this makes review easier.
ok, I'll squash it with patch 1
Quoted 5 lines
Quoted 1 line
+ - atmel,audio-routing: A list of the connections between audio components.
This needs to be more specific and list the available board specific nodes for routing. For the CODEC you can just refer to the CODEC binding documentation.
Ok, I'll do that.
Quoted 3 lines
Quoted 1 line
+ - atmel,format: DAI format. Must be "i2s"
So why not just omit this then?
Will be removed.
Quoted 6 lines
Documentation/devicetree/bindings/sound/atmel-sam9x5-wm8731-audio.txt line 11
Quoted 3 lines
Documentation/devicetree/bindings/sound/atmel-sam9x5-wm8731-audio.txt new file +2
-0+ - atmel,bitclock-master: DAI clock master + - atmel,frame-master: DAI frame masterThe driver isn't handling these and there's no information on how to set them.
They will also go away.
Thanks !
Re: [PATCH v4 3/7] Documentation: DT: update atmel SSC with DMA binding
In reply to Mark Brown2013/7/9 Mark Brown <[email protected]>:
Quoted 12 lines · Richard Genoud
Documentation/devicetree/bindings/misc/atmel-ssc.txt Required properties: · line 13
Quoted 8 lines
- reg: Should contain SSC registers location and length
- interrupts: Should contain SSC interruptDocumentation/devicetree/bindings/misc/atmel-ssc.txt +5
-0+For dma transfer: +- dmas: DMA specifier, consisting of a phandle to DMA controller node, + the memory interface and SSC DMA channel ID (for tx and rx). + See Documentation/devicetree/bindings/dma/atmel-dma.txt for details. +- dma-names: Must be "tx", "rx".This is added as a required property so...
Quoted 10 lines
Documentation/devicetree/bindings/misc/atmel-ssc.txt Required properties: · line 20
Quoted 7 lines
Documentation/devicetree/bindings/misc/atmel-ssc.txt +1
-1-Example: +Examples: ssc0: ssc@fffbc000 { compatible = "atmel,at91rm9200-ssc"; reg = <0xfffbc000 0x4000>; interrupts = <14 4 5>; };...this first example is now invalid and should probably just be being extended with the new required properties.
Well, I have to rewrite that to make it clearer. The thing is:
with "atmel,at91rm9200-ssc" the SSC doesn't work with DMA. with "atmel,at91sam9g45-ssc", the SSC work ONLY with DMA.
So the dmas/dma-names properties are only required for g45-ssc, and useless for rm9200-ssc
Maybe the best will be to write a paragraph for g45-ssc and another for rm9200-ssc, even if there's some identical lines between them.
Thanks !
Richard.
Mark Brown
maintainerRe: [PATCH v4 1/7] sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
In reply to Richard GenoudQuoted 7 lines · Richard Genoud
2013/7/9 Mark Brown <[email protected]>:
Quoted 4 lines
Shouldn't the SSC driver be enforcing this constraint if it comes from the SSC hardware? If the clock is reprogrammable the usual convention for drivers is to not constrain if the clock is set to zero so a machine driver could remove the constraint.
Quoted 8 lines
Actually, my comment is buggy here (or at least, unrelated to the authorized rates).
The "MCLK_RATE" is the master clock of the wm8731 codec (a 12.288MHz crystal). According to the datasheet of wm8731, when a 12.288 crystal is used, the authorized rates are 8, 32, 48 and 96kHz (I have to remove 16 and 64kHz).So, is this the right place for the rates ?
No, the CODEC driver should be enforcing the restrictions if that's where they come from.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Mark Brown
maintainerRe: [PATCH v4 3/7] Documentation: DT: update atmel SSC with DMA binding
In reply to Richard GenoudQuoted 10 lines · Richard Genoud
2013/7/9 Mark Brown <[email protected]>:
Quoted 2 lines
...this first example is now invalid and should probably just be being extended with the new required properties.
Well, I have to rewrite that to make it clearer. The thing is:
with "atmel,at91rm9200-ssc" the SSC doesn't work with DMA. with "atmel,at91sam9g45-ssc", the SSC work ONLY with DMA.
Quoted 5 lines
So the dmas/dma-names properties are only required for g45-ssc, and useless for rm9200-ssc
Maybe the best will be to write a paragraph for g45-ssc and another for rm9200-ssc, even if there's some identical lines between them.
OK, or just write a section "Required for devices with compatible X".