Add support of MAX98091 codec to Edge (Pi)

Okay, so I can use another corresponding sound card which is listed in audio_hw.c.
For Example :

static char* SPEAKER_NAME [] =
{
“rockchiprk”,
“realtekrt5651co”,
“rockchipes8316c”,
“rockchiprk809co”,
“rockchiprt5640c”,
};

Any codec outside of this array can not be used as a sound card. Am I right?

@goenjoy

I will set the configuration but How can I use my card since It is not added in audio_hw.c file. And what about max98090_config.h file because it is not there in the source?

@goenjoy

Just a reminder for my previous comment.


Is this step confirmed?

No, I am not getting my sound card under ‘/proc/asound/cards’ directory.
That is why I was asking that is it possible to identify the codec without modifications of audio_hw.c?

yes…

So, there is only one thing which could be wrong here.
Do you think that my configuration is not okay?

I am getting these two errors while probing rockchip, max98090 ASoC driver.

[ 1.741933] rockchip-snd-max98090 sound: ASoC: /pinctrl/headset/headset_connect not registered
[ 1.742046] rockchip-snd-max98090 sound: Soc register card failed -517

Do you think that this error is not letting our audio card to get recognised?

Of course…

Thanx.
I tried other GPIOs from the header as well but still getting the same error.
I am getting this error in headset detect pin only. I have registered the gpio for max98091 irq pin in same way but in that case I am able to register it successfully.

max98091 {
max98091_irq: max98091_irq {
rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_up>; /* GPIO1_B7 */
};
};

headset {
	headset_connect: headset_connect {
		rockchip,pins = <1 RK_PB7 RK_FUNC_GPIO &pcfg_pull_up>; /* GPIO1_B7 */
	};
};

@goenjoy

How would I solve this error?

I can’t understand what you said error.

How do I solve this:

[ 1.741933] rockchip-snd-max98090 sound: ASoC: /pinctrl/headset/headset_connect not registered
[ 1.742046] rockchip-snd-max98090 sound: Soc register card failed -517

This information doesn’t show where the problem is. You need to add log tracking code to analyze.

@goenjoy

I am debugging the problem but my concern is why I am not able to use simple-audio-card in device tree?
Because when I use my rockchip_max98090(as a compatible audio card)then it is getting probed but when I use it as simple-audio-card(as a compatible audio card) then it is not getting probed.

image
image

sound {
status = “okay”;
compatible = “simple-audio-card”;
pinctrl-names = “default”;
pinctrl-0 = <&max98091_irq>;
simple-audio-card,format = “i2s”;
simple-audio-card,name = “rockchip,rockchip-audio-max98090”;
simple-audio-card,mclk-fs = <256>;
simple-audio-card,widgets =
“Microphone”, “Mic Jack”,
“Headphone”, “Headphone Jack”;
simple-audio-card,routing =
“Mic Jack”, “MICBIAS1”,
“IN1P”, “Mic Jack”,
“Headphone Jack”, “HPOL”,
“Headphone Jack”, “HPOR”;
simple-audio-card,cpu {
sound-dai = <&i2s0>;
};
simple-audio-card,codec {
sound-dai = <&max98091>;
};

};

max98091: max98091@10 {
compatible = “maxim,max98091”;
reg = <0x10>;
clocks = <&cru SCLK_I2S_8CH_OUT>;
clock-names = “mclk”;
#sound-dai-cells = <0>;
interrupt-parent = <&gpio1>;
interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
pinctrl-names = “default”;
pinctrl-0 = <&max98091_irq>;
};

Is this correct?

image

@goenjoy

Are you sure about this?
We will have two different drivers for ASoC and codec. Right? Which is why I used maxim,max98091 driver for my codec.
How can we use same driver for card and codec?

@goenjoy

I changed my compatible to “rockchip,rockchip-audio-max98090” but still I am not seeing my card under ‘/proc/asound/cards’ directory.