Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284894
b: refs/heads/master
c: 3b98409
h: refs/heads/master
v: v3
  • Loading branch information
Tomi Valkeinen committed Dec 2, 2011
1 parent c5b6999 commit 973dbb1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 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: 522a0c2fe58fb6eb145cce07a303857b08322a2b
refs/heads/master: 3b98409eb7508ce534243312c3a9ac8543c06808
25 changes: 20 additions & 5 deletions trunk/drivers/video/omap2/dss/dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,14 +418,29 @@ static void dsi_completion_handler(void *data, u32 mask)
static inline int wait_for_bit_change(struct platform_device *dsidev,
const struct dsi_reg idx, int bitnum, int value)
{
int t = 100000;
unsigned long timeout;
ktime_t wait;
int t;

/* first busyloop to see if the bit changes right away */
t = 100;
while (t-- > 0) {
if (REG_GET(dsidev, idx, bitnum, bitnum) == value)
return value;
}

/* then loop for 500ms, sleeping for 1ms in between */
timeout = jiffies + msecs_to_jiffies(500);
while (time_before(jiffies, timeout)) {
if (REG_GET(dsidev, idx, bitnum, bitnum) == value)
return value;

while (REG_GET(dsidev, idx, bitnum, bitnum) != value) {
if (--t == 0)
return !value;
wait = ns_to_ktime(1000 * 1000);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_hrtimeout(&wait, HRTIMER_MODE_REL);
}

return value;
return !value;
}

u8 dsi_get_pixel_size(enum omap_dss_dsi_pixel_format fmt)
Expand Down

0 comments on commit 973dbb1

Please sign in to comment.