Lines Matching refs:i2c_bus
474 static inline int i2c_check_for_device(struct em28xx_i2c_bus *i2c_bus, u16 addr) in i2c_check_for_device() argument
476 struct em28xx *dev = i2c_bus->dev; in i2c_check_for_device()
479 if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM28XX) in i2c_check_for_device()
481 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM2800) in i2c_check_for_device()
483 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B) in i2c_check_for_device()
488 static inline int i2c_recv_bytes(struct em28xx_i2c_bus *i2c_bus, in i2c_recv_bytes() argument
491 struct em28xx *dev = i2c_bus->dev; in i2c_recv_bytes()
495 if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM28XX) in i2c_recv_bytes()
497 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM2800) in i2c_recv_bytes()
499 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B) in i2c_recv_bytes()
504 static inline int i2c_send_bytes(struct em28xx_i2c_bus *i2c_bus, in i2c_send_bytes() argument
507 struct em28xx *dev = i2c_bus->dev; in i2c_send_bytes()
511 if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM28XX) in i2c_send_bytes()
513 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM2800) in i2c_send_bytes()
515 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B) in i2c_send_bytes()
527 struct em28xx_i2c_bus *i2c_bus = i2c_adap->algo_data; in em28xx_i2c_xfer() local
528 struct em28xx *dev = i2c_bus->dev; in em28xx_i2c_xfer()
529 unsigned int bus = i2c_bus->bus; in em28xx_i2c_xfer()
546 i2c_bus->algo_type == EM28XX_I2C_ALGO_EM28XX) { in em28xx_i2c_xfer()
563 rc = i2c_check_for_device(i2c_bus, addr); in em28xx_i2c_xfer()
569 rc = i2c_recv_bytes(i2c_bus, msgs[i]); in em28xx_i2c_xfer()
572 rc = i2c_send_bytes(i2c_bus, msgs[i], i == num - 1); in em28xx_i2c_xfer()
881 struct em28xx_i2c_bus *i2c_bus = i2c_adap->algo_data; in functionality() local
883 if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM28XX || in functionality()
884 i2c_bus->algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B) { in functionality()
886 } else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM2800) { in functionality()
985 dev->i2c_bus[bus].bus = bus; in em28xx_i2c_register()
986 dev->i2c_bus[bus].algo_type = algo_type; in em28xx_i2c_register()
987 dev->i2c_bus[bus].dev = dev; in em28xx_i2c_register()
988 dev->i2c_adap[bus].algo_data = &dev->i2c_bus[bus]; in em28xx_i2c_register()