All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] ARM: mediatek: Add driver for Mediatek I2C controller
@ 2014-11-24  9:38 ` Xudong Chen
  0 siblings, 0 replies; 32+ messages in thread
From: Xudong Chen @ 2014-11-24  9:38 UTC (permalink / raw)
  To: Mark Rutland, Matthias Brugger, Wolfram Sang
  Cc: srv_heupstream, Sascha Hauer, Rob Herring, Pawel Moll,
	Ian Campbell, Kumar Gala, Russell King, Grant Likely,
	Xudong Chen, Jean Delvare, Arnd Bergmann, devicetree,
	linux-kernel, linux-arm-kernel, linux-i2c, Yingjoe Chen,
	Eddie Huang, Nathan Chung, YH Chen

This series is the third version of Mediatek SoCs I2C controller common
bus driver.
Compared to the second version,
1. Add comments for clock in dt-bindings file i2c-mt6577.txt.
2. Remove mt8135.dtsi because of the dependency on pinctrl and clock.
3. Encode the feature have-dcm in i2c-mt65xx.c by checking the compatible.

This driver is based on 3.18-rc1.

MTK I2C HW has some limitation.
1. If the i2c_msg number is more than one, STOP will be issued instead of
RS(Repeat Start) between each message.
Such as: "START + ADDR + DATA_n + STOP + START + ADDR + DATA_n + STOP ..."

2. Mediatek I2C controller support WRRD(write then read) mode, in WRRD
mode the Repeat Start will be issued between 2 messages.
In this driver if 2 messages is first write then read, the driver will
combine 2 messages using Write-Read mode so the RS will be issued between
the 2 messages.
Ex: W/R/R, driver will combine first W/R and then R.
The data series will be:
"START + WriteADDR + DATA + RS + ReadADDR + DATA + STOP + START + ReadADDR +
DATA + STOP".

3. Due to HW limitation, in this version the max transfer data length is 255
in one message. If want to transfer more than 255 bytes, HW needs the SW
driver to split the data. Take 600 bytes for example, the data need to be
divided into 3 parts 255 + 255 + 90. The data series will be:
"START + ADDR + DATA_255 + RS + ADDR + DATA_255 + RS + ADDR +  DATA_90 + STOP"
instead of "START + ADDR + DATA_900 + STOP".
We haven't implement this yet, we will do this in the separate patch.

MT8135 and MT6589 can control I2C pins on PMIC(MT6397) by setting the i2c
registers in MT8135 side. In this case, driver should set OFFSET_PATH_DIR
bit first, the operation on other registers are still the same.
For now MT6589/MT8135 support this, MT6577/MT6595/MT8127 do not support.
For example, If want to use I2C4/5/6 pins on MT8135 just need to enable
the pinmux, else if want to use I2C pins on PMIC(MT6397) need to add
"mediatek,have-pmic" property in the .dts file of each platform.

Xudong Chen (2):
  dt-bindings: Add I2C bindings for mt65xx/mt81xx.
  I2C: mediatek: Add driver for MediaTek I2C controller

 .../devicetree/bindings/i2c/i2c-mt6577.txt         |  40 ++
 drivers/i2c/busses/Kconfig                         |   9 +
 drivers/i2c/busses/Makefile                        |   1 +
 drivers/i2c/busses/i2c-mt65xx.c                    | 742 +++++++++++++++++++++
 4 files changed, 792 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mt6577.txt
 create mode 100644 drivers/i2c/busses/i2c-mt65xx.c

--
1.8.1.1.dirty


^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2015-01-13 15:23 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-24  9:38 [PATCH v3 0/2] ARM: mediatek: Add driver for Mediatek I2C controller Xudong Chen
2014-11-24  9:38 ` Xudong Chen
2014-11-24  9:38 ` Xudong Chen
2014-11-24  9:38 ` [PATCH v3 1/2] dt-bindings: Add I2C bindings for mt65xx/mt81xx Xudong Chen
2014-11-24  9:38   ` Xudong Chen
2014-11-24  9:38   ` Xudong Chen
2014-11-24  9:38 ` [PATCH v3 2/2] I2C: mediatek: Add driver for MediaTek I2C controller Xudong Chen
2014-11-24  9:38   ` Xudong Chen
2014-11-24  9:38   ` Xudong Chen
2014-11-24 12:15 ` [PATCH v3 0/2] ARM: mediatek: Add driver for Mediatek " Wolfram Sang
2014-11-24 12:15   ` Wolfram Sang
2014-11-24 12:15   ` Wolfram Sang
2014-11-27 14:00   ` Yingjoe Chen
2014-11-27 14:00     ` Yingjoe Chen
2014-11-27 14:00     ` Yingjoe Chen
2014-11-27 16:45     ` Wolfram Sang
2014-11-27 16:45       ` Wolfram Sang
2014-11-27 16:45       ` Wolfram Sang
2014-12-12  2:40       ` Yingjoe Chen
2014-12-12  2:40         ` Yingjoe Chen
2014-12-12  2:40         ` Yingjoe Chen
2015-01-06 13:37         ` Wolfram Sang
2015-01-06 13:37           ` Wolfram Sang
2015-01-06 13:37           ` Wolfram Sang
2015-01-13  9:57           ` Wolfram Sang
2015-01-13  9:57             ` Wolfram Sang
2015-01-13  9:57             ` Wolfram Sang
2015-01-13 15:15             ` Yingjoe Chen
2015-01-13 15:15               ` Yingjoe Chen
2015-01-13 15:15               ` Yingjoe Chen
2015-01-13 15:23               ` Wolfram Sang
2015-01-13 15:23                 ` Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.