projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7c6bd20
)
i2c-pnx: Limit maximum divider to 1023
author
Kevin Wells
<
[email protected]
>
Tue, 16 Mar 2010 22:55:36 +0000
(15:55 -0700)
committer
Ben Dooks
<
[email protected]
>
Tue, 20 Apr 2010 00:16:57 +0000
(
01:16
+0100)
Limit maximum divider to 0x3ff to divider computations. On high I2C
parent clock rates, the divider can exceed 0x3ff. This will help
prevent some very odd clock rates.
Signed-off-by: Kevin Wells <
[email protected]
>
Signed-off-by: Ben Dooks <
[email protected]
>
drivers/i2c/busses/i2c-pnx.c
patch
|
blob
|
history
diff --git
a/drivers/i2c/busses/i2c-pnx.c
b/drivers/i2c/busses/i2c-pnx.c
index 247103372a066ae35fd418089f8ecaa076497211..68fa415d9ad552a93e8cf65164b184bd6a76bae1 100644
(file)
--- a/
drivers/i2c/busses/i2c-pnx.c
+++ b/
drivers/i2c/busses/i2c-pnx.c
@@
-633,6
+633,8
@@
static int __devinit i2c_pnx_probe(struct platform_device *pdev)
*/
tmp = ((freq / 1000) / I2C_PNX_SPEED_KHZ) / 2 - 2;
+ if (tmp > 0x3FF)
+ tmp = 0x3FF;
iowrite32(tmp, I2C_REG_CKH(alg_data));
iowrite32(tmp, I2C_REG_CKL(alg_data));