Skip to content

Commit

Permalink
I2C: OMAP2+: Solve array bounds overflow error on i2c idle
Browse files Browse the repository at this point in the history
This solves the main problem the patch series is about.  Prior
to this patch on OMAP3530 the driver wrongly interprets the I2C
peripheral unit's own reported revision as meaning it is running
on an IP V2 device and must use the extended registers.

In fact OMAP3530 is IP V1 with the smaller register set, the
reason for the confusion is that the hardware does in fact report
having the same IP revision index as is found on an OMAP4430,
which really is IP V2 and has the extended registers.

This corrects the test for which registers to use so that it
decides using hwmod knowledge found in the platform_data.

Cc: [email protected]
Reported-by: Peter Maydell <[email protected]>
Signed-off-by: Andy Green <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
Acked-by: Ben Dooks <[email protected]>
Signed-off-by: Kevin Hilman <[email protected]>
  • Loading branch information
lws-team authored and Ben Dooks committed Oct 29, 2011
1 parent a129557 commit 6314f09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ static void omap_i2c_idle(struct omap_i2c_dev *dev)
pdata = pdev->dev.platform_data;

dev->iestate = omap_i2c_read_reg(dev, OMAP_I2C_IE_REG);
if (dev->rev >= OMAP_I2C_REV_ON_4430)
if (pdata->rev == OMAP_I2C_IP_VERSION_2)
omap_i2c_write_reg(dev, OMAP_I2C_IP_V2_IRQENABLE_CLR, 1);
else
omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, 0);
Expand Down

0 comments on commit 6314f09

Please sign in to comment.