三.在alsa框架中添加音频芯片add2012
音频芯片Codec注册:
static struct i2c_driver add2012_i2c_driver = {
.driver = {
.name = "add2012",
.of_match_table = of_match_ptr(add2012_of_match),
},
.probe = add2012_probe,
.id_table = add2012_id,
};
add2012控制信号为I2C总线连接到平台主芯片上,主系统启动之后会探测I2C总线上面注册的设备是否存在,如果设备存在并且与对应驱动相匹配,则驱动probe函数被调用,如下:
static int add2012_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct device *dev = &client->dev;
struct add2012_data *data;
const struct regmap_config *regmap_config;
int ret;
int i;
static int step = 0;
printk("zqh goin add2012_probe step=%d start\n", step); //add
data = dev