i2c-gpio.h 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * i2c-gpio interface to platform code
  4. *
  5. * Copyright (C) 2007 Atmel Corporation
  6. */
  7. #ifndef _LINUX_I2C_GPIO_H
  8. #define _LINUX_I2C_GPIO_H
  9. /**
  10. * struct i2c_gpio_platform_data - Platform-dependent data for i2c-gpio
  11. * @udelay: signal toggle delay. SCL frequency is (500 / udelay) kHz
  12. * @timeout: clock stretching timeout in jiffies. If the slave keeps
  13. * SCL low for longer than this, the transfer will time out.
  14. * @sda_is_open_drain: SDA is configured as open drain, i.e. the pin
  15. * isn't actively driven high when setting the output value high.
  16. * gpio_get_value() must return the actual pin state even if the
  17. * pin is configured as an output.
  18. * @scl_is_open_drain: SCL is set up as open drain. Same requirements
  19. * as for sda_is_open_drain apply.
  20. * @scl_is_output_only: SCL output drivers cannot be turned off.
  21. */
  22. struct i2c_gpio_platform_data {
  23. int udelay;
  24. int timeout;
  25. unsigned int sda_is_open_drain:1;
  26. unsigned int scl_is_open_drain:1;
  27. unsigned int scl_is_output_only:1;
  28. };
  29. #endif /* _LINUX_I2C_GPIO_H */