summaryrefslogtreecommitdiff
path: root/include/linux/platform_data/i2c-gpio.h
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2023-01-18 22:55:12 +0100
committerWolfram Sang <wsa@kernel.org>2023-01-23 23:18:54 +0100
commit8786b095df02c1b881643146869a7d6f80411e6a (patch)
tree541f37aca6742f571b6bb44098818675c916d984 /include/linux/platform_data/i2c-gpio.h
parent9dfee1487c271b7904e38dea5bed8f6e2d058dc3 (diff)
i2c: gpio: support write-only sda/scl w/o pull-up
There are slave devices that understand I2C but have read-only SDA and SCL. Examples are FD650 7-segment LED controller and its derivatives. Typical board designs don't even have a pull-up for both pins. Handle the new attributes for write-only SDA and missing pull-up on SDA/SCL. For either pin the open-drain and has-no-pullup properties are mutually-exclusive, what is documented in the DT property documentation. We don't add an extra warning here because the open-drain properties are marked deprecated anyway. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> [wsa: switched to device properties] Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'include/linux/platform_data/i2c-gpio.h')
-rw-r--r--include/linux/platform_data/i2c-gpio.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/platform_data/i2c-gpio.h b/include/linux/platform_data/i2c-gpio.h
index a907774fd177..545639bcca72 100644
--- a/include/linux/platform_data/i2c-gpio.h
+++ b/include/linux/platform_data/i2c-gpio.h
@@ -16,16 +16,25 @@
* isn't actively driven high when setting the output value high.
* gpio_get_value() must return the actual pin state even if the
* pin is configured as an output.
+ * @sda_is_output_only: SDA output drivers can't be turned off.
+ * This is for clients that can only read SDA/SCL.
+ * @sda_has_no_pullup: SDA is used in a non-compliant way and has no pull-up.
+ * Therefore disable open-drain.
* @scl_is_open_drain: SCL is set up as open drain. Same requirements
* as for sda_is_open_drain apply.
* @scl_is_output_only: SCL output drivers cannot be turned off.
+ * @scl_has_no_pullup: SCL is used in a non-compliant way and has no pull-up.
+ * Therefore disable open-drain.
*/
struct i2c_gpio_platform_data {
int udelay;
int timeout;
unsigned int sda_is_open_drain:1;
+ unsigned int sda_is_output_only:1;
+ unsigned int sda_has_no_pullup:1;
unsigned int scl_is_open_drain:1;
unsigned int scl_is_output_only:1;
+ unsigned int scl_has_no_pullup:1;
};
#endif /* _LINUX_I2C_GPIO_H */