aboutsummaryrefslogtreecommitdiff
path: root/drivers/clocksource/moxart_timer.c
AgeCommit message (Collapse)AuthorFilesLines
2016-12-19clocksource/drivers/moxart: Plug memory and mapping leaksSudip Mukherjee1-6/+16
If of_iomap() or any other subsequent function fails moxart_timer_init() exits without freeing memory and unmapping the timer base. Add proper cleanup points. Signed-off-by: Sudip Mukherjee <[email protected]> Cc: Daniel Lezcano <[email protected]> Cc: Sudip Mukherjee <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2016-09-12clocksource/drivers/moxart: Replace panic by pr_errDaniel Lezcano1-2/+4
The clksrc-of code is supposed to catch the return code and fail gracefully. Don't panic on error, but print the error and exit with a relevant error code. Signed-off-by: Daniel Lezcano <[email protected]> Acked-by: Joel Stanley <[email protected]>
2016-09-12clocksource/drivers/moxart: Replace setup_irq by request_irqDaniel Lezcano1-6/+2
Save memory space and line of code by replacing setup_irq by request_irq. Signed-off-by: Daniel Lezcano <[email protected]> Acked-by: Joel Stanley <[email protected]>
2016-09-09clocksource/drivers/moxart: Add Aspeed supportJoel Stanley1-0/+32
The Aspeed SoC has timer IP with a very similar register layout to the moxart timer. This patch adds support for the fourth and fifth gen aspeed SoCs, and has been tested on the ast2400 and ast2500. Signed-off-by: Joel Stanley <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]>
2016-09-09clocksource/drivers/moxart: Use struct to hold stateJoel Stanley1-61/+86
Add a struct moxart_timer to hold the driver state, including the irqaction and struct clock_event_device. Most importantly this holds values for enabling and disabling the timer, so future support can be added for devices that use different bits for enable/disable. In preparation for future hardware support we add a MOXART prefix to the existing values. Signed-off-by: Joel Stanley <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]>
2016-09-09clocksource/drivers/moxart: Refactor enable/disableJoel Stanley1-6/+16
This patch abstracts the enable and disable register writes into their own functions in preparation for future changes to use SoC specific values for the writes. Signed-off-by: Joel Stanley <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]>
2016-06-28clocksources: Switch back to the clksrc tableDaniel Lezcano1-1/+1
All the clocksource drivers's init function are now converted to return an error code. CLOCKSOURCE_OF_DECLARE is no longer used as well as the clksrc-of table. Let's convert back the names: - CLOCKSOURCE_OF_DECLARE_RET => CLOCKSOURCE_OF_DECLARE - clksrc-of-ret => clksrc-of Signed-off-by: Daniel Lezcano <[email protected]> For exynos_mct and samsung_pwm_timer: Acked-by: Krzysztof Kozlowski <[email protected]> For arch/arc: Acked-by: Vineet Gupta <[email protected]> For mediatek driver: Acked-by: Matthias Brugger <[email protected]> For the Rockchip-part Acked-by: Heiko Stuebner <[email protected]> For STi : Acked-by: Patrice Chotard <[email protected]> For the mps2-timer.c and versatile.c changes: Acked-by: Liviu Dudau <[email protected]> For the OXNAS part : Acked-by: Neil Armstrong <[email protected]> For LPC32xx driver: Acked-by: Sylvain Lemieux <[email protected]> For Broadcom Kona timer change: Acked-by: Ray Jui <[email protected]> For Sun4i and Sun5i: Acked-by: Chen-Yu Tsai <[email protected]> For Meson6: Acked-by: Carlo Caione <[email protected]> For Keystone: Acked-by: Santosh Shilimkar <[email protected]> For NPS: Acked-by: Noam Camus <[email protected]> For bcm2835: Acked-by: Eric Anholt <[email protected]>
2016-06-28clocksource/drivers/moxart: Convert init function to return errorDaniel Lezcano1-14/+27
The init functions do not return any error. They behave as the following: - panic, thus leading to a kernel crash while another timer may work and make the system boot up correctly or - print an error and let the caller unaware if the state of the system Change that by converting the init functions to return an error conforming to the CLOCKSOURCE_OF_RET prototype. Proper error handling (rollback, errno value) will be changed later case by case, thus this change just return back an error or success in the init function. Signed-off-by: Daniel Lezcano <[email protected]>
2015-08-10clockevents/drivers/moxart: Migrate to new 'set-state' interfaceViresh Kumar1-23/+26
Migrate moxart driver to the new 'set-state' interface provided by clockevents core, the earlier 'set-mode' interface is marked obsolete now. This also enables us to implement callbacks for new states of clockevent devices, for example: ONESHOT_STOPPED. Cc: Jonas Jensen <[email protected]> Signed-off-by: Viresh Kumar <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]>
2013-08-01ARM: clocksource: moxart: Add bitops.h includeJonas Jensen1-0/+1
bitops.h included implicitly, add #include <linux/bitops.h> Signed-off-by: Jonas Jensen <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]>
2013-07-18ARM: clocksource: Add support for MOXA ART SoCsJonas Jensen1-0/+164
This patch adds an clocksource driver for the main timer(s) found on MOXA ART SoCs. The MOXA ART SoC provides three separate timers with individual count/load/match registers, two are used here: TIMER1: clockevents, used to support oneshot and periodic events TIMER2: set up as a free running counter, used as clocksource Timers are preconfigured by bootloader to count down and interrupt on match or zero. Count increments every APB clock cycle and is automatically reloaded when it reaches zero. Signed-off-by: Jonas Jensen <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]>