Skip to content

Commit dacec3e

Browse files
committed
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang: "Some driver updates, a MAINTAINERS fix, and additions to COMPILE_TEST (so we won't miss build problems again)" * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: MAINTAINERS: remove duplicate entry for i2c-qcom-geni i2c: brcmstb: fix support for DSL and CM variants i2c: qup: allow COMPILE_TEST i2c: imx: allow COMPILE_TEST i2c: cadence: allow COMPILE_TEST i2c: qcom-cci: don't put a device tree node before i2c_add_adapter() i2c: qcom-cci: don't delete an unregistered adapter i2c: bcm2835: Avoid clock stretching timeouts
2 parents 961af9d + 2428766 commit dacec3e

5 files changed

Lines changed: 26 additions & 17 deletions

File tree

MAINTAINERS

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16008,14 +16008,6 @@ F: Documentation/devicetree/bindings/misc/qcom,fastrpc.txt
1600816008
F: drivers/misc/fastrpc.c
1600916009
F: include/uapi/misc/fastrpc.h
1601016010

16011-
QUALCOMM GENERIC INTERFACE I2C DRIVER
16012-
M: Akash Asthana <akashast@codeaurora.org>
16013-
M: Mukesh Savaliya <msavaliy@codeaurora.org>
16014-
L: linux-i2c@vger.kernel.org
16015-
L: linux-arm-msm@vger.kernel.org
16016-
S: Supported
16017-
F: drivers/i2c/busses/i2c-qcom-geni.c
16018-
1601916011
QUALCOMM HEXAGON ARCHITECTURE
1602016012
M: Brian Cain <bcain@codeaurora.org>
1602116013
L: linux-hexagon@vger.kernel.org

drivers/i2c/busses/Kconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ config I2C_BRCMSTB
488488

489489
config I2C_CADENCE
490490
tristate "Cadence I2C Controller"
491-
depends on ARCH_ZYNQ || ARM64 || XTENSA
491+
depends on ARCH_ZYNQ || ARM64 || XTENSA || COMPILE_TEST
492492
help
493493
Say yes here to select Cadence I2C Host Controller. This controller is
494494
e.g. used by Xilinx Zynq.
@@ -680,7 +680,7 @@ config I2C_IMG
680680

681681
config I2C_IMX
682682
tristate "IMX I2C interface"
683-
depends on ARCH_MXC || ARCH_LAYERSCAPE || COLDFIRE
683+
depends on ARCH_MXC || ARCH_LAYERSCAPE || COLDFIRE || COMPILE_TEST
684684
select I2C_SLAVE
685685
help
686686
Say Y here if you want to use the IIC bus controller on
@@ -935,7 +935,7 @@ config I2C_QCOM_GENI
935935

936936
config I2C_QUP
937937
tristate "Qualcomm QUP based I2C controller"
938-
depends on ARCH_QCOM
938+
depends on ARCH_QCOM || COMPILE_TEST
939939
help
940940
If you say yes to this option, support will be included for the
941941
built-in I2C interface on the Qualcomm SoCs.

drivers/i2c/busses/i2c-bcm2835.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
#define BCM2835_I2C_FIFO 0x10
2424
#define BCM2835_I2C_DIV 0x14
2525
#define BCM2835_I2C_DEL 0x18
26+
/*
27+
* 16-bit field for the number of SCL cycles to wait after rising SCL
28+
* before deciding the slave is not responding. 0 disables the
29+
* timeout detection.
30+
*/
2631
#define BCM2835_I2C_CLKT 0x1c
2732

2833
#define BCM2835_I2C_C_READ BIT(0)
@@ -474,6 +479,12 @@ static int bcm2835_i2c_probe(struct platform_device *pdev)
474479
adap->dev.of_node = pdev->dev.of_node;
475480
adap->quirks = of_device_get_match_data(&pdev->dev);
476481

482+
/*
483+
* Disable the hardware clock stretching timeout. SMBUS
484+
* specifies a limit for how long the device can stretch the
485+
* clock, but core I2C doesn't.
486+
*/
487+
bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_CLKT, 0);
477488
bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, 0);
478489

479490
ret = i2c_add_adapter(adap);

drivers/i2c/busses/i2c-brcmstb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ static int brcmstb_i2c_probe(struct platform_device *pdev)
673673

674674
/* set the data in/out register size for compatible SoCs */
675675
if (of_device_is_compatible(dev->device->of_node,
676-
"brcmstb,brcmper-i2c"))
676+
"brcm,brcmper-i2c"))
677677
dev->data_regsz = sizeof(u8);
678678
else
679679
dev->data_regsz = sizeof(u32);

drivers/i2c/busses/i2c-qcom-cci.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ static int cci_probe(struct platform_device *pdev)
558558
cci->master[idx].adap.quirks = &cci->data->quirks;
559559
cci->master[idx].adap.algo = &cci_algo;
560560
cci->master[idx].adap.dev.parent = dev;
561-
cci->master[idx].adap.dev.of_node = child;
561+
cci->master[idx].adap.dev.of_node = of_node_get(child);
562562
cci->master[idx].master = idx;
563563
cci->master[idx].cci = cci;
564564

@@ -643,8 +643,10 @@ static int cci_probe(struct platform_device *pdev)
643643
continue;
644644

645645
ret = i2c_add_adapter(&cci->master[i].adap);
646-
if (ret < 0)
646+
if (ret < 0) {
647+
of_node_put(cci->master[i].adap.dev.of_node);
647648
goto error_i2c;
649+
}
648650
}
649651

650652
pm_runtime_set_autosuspend_delay(dev, MSEC_PER_SEC);
@@ -655,9 +657,11 @@ static int cci_probe(struct platform_device *pdev)
655657
return 0;
656658

657659
error_i2c:
658-
for (; i >= 0; i--) {
659-
if (cci->master[i].cci)
660+
for (--i ; i >= 0; i--) {
661+
if (cci->master[i].cci) {
660662
i2c_del_adapter(&cci->master[i].adap);
663+
of_node_put(cci->master[i].adap.dev.of_node);
664+
}
661665
}
662666
error:
663667
disable_irq(cci->irq);
@@ -673,8 +677,10 @@ static int cci_remove(struct platform_device *pdev)
673677
int i;
674678

675679
for (i = 0; i < cci->data->num_masters; i++) {
676-
if (cci->master[i].cci)
680+
if (cci->master[i].cci) {
677681
i2c_del_adapter(&cci->master[i].adap);
682+
of_node_put(cci->master[i].adap.dev.of_node);
683+
}
678684
cci_halt(cci, i);
679685
}
680686

0 commit comments

Comments
 (0)