最近在看Linux 2.6.21内核的I2C驱动,也在网上查了一下资料,有错也有对,有些心得,记录下来吧。里面认识或许多有不当之处,还恳请指正。
static const struct i2c_algorithm i2c_pxa_algorithm = { .master_xfer = i2c_pxa_xfer, .functionality = i2c_pxa_functionality, }; |
static struct pxa_i2c i2c_pxa = { .lock = SPIN_LOCK_UNLOCKED, .adap = { .owner = THIS_MODULE, .algo = &i2c_pxa_algorithm, .name = "pxa2xx-i2c.0", .retries = 5, }, }; |
static struct i2c_driver i2cdev_driver = { .driver = { .name = "dev_driver", }, .id = I2C_DRIVERID_I2CDEV, .attach_adapter = i2cdev_attach_adapter, .detach_adapter = i2cdev_detach_adapter, .detach_client = i2cdev_detach_client, }; struct i2c_dev { struct list_head list; struct i2c_adapter *adap; struct device *dev; }; |
static const struct file_operations i2cdev_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = i2cdev_read, .write = i2cdev_write, .ioctl = i2cdev_ioctl, .open = i2cdev_open, .release = i2cdev_release, }; |
欢迎光临 mobile CCTV,mobile surveillance,police body worn cameras (http://bbs.besovideo.com:8067/) | Powered by Discuz! X3.2 |