Will do! Work is almost over for today but currently I am just figuring out this ASoC stuff and how these drivers communicate with one another. Thanks again for all your help!
There is a lot of complexity in the older static configuration kernels that was solved with the 'device tree' dynamic configuration used in newer kernels. Once you understand how static configuration works you might want to experiment with a kernel update so you can convert the machine driver code to device tree. It takes a while to GROK how it all works so take your time if possible.@nsaspook Ah I see, thanks! Yep I agree lol and I already started that video XD glad I am heading in the right direction! Thanks again!
Is mine statically configured? I can't seem to find the machine driver. I tried a simple grep search: 'grep -lr wm8753.c', the 8753 is the old codec and the results are:There is a lot of complexity in the older static configuration kernels that was solved with the 'device tree' dynamic configuration used in newer kernels.
ASoC Machine Driver
The ASoC machine (or board) driver is the code that glues together all the component drivers (e.g. codecs, platforms and DAIs). It also describes the relationships between each component which include audio paths, GPIOs, interrupts, clocking, jacks and voltage regulators.
The machine driver can contain codec and platform specific code. It registers the audio subsystem with the kernel as a platform device and is represented by the following struct:-
Yes, the '{' is from the .h file defining the struct.@nsaspook Yes, I managed to find some documentation for my kernel. I did a grep for the string: 'struct snd_soc_card {' and my only result was: include/sound/soc.h
Correct me if I am wrong but I believe I am looking for a .c file and not a header file? If I don't include the '{' in the string then I get a rather large list of .c files located in sound/soc.
Of those three I only have neo1973_wm8753.c in my source tree but that one is a 'machine driver'.I believe I can narrow down the results of that search to:
sound/soc/imx/imx-ccwmx51-wm8753.c
sound/soc/s3c24xx/neo1973_wm8753.c
sound/soc/s3c24xx/cc9m2443js_wm8753.c
are these all machine drivers?
static struct snd_soc_card neo1973 = {
.name = "neo1973",
.platform = &s3c24xx_soc_platform,
.dai_link = neo1973_dai,
.num_links = ARRAY_SIZE(neo1973_dai),
};
static struct snd_soc_device neo1973_snd_devdata = {
.card = &neo1973,
.codec_dev = &soc_codec_dev_wm8753,
};
Seems so. Good luck.@nsaspook If I had to guess i would say its sound/soc/imx/imx-ccwmx51-wm8753.c because the board itself is an i.mx5.
Awhile back you had posted some information on the configuration process when configuring the kernel. I know you found the option for enabling all the audio codecs but what about enabling/disabling specific audio codecs? It must be possible because our .config page has certain ones available while others are not, for instance:Seems so. Good luck.
# CONFIG_SND_SOC_IMX_CCXMX53_SGTL5000 is not set
# CONFIG_SND_SOC_IMX_3STACK_AK4647 is not set
# CONFIG_SND_SOC_IMX_3STACK_WM8580 is not set
CONFIG_SND_SOC_IMX_CCWMX51_WM8753=y
# CONFIG_SND_SOC_IMX_3STACK_AK5702 is not set
# CONFIG_SND_SOC_IMX_3STACK_BLUETOOTH is not set
# CONFIG_SND_SOC_IMX_3STACK_CS42888 is not set
# CONFIG_SND_SOC_IMX_SPDIF is not set
# CONFIG_MXC_SSI_DUAL_FIFO is not set
CONFIG_SND_SOC_I2C_AND_SPI=y
# CONFIG_SND_SOC_ALL_CODECS is not set
CONFIG_SND_SOC_WM8753=y
Okay I believe I found the right kconfig file. Here is the initialization for the wm8753:The Kconfig file for those options can be edited to ask, enable/disable any set of options you want.
https://docs.zephyrproject.org/1.3.0/reference/kbuild/kbuild_kconfig.html
For example this patch allow for a independently selected driver option. There might be a similar type modifications in your Kconfig file for your internal driver files.
http://lists.infradead.org/pipermail/linux-arm-kernel/2012-February/085958.html
config SND_SOC_IMX_CCWMX51_WM8753
tristate "SoC Audio support for IMX - WM8753"
select SND_MXC_SOC_SSI
select SND_SOC_WM8753
help
Say Y if you want to add support for Soc audio on IMX CCWMX51
with the WM8753
config SND_SOC_IMX_CCWMX50_WM8750
tristate "SoC Audio support for IMX - WM8750"
select SND_MXC_SOC_SSI
select SND_SOC_WM8750
help
Say Y if you want to add support for Soc audio on IMX CCWMX50
with the WM8750
You need to change the Makefile also to compile and generate the correct object(s).Okay I believe I found the right kconfig file. Here is the initialization for the wm8753:
I am assuming in order to initialize the wm8750 I would just add:Code:config SND_SOC_IMX_CCWMX51_WM8753 tristate "SoC Audio support for IMX - WM8753" select SND_MXC_SOC_SSI select SND_SOC_WM8753 help Say Y if you want to add support for Soc audio on IMX CCWMX51 with the WM8753
and then from what I understand I can just run a make and it should pop up on the list?Code:config SND_SOC_IMX_CCWMX50_WM8750 tristate "SoC Audio support for IMX - WM8750" select SND_MXC_SOC_SSI select SND_SOC_WM8750 help Say Y if you want to add support for Soc audio on IMX CCWMX50 with the WM8750
There might be data configuration files related to the define in other files. The only way to make sure is to run a diff (if you don't have a diff patch file already) from the vanilla kernel sources on your source tree.Stumbling a bit I did a grep search for: SND_SOC_IMX_CCWMX51_WM8753 and I was presented with 8 different c files all referencing that string. Has me worried because I was under the assumption that I would only be editing the machine driver. Any chance these are auto-generated c files?
#if defined(CONFIG_SND_SOC_IMX_CCWMX51_WM8753) || defined(CONFIG_SND_SOC_IMX_CCWMX51_WM8753_MODULE)
mxc_register_device(&mxc_wm8753_device, &wm8753_data);
#endif
#if defined (CONFIG_MXC_CAMERA_MICRON111_1) || defined(CONFIG_MXC_CAMERA_MICRON111_1_MODULE)
{
I2C_BOARD_INFO("mt9v111_1", 0xB8>>1),
},
#endif
...
#if defined(CONFIG_SND_SOC_IMX_CCWMX51_WM8753) || defined(CONFIG_SND_SOC_IMX_CCWMX51_WM8753_MODULE)
struct platform_device mxc_wm8753_device = {
.name = "ccwmx51js",
};
#endif
...
struct mxc_audio_platform_data wm8753_data = {
.ssi_num = 1,
.src_port = 2,
.ext_port = 3,
.sysclk = 0 /* Set on the fly */,
};
#if defined(CONFIG_SND_S3C24XX_SOC_CC9M2443JS_WM8753) || defined(CONFIG_SND_S3C24XX_SOC_CC9M2443JS_WM8753_MODULE)
{
I2C_BOARD_INFO("wm8753", 0x1a),
},
#endif
#if defined(CONFIG_SND_S3C24XX_SOC_CC9M2443JS_WM8753) || defined(CONFIG_SND_S3C24XX_SOC_CC9M2443JS_WM8753_MODULE)
{
I2C_BOARD_INFO("wm8753", 0x1a),
},
#endif
by Aaron Carman
by Duane Benson
by Duane Benson