mxc_i2c.h 801 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #ifndef __ASM_ARCH_MXC_MXC_I2C_H__
  7. #define __ASM_ARCH_MXC_MXC_I2C_H__
  8. #include <asm/imx-common/iomux-v3.h>
  9. struct i2c_pin_ctrl {
  10. iomux_v3_cfg_t i2c_mode;
  11. iomux_v3_cfg_t gpio_mode;
  12. unsigned char gp;
  13. unsigned char spare;
  14. };
  15. struct i2c_pads_info {
  16. struct i2c_pin_ctrl scl;
  17. struct i2c_pin_ctrl sda;
  18. };
  19. void setup_i2c(unsigned i2c_index, int speed, int slave_addr,
  20. struct i2c_pads_info *p);
  21. void bus_i2c_init(void *base, int speed, int slave_addr,
  22. int (*idle_bus_fn)(void *p), void *p);
  23. int bus_i2c_read(void *base, uchar chip, uint addr, int alen, uchar *buf,
  24. int len);
  25. int bus_i2c_write(void *base, uchar chip, uint addr, int alen,
  26. const uchar *buf, int len);
  27. #endif