blob: a907774fd177f83a31abd5f20b3153690ee0f2d2 [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Haavard Skinnemoen1c23af92007-05-01 23:26:34 +02002/*
3 * i2c-gpio interface to platform code
4 *
5 * Copyright (C) 2007 Atmel Corporation
Haavard Skinnemoen1c23af92007-05-01 23:26:34 +02006 */
7#ifndef _LINUX_I2C_GPIO_H
8#define _LINUX_I2C_GPIO_H
9
10/**
11 * struct i2c_gpio_platform_data - Platform-dependent data for i2c-gpio
Haavard Skinnemoen1c23af92007-05-01 23:26:34 +020012 * @udelay: signal toggle delay. SCL frequency is (500 / udelay) kHz
13 * @timeout: clock stretching timeout in jiffies. If the slave keeps
14 * SCL low for longer than this, the transfer will time out.
15 * @sda_is_open_drain: SDA is configured as open drain, i.e. the pin
16 * isn't actively driven high when setting the output value high.
17 * gpio_get_value() must return the actual pin state even if the
18 * pin is configured as an output.
19 * @scl_is_open_drain: SCL is set up as open drain. Same requirements
20 * as for sda_is_open_drain apply.
21 * @scl_is_output_only: SCL output drivers cannot be turned off.
22 */
23struct i2c_gpio_platform_data {
Haavard Skinnemoen1c23af92007-05-01 23:26:34 +020024 int udelay;
25 int timeout;
26 unsigned int sda_is_open_drain:1;
27 unsigned int scl_is_open_drain:1;
28 unsigned int scl_is_output_only:1;
29};
30
31#endif /* _LINUX_I2C_GPIO_H */