diff options
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r-- | arch/arm/mach-pxa/mfp.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-pxa/pxa300.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-pxa/pxa320.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-pxa/pxa3xx.c | 39 | ||||
-rw-r--r-- | arch/arm/mach-pxa/time.c | 26 | ||||
-rw-r--r-- | arch/arm/mach-pxa/zylonite.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-pxa/zylonite_pxa300.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-pxa/zylonite_pxa320.c | 2 |
8 files changed, 54 insertions, 23 deletions
diff --git a/arch/arm/mach-pxa/mfp.c b/arch/arm/mach-pxa/mfp.c index 5cd3cadbbd1..436f9657496 100644 --- a/arch/arm/mach-pxa/mfp.c +++ b/arch/arm/mach-pxa/mfp.c @@ -5,7 +5,7 @@ * * Copyright (C) 2007 Marvell Internation Ltd. * - * 2007-08-21: eric miao <eric.y.miao@gmail.com> + * 2007-08-21: eric miao <eric.miao@marvell.com> * initial version * * This program is free software; you can redistribute it and/or modify diff --git a/arch/arm/mach-pxa/pxa300.c b/arch/arm/mach-pxa/pxa300.c index 7a34231f317..0a0d3877f21 100644 --- a/arch/arm/mach-pxa/pxa300.c +++ b/arch/arm/mach-pxa/pxa300.c @@ -5,7 +5,7 @@ * * Copyright (C) 2007 Marvell Internation Ltd. * - * 2007-08-21: eric miao <eric.y.miao@gmail.com> + * 2007-08-21: eric miao <eric.miao@marvell.com> * initial version * * This program is free software; you can redistribute it and/or modify diff --git a/arch/arm/mach-pxa/pxa320.c b/arch/arm/mach-pxa/pxa320.c index cd9eba5b3df..1010f77d977 100644 --- a/arch/arm/mach-pxa/pxa320.c +++ b/arch/arm/mach-pxa/pxa320.c @@ -5,7 +5,7 @@ * * Copyright (C) 2007 Marvell Internation Ltd. * - * 2007-08-21: eric miao <eric.y.miao@gmail.com> + * 2007-08-21: eric miao <eric.miao@marvell.com> * initial version * * This program is free software; you can redistribute it and/or modify diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c index 39f0de8c189..61d9c9d69e6 100644 --- a/arch/arm/mach-pxa/pxa3xx.c +++ b/arch/arm/mach-pxa/pxa3xx.c @@ -5,7 +5,7 @@ * * Copyright (C) 2006 Marvell International Ltd. * - * 2007-09-02: eric miao <eric.y.miao@gmail.com> + * 2007-09-02: eric miao <eric.miao@marvell.com> * initial version * * This program is free software; you can redistribute it and/or modify @@ -150,22 +150,45 @@ static void clk_pxa3xx_cken_disable(struct clk *clk) local_irq_enable(); } +static const struct clkops clk_pxa3xx_cken_ops = { + .enable = clk_pxa3xx_cken_enable, + .disable = clk_pxa3xx_cken_disable, +}; + static const struct clkops clk_pxa3xx_hsio_ops = { .enable = clk_pxa3xx_cken_enable, .disable = clk_pxa3xx_cken_disable, .getrate = clk_pxa3xx_hsio_getrate, }; +#define PXA3xx_CKEN(_name, _cken, _rate, _delay, _dev) \ + { \ + .name = _name, \ + .dev = _dev, \ + .ops = &clk_pxa3xx_cken_ops, \ + .rate = _rate, \ + .cken = CKEN_##_cken, \ + .delay = _delay, \ + } + +#define PXA3xx_CK(_name, _cken, _ops, _dev) \ + { \ + .name = _name, \ + .dev = _dev, \ + .ops = _ops, \ + .cken = CKEN_##_cken, \ + } + static struct clk pxa3xx_clks[] = { - INIT_CK("LCDCLK", LCD, &clk_pxa3xx_hsio_ops, &pxa_device_fb.dev), - INIT_CK("CAMCLK", CAMERA, &clk_pxa3xx_hsio_ops, NULL), + PXA3xx_CK("LCDCLK", LCD, &clk_pxa3xx_hsio_ops, &pxa_device_fb.dev), + PXA3xx_CK("CAMCLK", CAMERA, &clk_pxa3xx_hsio_ops, NULL), - INIT_CKEN("UARTCLK", FFUART, 14857000, 1, &pxa_device_ffuart.dev), - INIT_CKEN("UARTCLK", BTUART, 14857000, 1, &pxa_device_btuart.dev), - INIT_CKEN("UARTCLK", STUART, 14857000, 1, NULL), + PXA3xx_CKEN("UARTCLK", FFUART, 14857000, 1, &pxa_device_ffuart.dev), + PXA3xx_CKEN("UARTCLK", BTUART, 14857000, 1, &pxa_device_btuart.dev), + PXA3xx_CKEN("UARTCLK", STUART, 14857000, 1, NULL), - INIT_CKEN("I2CCLK", I2C, 32842000, 0, &pxa_device_i2c.dev), - INIT_CKEN("UDCCLK", UDC, 48000000, 5, &pxa_device_udc.dev), + PXA3xx_CKEN("I2CCLK", I2C, 32842000, 0, &pxa_device_i2c.dev), + PXA3xx_CKEN("UDCCLK", UDC, 48000000, 5, &pxa_device_udc.dev), }; void __init pxa3xx_init_irq(void) diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c index ec4286c7931..fbfa1920353 100644 --- a/arch/arm/mach-pxa/time.c +++ b/arch/arm/mach-pxa/time.c @@ -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 @@ -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)); @@ -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 @@ -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; @@ -149,8 +153,12 @@ 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; + + case CLOCK_EVT_MODE_RESUME: + break; } } diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c index 3f18d760dd1..743a87b2faa 100644 --- a/arch/arm/mach-pxa/zylonite.c +++ b/arch/arm/mach-pxa/zylonite.c @@ -5,7 +5,7 @@ * * Copyright (C) 2006 Marvell International Ltd. * - * 2007-09-04: eric miao <eric.y.miao@gmail.com> + * 2007-09-04: eric miao <eric.miao@marvell.com> * rewrite to align with latest kernel * * This program is free software; you can redistribute it and/or modify diff --git a/arch/arm/mach-pxa/zylonite_pxa300.c b/arch/arm/mach-pxa/zylonite_pxa300.c index b5fbd2f4c69..1832bc31650 100644 --- a/arch/arm/mach-pxa/zylonite_pxa300.c +++ b/arch/arm/mach-pxa/zylonite_pxa300.c @@ -5,7 +5,7 @@ * PXA3xx Development Platform (aka Zylonite) * * Copyright (C) 2007 Marvell Internation Ltd. - * 2007-08-21: eric miao <eric.y.miao@gmail.com> + * 2007-08-21: eric miao <eric.miao@marvell.com> * initial version * * This program is free software; you can redistribute it and/or modify diff --git a/arch/arm/mach-pxa/zylonite_pxa320.c b/arch/arm/mach-pxa/zylonite_pxa320.c index 63cb36be086..94c715808b5 100644 --- a/arch/arm/mach-pxa/zylonite_pxa320.c +++ b/arch/arm/mach-pxa/zylonite_pxa320.c @@ -5,7 +5,7 @@ * PXA3xx Development Platform (aka Zylonite) * * Copyright (C) 2007 Marvell Internation Ltd. - * 2007-08-21: eric miao <eric.y.miao@gmail.com> + * 2007-08-21: eric miao <eric.miao@marvell.com> * initial version * * This program is free software; you can redistribute it and/or modify |