Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 148943
b: refs/heads/master
c: baf46b4
h: refs/heads/master
i:
  148941: 041b7f5
  148939: d960507
  148935: 6439d04
  148927: a8e026b
v: v3
  • Loading branch information
Aaro Koskinen authored and Ben Dooks committed Jun 13, 2009
1 parent 765cdf1 commit e15d4a7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 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: e0cd2dd5dd2b7c6512e46ce0b4f119cd7b0c74a4
refs/heads/master: baf46b4e378d7950dff7ba30cfd50ff585987cb4
25 changes: 18 additions & 7 deletions trunk/drivers/i2c/busses/i2c-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,17 +343,28 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)

/* If configured for High Speed */
if (dev->speed > 400) {
unsigned long scl;

/* For first phase of HS mode */
fsscll = internal_clk / (400 * 2) - 6;
fssclh = internal_clk / (400 * 2) - 6;
scl = internal_clk / 400;
fsscll = scl - (scl / 3) - 7;
fssclh = (scl / 3) - 5;

/* For second phase of HS mode */
hsscll = fclk_rate / (dev->speed * 2) - 6;
hssclh = fclk_rate / (dev->speed * 2) - 6;
scl = fclk_rate / dev->speed;
hsscll = scl - (scl / 3) - 7;
hssclh = (scl / 3) - 5;
} else if (dev->speed > 100) {
unsigned long scl;

/* Fast mode */
scl = internal_clk / dev->speed;
fsscll = scl - (scl / 3) - 7;
fssclh = (scl / 3) - 5;
} else {
/* To handle F/S modes */
fsscll = internal_clk / (dev->speed * 2) - 6;
fssclh = internal_clk / (dev->speed * 2) - 6;
/* Standard mode */
fsscll = internal_clk / (dev->speed * 2) - 7;
fssclh = internal_clk / (dev->speed * 2) - 5;
}
scll = (hsscll << OMAP_I2C_SCLL_HSSCLL) | fsscll;
sclh = (hssclh << OMAP_I2C_SCLH_HSSCLH) | fssclh;
Expand Down

0 comments on commit e15d4a7

Please sign in to comment.