From bd60f9f0fe38428c16c487c2c0a34c066f567302 Mon Sep 17 00:00:00 2001 From: Kenneth Waters Date: Mon, 25 Apr 2011 12:29:54 -0600 Subject: [PATCH] --- yaml --- r: 250833 b: refs/heads/master c: 65a1a0ace554d61ea5a90377a54df1505275c1b1 h: refs/heads/master i: 250831: 3f7c47c33dd8cbbfd9e621cab016990c03b445a3 v: v3 --- [refs] | 2 +- trunk/drivers/i2c/busses/i2c-sh_mobile.c | 19 ++++++------------- trunk/drivers/i2c/busses/i2c-tegra.c | 5 +++++ trunk/include/linux/i2c/i2c-sh_mobile.h | 10 ---------- 4 files changed, 12 insertions(+), 24 deletions(-) delete mode 100644 trunk/include/linux/i2c/i2c-sh_mobile.h diff --git a/[refs] b/[refs] index f41db6c661d8..8bd9b14516ef 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 81f8115305f821335cf9e16110bf0806f7b93283 +refs/heads/master: 65a1a0ace554d61ea5a90377a54df1505275c1b1 diff --git a/trunk/drivers/i2c/busses/i2c-sh_mobile.c b/trunk/drivers/i2c/busses/i2c-sh_mobile.c index d917dd1cc091..2707f5e17158 100644 --- a/trunk/drivers/i2c/busses/i2c-sh_mobile.c +++ b/trunk/drivers/i2c/busses/i2c-sh_mobile.c @@ -32,7 +32,6 @@ #include #include #include -#include /* Transmit operation: */ /* */ @@ -118,7 +117,7 @@ struct sh_mobile_i2c_data { struct device *dev; void __iomem *reg; struct i2c_adapter adap; - unsigned long bus_speed; + struct clk *clk; u_int8_t icic; u_int8_t iccl; @@ -206,7 +205,7 @@ static void activate_ch(struct sh_mobile_i2c_data *pd) * We also round off the result. */ num = i2c_clk * 5; - denom = pd->bus_speed * 9; + denom = NORMAL_SPEED * 9; tmp = num * 10 / denom; if (tmp % 10 >= 5) pd->iccl = (u_int8_t)((num/denom) + 1); @@ -575,10 +574,10 @@ static int sh_mobile_i2c_hook_irqs(struct platform_device *dev, int hook) static int sh_mobile_i2c_probe(struct platform_device *dev) { - struct i2c_sh_mobile_platform_data *pdata = dev->dev.platform_data; struct sh_mobile_i2c_data *pd; struct i2c_adapter *adap; struct resource *res; + char clk_name[8]; int size; int ret; @@ -588,9 +587,10 @@ static int sh_mobile_i2c_probe(struct platform_device *dev) return -ENOMEM; } - pd->clk = clk_get(&dev->dev, NULL); + snprintf(clk_name, sizeof(clk_name), "i2c%d", dev->id); + pd->clk = clk_get(&dev->dev, clk_name); if (IS_ERR(pd->clk)) { - dev_err(&dev->dev, "cannot get clock\n"); + dev_err(&dev->dev, "cannot get clock \"%s\"\n", clk_name); ret = PTR_ERR(pd->clk); goto err; } @@ -620,11 +620,6 @@ static int sh_mobile_i2c_probe(struct platform_device *dev) goto err_irq; } - /* Use platformd data bus speed or NORMAL_SPEED */ - pd->bus_speed = NORMAL_SPEED; - if (pdata && pdata->bus_speed) - pd->bus_speed = pdata->bus_speed; - /* The IIC blocks on SH-Mobile ARM processors * come with two new bits in ICIC. */ @@ -665,8 +660,6 @@ static int sh_mobile_i2c_probe(struct platform_device *dev) goto err_all; } - dev_info(&dev->dev, "I2C adapter %d with bus speed %lu Hz\n", - adap->nr, pd->bus_speed); return 0; err_all: diff --git a/trunk/drivers/i2c/busses/i2c-tegra.c b/trunk/drivers/i2c/busses/i2c-tegra.c index b4ab39b741eb..5f1b92c74bd9 100644 --- a/trunk/drivers/i2c/busses/i2c-tegra.c +++ b/trunk/drivers/i2c/busses/i2c-tegra.c @@ -330,6 +330,11 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev) i2c_writel(i2c_dev, 0, I2C_INT_MASK); clk_set_rate(i2c_dev->clk, i2c_dev->bus_clk_rate * 8); + if (!i2c_dev->is_dvc) { + u32 sl_cfg = i2c_readl(i2c_dev, I2C_SL_CNFG); + i2c_writel(i2c_dev, sl_cfg | I2C_SL_CNFG_NEWSL, I2C_SL_CNFG); + } + val = 7 << I2C_FIFO_CONTROL_TX_TRIG_SHIFT | 0 << I2C_FIFO_CONTROL_RX_TRIG_SHIFT; i2c_writel(i2c_dev, val, I2C_FIFO_CONTROL); diff --git a/trunk/include/linux/i2c/i2c-sh_mobile.h b/trunk/include/linux/i2c/i2c-sh_mobile.h deleted file mode 100644 index beda7081aead..000000000000 --- a/trunk/include/linux/i2c/i2c-sh_mobile.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __I2C_SH_MOBILE_H__ -#define __I2C_SH_MOBILE_H__ - -#include - -struct i2c_sh_mobile_platform_data { - unsigned long bus_speed; -}; - -#endif /* __I2C_SH_MOBILE_H__ */