dtsi file setup for wm8960 audio codec - phyboard-pollux-imx8mp

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

dtsi file setup for wm8960 audio codec - phyboard-pollux-imx8mp

1,841 Views
SachinGowda
Contributor II

Hi,

i made little changes in this dtsi file- "arch/arm64/boot/dts/freescale/imx8mp-phyboard-pollux-peb-av-010.dtsi

&i2c4 {
pinctrl-names = "default","gpio";
pinctrl-0 = <&pinctrl_i2c4>;
pinctrl-1 = <&pinctrl_i2c4_gpio>;
sda-gpios = <&gpio5 21 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; //21
scl-gpios = <&gpio5 20 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; //20
clock-frequency = <400000>;
status = "okay";

clock-frequency = <100000>;

codec: wm8960@1a {
compatible = "wlf,wm8960";
reg = <0x1a>;
#sound-dai-cells = <0>;
pinctrl-0 = <&pinctrl_i2c4>;
//clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI2_MCLK1>;
clocks = <&audiomix_clk IMX8MP_CLK_AUDIOMIX_SAI2_MCLK1>;
clock-names = "mclk";
wlf,shared-lrclk;
status="okay";
};

sound-wm8960 {
compatible = "fsl,imx7d-evk-wm8960", "fsl,imx-audio-wm8960";
model = "wm8960-audio";
cpu-dai = <&sai2>;
audio-codec = <&codec>;
asrc-controller = <&easrc>;
codec-master;
/* JD2: hp detect high for headphone*/
hp-det = 0>;
hp-det-gpios = <&gpio4 28 1>;
mic-det-gpios = <&gpio4 28 1>;
audio-routing =
"Headphone Jack", "HP_L",
"Headphone Jack", "HP_R",
"Ext Spk", "SPK_LP",
"Ext Spk", "SPK_LN",
"Ext Spk", "SPK_RP",
"Ext Spk", "SPK_RN",
"LINPUT1", "Mic Jack",
"LINPUT3", "Mic Jack",
"Mic Jack", "MICB",
"CPU-Playback", "ASRC-Playback",
"Playback", "CPU-Playback",
"ASRC-Capture", "CPU-Capture",
"CPU-Capture", "Capture";
};

in compilation time i'm getting this warning 

arch/arm64/boot/dts/freescale/imx8mp-phyboard-pollux-peb-av-010.dtsi:56.27-58.5: Warning (sound_dai_property): /sound-peb-av-10/simple-audio-card,codec: Missing property '#sound-dai-cells' in node /soc@0/bus@30800000/i2c@30a50000/wm8960@1a or bad phandle (referred from sound-dai[0])

 

1. root@phyboard-pollux-imx8mp-2:~# i2cdetect -y 3
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- UU -- 1a -- -- -- -- --  

#imx8mplus #imx8mp

0 Kudos
9 Replies

1,811 Views
SachinGowda
Contributor II

Hi Jorge, 

configuration for wm8960, imx-wm8960 and imx8mp-phyboard-pollux-rdk.dts  is done and now both driver is loaded. 

root@phyboard-pollux-imx8mp-2:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Dummy [Dummy], device 0: Dummy PCM [Dummy PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1

card 1: wm8960audio [wm8960-audio], device 0: HiFi wm8960-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: wm8960audio [wm8960-audio], device 1: HiFi-ASRC-FE (*) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: audiohdmi [audio-hdmi], device 0: imx8 hdmi i2s-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

 

root@phyboard-pollux-imx8mp-2:~# dmesg | grep -i "wm"
[ 1.429088] imx-dwmac 30bf0000.ethernet: IRQ eth_lpi not found
[ 2.134012] wm..............imx_wm8960_probe ........!!!!
[ 2.141452] wm..............imx_wm8960_probe complete........!!!!
[ 2.696897] wm.......... wm8960 i2c probe .............!!!!!
[ 2.710881] wm.....wm8960 probe function completed!!!

but now i'm facing this problem and am unable to play and listen the songs/music.....................

root@phyboard-pollux-imx8mp-2:~# aplay -D hw:1,0 file_example_WAV_5MG.wav
Playing WAVE 'file_example_WAV_5MG.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
^Vaplay: pcm_write:2057: write error: Input/output error

#imx8mp #wm8960

0 Kudos

1,788 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

This error occurs on an audio playback, when audio samples are not output. A possible cause is a wrong configuration of the audio interface:

- DAI: missing in device tree or in bad state.
- DAI/codec not clocked: kernel/master clock not enabled.

Best regards.

0 Kudos

1,762 Views
SachinGowda
Contributor II

Hi,

 see below attached the dts file, i did the configuration like that and still i'm facing this error

root@phyboard-pollux-imx8mp-2:~# aplay -D hw:1,0 file_example_WAV_5MG.wav
Playing WAVE 'file_example_WAV_5MG.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
aplay: pcm_write:2057: write error: Input/output error

configuration of audio routing parameter fine and but i have doubt in this

/* JD2: hp detect high for headphone*/
hp-det = 0>;
hp-det-gpios = <&gpio4 28 1>;
mic-det-gpios = <&gpio4 28 1>;

let me know where i did wrong.

 

HW Pin configuration x15 sai2

https://wiki.phytec.com/pages/releaseview.action?pageId=507216018#L1009e.A2phyCOREi.MX8MPlus/phyBOAR...

 

 

Tags (1)
0 Kudos

1,677 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

If you are using an IMX8MP EVK board, you should be able to detect this CODEC by using the pre-build image. In the case that you are using a custom board or third-party board you should adapt your device tree using the EVK board device tree as a reference.

Could you please provide your board model?

Best regards.

0 Kudos

1,637 Views
SachinGowda
Contributor II

Hi....

we are not using IMX8MP EVK board.

actually we are using imx8mp processor and model details:

ModulephyCORE-i.MX 8M Plus
SOM MountingConnector insertion
Processori.MX 8M Plus Quad
ArchitectureARM Cortex-A53 / Cortex-M7
Frequency4x 1.8 GHz + 800 MHz

 

for more technical details -  https://www.phytec.eu/en/produkte/single-board-computer/phyboard-pollux/?lang=en/#technische-details...

BSP Details - https://www.phytec.de/cdocuments/?doc=WoB9I

HW manual - https://wiki.phytec.com/pages/releaseview.action?pageId=507216018#L1009e.A2phyCOREi.MX8MPlus/phyBOAR...

 

Hw pin configuration Details

 

Thanks & regards

Sachin

 

 

0 Kudos

1,621 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

Got it, in that case you should refer to Phytec to check your issue, the device tree configuration for EVK board should be enough to detect a new sound device and work correctly. If your device includes the CODEC on the board you should try with BSP provided by Phytec.

In the case that the CODEC it is not directly supported by Phytec's BSP maybe it is necessary a patch or something else on your board but, I do not have access to that information.

Best regards.

0 Kudos

1,459 Views
SachinGowda
Contributor II

Hi Jorge,

Thanks for your support,

Now we are able to play and record the audio through wm8960 audio codec.

Best regards

Sachin

Moschip Technologies ltd

0 Kudos

1,295 Views
SachinGowda
Contributor II

Hi,,,

we are not using imx8mp EVK Board, 

our Board model and Technical details:

ModulephyCORE-i.MX 8M Plus
SOM MountingConnector insertion
Processori.MX 8M Plus Quad
ArchitectureARM Cortex-A53 / Cortex-M7
Frequency4x 1.8 GHz + 800 MHz

for more Details :

- Board model& Technical Details - https://www.phytec.eu/en/produkte/single-board-computer/phyboard-pollux/?lang=en/#technische-details...

- BSP manual link -https://www.phytec.de/cdocuments/?doc=WoB9I

 

Thanks & Regards

Sachin

 

#imx8mp-phyboard-pollux #wm8960 audio codec

 

 

 

Tags (1)
0 Kudos

1,831 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

Do you follow reference EVK device tree? There are all the configurations to use WM8960 on iMX8MP.

iMX8MP device tree.

Best regards.

0 Kudos