Subversion Repositories Kolibri OS

Rev

Rev 4065 | Rev 5270 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4065 Rev 5056
Line 133... Line 133...
133
 *	I2C_CLIENT_PEC indicates it uses SMBus Packet Error Checking
133
 *	I2C_CLIENT_PEC indicates it uses SMBus Packet Error Checking
134
 * @addr: Address used on the I2C bus connected to the parent adapter.
134
 * @addr: Address used on the I2C bus connected to the parent adapter.
135
 * @name: Indicates the type of the device, usually a chip name that's
135
 * @name: Indicates the type of the device, usually a chip name that's
136
 *	generic enough to hide second-sourcing and compatible revisions.
136
 *	generic enough to hide second-sourcing and compatible revisions.
137
 * @adapter: manages the bus segment hosting this I2C device
137
 * @adapter: manages the bus segment hosting this I2C device
138
 * @driver: device's driver, hence pointer to access routines
-
 
139
 * @dev: Driver model device node for the slave.
138
 * @dev: Driver model device node for the slave.
140
 * @irq: indicates the IRQ generated by this device (if any)
139
 * @irq: indicates the IRQ generated by this device (if any)
141
 * @detected: member of an i2c_driver.clients list or i2c-core's
140
 * @detected: member of an i2c_driver.clients list or i2c-core's
142
 *	userspace_devices list
141
 *	userspace_devices list
143
 *
142
 *
Line 150... Line 149...
150
	unsigned short addr;		/* chip address - NOTE: 7bit	*/
149
	unsigned short addr;		/* chip address - NOTE: 7bit	*/
151
					/* addresses are stored in the	*/
150
					/* addresses are stored in the	*/
152
					/* _LOWER_ 7 bits		*/
151
					/* _LOWER_ 7 bits		*/
153
	char name[I2C_NAME_SIZE];
152
	char name[I2C_NAME_SIZE];
154
	struct i2c_adapter *adapter;	/* the adapter we sit on	*/
153
	struct i2c_adapter *adapter;	/* the adapter we sit on	*/
155
    struct i2c_driver *driver;      /* and our access routines      */
-
 
156
	struct device dev;		/* the device structure		*/
154
	struct device dev;		/* the device structure		*/
157
	int irq;			/* irq issued by device		*/
155
	int irq;			/* irq issued by device		*/
158
	struct list_head detected;
156
	struct list_head detected;
159
};
157
};
160
#define to_i2c_client(d) container_of(d, struct i2c_client, dev)
158
#define to_i2c_client(d) container_of(d, struct i2c_client, dev)
Line 161... Line 159...
161
 
159
 
-
 
160
extern struct i2c_client *i2c_verify_client(struct device *dev);
Line 162... Line 161...
162
extern struct i2c_client *i2c_verify_client(struct device *dev);
161
extern struct i2c_adapter *i2c_verify_adapter(struct device *dev);
163
 
162
 
164
/**
163
/**
165
 * struct i2c_board_info - template for device creation
164
 * struct i2c_board_info - template for device creation
Line 207... Line 206...
207
/*
206
/*
208
 * The following structs are for those who like to implement new bus drivers:
207
 * The following structs are for those who like to implement new bus drivers:
209
 * i2c_algorithm is the interface to a class of hardware solutions which can
208
 * i2c_algorithm is the interface to a class of hardware solutions which can
210
 * be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584
209
 * be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584
211
 * to name two of the most common.
210
 * to name two of the most common.
-
 
211
 *
-
 
212
 * The return codes from the @master_xfer field should indicate the type of
-
 
213
 * error code that occured during the transfer, as documented in the kernel
-
 
214
 * Documentation file Documentation/i2c/fault-codes.
212
 */
215
 */
213
struct i2c_algorithm {
216
struct i2c_algorithm {
214
	/* If an adapter algorithm can't do I2C-level access, set master_xfer
217
	/* If an adapter algorithm can't do I2C-level access, set master_xfer
215
	   to NULL. If an adapter algorithm can do SMBus access, set
218
	   to NULL. If an adapter algorithm can do SMBus access, set
216
	   smbus_xfer. If set to NULL, the SMBus protocol is simulated
219
	   smbus_xfer. If set to NULL, the SMBus protocol is simulated
Line 273... Line 276...
273
 
276
 
274
/* i2c adapter classes (bitmask) */
277
/* i2c adapter classes (bitmask) */
275
#define I2C_CLASS_HWMON		(1<<0)	/* lm_sensors, ... */
278
#define I2C_CLASS_HWMON		(1<<0)	/* lm_sensors, ... */
276
#define I2C_CLASS_DDC		(1<<3)	/* DDC bus on graphics adapters */
279
#define I2C_CLASS_DDC		(1<<3)	/* DDC bus on graphics adapters */
-
 
280
#define I2C_CLASS_SPD		(1<<7)	/* Memory modules */
Line 277... Line 281...
277
#define I2C_CLASS_SPD		(1<<7)	/* Memory modules */
281
#define I2C_CLASS_DEPRECATED	(1<<8)	/* Warn users that adapter will stop using classes */
278
 
282
 
Line 279... Line 283...
279
/* Internal numbers to terminate lists */
283
/* Internal numbers to terminate lists */