Peter Korsgaard | 92ed1a7 | 2011-01-10 22:11:23 +0100 | [diff] [blame] | 1 | /* |
Jean Delvare | e7065e2 | 2012-04-28 15:32:06 +0200 | [diff] [blame] | 2 | * i2c-mux-gpio interface to platform code |
Peter Korsgaard | 92ed1a7 | 2011-01-10 22:11:23 +0100 | [diff] [blame] | 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 | |
Jean Delvare | e7065e2 | 2012-04-28 15:32:06 +0200 | [diff] [blame] | 11 | #ifndef _LINUX_I2C_MUX_GPIO_H |
| 12 | #define _LINUX_I2C_MUX_GPIO_H |
Peter Korsgaard | 92ed1a7 | 2011-01-10 22:11:23 +0100 | [diff] [blame] | 13 | |
| 14 | /* MUX has no specific idle mode */ |
Jean Delvare | e7065e2 | 2012-04-28 15:32:06 +0200 | [diff] [blame] | 15 | #define I2C_MUX_GPIO_NO_IDLE ((unsigned)-1) |
Peter Korsgaard | 92ed1a7 | 2011-01-10 22:11:23 +0100 | [diff] [blame] | 16 | |
| 17 | /** |
Jean Delvare | e7065e2 | 2012-04-28 15:32:06 +0200 | [diff] [blame] | 18 | * struct i2c_mux_gpio_platform_data - Platform-dependent data for i2c-mux-gpio |
Peter Korsgaard | 92ed1a7 | 2011-01-10 22:11:23 +0100 | [diff] [blame] | 19 | * @parent: Parent I2C bus adapter number |
| 20 | * @base_nr: Base I2C bus number to number adapters from or zero for dynamic |
| 21 | * @values: Array of bitmasks of GPIO settings (low/high) for each |
| 22 | * position |
| 23 | * @n_values: Number of multiplexer positions (busses to instantiate) |
Jean Delvare | eee543e | 2012-10-05 22:23:51 +0200 | [diff] [blame] | 24 | * @classes: Optional I2C auto-detection classes |
Jean Delvare | e7ee514 | 2012-10-05 22:23:54 +0200 | [diff] [blame] | 25 | * @gpio_chip: Optional GPIO chip name; if set, GPIO pin numbers are given |
| 26 | * relative to the base GPIO number of that chip |
Peter Korsgaard | 92ed1a7 | 2011-01-10 22:11:23 +0100 | [diff] [blame] | 27 | * @gpios: Array of GPIO numbers used to control MUX |
| 28 | * @n_gpios: Number of GPIOs used to control MUX |
| 29 | * @idle: Bitmask to write to MUX when idle or GPIO_I2CMUX_NO_IDLE if not used |
| 30 | */ |
Jean Delvare | e7065e2 | 2012-04-28 15:32:06 +0200 | [diff] [blame] | 31 | struct i2c_mux_gpio_platform_data { |
Peter Korsgaard | 92ed1a7 | 2011-01-10 22:11:23 +0100 | [diff] [blame] | 32 | int parent; |
| 33 | int base_nr; |
| 34 | const unsigned *values; |
| 35 | int n_values; |
Jean Delvare | eee543e | 2012-10-05 22:23:51 +0200 | [diff] [blame] | 36 | const unsigned *classes; |
Jean Delvare | e7ee514 | 2012-10-05 22:23:54 +0200 | [diff] [blame] | 37 | char *gpio_chip; |
Peter Korsgaard | 92ed1a7 | 2011-01-10 22:11:23 +0100 | [diff] [blame] | 38 | const unsigned *gpios; |
| 39 | int n_gpios; |
| 40 | unsigned idle; |
| 41 | }; |
| 42 | |
Jean Delvare | e7065e2 | 2012-04-28 15:32:06 +0200 | [diff] [blame] | 43 | #endif /* _LINUX_I2C_MUX_GPIO_H */ |