Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73361
b: refs/heads/master
c: 91bc51d
h: refs/heads/master
i:
  73359: 19c09b1
v: v3
  • Loading branch information
Russell King authored and Russell King committed Nov 8, 2007
1 parent 46ba039 commit b1b2aa7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 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: c2ec21c5c8f15c079c209f403d582f3134785060
refs/heads/master: 91bc51d8a10b00d8233dd5b6f07d7eb40828b87d
23 changes: 14 additions & 9 deletions trunk/arch/arm/mach-pxa/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ pxa_ost0_interrupt(int irq, void *dev_id)
if (c->mode == CLOCK_EVT_MODE_ONESHOT) {
/* Disarm the compare/match, signal the event. */
OIER &= ~OIER_E0;
OSSR = OSSR_M0;
c->event_handler(c);
} else if (c->mode == CLOCK_EVT_MODE_PERIODIC) {
/* Call the event handler as many times as necessary
Expand Down Expand Up @@ -100,9 +101,9 @@ pxa_ost0_interrupt(int irq, void *dev_id)
* anything that might put us "very close".
*/
#define MIN_OSCR_DELTA 16
do {
do {
OSSR = OSSR_M0;
next_match = (OSMR0 += LATCH);
next_match = (OSMR0 += LATCH);
c->event_handler(c);
} while (((signed long)(next_match - OSCR) <= MIN_OSCR_DELTA)
&& (c->mode == CLOCK_EVT_MODE_PERIODIC));
Expand All @@ -114,14 +115,16 @@ pxa_ost0_interrupt(int irq, void *dev_id)
static int
pxa_osmr0_set_next_event(unsigned long delta, struct clock_event_device *dev)
{
unsigned long irqflags;
unsigned long flags, next, oscr;

raw_local_irq_save(irqflags);
OSMR0 = OSCR + delta;
OSSR = OSSR_M0;
raw_local_irq_save(flags);
OIER |= OIER_E0;
raw_local_irq_restore(irqflags);
return 0;
next = OSCR + delta;
OSMR0 = next;
oscr = OSCR;
raw_local_irq_restore(flags);

return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0;
}

static void
Expand All @@ -132,15 +135,16 @@ pxa_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *dev)
switch (mode) {
case CLOCK_EVT_MODE_PERIODIC:
raw_local_irq_save(irqflags);
OSMR0 = OSCR + LATCH;
OSSR = OSSR_M0;
OIER |= OIER_E0;
OSMR0 = OSCR + LATCH;
raw_local_irq_restore(irqflags);
break;

case CLOCK_EVT_MODE_ONESHOT:
raw_local_irq_save(irqflags);
OIER &= ~OIER_E0;
OSSR = OSSR_M0;
raw_local_irq_restore(irqflags);
break;

Expand All @@ -149,6 +153,7 @@ pxa_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *dev)
/* initializing, released, or preparing for suspend */
raw_local_irq_save(irqflags);
OIER &= ~OIER_E0;
OSSR = OSSR_M0;
raw_local_irq_restore(irqflags);
break;

Expand Down

0 comments on commit b1b2aa7

Please sign in to comment.