linux/include/linux/platform_data/i2c-gpio.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0-only */
   2/*
   3 * i2c-gpio interface to platform code
   4 *
   5 * Copyright (C) 2007 Atmel Corporation
   6 */
   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
  12 * @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 {
  24        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 */
  32