From c54473cb25968be53e6b47527d5970b03a3cf41d Mon Sep 17 00:00:00 2001
From: Przemyslaw Marczak
Date: Tue, 31 Mar 2015 18:57:18 +0200
Subject: dm: i2c: add i2c-gpio driver
This commit adds driver model support to software emulated i2c bus driver.
This driver supports kernel-style device tree bindings. Fdt properties in use:
- compatible - "i2c-gpio"
- gpios - data and clock GPIO pin phandles
- delay-us - micro seconds delay between GPIOs toggle operations,
which is 1/4 of I2C speed clock period.
Added:
- Config: CONFIG_DM_I2C_GPIO
- File: drivers/i2c/i2c-gpio.c
- File: doc/device-tree-bindings/i2c/i2c-gpio.txt
Driver base code is taken from: drivers/i2c/soft-i2c.c, changes:
- use "i2c-gpio" naming
- update comments style
- move preprocesor macros into functions
- add device tree support
- add driver model i2c support
- code cleanup,
- add Kconfig entry
Signed-off-by: Przemyslaw Marczak
Acked-by: Simon Glass
Added braces in i2c_gpio_xfer() to fix style nit:
Signed-off-by: Simon Glass
---
drivers/i2c/Makefile | 1 +
1 file changed, 1 insertion(+)
(limited to 'drivers/i2c/Makefile')
diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
index 26ea854ec8d..d9e912f7864 100644
--- a/drivers/i2c/Makefile
+++ b/drivers/i2c/Makefile
@@ -6,6 +6,7 @@
#
obj-$(CONFIG_DM_I2C) += i2c-uclass.o
obj-$(CONFIG_DM_I2C_COMPAT) += i2c-uclass-compat.o
+obj-$(CONFIG_DM_I2C_GPIO) += i2c-gpio.o
obj-$(CONFIG_SYS_I2C_ADI) += adi_i2c.o
obj-$(CONFIG_I2C_MV) += mv_i2c.o
--
cgit v1.2.3