Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * i2c-gpio interface to platform code
0004  *
0005  * Copyright (C) 2007 Atmel Corporation
0006  */
0007 #ifndef _LINUX_I2C_GPIO_H
0008 #define _LINUX_I2C_GPIO_H
0009 
0010 /**
0011  * struct i2c_gpio_platform_data - Platform-dependent data for i2c-gpio
0012  * @udelay: signal toggle delay. SCL frequency is (500 / udelay) kHz
0013  * @timeout: clock stretching timeout in jiffies. If the slave keeps
0014  *  SCL low for longer than this, the transfer will time out.
0015  * @sda_is_open_drain: SDA is configured as open drain, i.e. the pin
0016  *  isn't actively driven high when setting the output value high.
0017  *  gpio_get_value() must return the actual pin state even if the
0018  *  pin is configured as an output.
0019  * @scl_is_open_drain: SCL is set up as open drain. Same requirements
0020  *  as for sda_is_open_drain apply.
0021  * @scl_is_output_only: SCL output drivers cannot be turned off.
0022  */
0023 struct i2c_gpio_platform_data {
0024     int     udelay;
0025     int     timeout;
0026     unsigned int    sda_is_open_drain:1;
0027     unsigned int    scl_is_open_drain:1;
0028     unsigned int    scl_is_output_only:1;
0029 };
0030 
0031 #endif /* _LINUX_I2C_GPIO_H */