SAMA5D36 custom board with WM8904 codec DMA chanel missing

Moderator: nferre

szitabalint
Posts: 3
Joined: Fri Dec 25, 2015 12:26 pm

SAMA5D36 custom board with WM8904 codec DMA chanel missing

Fri Dec 25, 2015 12:40 pm

Hello,

I'm make a custom board with wm8904 audio codec., but I don't find error, while not recognise sound card.
I2c probe is working. What's wrong?


boot log:

wm8904 0-001a: revision A
ssc f0008000.ssc: Missing dma channel for stream: 0
ssc f0008000.ssc: ASoC: pcm constructor failed: -22
atmel-wm8904-audio sound: ASoC: can't create pcm WM8904 PCM :-22
atmel-wm8904-audio sound: ASoC: failed to instantiate card -22
atmel-wm8904-audio sound: snd_soc_register_card failed
atmel-wm8904-audio: probe of sound failed with error -22

kernel: linux 3.18

kernel sound configuration:
# HD-Audio
#
# CONFIG_SND_ARM is not set

#
# Atmel devices (AVR32 and AT91)
#
# CONFIG_SND_ATMEL_AC97C is not set
# CONFIG_SND_SPI is not set
# CONFIG_SND_USB is not set
CONFIG_SND_SOC=y
CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y
CONFIG_SND_ATMEL_SOC=y
CONFIG_SND_ATMEL_SOC_PDC=y
CONFIG_SND_ATMEL_SOC_DMA=y
CONFIG_SND_ATMEL_SOC_SSC=y
CONFIG_SND_AT91_SOC_SAM9G20_WM8731=y
CONFIG_SND_ATMEL_SOC_WM8904=y
# CONFIG_SND_DESIGNWARE_I2S is not set



device tree file:

#include "sama5d36.dtsi"
#include "at91-sama5d3_xplained_dm_pda4.dtsi"


/ {
model = "Atmel SAMA5D3 Xplained TM43xx";
compatible = "atmel,sama5d3-xplained", "atmel,sama5d3", "atmel,sama5", "atmel,asoc-wm8904", "atmel,sama5d36ek", "atmel,sama5d36";

chosen {
bootargs = "console=ttyS0,115200";
};

memory {
reg = <0x20000000 0x10000000>;
};

clocks {
slow_xtal {
clock-frequency = <32768>;
};

main_xtal {
clock-frequency = <12000000>;
};
};

ahb {
apb {
mmc0: mmc@f0000000 {
pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3 &pinctrl_mmc0_dat4_7 &pinctrl_mmc0_cd>;
status = "okay";
slot@0 {
reg = <0>;
bus-width = <8>;
cd-gpios = <&pioE 0 GPIO_ACTIVE_LOW>;
};
};

spi0: spi@f0004000 {
cs-gpios = <&pioD 13 0>, <0>, <&pioD 15 0>, <&pioD 16 0>;

status = "okay";
ads7846: touchscreen@0 {
compatible = "ti,tsc2046";
reg = <2>;
spi-max-frequency = <1000000>;
pinctrl-names = "default";
interrupt-parent = <&pioE>;
interrupts = <7 0>;
pendown-gpio = <&pioE 7 0>;

ti,settle-delay-usec = /bits/ 16 <150>;
ti,debounce-max = /bits/ 16 <10>;
ti,debounce-tol = /bits/ 16 <5>;
ti,debounce-rep = /bits/ 16 <1>;
ti,keep-vref-on = /bits/ 16 <1>;
ti,x-min = /bits/ 16 <0>;
ti,x-max = /bits/ 16 <8000>;
ti,y-min = /bits/ 16 <0>;
ti,y-max = /bits/ 16 <4800>;
ti,x-plate-ohms = /bits/ 16 <40>;
ti,pressure-max = /bits/ 16 <255>;
linux,wakeup;
status = "okay";
};

};

i2c0: i2c@f0014000 {
status = "okay";
wm8904: wm8904@1a {
compatible = "wlf,wm8904";
reg = <0x1a>;
clocks = <&pck0>;
clock-names = "mclk";
};

};




i2c1: i2c@f0018000 {
pinctrl-0 = <&pinctrl_i2c1>;
status = "okay";

};


ssc0: ssc@f0008000 {
atmel,clk-from-rk-pin;
status="okay";
};


pwm0: pwm@f002c000 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm0_pwmh0_0 &pinctrl_pwm0_pwmh1_0>;
status = "okay";
};

usart0: serial@f001c000 {
status = "okay";
};

usart1: serial@f0020000 {
pinctrl-0 = <&pinctrl_usart1>;
status = "okay";
};

uart0: serial@f0024000 {
status = "okay";
};

mmc1: mmc@f8000000 {
pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3 &pinctrl_mmc1_cd>;
status = "okay";
slot@0 {
reg = <0>;
bus-width = <4>;
cd-gpios = <&pioE 1 GPIO_ACTIVE_HIGH>;
};
};

spi1: spi@f8008000 {
cs-gpios = <&pioC 25 0>;
status = "okay";
};

adc0: adc@f8018000 {
pinctrl-0 = <
&pinctrl_adc0_adtrg
&pinctrl_adc0_ad0
&pinctrl_adc0_ad1
&pinctrl_adc0_ad2
&pinctrl_adc0_ad3
&pinctrl_adc0_ad4
>;
status = "okay";
};

i2c2: i2c@f801c000 {
dmas = <0>, <0>; /* Do not use DMA for i2c2 */
pinctrl-0 = <&pinctrl_i2c2_pu>;
status = "okay";
};


dbgu: serial@ffffee00 {
dmas = <0>, <0>; /* Do not use DMA for dbgu */
status = "okay";
};

pinctrl@fffff200 {
board {
pinctrl_pck0_as_audio_mck: pck0_as_audio_mck {
atmel,pins =
<AT91_PIOD 30 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PD30 periph B */
};
pinctrl_i2c0_pu: i2c0_pu {
atmel,pins =
<AT91_PIOA 30 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>,
<AT91_PIOA 31 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
};

pinctrl_i2c2_pu: i2c2_pu {
atmel,pins =
<AT91_PIOA 18 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>,
<AT91_PIOA 19 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>;
};

pinctrl_mmc0_cd: mmc0_cd {
atmel,pins =
<AT91_PIOE 0 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
};

pinctrl_mmc1_cd: mmc1_cd {
atmel,pins =
<AT91_PIOE 1 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
};

pinctrl_usba_vbus: usba_vbus {
atmel,pins =
<AT91_PIOE 9 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; /* PE9, conflicts with A9 */
};


};
};

pmc: pmc@fffffc00 {
main: mainck {
clock-frequency = <12000000>;
};
};
};

nand0: nand@60000000 {
nand-bus-width = <8>;
nand-ecc-mode = "hw";
atmel,has-pmecc;
atmel,pmecc-cap = <4>;
atmel,pmecc-sector-size = <512>;
nand-on-flash-bbt;
status = "okay";

at91bootstrap@0 {
label = "at91bootstrap";
reg = <0x0 0x40000>;
};

bootloader@40000 {
label = "bootloader";
reg = <0x40000 0x80000>;
};

bootloaderenv@c0000 {
label = "bootloader env";
reg = <0xc0000 0xc0000>;
};

dtb@180000 {
label = "device tree";
reg = <0x180000 0x80000>;
};

kernel@200000 {
label = "kernel";
reg = <0x200000 0x600000>;
};

rootfs@800000 {
label = "rootfs";
reg = <0x800000 0x0f800000>;
};
};

usb0: gadget@00500000 {
atmel,vbus-gpio = <&pioE 9 GPIO_ACTIVE_HIGH>; /* PE9, conflicts with A9 */
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usba_vbus>;
status = "okay";
};


};



leds {
compatible = "gpio-leds";

d2 {
label = "d2";
gpios = <&pioE 23 GPIO_ACTIVE_LOW>; /* PE23, conflicts with A23, CTS2 */
linux,default-trigger = "heartbeat";
};


};

sound {
compatible = "atmel,asoc-wm8904";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pck0_as_audio_mck>;

atmel,model = "wm8904 @ AT91SAM9N12EK";
atmel,audio-routing =
"Headphone Jack", "HPOUTL",
"Headphone Jack", "HPOUTR",
"IN2L", "Line In Jack",
"IN2R", "Line In Jack",
"Mic", "MICBIAS",
"IN1L", "Mic";

atmel,ssc-controller = <&ssc0>;
atmel,audio-codec = <&wm8904>;

status = "okay";
};
};



Balint
cheikhna
Posts: 2
Joined: Tue Mar 01, 2016 11:01 am

Re: SAMA5D36 custom board with WM8904 codec DMA chanel missi

Tue Mar 01, 2016 11:21 am

Hi,
The problem comes from your SSC.
Do you assume using SSC0?
Why have you deleted the pin controller for i2c ?
Can I see your board connexion?
I have implemented it for SAMA5D44 and it's working fine now.
DF
szitabalint
Posts: 3
Joined: Fri Dec 25, 2015 12:26 pm

Re: SAMA5D36 custom board with WM8904 codec DMA chanel missi

Tue Mar 01, 2016 2:42 pm

Thank You for answers!

The problem is solved.
First I use modified sama5d3-xplaned dtb file. This is not working. Later I am modify sama5d3-ek dtb file and it is work perfect.

Balint
cheikhna
Posts: 2
Joined: Tue Mar 01, 2016 11:01 am

Re: SAMA5D36 custom board with WM8904 codec DMA chanel missi

Tue Mar 01, 2016 3:40 pm

Great!
But sometimes I'm having troubles with the I2C which is crashing.
Are you facing the same phenomenon ?
szitabalint
Posts: 3
Joined: Fri Dec 25, 2015 12:26 pm

Re: SAMA5D36 custom board with WM8904 codec DMA chanel missi

Mon Mar 07, 2016 11:25 pm

I didn't see such a thing.
mhmbox
Posts: 2
Joined: Tue Mar 15, 2016 6:45 pm

Re: SAMA5D36 custom board with WM8904 codec DMA chanel missi

Tue Mar 15, 2016 6:48 pm

szitabalint wrote:Thank You for answers!

The problem is solved.
First I use modified sama5d3-xplaned dtb file. This is not working. Later I am modify sama5d3-ek dtb file and it is work perfect.

Balint

Can you post dts you use?
I have the same problem: ALSA --- no soundcards ---
thanks

Return to “SAMA5-based”

Who is online

Users browsing this forum: No registered users and 1 guest