History

Merge tag 'i2c-for-6.10-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang: "Fixes for the I2C testunit, the Renesas R-Car driver and some MAINTAINERS corrections" * tag 'i2c-for-6.10-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: testunit: avoid re-issued work after read message i2c: rcar: ensure Gen3+ reset does not disturb local targets i2c: mark HostNotify target address as used i2c: testunit: correct Kconfig description MAINTAINERS: VIRTIO I2C loses a maintainer, gains a reviewer MAINTAINERS: delete entries for Thor Thayer i2c: rcar: clear NO_RXDMA flag after resetting i2c: rcar: bring hardware to known state when probing

Linus Torvalds committed 2 years ago

Commit 4d145e32 parents d0d0cd3 3fdd2d25 files · +31 −29Browse files

Unified · Split

5 files
  1. MAINTAINERS +1 −22
  2. drivers/i2c/Kconfig +1 −1
  3. drivers/i2c/busses/i2c-rcar.c +21 −6
  4. drivers/i2c/i2c-core-base.c +1 −0
  5. drivers/i2c/i2c-slave-testunit.c +7 −0
MAINTAINERS+1−22
@@ -846,12 +846,6 @@ ALPS PS/2 TOUCHPAD DRIVER · 845 unmodified lines
846R: Pali Rohár <pali@kernel.org>846R: Pali Rohár <pali@kernel.org>
847F: drivers/input/mouse/alps.*847F: drivers/input/mouse/alps.*
848 848
849ALTERA I2C CONTROLLER DRIVER
850M: Thor Thayer <thor.thayer@linux.intel.com>
851S: Maintained
852F: Documentation/devicetree/bindings/i2c/i2c-altera.txt
853F: drivers/i2c/busses/i2c-altera.c
854
855ALTERA MAILBOX DRIVER849ALTERA MAILBOX DRIVER
856M: Mun Yew Tham <mun.yew.tham@intel.com>850M: Mun Yew Tham <mun.yew.tham@intel.com>
857S: Maintained851S: Maintained
@@ -871,21 +865,6 @@ L: linux-gpio@vger.kernel.org · 13 unmodified lines
871S: Maintained865S: Maintained
872F: drivers/gpio/gpio-altera.c866F: drivers/gpio/gpio-altera.c
873 867
874ALTERA SYSTEM MANAGER DRIVER
875M: Thor Thayer <thor.thayer@linux.intel.com>
876S: Maintained
877F: drivers/mfd/altera-sysmgr.c
878F: include/linux/mfd/altera-sysmgr.h
879
880ALTERA SYSTEM RESOURCE DRIVER FOR ARRIA10 DEVKIT
881M: Thor Thayer <thor.thayer@linux.intel.com>
882S: Maintained
883F: drivers/gpio/gpio-altera-a10sr.c
884F: drivers/mfd/altera-a10sr.c
885F: drivers/reset/reset-a10sr.c
886F: include/dt-bindings/reset/altr,rst-mgr-a10sr.h
887F: include/linux/mfd/altera-a10sr.h
888
889ALTERA TRIPLE SPEED ETHERNET DRIVER868ALTERA TRIPLE SPEED ETHERNET DRIVER
890M: Joyce Ooi <joyce.ooi@intel.com>869M: Joyce Ooi <joyce.ooi@intel.com>
891L: netdev@vger.kernel.org870L: netdev@vger.kernel.org
@@ -23864,8 +23843,8 @@ S: Maintained · 22972 unmodified lines
23864F: drivers/vhost/scsi.c23843F: drivers/vhost/scsi.c
23865 23844
23866VIRTIO I2C DRIVER23845VIRTIO I2C DRIVER
23867M: Conghui Chen <conghui.chen@intel.com>
23868M: Viresh Kumar <viresh.kumar@linaro.org>23846M: Viresh Kumar <viresh.kumar@linaro.org>
23847R: "Chen, Jian Jun" <jian.jun.chen@intel.com>
23869L: linux-i2c@vger.kernel.org23848L: linux-i2c@vger.kernel.org
23870L: virtualization@lists.linux.dev23849L: virtualization@lists.linux.dev
23871S: Maintained23850S: Maintained
drivers/i2c/Kconfig+1−1
@@ -135,7 +135,7 @@ config I2C_SLAVE_EEPROM · 134 unmodified lines
135 Documentation/i2c/slave-eeprom-backend.rst for further details.135 Documentation/i2c/slave-eeprom-backend.rst for further details.
136 136
137config I2C_SLAVE_TESTUNIT137config I2C_SLAVE_TESTUNIT
138 tristate "I2C eeprom testunit driver"138 tristate "I2C testunit driver"
139 help139 help
140 This backend can be used to trigger test cases for I2C bus masters140 This backend can be used to trigger test cases for I2C bus masters
141 which require a remote device with certain capabilities, e.g.141 which require a remote device with certain capabilities, e.g.
drivers/i2c/busses/i2c-rcar.c+21−6
@@ -257,6 +257,14 @@ static void rcar_i2c_init(struct rcar_i2c_priv *priv) · 256 unmodified lines
257 }257 }
258}258}
259 259
260static void rcar_i2c_reset_slave(struct rcar_i2c_priv *priv)
261{
262 rcar_i2c_write(priv, ICSIER, 0);
263 rcar_i2c_write(priv, ICSSR, 0);
264 rcar_i2c_write(priv, ICSCR, SDBS);
265 rcar_i2c_write(priv, ICSAR, 0); /* Gen2: must be 0 if not using slave */
266}
267
260static int rcar_i2c_bus_barrier(struct rcar_i2c_priv *priv)268static int rcar_i2c_bus_barrier(struct rcar_i2c_priv *priv)
261{269{
262 int ret;270 int ret;
@@ -875,6 +883,10 @@ static int rcar_i2c_do_reset(struct rcar_i2c_priv *priv) · 612 unmodified lines
875{883{
876 int ret;884 int ret;
877 885
886 /* Don't reset if a slave instance is currently running */
887 if (priv->slave)
888 return -EISCONN;
889
878 ret = reset_control_reset(priv->rstc);890 ret = reset_control_reset(priv->rstc);
879 if (ret)891 if (ret)
880 return ret;892 return ret;
@@ -903,10 +915,10 @@ static int rcar_i2c_master_xfer(struct i2c_adapter *adap, · 22 unmodified lines
903 915
904 /* Gen3+ needs a reset. That also allows RXDMA once */916 /* Gen3+ needs a reset. That also allows RXDMA once */
905 if (priv->devtype >= I2C_RCAR_GEN3) {917 if (priv->devtype >= I2C_RCAR_GEN3) {
906 priv->flags &= ~ID_P_NO_RXDMA;
907 ret = rcar_i2c_do_reset(priv);918 ret = rcar_i2c_do_reset(priv);
908 if (ret)919 if (ret)
909 goto out;920 goto out;
921 priv->flags &= ~ID_P_NO_RXDMA;
910 }922 }
911 923
912 rcar_i2c_init(priv);924 rcar_i2c_init(priv);
@@ -1033,11 +1045,8 @@ static int rcar_unreg_slave(struct i2c_client *slave) · 120 unmodified lines
1033 1045
1034 /* ensure no irq is running before clearing ptr */1046 /* ensure no irq is running before clearing ptr */
1035 disable_irq(priv->irq);1047 disable_irq(priv->irq);
1036 rcar_i2c_write(priv, ICSIER, 0);1048 rcar_i2c_reset_slave(priv);
1037 rcar_i2c_write(priv, ICSSR, 0);
1038 enable_irq(priv->irq);1049 enable_irq(priv->irq);
1039 rcar_i2c_write(priv, ICSCR, SDBS);
1040 rcar_i2c_write(priv, ICSAR, 0); /* Gen2: must be 0 if not using slave */
1041 1050
1042 priv->slave = NULL;1051 priv->slave = NULL;
1043 1052
@@ -1152,7 +1161,9 @@ static int rcar_i2c_probe(struct platform_device *pdev) · 108 unmodified lines
1152 goto out_pm_disable;1161 goto out_pm_disable;
1153 }1162 }
1154 1163
1155 rcar_i2c_write(priv, ICSAR, 0); /* Gen2: must be 0 if not using slave */1164 /* Bring hardware to known state */
1165 rcar_i2c_init(priv);
1166 rcar_i2c_reset_slave(priv);
1156 1167
1157 if (priv->devtype < I2C_RCAR_GEN3) {1168 if (priv->devtype < I2C_RCAR_GEN3) {
1158 irqflags |= IRQF_NO_THREAD;1169 irqflags |= IRQF_NO_THREAD;
@@ -1168,6 +1179,7 @@ static int rcar_i2c_probe(struct platform_device *pdev) · 9 unmodified lines
1168 if (of_property_read_bool(dev->of_node, "smbus"))1179 if (of_property_read_bool(dev->of_node, "smbus"))
1169 priv->flags |= ID_P_HOST_NOTIFY;1180 priv->flags |= ID_P_HOST_NOTIFY;
1170 1181
1182 /* R-Car Gen3+ needs a reset before every transfer */
1171 if (priv->devtype >= I2C_RCAR_GEN3) {1183 if (priv->devtype >= I2C_RCAR_GEN3) {
1172 priv->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);1184 priv->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
1173 if (IS_ERR(priv->rstc)) {1185 if (IS_ERR(priv->rstc)) {
@@ -1178,6 +1190,9 @@ static int rcar_i2c_probe(struct platform_device *pdev) · 4 unmodified lines
1178 ret = reset_control_status(priv->rstc);1190 ret = reset_control_status(priv->rstc);
1179 if (ret < 0)1191 if (ret < 0)
1180 goto out_pm_put;1192 goto out_pm_put;
1193
1194 /* hard reset disturbs HostNotify local target, so disable it */
1195 priv->flags &= ~ID_P_HOST_NOTIFY;
1181 }1196 }
1182 1197
1183 ret = platform_get_irq(pdev, 0);1198 ret = platform_get_irq(pdev, 0);
drivers/i2c/i2c-core-base.c+1−0
@@ -1067,6 +1067,7 @@ EXPORT_SYMBOL(i2c_find_device_by_fwnode); · 1066 unmodified lines
1067 1067
1068static const struct i2c_device_id dummy_id[] = {1068static const struct i2c_device_id dummy_id[] = {
1069 { "dummy", 0 },1069 { "dummy", 0 },
1070 { "smbus_host_notify", 0 },
1070 { },1071 { },
1071};1072};
1072 1073
drivers/i2c/i2c-slave-testunit.c+7−0
@@ -118,6 +118,13 @@ static int i2c_slave_testunit_slave_cb(struct i2c_client *client, · 117 unmodified lines
118 queue_delayed_work(system_long_wq, &tu->worker,118 queue_delayed_work(system_long_wq, &tu->worker,
119 msecs_to_jiffies(10 * tu->regs[TU_REG_DELAY]));119 msecs_to_jiffies(10 * tu->regs[TU_REG_DELAY]));
120 }120 }
121
122 /*
123 * Reset reg_idx to avoid that work gets queued again in case of
124 * STOP after a following read message. But do not clear TU regs
125 * here because we still need them in the workqueue!
126 */
127 tu->reg_idx = 0;
121 break;128 break;
122 129
123 case I2C_SLAVE_WRITE_REQUESTED:130 case I2C_SLAVE_WRITE_REQUESTED:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t