]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
dm: i2c: add i2c-gpio driver
authorPrzemyslaw Marczak <p.marczak@samsung.com>
Tue, 31 Mar 2015 16:57:18 +0000 (18:57 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 19:47:49 +0000 (21:47 +0200)
commitbac4e85810adf994f704dbc781ef3ef7187009db
tree7bd27eea6f2fa0efb813b2175b1bc36893a9c074
parent860a85f76001c7ab12d06e05deb382137d527dec
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 <p.marczak@samsung.com>
Acked-by: Simon Glass <sjg@chromium.org>
Added braces in i2c_gpio_xfer() to fix style nit:
Signed-off-by: Simon Glass <sjg@chromium.org>
doc/device-tree-bindings/i2c/i2c-gpio.txt [new file with mode: 0644]
drivers/i2c/Kconfig
drivers/i2c/Makefile
drivers/i2c/i2c-gpio.c [new file with mode: 0644]