blob: 4ea1cc7392bd9464ba7282f689e1aae4075b5539 [file] [log] [blame]
Peter Korsgaard92ed1a72011-01-10 22:11:23 +01001/*
Jean Delvaree7065e22012-04-28 15:32:06 +02002 * i2c-mux-gpio interface to platform code
Peter Korsgaard92ed1a72011-01-10 22:11:23 +01003 *
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 Delvaree7065e22012-04-28 15:32:06 +020011#ifndef _LINUX_I2C_MUX_GPIO_H
12#define _LINUX_I2C_MUX_GPIO_H
Peter Korsgaard92ed1a72011-01-10 22:11:23 +010013
14/* MUX has no specific idle mode */
Jean Delvaree7065e22012-04-28 15:32:06 +020015#define I2C_MUX_GPIO_NO_IDLE ((unsigned)-1)
Peter Korsgaard92ed1a72011-01-10 22:11:23 +010016
17/**
Jean Delvaree7065e22012-04-28 15:32:06 +020018 * struct i2c_mux_gpio_platform_data - Platform-dependent data for i2c-mux-gpio
Peter Korsgaard92ed1a72011-01-10 22:11:23 +010019 * @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 Delvareeee543e2012-10-05 22:23:51 +020024 * @classes: Optional I2C auto-detection classes
Peter Korsgaard92ed1a72011-01-10 22:11:23 +010025 * @gpios: Array of GPIO numbers used to control MUX
26 * @n_gpios: Number of GPIOs used to control MUX
27 * @idle: Bitmask to write to MUX when idle or GPIO_I2CMUX_NO_IDLE if not used
28 */
Jean Delvaree7065e22012-04-28 15:32:06 +020029struct i2c_mux_gpio_platform_data {
Peter Korsgaard92ed1a72011-01-10 22:11:23 +010030 int parent;
31 int base_nr;
32 const unsigned *values;
33 int n_values;
Jean Delvareeee543e2012-10-05 22:23:51 +020034 const unsigned *classes;
Peter Korsgaard92ed1a72011-01-10 22:11:23 +010035 const unsigned *gpios;
36 int n_gpios;
37 unsigned idle;
38};
39
Jean Delvaree7065e22012-04-28 15:32:06 +020040#endif /* _LINUX_I2C_MUX_GPIO_H */