Just as short feedback.
I have tested the driver in combination with gplay-1.0. As a result I would say the driver is buggy or maybe another layer in the imx world. I focused my investigation on the /sound/soc/codecs/wm8524.c file.
There are three positions that change the level of the mute pin.
- wm8524_startup
- wm8524_shutdown
- wm8524_mute_stream
Startup and shutdown are called when starting/stopping the audio. When I trigger a "stop"/"[s]" with gplay-1.0, the mute_stream function gets a call. With the "mute"/"[m]" of gplay-1.0 nothing happens in the driver, for whatever reason.
Also, the configuration of the GPIO is inverted from startup/shutdown to mute_stream.
To solve my problem, I changed the dts configuration from:
wlf,mute-gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
to:
wlf,mute-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
And changed the function wm8524_mute_stream from:
gpiod_set_value_cansleep(wm8524->mute, mute);
to:
gpiod_set_value_cansleep(wm8524->mute, !mute);
Of course, the variable mute is an integer and can be something other than 0 or 1, but during my debugging I only got these values.
If you have the same problem, feel free to use a more complex check
As a result, my mute gpio becomes low -> mute active during boot.
While playing audio the gpio becomes high -> Mute inactive