summaryrefslogtreecommitdiff
path: root/arch/arm/mach-w90x900/time.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-09-01 12:10:20 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-01 12:10:20 -0700
commitc5fc249862af862df027030188cc083e072ecd19 (patch)
tree1205eaa47b07fc06b79e8c742a15dca5bcb1066c /arch/arm/mach-w90x900/time.c
parent00e3fcc221f6fe6a890bf3e0e71c6b9944e58233 (diff)
parent97a2482d9891f0ad6a3710e0b6ae9949c140c7f1 (diff)
downloadlinux-c5fc249862af862df027030188cc083e072ecd19.tar.gz
linux-c5fc249862af862df027030188cc083e072ecd19.tar.xz
Merge tag 'armsoc-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC cleanups from Olof Johansson: "A large cleanup branch this release, with a healthy 10k negative line delta. Most of this is removal of legacy (non-DT) support of shmobile platforms. There is also removal of two non-DT platforms on OMAP, and the plat-samsung directory is cleaned out by moving most of the previously shared-location-but-not-actually-shared files from there to the appropriate mach directories instead. There are other sets of changes in here as well: - Rob Herring removed use of set_irq_flags under all platforms and moved to genirq alternatives - a series of timer API conversions to set-state interface - ep93xx, nomadik and ux500 cleanups from Linus Walleij - __init annotation fixes from Nicolas Pitre + a bunch of other changes that all add up to a nice set of cleanups" * tag 'armsoc-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (108 commits) ARM/fb: ep93xx: switch framebuffer to use modedb only ARM: gemini: Setup timer3 as free running timer ARM: gemini: Use timer1 for clockevent ARM: gemini: Add missing register definitions for gemini timer ARM: ep93xx/timer: Migrate to new 'set-state' interface ARM: nomadik: push accelerometer down to boards ARM: nomadik: move l2x0 setup to device tree ARM: nomadik: selectively enable UART0 on boards ARM: nomadik: move hog code to use DT hogs ARM: shmobile: Fix mismerges ARM: ux500: simplify secondary CPU boot ARM: SAMSUNG: remove keypad-core header in plat-samsung ARM: SAMSUNG: local watchdog-reset header in mach-s3c64xx ARM: SAMSUNG: local onenand-core header in mach-s3c64xx ARM: SAMSUNG: local irq-uart header in mach-s3c64xx ARM: SAMSUNG: local backlight header in mach-s3c64xx ARM: SAMSUNG: local ata-core header in mach-s3c64xx ARM: SAMSUNG: local regs-usb-hsotg-phy header in mach-s3c64xx ARM: SAMSUNG: local spi-core header in mach-s3c24xx ARM: SAMSUNG: local nand-core header in mach-s3c24xx ...
Diffstat (limited to 'arch/arm/mach-w90x900/time.c')
-rw-r--r--arch/arm/mach-w90x900/time.c51
1 files changed, 28 insertions, 23 deletions
diff --git a/arch/arm/mach-w90x900/time.c b/arch/arm/mach-w90x900/time.c
index 9230d3725599..cd1966ec9143 100644
--- a/arch/arm/mach-w90x900/time.c
+++ b/arch/arm/mach-w90x900/time.c
@@ -48,31 +48,32 @@
static unsigned int timer0_load;
-static void nuc900_clockevent_setmode(enum clock_event_mode mode,
- struct clock_event_device *clk)
+static int nuc900_clockevent_shutdown(struct clock_event_device *evt)
{
- unsigned int val;
+ unsigned int val = __raw_readl(REG_TCSR0) & ~(0x03 << 27);
- val = __raw_readl(REG_TCSR0);
- val &= ~(0x03 << 27);
+ __raw_writel(val, REG_TCSR0);
+ return 0;
+}
+
+static int nuc900_clockevent_set_oneshot(struct clock_event_device *evt)
+{
+ unsigned int val = __raw_readl(REG_TCSR0) & ~(0x03 << 27);
- switch (mode) {
- case CLOCK_EVT_MODE_PERIODIC:
- __raw_writel(timer0_load, REG_TICR0);
- val |= (PERIOD | COUNTEN | INTEN | PRESCALE);
- break;
+ val |= (ONESHOT | COUNTEN | INTEN | PRESCALE);
- case CLOCK_EVT_MODE_ONESHOT:
- val |= (ONESHOT | COUNTEN | INTEN | PRESCALE);
- break;
+ __raw_writel(val, REG_TCSR0);
+ return 0;
+}
- case CLOCK_EVT_MODE_UNUSED:
- case CLOCK_EVT_MODE_SHUTDOWN:
- case CLOCK_EVT_MODE_RESUME:
- break;
- }
+static int nuc900_clockevent_set_periodic(struct clock_event_device *evt)
+{
+ unsigned int val = __raw_readl(REG_TCSR0) & ~(0x03 << 27);
+ __raw_writel(timer0_load, REG_TICR0);
+ val |= (PERIOD | COUNTEN | INTEN | PRESCALE);
__raw_writel(val, REG_TCSR0);
+ return 0;
}
static int nuc900_clockevent_setnextevent(unsigned long evt,
@@ -90,11 +91,15 @@ static int nuc900_clockevent_setnextevent(unsigned long evt,
}
static struct clock_event_device nuc900_clockevent_device = {
- .name = "nuc900-timer0",
- .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
- .set_mode = nuc900_clockevent_setmode,
- .set_next_event = nuc900_clockevent_setnextevent,
- .rating = 300,
+ .name = "nuc900-timer0",
+ .features = CLOCK_EVT_FEAT_PERIODIC |
+ CLOCK_EVT_FEAT_ONESHOT,
+ .set_state_shutdown = nuc900_clockevent_shutdown,
+ .set_state_periodic = nuc900_clockevent_set_periodic,
+ .set_state_oneshot = nuc900_clockevent_set_oneshot,
+ .tick_resume = nuc900_clockevent_shutdown,
+ .set_next_event = nuc900_clockevent_setnextevent,
+ .rating = 300,
};
/*IRQ handler for the timer*/