⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 i2c-compat.h

📁 This program is free software you can redistribute it and/or modify it under the terms of the GNU Ge
💻 H
字号:
/*
 * some i2c layer compatibility stuff -- to avoid cluttering up the
 * i2c modules with tons of #ifdefs
 */

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,66)

static inline void *i2c_get_adapdata(struct i2c_adapter *dev)
{
	return dev->data;
}

static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data)
{
	dev->data = data;
}

static inline void *i2c_get_clientdata(struct i2c_client *dev)
{
        return dev->data;
}

static inline void i2c_set_clientdata(struct i2c_client *dev, void *data)
{
	dev->data = data;
}

#define I2C_DEVNAME(str)   .name = str

static inline char *i2c_clientname(struct i2c_client *c)
{
	return c->name;
}

static inline void i2c_clients_command(struct i2c_adapter *adap,
				       unsigned int cmd, void *arg)
{
	int i;

	for (i = 0; i < I2C_CLIENT_MAX; i++) {
		if (NULL == adap->clients[i])
			continue;
		if (NULL == adap->clients[i]->driver->command)
			continue;
		adap->clients[i]->driver->command(adap->clients[i],cmd,arg);
	}
}

#endif

/*
 * Local variables:
 * c-basic-offset: 8
 * End:
 */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -