From: Linus Torvalds Date: Sat, 28 Jul 2012 20:43:12 +0000 (-0700) Subject: Merge branch 'i2c-embedded/for-next' of git://git.pengutronix.de/git/wsa/linux X-Git-Tag: accepted/tizen/common/20141203.182822~4086 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a410963ba4c0c768302f0298e258b1ee940e8316;p=platform%2Fkernel%2Flinux-arm64.git Merge branch 'i2c-embedded/for-next' of git://git.pengutronix.de/git/wsa/linux Pull embedded i2c changes from Wolfram Sang: "Changes for the "embedded" part of the I2C subsystem: - lots of devicetree conversions of drivers (and preparations for that) - big cleanups for drivers for OMAP, Tegra, Nomadik, Blackfin - Rafael's struct dev_pm_ops conversion patches for I2C - usual driver cleanups and fixes All patches have been in linux-next for an apropriate time and all patches touching files outside of i2c-folders should have proper acks from the maintainers." * 'i2c-embedded/for-next' of git://git.pengutronix.de/git/wsa/linux: (60 commits) Revert "i2c: tegra: convert normal suspend/resume to *_noirq" I2C: MV64XYZ: Add Device Tree support i2c: stu300: use devm managed resources i2c: i2c-ocores: support for 16bit and 32bit IO V4L/DVB: mfd: use reg_shift instead of regstep i2c: i2c-ocores: Use reg-shift property i2c: i2c-ocores: DT bindings and minor fixes. i2c: mv64xxxx: remove EXPERIMENTAL tag i2c-s3c2410: Use plain pm_runtime_put() i2c: s3c2410: Fix pointer type passed to of_match_node() i2c: mxs: Set I2C timing registers for mxs-i2c i2c: i2c-bfin-twi: Move blackfin TWI register access Macro to head file. i2c: i2c-bfin-twi: Move TWI peripheral pin request array to platform data. i2c:i2c-bfin-twi: include twi head file i2c:i2c-bfin-twi: TWI fails to restart next transfer in high system load. i2c: i2c-bfin-twi: Tighten condition when failing I2C transfer if MEN bit is reset unexpectedly. i2c: i2c-bfin-twi: Break dead waiting loop if i2c device misbehaves. i2c: i2c-bfin-twi: Improve the patch for bug "Illegal i2c bus lock upon certain transfer scenarios". i2c: i2c-bfin-twi: Illegal i2c bus lock upon certain transfer scenarios. i2c-mv64xxxx: allow more than one driver instance ... Conflicts: drivers/i2c/busses/i2c-nomadik.c --- a410963ba4c0c768302f0298e258b1ee940e8316 diff --cc drivers/i2c/busses/i2c-nomadik.c index a92440d,e6b93f3..5e6f1ee --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c @@@ -965,12 -969,12 +969,11 @@@ static int nmk_i2c_probe(struct amba_de adap->owner = THIS_MODULE; adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD; adap->algo = &nmk_i2c_algo; - adap->timeout = pdata->timeout ? msecs_to_jiffies(pdata->timeout) : - msecs_to_jiffies(20000); + adap->timeout = msecs_to_jiffies(pdata->timeout); + adap->nr = atomic_read(&adapter_id); snprintf(adap->name, sizeof(adap->name), - "Nomadik I2C%d at %lx", pdev->id, (unsigned long)res->start); - - /* fetch the controller id */ - adap->nr = pdev->id; + "Nomadik I2C%d at %pR", adap->nr, &adev->res); + atomic_inc(&adapter_id); /* fetch the controller configuration from machine */ dev->cfg.clk_freq = pdata->clk_freq; diff --cc drivers/i2c/busses/i2c-tegra.c index 3da7ee3,f85dee5..66eb53f --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@@ -546,10 -563,16 +563,16 @@@ static int tegra_i2c_xfer(struct i2c_ad if (i2c_dev->is_suspended) return -EBUSY; - clk_enable(i2c_dev->clk); + clk_prepare_enable(i2c_dev->clk); for (i = 0; i < num; i++) { - int stop = (i == (num - 1)) ? 1 : 0; - ret = tegra_i2c_xfer_msg(i2c_dev, &msgs[i], stop); + enum msg_end_type end_type = MSG_END_STOP; + if (i < (num - 1)) { + if (msgs[i + 1].flags & I2C_M_NOSTART) + end_type = MSG_END_CONTINUE; + else + end_type = MSG_END_REPEAT_START; + } + ret = tegra_i2c_xfer_msg(i2c_dev, &msgs[i], end_type); if (ret) break; } @@@ -657,16 -671,17 +671,17 @@@ static int __devinit tegra_i2c_probe(st ret = tegra_i2c_init(i2c_dev); if (ret) { dev_err(&pdev->dev, "Failed to initialize i2c controller"); - goto err_free; + return ret; } - ret = request_irq(i2c_dev->irq, tegra_i2c_isr, 0, pdev->name, i2c_dev); + ret = devm_request_irq(&pdev->dev, i2c_dev->irq, + tegra_i2c_isr, 0, pdev->name, i2c_dev); if (ret) { dev_err(&pdev->dev, "Failed to request irq %i\n", i2c_dev->irq); - goto err_free; + return ret; } - clk_enable(i2c_dev->i2c_clk); + clk_prepare_enable(i2c_dev->i2c_clk); i2c_set_adapdata(&i2c_dev->adapter, i2c_dev); i2c_dev->adapter.owner = THIS_MODULE;