Commit acc5da0f authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'i2c-embedded/for-current' of git://git.pengutronix.de/git/wsa/linux

Pill i2c fixes from Wolfram Sang:
 "Here are a few, typical driver fixes for the I2C subsystem"

* 'i2c-embedded/for-current' of git://git.pengutronix.de/git/wsa/linux:
  i2c-designware: add missing MODULE_LICENSE
  i2c: omap: fix draining irq handling
  i2c: omap: errata i462: fix incorrect ack for arbitration lost interrupt
  i2c: muxes: fix wrong use of sizeof(ptr)
  i2c: sirf: register i2c_client from dt child-nodes in probe entry
  i2c: mxs: Fix type of error code
  i2c: mxs: Fix misuse init_completion
parents ff7532ca 9dd3162d
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/module.h>
#include "i2c-designware-core.h" #include "i2c-designware-core.h"
/* /*
...@@ -725,3 +726,6 @@ u32 i2c_dw_read_comp_param(struct dw_i2c_dev *dev) ...@@ -725,3 +726,6 @@ u32 i2c_dw_read_comp_param(struct dw_i2c_dev *dev)
return dw_readl(dev, DW_IC_COMP_PARAM_1); return dw_readl(dev, DW_IC_COMP_PARAM_1);
} }
EXPORT_SYMBOL_GPL(i2c_dw_read_comp_param); EXPORT_SYMBOL_GPL(i2c_dw_read_comp_param);
MODULE_DESCRIPTION("Synopsys DesignWare I2C bus adapter core");
MODULE_LICENSE("GPL");
...@@ -127,7 +127,7 @@ struct mxs_i2c_dev { ...@@ -127,7 +127,7 @@ struct mxs_i2c_dev {
struct device *dev; struct device *dev;
void __iomem *regs; void __iomem *regs;
struct completion cmd_complete; struct completion cmd_complete;
u32 cmd_err; int cmd_err;
struct i2c_adapter adapter; struct i2c_adapter adapter;
const struct mxs_i2c_speed_config *speed; const struct mxs_i2c_speed_config *speed;
...@@ -316,7 +316,7 @@ static int mxs_i2c_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, ...@@ -316,7 +316,7 @@ static int mxs_i2c_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg,
if (msg->len == 0) if (msg->len == 0)
return -EINVAL; return -EINVAL;
init_completion(&i2c->cmd_complete); INIT_COMPLETION(i2c->cmd_complete);
i2c->cmd_err = 0; i2c->cmd_err = 0;
ret = mxs_i2c_dma_setup_xfer(adap, msg, flags); ret = mxs_i2c_dma_setup_xfer(adap, msg, flags);
...@@ -473,6 +473,8 @@ static int mxs_i2c_probe(struct platform_device *pdev) ...@@ -473,6 +473,8 @@ static int mxs_i2c_probe(struct platform_device *pdev)
i2c->dev = dev; i2c->dev = dev;
i2c->speed = &mxs_i2c_95kHz_config; i2c->speed = &mxs_i2c_95kHz_config;
init_completion(&i2c->cmd_complete);
if (dev->of_node) { if (dev->of_node) {
err = mxs_i2c_get_ofdata(i2c); err = mxs_i2c_get_ofdata(i2c);
if (err) if (err)
......
...@@ -803,7 +803,7 @@ static int errata_omap3_i462(struct omap_i2c_dev *dev) ...@@ -803,7 +803,7 @@ static int errata_omap3_i462(struct omap_i2c_dev *dev)
if (stat & OMAP_I2C_STAT_AL) { if (stat & OMAP_I2C_STAT_AL) {
dev_err(dev->dev, "Arbitration lost\n"); dev_err(dev->dev, "Arbitration lost\n");
dev->cmd_err |= OMAP_I2C_STAT_AL; dev->cmd_err |= OMAP_I2C_STAT_AL;
omap_i2c_ack_stat(dev, OMAP_I2C_STAT_NACK); omap_i2c_ack_stat(dev, OMAP_I2C_STAT_AL);
} }
return -EIO; return -EIO;
...@@ -963,7 +963,7 @@ omap_i2c_isr_thread(int this_irq, void *dev_id) ...@@ -963,7 +963,7 @@ omap_i2c_isr_thread(int this_irq, void *dev_id)
i2c_omap_errata_i207(dev, stat); i2c_omap_errata_i207(dev, stat);
omap_i2c_ack_stat(dev, OMAP_I2C_STAT_RDR); omap_i2c_ack_stat(dev, OMAP_I2C_STAT_RDR);
break; continue;
} }
if (stat & OMAP_I2C_STAT_RRDY) { if (stat & OMAP_I2C_STAT_RRDY) {
...@@ -989,7 +989,7 @@ omap_i2c_isr_thread(int this_irq, void *dev_id) ...@@ -989,7 +989,7 @@ omap_i2c_isr_thread(int this_irq, void *dev_id)
break; break;
omap_i2c_ack_stat(dev, OMAP_I2C_STAT_XDR); omap_i2c_ack_stat(dev, OMAP_I2C_STAT_XDR);
break; continue;
} }
if (stat & OMAP_I2C_STAT_XRDY) { if (stat & OMAP_I2C_STAT_XRDY) {
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/of_i2c.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/io.h> #include <linux/io.h>
...@@ -328,6 +329,7 @@ static int i2c_sirfsoc_probe(struct platform_device *pdev) ...@@ -328,6 +329,7 @@ static int i2c_sirfsoc_probe(struct platform_device *pdev)
adap->algo = &i2c_sirfsoc_algo; adap->algo = &i2c_sirfsoc_algo;
adap->algo_data = siic; adap->algo_data = siic;
adap->dev.of_node = pdev->dev.of_node;
adap->dev.parent = &pdev->dev; adap->dev.parent = &pdev->dev;
adap->nr = pdev->id; adap->nr = pdev->id;
...@@ -371,6 +373,8 @@ static int i2c_sirfsoc_probe(struct platform_device *pdev) ...@@ -371,6 +373,8 @@ static int i2c_sirfsoc_probe(struct platform_device *pdev)
clk_disable(clk); clk_disable(clk);
of_i2c_register_devices(adap);
dev_info(&pdev->dev, " I2C adapter ready to operate\n"); dev_info(&pdev->dev, " I2C adapter ready to operate\n");
return 0; return 0;
......
...@@ -167,7 +167,7 @@ static int i2c_mux_pinctrl_probe(struct platform_device *pdev) ...@@ -167,7 +167,7 @@ static int i2c_mux_pinctrl_probe(struct platform_device *pdev)
} }
mux->busses = devm_kzalloc(&pdev->dev, mux->busses = devm_kzalloc(&pdev->dev,
sizeof(mux->busses) * mux->pdata->bus_count, sizeof(*mux->busses) * mux->pdata->bus_count,
GFP_KERNEL); GFP_KERNEL);
if (!mux->busses) { if (!mux->busses) {
dev_err(&pdev->dev, "Cannot allocate busses\n"); dev_err(&pdev->dev, "Cannot allocate busses\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment