2011-01-11 00:11:23 +03:00
|
|
|
/*
|
2012-04-28 17:32:06 +04:00
|
|
|
* i2c-mux-gpio interface to platform code
|
2011-01-11 00:11:23 +03:00
|
|
|
*
|
|
|
|
* Peter Korsgaard <peter.korsgaard@barco.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*/
|
|
|
|
|
2012-04-28 17:32:06 +04:00
|
|
|
#ifndef _LINUX_I2C_MUX_GPIO_H
|
|
|
|
#define _LINUX_I2C_MUX_GPIO_H
|
2011-01-11 00:11:23 +03:00
|
|
|
|
|
|
|
/* MUX has no specific idle mode */
|
2012-04-28 17:32:06 +04:00
|
|
|
#define I2C_MUX_GPIO_NO_IDLE ((unsigned)-1)
|
2011-01-11 00:11:23 +03:00
|
|
|
|
|
|
|
/**
|
2012-04-28 17:32:06 +04:00
|
|
|
* struct i2c_mux_gpio_platform_data - Platform-dependent data for i2c-mux-gpio
|
2011-01-11 00:11:23 +03:00
|
|
|
* @parent: Parent I2C bus adapter number
|
|
|
|
* @base_nr: Base I2C bus number to number adapters from or zero for dynamic
|
|
|
|
* @values: Array of bitmasks of GPIO settings (low/high) for each
|
|
|
|
* position
|
|
|
|
* @n_values: Number of multiplexer positions (busses to instantiate)
|
2012-10-06 00:23:51 +04:00
|
|
|
* @classes: Optional I2C auto-detection classes
|
2012-10-06 00:23:54 +04:00
|
|
|
* @gpio_chip: Optional GPIO chip name; if set, GPIO pin numbers are given
|
|
|
|
* relative to the base GPIO number of that chip
|
2011-01-11 00:11:23 +03:00
|
|
|
* @gpios: Array of GPIO numbers used to control MUX
|
|
|
|
* @n_gpios: Number of GPIOs used to control MUX
|
|
|
|
* @idle: Bitmask to write to MUX when idle or GPIO_I2CMUX_NO_IDLE if not used
|
|
|
|
*/
|
2012-04-28 17:32:06 +04:00
|
|
|
struct i2c_mux_gpio_platform_data {
|
2011-01-11 00:11:23 +03:00
|
|
|
int parent;
|
|
|
|
int base_nr;
|
|
|
|
const unsigned *values;
|
|
|
|
int n_values;
|
2012-10-06 00:23:51 +04:00
|
|
|
const unsigned *classes;
|
2012-10-06 00:23:54 +04:00
|
|
|
char *gpio_chip;
|
2011-01-11 00:11:23 +03:00
|
|
|
const unsigned *gpios;
|
|
|
|
int n_gpios;
|
|
|
|
unsigned idle;
|
|
|
|
};
|
|
|
|
|
2012-04-28 17:32:06 +04:00
|
|
|
#endif /* _LINUX_I2C_MUX_GPIO_H */
|