i2c.h (f9a4c2da72d04e13b05deecb800f232d2948eb85) | i2c.h (73845350b6281a7afeeb279475e6eb613d7a89f9) |
---|---|
1/* 2 * Copyright (C) 2009 Sergey Kubushyn <ksi@koi8.net> 3 * Copyright (C) 2009 - 2013 Heiko Schocher <hs@denx.de> 4 * Changes for multibus/multiadapter I2C support. 5 * 6 * (C) Copyright 2001 7 * Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com. 8 * --- 170 unchanged lines hidden (view full) --- 179 * 180 * See the deblock() method in 'struct dm_i2c_ops' for full information 181 * 182 * @bus: Bus to recover 183 * @return 0 if OK, -ve on error 184 */ 185int i2c_deblock(struct udevice *bus); 186 | 1/* 2 * Copyright (C) 2009 Sergey Kubushyn <ksi@koi8.net> 3 * Copyright (C) 2009 - 2013 Heiko Schocher <hs@denx.de> 4 * Changes for multibus/multiadapter I2C support. 5 * 6 * (C) Copyright 2001 7 * Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com. 8 * --- 170 unchanged lines hidden (view full) --- 179 * 180 * See the deblock() method in 'struct dm_i2c_ops' for full information 181 * 182 * @bus: Bus to recover 183 * @return 0 if OK, -ve on error 184 */ 185int i2c_deblock(struct udevice *bus); 186 |
187#ifdef CONFIG_DM_I2C_COMPAT 188/** 189 * i2c_probe() - Compatibility function for driver model 190 * 191 * Calls dm_i2c_probe() on the current bus 192 */ 193int i2c_probe(uint8_t chip_addr); 194 195/** 196 * i2c_read() - Compatibility function for driver model 197 * 198 * Calls dm_i2c_read() with the device corresponding to @chip_addr, and offset 199 * set to @addr. @alen must match the current setting for the device. 200 */ 201int i2c_read(uint8_t chip_addr, unsigned int addr, int alen, uint8_t *buffer, 202 int len); 203 204/** 205 * i2c_write() - Compatibility function for driver model 206 * 207 * Calls dm_i2c_write() with the device corresponding to @chip_addr, and offset 208 * set to @addr. @alen must match the current setting for the device. 209 */ 210int i2c_write(uint8_t chip_addr, unsigned int addr, int alen, uint8_t *buffer, 211 int len); 212 213/** 214 * i2c_get_bus_num_fdt() - Compatibility function for driver model 215 * 216 * @return the bus number associated with the given device tree node 217 */ 218int i2c_get_bus_num_fdt(int node); 219 220/** 221 * i2c_get_bus_num() - Compatibility function for driver model 222 * 223 * @return the 'current' bus number 224 */ 225unsigned int i2c_get_bus_num(void); 226 227/** 228 * i2c_set_bus_num(): Compatibility function for driver model 229 * 230 * Sets the 'current' bus 231 */ 232int i2c_set_bus_num(unsigned int bus); 233 234static inline void I2C_SET_BUS(unsigned int bus) 235{ 236 i2c_set_bus_num(bus); 237} 238 239static inline unsigned int I2C_GET_BUS(void) 240{ 241 return i2c_get_bus_num(); 242} 243 244#endif 245 |
|
187/* 188 * Not all of these flags are implemented in the U-Boot API 189 */ 190enum dm_i2c_msg_flags { 191 I2C_M_TEN = 0x0010, /* ten-bit chip address */ 192 I2C_M_RD = 0x0001, /* read data, from slave to master */ 193 I2C_M_STOP = 0x8000, /* send stop after this message */ 194 I2C_M_NOSTART = 0x4000, /* no start before this message */ --- 611 unchanged lines hidden --- | 246/* 247 * Not all of these flags are implemented in the U-Boot API 248 */ 249enum dm_i2c_msg_flags { 250 I2C_M_TEN = 0x0010, /* ten-bit chip address */ 251 I2C_M_RD = 0x0001, /* read data, from slave to master */ 252 I2C_M_STOP = 0x8000, /* send stop after this message */ 253 I2C_M_NOSTART = 0x4000, /* no start before this message */ --- 611 unchanged lines hidden --- |