LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   How to add codec driver direct into board specific file (https://www.linuxquestions.org/questions/linux-kernel-70/how-to-add-codec-driver-direct-into-board-specific-file-4175615519/)

rafiq380 10-12-2017 06:51 AM

How to add codec driver direct into board specific file
 
I am trying to replace the codec TLV320AIC32X4 with sierra wireless modem (MSM9615) stopped.
Since the kernel (3.4.91) don't support device tree, it required to specify the driver into the board file(s).

But unfortunately I'm not finding a good information that specifies the procedures.

Would like to have a guide line from experts.

Thanks.

daveolson 10-16-2017 04:31 PM

I'm not claiming to be an expert but I am currently porting code based on a circa 2.8 kernel w/o device tree to a circa 4.4 kernel w/ device tree. I can't tell you anything about the MXM9615 but I can tell you how my board file looked when interfacing to a TLV320AIC3104 codec under the non-device tree kernel.

There are two key pieces: configuration and board file. The configuration controls, among other things, whether or not the driver is compiled. In my case, I've used 'make menuconfig' to enable SND_SOC_TLV320AIC3X.

Here's the heavily edited chain of declarations/functions from my board file. They're presented top down though the order they exist in the board file is bottom up so that references are resolved correctly. The essential flow is that the board "probe" function eventually registers the I2C bus to which is attached the TLV320AIC3104 at I2C address 0x18.

/* code */
MACHINE_START(DM385IPNC, "dm385ipnc")
...
.init_machine = dm385_evm_init,
...
MACHINE_END

static void __init dm385_evm_init(void)
{
...
ti814x_evm_i2c_init();
...
}

static void __init ti814x_evm_i2c_init(void)
{
omap_register_i2c_bus(1, 400, ti814x_i2c_boardinfo,
ARRAY_SIZE(ti814x_i2c_boardinfo));
}

static struct i2c_board_info ti814x_i2c_boardinfo[] __initdata = {
#ifdef CONFIG_SND_SOC_TLV320AIC3X /* Codec */
{
I2C_BOARD_INFO("tlv320aic3104", 0x18),
},
#endif
...
}
/* end of code */


All times are GMT -5. The time now is 04:03 PM.