linux I2C (2)

 

 

linux  I2C (2)

2011-7-5 12:13:45

/* i2c_client_address_data is the struct for holding default client
 * addresses for a driver and for the parameters supplied on the
 * command line
 */
struct i2c_client_address_data {
 unsigned short *normal_i2c;
 unsigned short *probe;
 unsigned short *ignore;
 unsigned short **forces;
};

用来描述一个I2C的Client 地址

实际赋值如下

static struct i2c_client_address_data addr_data = {   \
 .normal_i2c = normal_i2c,     \
 .probe  = probe,     \
 .ignore  = ignore,     \
 .forces  = forces,     \
}

OV2655的地址为
 
static unsigned short normal_i2c[] = {OV2655_ADDRESS, I2C_CLIENT_END };

i2c_ov2655_detect_client

首先要查看是否支持该功能

设备是否在对应的I2C总线上

i2c_attach_client

生存一个client后,还需要把这个client通知给core

首先检测这个client的地址是不是已经被占用

如果没有就直接把client加入到adapter的clients链表中

再进行设备注册

如果有多个OV2655挂载在I2C上会发生什么情况?

你可能感兴趣的:(c,linux,struct,command,Parameters)