Skip to content

Commit 8f5d270

Browse files
committed
Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c new drivers from Wolfram Sang: "Here is a pull request from i2c hoping for the "new driver" rule. Originally, I wanted to send this request during the merge window, but code checkers with very recent additions complained, so a few fixups were needed. So, some more time went by and I merged rc1 to get a stable base" So the "new driver" rule is really about drivers that people absolutely need for the kernel to work on new hardware, which is not so much the case for i2c. So I considered not pulling this, but eventually relented. Just for FYI: the whole (and only) point of "new drivers" is not that new drivers cannot regress things (they can, and they have - by triggering badly tested code on machines that never triggered that code before), but because they can bring to life machines that otherwise wouldn't be useful at all without the drivers. So the new driver rule is for essential things that actual consumers would care about, ie devices like networking or disk drivers that matter to normal people (not server people - they run old kernels anyway, so mainlining new drivers is irrelevant for them). * 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: sun6-p2wi: fix call to snprintf i2c: rk3x: add NULL entry to the end of_device_id array i2c: sun6i-p2wi: use proper return value in probe i2c: sunxi: add P2WI (Push/Pull 2 Wire Interface) controller support i2c: sunxi: add P2WI DT bindings documentation i2c: rk3x: add driver for Rockchip RK3xxx SoC I2C adapter
2 parents 2dfded8 + f0b1f64 commit 8f5d270

File tree

6 files changed

+1216
-0
lines changed

6 files changed

+1216
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
* Rockchip RK3xxx I2C controller
2+
3+
This driver interfaces with the native I2C controller present in Rockchip
4+
RK3xxx SoCs.
5+
6+
Required properties :
7+
8+
- reg : Offset and length of the register set for the device
9+
- compatible : should be "rockchip,rk3066-i2c", "rockchip,rk3188-i2c" or
10+
"rockchip,rk3288-i2c".
11+
- interrupts : interrupt number
12+
- clocks : parent clock
13+
14+
Required on RK3066, RK3188 :
15+
16+
- rockchip,grf : the phandle of the syscon node for the general register
17+
file (GRF)
18+
- on those SoCs an alias with the correct I2C bus ID (bit offset in the GRF)
19+
is also required.
20+
21+
Optional properties :
22+
23+
- clock-frequency : SCL frequency to use (in Hz). If omitted, 100kHz is used.
24+
25+
Example:
26+
27+
aliases {
28+
i2c0 = &i2c0;
29+
}
30+
31+
i2c0: i2c@2002d000 {
32+
compatible = "rockchip,rk3188-i2c";
33+
reg = <0x2002d000 0x1000>;
34+
interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
35+
#address-cells = <1>;
36+
#size-cells = <0>;
37+
38+
rockchip,grf = <&grf>;
39+
40+
clock-names = "i2c";
41+
clocks = <&cru PCLK_I2C0>;
42+
};
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
* Allwinner P2WI (Push/Pull 2 Wire Interface) controller
3+
4+
Required properties :
5+
6+
- reg : Offset and length of the register set for the device.
7+
- compatible : Should one of the following:
8+
- "allwinner,sun6i-a31-p2wi"
9+
- interrupts : The interrupt line connected to the P2WI peripheral.
10+
- clocks : The gate clk connected to the P2WI peripheral.
11+
- resets : The reset line connected to the P2WI peripheral.
12+
13+
Optional properties :
14+
15+
- clock-frequency : Desired P2WI bus clock frequency in Hz. If not set the
16+
default frequency is 100kHz
17+
18+
A P2WI may contain one child node encoding a P2WI slave device.
19+
20+
Slave device properties:
21+
Required properties:
22+
- reg : the I2C slave address used during the initialization
23+
process to switch from I2C to P2WI mode
24+
25+
Example:
26+
27+
p2wi@01f03400 {
28+
compatible = "allwinner,sun6i-a31-p2wi";
29+
reg = <0x01f03400 0x400>;
30+
interrupts = <0 39 4>;
31+
clocks = <&apb0_gates 3>;
32+
clock-frequency = <6000000>;
33+
resets = <&apb0_rst 3>;
34+
35+
axp221: pmic@68 {
36+
compatible = "x-powers,axp221";
37+
reg = <0x68>;
38+
39+
/* ... */
40+
};
41+
};

drivers/i2c/busses/Kconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,16 @@ config I2C_RIIC
676676
This driver can also be built as a module. If so, the module
677677
will be called i2c-riic.
678678

679+
config I2C_RK3X
680+
tristate "Rockchip RK3xxx I2C adapter"
681+
depends on OF
682+
help
683+
Say Y here to include support for the I2C adapter in Rockchip RK3xxx
684+
SoCs.
685+
686+
This driver can also be built as a module. If so, the module will
687+
be called i2c-rk3x.
688+
679689
config HAVE_S3C2410_I2C
680690
bool
681691
help
@@ -764,6 +774,19 @@ config I2C_STU300
764774
This driver can also be built as a module. If so, the module
765775
will be called i2c-stu300.
766776

777+
config I2C_SUN6I_P2WI
778+
tristate "Allwinner sun6i internal P2WI controller"
779+
depends on RESET_CONTROLLER
780+
depends on MACH_SUN6I || COMPILE_TEST
781+
help
782+
If you say yes to this option, support will be included for the
783+
P2WI (Push/Pull 2 Wire Interface) controller embedded in some sunxi
784+
SOCs.
785+
The P2WI looks like an SMBus controller (which supports only byte
786+
accesses), except that it only supports one slave device.
787+
This interface is used to connect to specific PMIC devices (like the
788+
AXP221).
789+
767790
config I2C_TEGRA
768791
tristate "NVIDIA Tegra internal I2C controller"
769792
depends on ARCH_TEGRA

drivers/i2c/busses/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ obj-$(CONFIG_I2C_PXA) += i2c-pxa.o
6666
obj-$(CONFIG_I2C_PXA_PCI) += i2c-pxa-pci.o
6767
obj-$(CONFIG_I2C_QUP) += i2c-qup.o
6868
obj-$(CONFIG_I2C_RIIC) += i2c-riic.o
69+
obj-$(CONFIG_I2C_RK3X) += i2c-rk3x.o
6970
obj-$(CONFIG_I2C_S3C2410) += i2c-s3c2410.o
7071
obj-$(CONFIG_I2C_S6000) += i2c-s6000.o
7172
obj-$(CONFIG_I2C_SH7760) += i2c-sh7760.o
@@ -74,6 +75,7 @@ obj-$(CONFIG_I2C_SIMTEC) += i2c-simtec.o
7475
obj-$(CONFIG_I2C_SIRF) += i2c-sirf.o
7576
obj-$(CONFIG_I2C_ST) += i2c-st.o
7677
obj-$(CONFIG_I2C_STU300) += i2c-stu300.o
78+
obj-$(CONFIG_I2C_SUN6I_P2WI) += i2c-sun6i-p2wi.o
7779
obj-$(CONFIG_I2C_TEGRA) += i2c-tegra.o
7880
obj-$(CONFIG_I2C_VERSATILE) += i2c-versatile.o
7981
obj-$(CONFIG_I2C_WMT) += i2c-wmt.o

0 commit comments

Comments
 (0)