Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250833
b: refs/heads/master
c: 65a1a0a
h: refs/heads/master
i:
  250831: 3f7c47c
v: v3
  • Loading branch information
Kenneth Waters authored and Ben Dooks committed May 11, 2011
1 parent 3bffb60 commit bd60f9f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 81f8115305f821335cf9e16110bf0806f7b93283
refs/heads/master: 65a1a0ace554d61ea5a90377a54df1505275c1b1
19 changes: 6 additions & 13 deletions trunk/drivers/i2c/busses/i2c-sh_mobile.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/slab.h>
#include <linux/i2c/i2c-sh_mobile.h>

/* Transmit operation: */
/* */
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand All @@ -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;
}
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/i2c/busses/i2c-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 0 additions & 10 deletions trunk/include/linux/i2c/i2c-sh_mobile.h

This file was deleted.

0 comments on commit bd60f9f

Please sign in to comment.