mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
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
This commit is contained in:
commit
2e2d8c93ae
4 changed files with 21 additions and 12 deletions
|
@ -405,6 +405,7 @@ static int diolan_usb_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ret = num;
|
||||||
abort:
|
abort:
|
||||||
sret = diolan_i2c_stop(dev);
|
sret = diolan_i2c_stop(dev);
|
||||||
if (sret < 0 && ret >= 0)
|
if (sret < 0 && ret >= 0)
|
||||||
|
|
|
@ -350,10 +350,6 @@ static void setup_i2c_controller(struct nmk_i2c_dev *dev)
|
||||||
|
|
||||||
i2c_clk = clk_get_rate(dev->clk);
|
i2c_clk = clk_get_rate(dev->clk);
|
||||||
|
|
||||||
/* fallback to std. mode if machine has not provided it */
|
|
||||||
if (dev->cfg.clk_freq == 0)
|
|
||||||
dev->cfg.clk_freq = 100000;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The spec says, in case of std. mode the divider is
|
* The spec says, in case of std. mode the divider is
|
||||||
* 2 whereas it is 3 for fast and fastplus mode of
|
* 2 whereas it is 3 for fast and fastplus mode of
|
||||||
|
@ -911,20 +907,32 @@ static const struct i2c_algorithm nmk_i2c_algo = {
|
||||||
.functionality = nmk_i2c_functionality
|
.functionality = nmk_i2c_functionality
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static struct nmk_i2c_controller u8500_i2c = {
|
||||||
|
/*
|
||||||
|
* Slave data setup time; 250ns, 100ns, and 10ns, which
|
||||||
|
* is 14, 6 and 2 respectively for a 48Mhz i2c clock.
|
||||||
|
*/
|
||||||
|
.slsu = 0xe,
|
||||||
|
.tft = 1, /* Tx FIFO threshold */
|
||||||
|
.rft = 8, /* Rx FIFO threshold */
|
||||||
|
.clk_freq = 400000, /* fast mode operation */
|
||||||
|
.timeout = 200, /* Slave response timeout(ms) */
|
||||||
|
.sm = I2C_FREQ_MODE_FAST,
|
||||||
|
};
|
||||||
|
|
||||||
static atomic_t adapter_id = ATOMIC_INIT(0);
|
static atomic_t adapter_id = ATOMIC_INIT(0);
|
||||||
|
|
||||||
static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id)
|
static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
struct nmk_i2c_controller *pdata =
|
struct nmk_i2c_controller *pdata = adev->dev.platform_data;
|
||||||
adev->dev.platform_data;
|
|
||||||
struct nmk_i2c_dev *dev;
|
struct nmk_i2c_dev *dev;
|
||||||
struct i2c_adapter *adap;
|
struct i2c_adapter *adap;
|
||||||
|
|
||||||
if (!pdata) {
|
if (!pdata)
|
||||||
dev_warn(&adev->dev, "no platform data\n");
|
/* No i2c configuration found, using the default. */
|
||||||
return -ENODEV;
|
pdata = &u8500_i2c;
|
||||||
}
|
|
||||||
dev = kzalloc(sizeof(struct nmk_i2c_dev), GFP_KERNEL);
|
dev = kzalloc(sizeof(struct nmk_i2c_dev), GFP_KERNEL);
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
dev_err(&adev->dev, "cannot allocate memory\n");
|
dev_err(&adev->dev, "cannot allocate memory\n");
|
||||||
|
|
|
@ -584,7 +584,7 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
|
||||||
|
|
||||||
r = pm_runtime_get_sync(dev->dev);
|
r = pm_runtime_get_sync(dev->dev);
|
||||||
if (IS_ERR_VALUE(r))
|
if (IS_ERR_VALUE(r))
|
||||||
return r;
|
goto out;
|
||||||
|
|
||||||
r = omap_i2c_wait_for_bb(dev);
|
r = omap_i2c_wait_for_bb(dev);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
|
|
|
@ -712,7 +712,7 @@ static int __devexit tegra_i2c_remove(struct platform_device *pdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM_SLEEP
|
||||||
static int tegra_i2c_suspend(struct device *dev)
|
static int tegra_i2c_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev);
|
struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev);
|
||||||
|
|
Loading…
Reference in a new issue