Lines Matching refs:i2c_bus
445 static inline int i2c_check_for_device(struct em28xx_i2c_bus *i2c_bus, u16 addr) in i2c_check_for_device() argument
447 struct em28xx *dev = i2c_bus->dev; in i2c_check_for_device()
450 if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM28XX) in i2c_check_for_device()
452 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM2800) in i2c_check_for_device()
454 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B) in i2c_check_for_device()
459 static inline int i2c_recv_bytes(struct em28xx_i2c_bus *i2c_bus, in i2c_recv_bytes() argument
462 struct em28xx *dev = i2c_bus->dev; in i2c_recv_bytes()
466 if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM28XX) in i2c_recv_bytes()
468 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM2800) in i2c_recv_bytes()
470 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B) in i2c_recv_bytes()
475 static inline int i2c_send_bytes(struct em28xx_i2c_bus *i2c_bus, in i2c_send_bytes() argument
478 struct em28xx *dev = i2c_bus->dev; in i2c_send_bytes()
482 if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM28XX) in i2c_send_bytes()
484 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM2800) in i2c_send_bytes()
486 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B) in i2c_send_bytes()
498 struct em28xx_i2c_bus *i2c_bus = i2c_adap->algo_data; in em28xx_i2c_xfer() local
499 struct em28xx *dev = i2c_bus->dev; in em28xx_i2c_xfer()
500 unsigned bus = i2c_bus->bus; in em28xx_i2c_xfer()
516 i2c_bus->algo_type == EM28XX_I2C_ALGO_EM28XX) { in em28xx_i2c_xfer()
543 rc = i2c_check_for_device(i2c_bus, addr); in em28xx_i2c_xfer()
558 rc = i2c_recv_bytes(i2c_bus, msgs[i]); in em28xx_i2c_xfer()
569 rc = i2c_send_bytes(i2c_bus, msgs[i], i == num - 1); in em28xx_i2c_xfer()
845 struct em28xx_i2c_bus *i2c_bus = i2c_adap->algo_data; in functionality() local
847 if ((i2c_bus->algo_type == EM28XX_I2C_ALGO_EM28XX) || in functionality()
848 (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B)) { in functionality()
850 } else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM2800) { in functionality()
946 dev->i2c_bus[bus].bus = bus; in em28xx_i2c_register()
947 dev->i2c_bus[bus].algo_type = algo_type; in em28xx_i2c_register()
948 dev->i2c_bus[bus].dev = dev; in em28xx_i2c_register()
949 dev->i2c_adap[bus].algo_data = &dev->i2c_bus[bus]; in em28xx_i2c_register()