Skip to content

Commit d7b686e

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: - bugfixes for uniphier, i801, and xiic drivers - ID removal (never produced) for imx - one MAINTAINER addition * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: xiic: Record xilinx i2c with Zynq fragment i2c: xiic: Make the start and the byte count write atomic i2c: i801: fix DNV's SMBCTRL register offset i2c: imx-lpi2c: Remove mx8dv compatible entry dt-bindings: imx-lpi2c: Remove mx8dv compatible entry i2c: uniphier-f: issue STOP only for last message or I2C_M_STOP i2c: uniphier: issue STOP only for last message or I2C_M_STOP
2 parents 2c34a0e + da4dfaf commit d7b686e

File tree

7 files changed

+16
-14
lines changed

7 files changed

+16
-14
lines changed

Documentation/devicetree/bindings/i2c/i2c-imx-lpi2c.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
Required properties:
44
- compatible :
55
- "fsl,imx7ulp-lpi2c" for LPI2C compatible with the one integrated on i.MX7ULP soc
6-
- "fsl,imx8dv-lpi2c" for LPI2C compatible with the one integrated on i.MX8DV soc
76
- reg : address and length of the lpi2c master registers
87
- interrupts : lpi2c interrupt
98
- clocks : lpi2c clock specifier
109

1110
Examples:
1211

1312
lpi2c7: lpi2c7@40a50000 {
14-
compatible = "fsl,imx8dv-lpi2c";
13+
compatible = "fsl,imx7ulp-lpi2c";
1514
reg = <0x40A50000 0x10000>;
1615
interrupt-parent = <&intc>;
1716
interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,6 +2311,7 @@ F: drivers/clocksource/cadence_ttc_timer.c
23112311
F: drivers/i2c/busses/i2c-cadence.c
23122312
F: drivers/mmc/host/sdhci-of-arasan.c
23132313
F: drivers/edac/synopsys_edac.c
2314+
F: drivers/i2c/busses/i2c-xiic.c
23142315

23152316
ARM64 PORT (AARCH64 ARCHITECTURE)
23162317
M: Catalin Marinas <catalin.marinas@arm.com>

drivers/i2c/busses/i2c-i801.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140

141141
#define SBREG_BAR 0x10
142142
#define SBREG_SMBCTRL 0xc6000c
143+
#define SBREG_SMBCTRL_DNV 0xcf000c
143144

144145
/* Host status bits for SMBPCISTS */
145146
#define SMBPCISTS_INTS BIT(3)
@@ -1399,7 +1400,11 @@ static void i801_add_tco(struct i801_priv *priv)
13991400
spin_unlock(&p2sb_spinlock);
14001401

14011402
res = &tco_res[ICH_RES_MEM_OFF];
1402-
res->start = (resource_size_t)base64_addr + SBREG_SMBCTRL;
1403+
if (pci_dev->device == PCI_DEVICE_ID_INTEL_DNV_SMBUS)
1404+
res->start = (resource_size_t)base64_addr + SBREG_SMBCTRL_DNV;
1405+
else
1406+
res->start = (resource_size_t)base64_addr + SBREG_SMBCTRL;
1407+
14031408
res->end = res->start + 3;
14041409
res->flags = IORESOURCE_MEM;
14051410

drivers/i2c/busses/i2c-imx-lpi2c.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,6 @@ static const struct i2c_algorithm lpi2c_imx_algo = {
538538

539539
static const struct of_device_id lpi2c_imx_of_match[] = {
540540
{ .compatible = "fsl,imx7ulp-lpi2c" },
541-
{ .compatible = "fsl,imx8dv-lpi2c" },
542541
{ },
543542
};
544543
MODULE_DEVICE_TABLE(of, lpi2c_imx_of_match);

drivers/i2c/busses/i2c-uniphier-f.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,8 @@ static int uniphier_fi2c_master_xfer(struct i2c_adapter *adap,
401401
return ret;
402402

403403
for (msg = msgs; msg < emsg; msg++) {
404-
/* If next message is read, skip the stop condition */
405-
bool stop = !(msg + 1 < emsg && msg[1].flags & I2C_M_RD);
406-
/* but, force it if I2C_M_STOP is set */
407-
if (msg->flags & I2C_M_STOP)
408-
stop = true;
404+
/* Emit STOP if it is the last message or I2C_M_STOP is set. */
405+
bool stop = (msg + 1 == emsg) || (msg->flags & I2C_M_STOP);
409406

410407
ret = uniphier_fi2c_master_xfer_one(adap, msg, stop);
411408
if (ret)

drivers/i2c/busses/i2c-uniphier.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,8 @@ static int uniphier_i2c_master_xfer(struct i2c_adapter *adap,
248248
return ret;
249249

250250
for (msg = msgs; msg < emsg; msg++) {
251-
/* If next message is read, skip the stop condition */
252-
bool stop = !(msg + 1 < emsg && msg[1].flags & I2C_M_RD);
253-
/* but, force it if I2C_M_STOP is set */
254-
if (msg->flags & I2C_M_STOP)
255-
stop = true;
251+
/* Emit STOP if it is the last message or I2C_M_STOP is set. */
252+
bool stop = (msg + 1 == emsg) || (msg->flags & I2C_M_STOP);
256253

257254
ret = uniphier_i2c_master_xfer_one(adap, msg, stop);
258255
if (ret)

drivers/i2c/busses/i2c-xiic.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ static void xiic_start_recv(struct xiic_i2c *i2c)
532532
{
533533
u8 rx_watermark;
534534
struct i2c_msg *msg = i2c->rx_msg = i2c->tx_msg;
535+
unsigned long flags;
535536

536537
/* Clear and enable Rx full interrupt. */
537538
xiic_irq_clr_en(i2c, XIIC_INTR_RX_FULL_MASK | XIIC_INTR_TX_ERROR_MASK);
@@ -547,6 +548,7 @@ static void xiic_start_recv(struct xiic_i2c *i2c)
547548
rx_watermark = IIC_RX_FIFO_DEPTH;
548549
xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, rx_watermark - 1);
549550

551+
local_irq_save(flags);
550552
if (!(msg->flags & I2C_M_NOSTART))
551553
/* write the address */
552554
xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET,
@@ -556,6 +558,8 @@ static void xiic_start_recv(struct xiic_i2c *i2c)
556558

557559
xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET,
558560
msg->len | ((i2c->nmsgs == 1) ? XIIC_TX_DYN_STOP_MASK : 0));
561+
local_irq_restore(flags);
562+
559563
if (i2c->nmsgs == 1)
560564
/* very last, enable bus not busy as well */
561565
xiic_irq_clr_en(i2c, XIIC_INTR_BNB_MASK);

0 commit comments

Comments
 (0)