aboutsummaryrefslogtreecommitdiff
path: root/drivers/clocksource/mmio.c
AgeCommit message (Collapse)AuthorFilesLines
2014-05-23clocksource: Fix clocksource_mmio_readX_downXiubo Li1-2/+2
For some clocksource devices, for example, the registers are 32-bit, while the lower 16-bit is used for timer counting(And reading the upper 16-bit will return 0). For example, when the counter value is 0x00001111, and then the ~readl_relaxed(to_mmio_clksrc(c)->reg) will return the value of 0xFFFFEEEE, but it should be 0x0000EEEE. So just using the c->mask to mask the unused bits. Signed-off-by: Xiubo Li <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]>
2014-05-23clocksource: Fix type confusion for clocksource_mmio_readX_YXiubo Li1-4/+4
The types' definations are: o cycle_t -> u64 o readl_relaxed -> u32 o readw_relaxed -> u16 So let clocksource_mmio_readX_Ys return a cast to cycle_t, though this maybe look reduntant sometimes, it make sense and they will be more readable and less confusion... This patch clarifies the functions type and fix it. Signed-off-by: Xiubo Li <[email protected]> Cc: Daniel Lezcano <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]>
2011-05-23clocksource: add common mmio clocksourceRussell King1-0/+73
Add a generic mmio clocksource, covering both 32-bit and 16-bit register access sizes, for up or down counters. This can be used to easily create clocksources for simple counter-based implementations. Cc: Alessandro Rubini <[email protected]> Cc: Colin Cross <[email protected]> Cc: Eric Miao <[email protected]> Cc: Erik Gilling <[email protected]> Acked-by: "Hans J. Koch" <[email protected]> Cc: Imre Kaloz <[email protected]> Cc: Krzysztof Halasa <[email protected]> Cc: Kukjin Kim <[email protected]> Cc: Lennert Buytenhek <[email protected]> Cc: Linus Walleij <[email protected]> Cc: [email protected] Acked-by: Nicolas Pitre <[email protected]> Cc: Olof Johansson <[email protected]> Tested-by: Sascha Hauer <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Tested-by: Tony Lindgren <[email protected]> Reviewed-by: Viresh Kumar <[email protected]> Cc: Wan ZongShun <[email protected]> Signed-off-by: Russell King <[email protected]>