Dear Liam
Thank you for your reply
# cd /sys/bus/platform/drivers/fsi-ak4642-audio # echo sh_fsi2_a_ak4643.0 > unbind # echo sh_fsi2_a_ak4643.0 > bind *1
*1 soc_new_pcm isn't called, and "aplay -l" doens't show fsi-ak4642. snd_soc_instantiate_card return around /* bind comleted ? */
Can you confirm are you unloading (all ?) then reloading the driver modules in this test case ?
Thanks. I show my test in below.
But please check this patch carefully. I'm not familiar with ASoC core, and don't want "confusion" or "new bug" for it.
This issue doesn't happen if I use "rmmod, insmod". But it happen if I use "unbind" / "bind" I show each case. My board has 2 sound card (fsi-ak4642, fsi-hdmi).
===================== rmmod, insmod case. no patch, no issue. =====================
check current status ------------------------ ... ALSA device list: No soundcards found. ...
# lsmod # ------------------------
insmod 2 cards. "aplay -l" show it. ------------------------ # insmod /home/snd-soc-ak4642.ko # insmod /home/snd-soc-fsi-ak4642.ko ak4642-codec 0-0013: AK4642 Audio Codec 0.0.1 i2c-sh_mobile i2c-sh_mobile.0: clocks managed by runtime pm asoc: ak4642-hifi <-> fsia-dai mapping ok # # insmod /home/snd-soc-fsi-hdmi.ko sh-mobile-hdmi sh-mobile-hdmi: SH Mobile HDMI Audio Codec asoc: sh_mobile_hdmi-hifi <-> fsib-dai mapping ok # aplay -l **** List of PLAYBACK Hardware Devices **** card 0: AK4643 [FSI2A (AK4643)], device 0: AK4643 ak4642-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: HDMI [FSI2B (SH MOBILE HDMI)], device 0: HDMI sh_mobile_hdmi-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 ------------------------
rmmod 2 cards. "aplay -l" show it ------------------------ # lsmod snd_soc_fsi_hdmi 1533 0 - Live 0xbf00c000 snd_soc_fsi_ak4642 2085 0 - Live 0xbf006000 snd_soc_ak4642 3228 1 - Live 0xbf000000 # # rmmod snd_soc_fsi_ak4642 # rmmod snd_soc_ak4642 # lsmod snd_soc_fsi_hdmi 1533 0 - Live 0xbf00c000 # aplay -l **** List of PLAYBACK Hardware Devices **** card 1: HDMI [FSI2B (SH MOBILE HDMI)], device 0: HDMI sh_mobile_hdmi-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 # # rmmod snd_soc_fsi_hdmi # lsmod # aplay -l aplay: device_list:223: no soundcards found... ------------------------
re-insmod OK. ------------------------ # insmod /home/snd-soc-ak4642.ko # insmod /home/snd-soc-fsi-ak4642.ko ak4642-codec 0-0013: AK4642 Audio Codec 0.0.1 asoc: ak4642-hifi <-> fsia-dai mapping ok # insmod /home/snd-soc-fsi-hdmi.ko sh-mobile-hdmi sh-mobile-hdmi: SH Mobile HDMI Audio Codec asoc: sh_mobile_hdmi-hifi <-> fsib-dai mapping ok # lsmod snd_soc_fsi_hdmi 1533 0 - Live 0xbf01e000 snd_soc_fsi_ak4642 2085 0 - Live 0xbf018000 snd_soc_ak4642 3228 1 - Live 0xbf012000 # aplay -l **** List of PLAYBACK Hardware Devices **** card 0: AK4643 [FSI2A (AK4643)], device 0: AK4643 ak4642-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: HDMI [FSI2B (SH MOBILE HDMI)], device 0: HDMI sh_mobile_hdmi-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 ------------------------
===================== unbind/bind case. re-bind have issue without this patch. =====================
check current status ------------------------ # aplay -l **** List of PLAYBACK Hardware Devices **** card 0: AK4643 [FSI2A (AK4643)], device 0: AK4643 ak4642-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: HDMI [FSI2B (SH MOBILE HDMI)], device 0: HDMI sh_mobile_hdmi-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 ------------------------
unbind modules (same behavior with/without patch) each "aplay -l" show it ------------------------ # cd /sys/bus/platform/drivers/fsi-ak4642-audio/ # echo sh_fsi2_a_ak4643.0 > unbind # aplay -l **** List of PLAYBACK Hardware Devices **** card 1: HDMI [FSI2B (SH MOBILE HDMI)], device 0: HDMI sh_mobile_hdmi-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 # # # cd ../fsi-hdmi-audio/ # echo sh_fsi2_b_hdmi.0 > unbind # aplay -l aplay: device_list:223: no soundcards found... ------------------------
without this patch, "re-bind" doesn't work ------------------------ # cd /sys/bus/platform/drivers/fsi-hdmi-audio/ # echo sh_fsi2_b_hdmi.0 > bind # aplay -l aplay: device_list:223: no soundcards found... # # # cd ../fsi-ak4642-audio/ # echo sh_fsi2_a_ak4643.0 > bind # aplay -l aplay: device_list:223: no soundcards found... ------------------------
with this patch, "re-bind" works ------------------------ # cd /sys/bus/platform/drivers/fsi-hdmi-audio/ # echo sh_fsi2_b_hdmi.0 > bind sh-mobile-hdmi sh-mobile-hdmi: SH Mobile HDMI Audio Codec asoc: sh_mobile_hdmi-hifi <-> fsib-dai mapping ok # aplay -l **** List of PLAYBACK Hardware Devices **** card 0: HDMI [FSI2B (SH MOBILE HDMI)], device 0: HDMI sh_mobile_hdmi-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 # # # cd ../fsi-ak4642-audio/ # echo sh_fsi2_a_ak4643.0 > bind ak4642-codec 0-0013: AK4642 Audio Codec 0.0.1 asoc: ak4642-hifi <-> fsia-dai mapping ok # aplay -l **** List of PLAYBACK Hardware Devices **** card 0: HDMI [FSI2B (SH MOBILE HDMI)], device 0: HDMI sh_mobile_hdmi-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: AK4643 [FSI2A (AK4643)], device 0: AK4643 ak4642-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 ------------------------
Best regards -- Kuninori Morimoto