Skip to content

Commit

Permalink
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
 "I2C has one buildfix, one ABBA deadlock fix, and three simple 'add ID'
  patches"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: exynos5: Fix possible ABBA deadlock by keeping I2C clock prepared
  i2c: cpm: Fix build break due to incompatible pointer types
  i2c: ismt: Add Intel DNV PCI ID
  i2c: xlp9xx: add support for Broadcom Vulcan
  i2c: rk3x: add support for rk3228
  • Loading branch information
torvalds committed Apr 27, 2016
2 parents 24131a6 + 10ff4c5 commit 3118e5f
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Documentation/devicetree/bindings/i2c/i2c-rk3x.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ RK3xxx SoCs.
Required properties :

- reg : Offset and length of the register set for the device
- compatible : should be "rockchip,rk3066-i2c", "rockchip,rk3188-i2c" or
"rockchip,rk3288-i2c".
- compatible : should be "rockchip,rk3066-i2c", "rockchip,rk3188-i2c",
"rockchip,rk3228-i2c" or "rockchip,rk3288-i2c".
- interrupts : interrupt number
- clocks : parent clock

Expand Down
4 changes: 2 additions & 2 deletions drivers/i2c/busses/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -975,10 +975,10 @@ config I2C_XLR

config I2C_XLP9XX
tristate "XLP9XX I2C support"
depends on CPU_XLP || COMPILE_TEST
depends on CPU_XLP || ARCH_VULCAN || COMPILE_TEST
help
This driver enables support for the on-chip I2C interface of
the Broadcom XLP9xx/XLP5xx MIPS processors.
the Broadcom XLP9xx/XLP5xx MIPS and Vulcan ARM64 processors.

This driver can also be built as a module. If so, the module will
be called i2c-xlp9xx.
Expand Down
4 changes: 2 additions & 2 deletions drivers/i2c/busses/i2c-cpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ struct cpm_i2c {
cbd_t __iomem *rbase;
u_char *txbuf[CPM_MAXBD];
u_char *rxbuf[CPM_MAXBD];
u32 txdma[CPM_MAXBD];
u32 rxdma[CPM_MAXBD];
dma_addr_t txdma[CPM_MAXBD];
dma_addr_t rxdma[CPM_MAXBD];
};

static irqreturn_t cpm_i2c_interrupt(int irq, void *dev_id)
Expand Down
24 changes: 19 additions & 5 deletions drivers/i2c/busses/i2c-exynos5.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,9 @@ static int exynos5_i2c_xfer(struct i2c_adapter *adap,
return -EIO;
}

clk_prepare_enable(i2c->clk);
ret = clk_enable(i2c->clk);
if (ret)
return ret;

for (i = 0; i < num; i++, msgs++) {
stop = (i == num - 1);
Expand All @@ -695,7 +697,7 @@ static int exynos5_i2c_xfer(struct i2c_adapter *adap,
}

out:
clk_disable_unprepare(i2c->clk);
clk_disable(i2c->clk);
return ret;
}

Expand Down Expand Up @@ -747,7 +749,9 @@ static int exynos5_i2c_probe(struct platform_device *pdev)
return -ENOENT;
}

clk_prepare_enable(i2c->clk);
ret = clk_prepare_enable(i2c->clk);
if (ret)
return ret;

mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
i2c->regs = devm_ioremap_resource(&pdev->dev, mem);
Expand Down Expand Up @@ -799,6 +803,10 @@ static int exynos5_i2c_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, i2c);

clk_disable(i2c->clk);

return 0;

err_clk:
clk_disable_unprepare(i2c->clk);
return ret;
Expand All @@ -810,6 +818,8 @@ static int exynos5_i2c_remove(struct platform_device *pdev)

i2c_del_adapter(&i2c->adap);

clk_unprepare(i2c->clk);

return 0;
}

Expand All @@ -821,6 +831,8 @@ static int exynos5_i2c_suspend_noirq(struct device *dev)

i2c->suspended = 1;

clk_unprepare(i2c->clk);

return 0;
}

Expand All @@ -830,7 +842,9 @@ static int exynos5_i2c_resume_noirq(struct device *dev)
struct exynos5_i2c *i2c = platform_get_drvdata(pdev);
int ret = 0;

clk_prepare_enable(i2c->clk);
ret = clk_prepare_enable(i2c->clk);
if (ret)
return ret;

ret = exynos5_hsi2c_clock_setup(i2c);
if (ret) {
Expand All @@ -839,7 +853,7 @@ static int exynos5_i2c_resume_noirq(struct device *dev)
}

exynos5_i2c_init(i2c);
clk_disable_unprepare(i2c->clk);
clk_disable(i2c->clk);
i2c->suspended = 0;

return 0;
Expand Down
2 changes: 2 additions & 0 deletions drivers/i2c/busses/i2c-ismt.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
/* PCI DIDs for the Intel SMBus Message Transport (SMT) Devices */
#define PCI_DEVICE_ID_INTEL_S1200_SMT0 0x0c59
#define PCI_DEVICE_ID_INTEL_S1200_SMT1 0x0c5a
#define PCI_DEVICE_ID_INTEL_DNV_SMT 0x19ac
#define PCI_DEVICE_ID_INTEL_AVOTON_SMT 0x1f15

#define ISMT_DESC_ENTRIES 2 /* number of descriptor entries */
Expand Down Expand Up @@ -180,6 +181,7 @@ struct ismt_priv {
static const struct pci_device_id ismt_ids[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_S1200_SMT0) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_S1200_SMT1) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DNV_SMT) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_AVOTON_SMT) },
{ 0, }
};
Expand Down
1 change: 1 addition & 0 deletions drivers/i2c/busses/i2c-rk3x.c
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,7 @@ static struct rk3x_i2c_soc_data soc_data[3] = {
static const struct of_device_id rk3x_i2c_match[] = {
{ .compatible = "rockchip,rk3066-i2c", .data = (void *)&soc_data[0] },
{ .compatible = "rockchip,rk3188-i2c", .data = (void *)&soc_data[1] },
{ .compatible = "rockchip,rk3228-i2c", .data = (void *)&soc_data[2] },
{ .compatible = "rockchip,rk3288-i2c", .data = (void *)&soc_data[2] },
{},
};
Expand Down

0 comments on commit 3118e5f

Please sign in to comment.