Skip to content

Commit

Permalink
Merge branch 'i2c-embedded/for-current' of git://git.pengutronix.de/g…
Browse files Browse the repository at this point in the history
…it/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
  • Loading branch information
Linus Torvalds committed Jan 24, 2013
2 parents ff7532c + 9dd3162 commit acc5da0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
4 changes: 4 additions & 0 deletions drivers/i2c/busses/i2c-designware-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <linux/io.h>
#include <linux/pm_runtime.h>
#include <linux/delay.h>
#include <linux/module.h>
#include "i2c-designware-core.h"

/*
Expand Down Expand Up @@ -725,3 +726,6 @@ u32 i2c_dw_read_comp_param(struct dw_i2c_dev *dev)
return dw_readl(dev, DW_IC_COMP_PARAM_1);
}
EXPORT_SYMBOL_GPL(i2c_dw_read_comp_param);

MODULE_DESCRIPTION("Synopsys DesignWare I2C bus adapter core");
MODULE_LICENSE("GPL");
6 changes: 4 additions & 2 deletions drivers/i2c/busses/i2c-mxs.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ struct mxs_i2c_dev {
struct device *dev;
void __iomem *regs;
struct completion cmd_complete;
u32 cmd_err;
int cmd_err;
struct i2c_adapter adapter;
const struct mxs_i2c_speed_config *speed;

Expand Down Expand Up @@ -316,7 +316,7 @@ static int mxs_i2c_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg,
if (msg->len == 0)
return -EINVAL;

init_completion(&i2c->cmd_complete);
INIT_COMPLETION(i2c->cmd_complete);
i2c->cmd_err = 0;

ret = mxs_i2c_dma_setup_xfer(adap, msg, flags);
Expand Down Expand Up @@ -473,6 +473,8 @@ static int mxs_i2c_probe(struct platform_device *pdev)
i2c->dev = dev;
i2c->speed = &mxs_i2c_95kHz_config;

init_completion(&i2c->cmd_complete);

if (dev->of_node) {
err = mxs_i2c_get_ofdata(i2c);
if (err)
Expand Down
6 changes: 3 additions & 3 deletions drivers/i2c/busses/i2c-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ static int errata_omap3_i462(struct omap_i2c_dev *dev)
if (stat & OMAP_I2C_STAT_AL) {
dev_err(dev->dev, "Arbitration lost\n");
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;
Expand Down Expand Up @@ -963,7 +963,7 @@ omap_i2c_isr_thread(int this_irq, void *dev_id)
i2c_omap_errata_i207(dev, stat);

omap_i2c_ack_stat(dev, OMAP_I2C_STAT_RDR);
break;
continue;
}

if (stat & OMAP_I2C_STAT_RRDY) {
Expand All @@ -989,7 +989,7 @@ omap_i2c_isr_thread(int this_irq, void *dev_id)
break;

omap_i2c_ack_stat(dev, OMAP_I2C_STAT_XDR);
break;
continue;
}

if (stat & OMAP_I2C_STAT_XRDY) {
Expand Down
4 changes: 4 additions & 0 deletions drivers/i2c/busses/i2c-sirf.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <linux/slab.h>
#include <linux/platform_device.h>
#include <linux/i2c.h>
#include <linux/of_i2c.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/io.h>
Expand Down Expand Up @@ -328,6 +329,7 @@ static int i2c_sirfsoc_probe(struct platform_device *pdev)
adap->algo = &i2c_sirfsoc_algo;
adap->algo_data = siic;

adap->dev.of_node = pdev->dev.of_node;
adap->dev.parent = &pdev->dev;
adap->nr = pdev->id;

Expand Down Expand Up @@ -371,6 +373,8 @@ static int i2c_sirfsoc_probe(struct platform_device *pdev)

clk_disable(clk);

of_i2c_register_devices(adap);

dev_info(&pdev->dev, " I2C adapter ready to operate\n");

return 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/muxes/i2c-mux-pinctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static int i2c_mux_pinctrl_probe(struct platform_device *pdev)
}

mux->busses = devm_kzalloc(&pdev->dev,
sizeof(mux->busses) * mux->pdata->bus_count,
sizeof(*mux->busses) * mux->pdata->bus_count,
GFP_KERNEL);
if (!mux->busses) {
dev_err(&pdev->dev, "Cannot allocate busses\n");
Expand Down

0 comments on commit acc5da0

Please sign in to comment.