Lines Matching refs:i2c_bus

484 static inline int i2c_check_for_device(struct em28xx_i2c_bus *i2c_bus, u16 addr)  in i2c_check_for_device()  argument
486 struct em28xx *dev = i2c_bus->dev; in i2c_check_for_device()
489 if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM28XX) in i2c_check_for_device()
491 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM2800) in i2c_check_for_device()
493 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B) in i2c_check_for_device()
498 static inline int i2c_recv_bytes(struct em28xx_i2c_bus *i2c_bus, in i2c_recv_bytes() argument
501 struct em28xx *dev = i2c_bus->dev; in i2c_recv_bytes()
505 if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM28XX) in i2c_recv_bytes()
507 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM2800) in i2c_recv_bytes()
509 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B) in i2c_recv_bytes()
514 static inline int i2c_send_bytes(struct em28xx_i2c_bus *i2c_bus, in i2c_send_bytes() argument
517 struct em28xx *dev = i2c_bus->dev; in i2c_send_bytes()
521 if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM28XX) in i2c_send_bytes()
523 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM2800) in i2c_send_bytes()
525 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B) in i2c_send_bytes()
537 struct em28xx_i2c_bus *i2c_bus = i2c_adap->algo_data; in em28xx_i2c_xfer() local
538 struct em28xx *dev = i2c_bus->dev; in em28xx_i2c_xfer()
539 unsigned int bus = i2c_bus->bus; in em28xx_i2c_xfer()
556 i2c_bus->algo_type == EM28XX_I2C_ALGO_EM28XX) { in em28xx_i2c_xfer()
573 rc = i2c_check_for_device(i2c_bus, addr); in em28xx_i2c_xfer()
579 rc = i2c_recv_bytes(i2c_bus, msgs[i]); in em28xx_i2c_xfer()
582 rc = i2c_send_bytes(i2c_bus, msgs[i], i == num - 1); in em28xx_i2c_xfer()
891 struct em28xx_i2c_bus *i2c_bus = i2c_adap->algo_data; in functionality() local
893 if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM28XX || in functionality()
894 i2c_bus->algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B) { in functionality()
896 } else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM2800) { in functionality()
995 dev->i2c_bus[bus].bus = bus; in em28xx_i2c_register()
996 dev->i2c_bus[bus].algo_type = algo_type; in em28xx_i2c_register()
997 dev->i2c_bus[bus].dev = dev; in em28xx_i2c_register()
998 dev->i2c_adap[bus].algo_data = &dev->i2c_bus[bus]; in em28xx_i2c_register()