Lines Matching refs:i2c_bus

480 static inline int i2c_check_for_device(struct em28xx_i2c_bus *i2c_bus, u16 addr)  in i2c_check_for_device()  argument
482 struct em28xx *dev = i2c_bus->dev; in i2c_check_for_device()
485 if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM28XX) in i2c_check_for_device()
487 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM2800) in i2c_check_for_device()
489 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B) in i2c_check_for_device()
494 static inline int i2c_recv_bytes(struct em28xx_i2c_bus *i2c_bus, in i2c_recv_bytes() argument
497 struct em28xx *dev = i2c_bus->dev; in i2c_recv_bytes()
501 if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM28XX) in i2c_recv_bytes()
503 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM2800) in i2c_recv_bytes()
505 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B) in i2c_recv_bytes()
510 static inline int i2c_send_bytes(struct em28xx_i2c_bus *i2c_bus, in i2c_send_bytes() argument
513 struct em28xx *dev = i2c_bus->dev; in i2c_send_bytes()
517 if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM28XX) in i2c_send_bytes()
519 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM2800) in i2c_send_bytes()
521 else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B) in i2c_send_bytes()
533 struct em28xx_i2c_bus *i2c_bus = i2c_adap->algo_data; in em28xx_i2c_xfer() local
534 struct em28xx *dev = i2c_bus->dev; in em28xx_i2c_xfer()
535 unsigned int bus = i2c_bus->bus; in em28xx_i2c_xfer()
552 i2c_bus->algo_type == EM28XX_I2C_ALGO_EM28XX) { in em28xx_i2c_xfer()
569 rc = i2c_check_for_device(i2c_bus, addr); in em28xx_i2c_xfer()
575 rc = i2c_recv_bytes(i2c_bus, msgs[i]); in em28xx_i2c_xfer()
578 rc = i2c_send_bytes(i2c_bus, msgs[i], i == num - 1); in em28xx_i2c_xfer()
887 struct em28xx_i2c_bus *i2c_bus = i2c_adap->algo_data; in functionality() local
889 if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM28XX || in functionality()
890 i2c_bus->algo_type == EM28XX_I2C_ALGO_EM25XX_BUS_B) { in functionality()
892 } else if (i2c_bus->algo_type == EM28XX_I2C_ALGO_EM2800) { in functionality()
990 dev->i2c_bus[bus].bus = bus; in em28xx_i2c_register()
991 dev->i2c_bus[bus].algo_type = algo_type; in em28xx_i2c_register()
992 dev->i2c_bus[bus].dev = dev; in em28xx_i2c_register()
993 dev->i2c_adap[bus].algo_data = &dev->i2c_bus[bus]; in em28xx_i2c_register()