Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272446
b: refs/heads/master
c: 4ff895b
h: refs/heads/master
v: v3
  • Loading branch information
Jean-Hugues Deschenes authored and Ben Dooks committed Oct 29, 2011
1 parent b80ebff commit 52c22e2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 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: 7f279601c59b814314083d572e7c0df11d09cad8
refs/heads/master: 4ff895bc8b90e30ff8e89ca7bc6666b229c77e5d
17 changes: 13 additions & 4 deletions trunk/drivers/i2c/busses/i2c-designware.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
#define DW_IC_TXFLR 0x74
#define DW_IC_RXFLR 0x78
#define DW_IC_COMP_PARAM_1 0xf4
#define DW_IC_COMP_TYPE 0xfc
#define DW_IC_TX_ABRT_SOURCE 0x80

#define DW_IC_CON_MASTER 0x1
Expand Down Expand Up @@ -710,6 +711,7 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev)
struct i2c_adapter *adap;
struct resource *mem, *ioarea;
int irq, r;
u32 reg;

/* NOTE: driver uses the static register mapping */
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
Expand Down Expand Up @@ -756,12 +758,19 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev)
r = -EBUSY;
goto err_unuse_clocks;
}
{
u32 param1 = dw_readl(dev, DW_IC_COMP_PARAM_1);

dev->tx_fifo_depth = ((param1 >> 16) & 0xff) + 1;
dev->rx_fifo_depth = ((param1 >> 8) & 0xff) + 1;
reg = dw_readl(dev, DW_IC_COMP_TYPE);
if (reg != 0x44570140) {
dev_err(&pdev->dev, "Unknown Synopsys component type: "
"0x%08x\n", reg);
r = -ENODEV;
goto err_iounmap;
}

reg = dw_readl(dev, DW_IC_COMP_PARAM_1);
dev->tx_fifo_depth = ((reg >> 16) & 0xff) + 1;
dev->rx_fifo_depth = ((reg >> 8) & 0xff) + 1;

i2c_dw_init(dev);

dw_writel(dev, 0, DW_IC_INTR_MASK); /* disable IRQ */
Expand Down

0 comments on commit 52c22e2

Please sign in to comment.