aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-08-22 13:41:36 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-08-22 13:41:36 -0400
commit2e2d8c93aec7c0f995bf140a00fb15ca2e07ddd4 (patch)
tree3d63494f9727262ea5c53da9d73577a04b14f493 /drivers
parentfec3c03fb07ac2acae03199fa7472a29a0d9b49d (diff)
parent371e67c9e1a82b5fd8110b9a25e36bbc3a99e8c7 (diff)
Merge branch 'i2c-embedded/for-current' of git://git.pengutronix.de/git/wsa/linux
Pull i2c-embedded fixes from Wolfram Sang: "Some bugfixes for the "embedded" part of the I2C subsystem. The fixes affect mostly drivers which have been largely reworked lately and where regressions appeared." * 'i2c-embedded/for-current' of git://git.pengutronix.de/git/wsa/linux: i2c: tegra: protect suspend/resume callbacks with CONFIG_PM_SLEEP i2c: diolan-u2c: Fix master_xfer return code I2C: OMAP: xfer: fix runtime PM get/put balance on error i2c: nomadik: Add default configuration into the Nomadik I2C driver
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/busses/i2c-diolan-u2c.c1
-rw-r--r--drivers/i2c/busses/i2c-nomadik.c28
-rw-r--r--drivers/i2c/busses/i2c-omap.c2
-rw-r--r--drivers/i2c/busses/i2c-tegra.c2
4 files changed, 21 insertions, 12 deletions
diff --git a/drivers/i2c/busses/i2c-diolan-u2c.c b/drivers/i2c/busses/i2c-diolan-u2c.c
index aedb94f34bf7..dae3ddfe7619 100644
--- a/drivers/i2c/busses/i2c-diolan-u2c.c
+++ b/drivers/i2c/busses/i2c-diolan-u2c.c
@@ -405,6 +405,7 @@ static int diolan_usb_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs,
405 } 405 }
406 } 406 }
407 } 407 }
408 ret = num;
408abort: 409abort:
409 sret = diolan_i2c_stop(dev); 410 sret = diolan_i2c_stop(dev);
410 if (sret < 0 && ret >= 0) 411 if (sret < 0 && ret >= 0)
diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c
index 5e6f1eed4f83..61b00edacb08 100644
--- a/drivers/i2c/busses/i2c-nomadik.c
+++ b/drivers/i2c/busses/i2c-nomadik.c
@@ -350,10 +350,6 @@ static void setup_i2c_controller(struct nmk_i2c_dev *dev)
350 350
351 i2c_clk = clk_get_rate(dev->clk); 351 i2c_clk = clk_get_rate(dev->clk);
352 352
353 /* fallback to std. mode if machine has not provided it */
354 if (dev->cfg.clk_freq == 0)
355 dev->cfg.clk_freq = 100000;
356
357 /* 353 /*
358 * The spec says, in case of std. mode the divider is 354 * The spec says, in case of std. mode the divider is
359 * 2 whereas it is 3 for fast and fastplus mode of 355 * 2 whereas it is 3 for fast and fastplus mode of
@@ -911,20 +907,32 @@ static const struct i2c_algorithm nmk_i2c_algo = {
911 .functionality = nmk_i2c_functionality 907 .functionality = nmk_i2c_functionality
912}; 908};
913 909
910static struct nmk_i2c_controller u8500_i2c = {
911 /*
912 * Slave data setup time; 250ns, 100ns, and 10ns, which
913 * is 14, 6 and 2 respectively for a 48Mhz i2c clock.
914 */
915 .slsu = 0xe,
916 .tft = 1, /* Tx FIFO threshold */
917 .rft = 8, /* Rx FIFO threshold */
918 .clk_freq = 400000, /* fast mode operation */
919 .timeout = 200, /* Slave response timeout(ms) */
920 .sm = I2C_FREQ_MODE_FAST,
921};
922
914static atomic_t adapter_id = ATOMIC_INIT(0); 923static atomic_t adapter_id = ATOMIC_INIT(0);
915 924
916static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id) 925static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id)
917{ 926{
918 int ret = 0; 927 int ret = 0;
919 struct nmk_i2c_controller *pdata = 928 struct nmk_i2c_controller *pdata = adev->dev.platform_data;
920 adev->dev.platform_data;
921 struct nmk_i2c_dev *dev; 929 struct nmk_i2c_dev *dev;
922 struct i2c_adapter *adap; 930 struct i2c_adapter *adap;
923 931
924 if (!pdata) { 932 if (!pdata)
925 dev_warn(&adev->dev, "no platform data\n"); 933 /* No i2c configuration found, using the default. */
926 return -ENODEV; 934 pdata = &u8500_i2c;
927 } 935
928 dev = kzalloc(sizeof(struct nmk_i2c_dev), GFP_KERNEL); 936 dev = kzalloc(sizeof(struct nmk_i2c_dev), GFP_KERNEL);
929 if (!dev) { 937 if (!dev) {
930 dev_err(&adev->dev, "cannot allocate memory\n"); 938 dev_err(&adev->dev, "cannot allocate memory\n");
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 6849635b268a..5d19a49803c1 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -584,7 +584,7 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
584 584
585 r = pm_runtime_get_sync(dev->dev); 585 r = pm_runtime_get_sync(dev->dev);
586 if (IS_ERR_VALUE(r)) 586 if (IS_ERR_VALUE(r))
587 return r; 587 goto out;
588 588
589 r = omap_i2c_wait_for_bb(dev); 589 r = omap_i2c_wait_for_bb(dev);
590 if (r < 0) 590 if (r < 0)
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index 66eb53fac202..9a08c57bc936 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -712,7 +712,7 @@ static int __devexit tegra_i2c_remove(struct platform_device *pdev)
712 return 0; 712 return 0;
713} 713}
714 714
715#ifdef CONFIG_PM 715#ifdef CONFIG_PM_SLEEP
716static int tegra_i2c_suspend(struct device *dev) 716static int tegra_i2c_suspend(struct device *dev)
717{ 717{
718 struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev); 718 struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev);