i2c-mux-gpio.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * i2c-mux-gpio 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_I2C_MUX_GPIO_H
  11. #define _LINUX_I2C_MUX_GPIO_H
  12. /* MUX has no specific idle mode */
  13. #define I2C_MUX_GPIO_NO_IDLE ((unsigned)-1)
  14. /**
  15. * struct i2c_mux_gpio_platform_data - Platform-dependent data for i2c-mux-gpio
  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. * @classes: Optional I2C auto-detection classes
  22. * @gpio_chip: Optional GPIO chip name; if set, GPIO pin numbers are given
  23. * relative to the base GPIO number of that chip
  24. * @gpios: Array of GPIO numbers used to control MUX
  25. * @n_gpios: Number of GPIOs used to control MUX
  26. * @idle: Bitmask to write to MUX when idle or GPIO_I2CMUX_NO_IDLE if not used
  27. */
  28. struct i2c_mux_gpio_platform_data {
  29. int parent;
  30. int base_nr;
  31. const unsigned *values;
  32. int n_values;
  33. const unsigned *classes;
  34. char *gpio_chip;
  35. const unsigned *gpios;
  36. int n_gpios;
  37. unsigned idle;
  38. };
  39. #endif /* _LINUX_I2C_MUX_GPIO_H */