blob: 9f6ca406505bbdf49ec7deacd03c8af6a18cd832 [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Peter Korsgaard92ed1a72011-01-10 22:11:23 +01002/*
Jean Delvaree7065e22012-04-28 15:32:06 +02003 * i2c-mux-gpio interface to platform code
Peter Korsgaard92ed1a72011-01-10 22:11:23 +01004 *
5 * Peter Korsgaard <peter.korsgaard@barco.com>
Peter Korsgaard92ed1a72011-01-10 22:11:23 +01006 */
7
Jean Delvaree7065e22012-04-28 15:32:06 +02008#ifndef _LINUX_I2C_MUX_GPIO_H
9#define _LINUX_I2C_MUX_GPIO_H
Peter Korsgaard92ed1a72011-01-10 22:11:23 +010010
11/* MUX has no specific idle mode */
Jean Delvaree7065e22012-04-28 15:32:06 +020012#define I2C_MUX_GPIO_NO_IDLE ((unsigned)-1)
Peter Korsgaard92ed1a72011-01-10 22:11:23 +010013
14/**
Jean Delvaree7065e22012-04-28 15:32:06 +020015 * struct i2c_mux_gpio_platform_data - Platform-dependent data for i2c-mux-gpio
Peter Korsgaard92ed1a72011-01-10 22:11:23 +010016 * @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)
Jean Delvareeee543e2012-10-05 22:23:51 +020021 * @classes: Optional I2C auto-detection classes
Jean Delvaree7ee51402012-10-05 22:23:54 +020022 * @gpio_chip: Optional GPIO chip name; if set, GPIO pin numbers are given
23 * relative to the base GPIO number of that chip
Peter Korsgaard92ed1a72011-01-10 22:11:23 +010024 * @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 */
Jean Delvaree7065e22012-04-28 15:32:06 +020028struct i2c_mux_gpio_platform_data {
Peter Korsgaard92ed1a72011-01-10 22:11:23 +010029 int parent;
30 int base_nr;
31 const unsigned *values;
32 int n_values;
Jean Delvareeee543e2012-10-05 22:23:51 +020033 const unsigned *classes;
Jean Delvaree7ee51402012-10-05 22:23:54 +020034 char *gpio_chip;
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 */