gpio-i2cmux.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * gpio-i2cmux interface to platform code
  3. *
  4. * Peter Korsgaard <peter.korsgaard@barco.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef _LINUX_GPIO_I2CMUX_H
  11. #define _LINUX_GPIO_I2CMUX_H
  12. /* MUX has no specific idle mode */
  13. #define GPIO_I2CMUX_NO_IDLE ((unsigned)-1)
  14. /**
  15. * struct gpio_i2cmux_platform_data - Platform-dependent data for gpio-i2cmux
  16. * @parent: Parent I2C bus adapter number
  17. * @base_nr: Base I2C bus number to number adapters from or zero for dynamic
  18. * @values: Array of bitmasks of GPIO settings (low/high) for each
  19. * position
  20. * @n_values: Number of multiplexer positions (busses to instantiate)
  21. * @gpios: Array of GPIO numbers used to control MUX
  22. * @n_gpios: Number of GPIOs used to control MUX
  23. * @idle: Bitmask to write to MUX when idle or GPIO_I2CMUX_NO_IDLE if not used
  24. */
  25. struct gpio_i2cmux_platform_data {
  26. int parent;
  27. int base_nr;
  28. const unsigned *values;
  29. int n_values;
  30. const unsigned *gpios;
  31. int n_gpios;
  32. unsigned idle;
  33. };
  34. #endif /* _LINUX_GPIO_I2CMUX_H */