summaryrefslogtreecommitdiff
path: root/drivers/clocksource/timer-vf-pit.c
AgeCommit message (Collapse)AuthorFilesLines
12 daysclocksource/drivers/vf-pit: Rename the VF PIT to NXP PITDaniel Lezcano1-292/+0
The PIT acronym stands for Periodic Interrupt Timer which is found on different NXP platforms not only on the Vybrid Family. Change the name to be more generic for the NXP platforms in general. That will be consistent with the NXP STM driver naming convention. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20250804152344.1109310-19-daniel.lezcano@linaro.org
12 daysclocksource/drivers/vf-pit: Unify the function name for irq ackDaniel Lezcano1-3/+3
Most the function are under the form pit_timer_*, let's change the interrupt acknowledgment function name to have the same format. No functional changes intended. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20250804152344.1109310-18-daniel.lezcano@linaro.org
12 daysclocksource/drivers/vf-pit: Consolidate calls to pit_*_disable/enableDaniel Lezcano1-21/+13
The difference between the pit_clocksource_enable() and pit_clocksource_disable() is only setting the TIF flag for the clockevent. Let's group them and pass the TIF flag parameter to the function so we save some lines of code. But as the base address is different regarding if it is a clocksource or a clockevent, we pass the base address in parameter instead of the struct pit_timer. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20250804152344.1109310-17-daniel.lezcano@linaro.org
12 daysclocksource/drivers/vf-pit: Encapsulate set counter functionDaniel Lezcano1-2/+7
Encapsulate the writel() calls to set the counter into a self-explainatory function. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20250804152344.1109310-16-daniel.lezcano@linaro.org
12 daysclocksource/drivers/vf-pit: Enable and disable module on errorDaniel Lezcano1-4/+17
Encapsulate the calls to writel to enable and disable the PIT module and make use of them. Add the missing module disablement in case of error. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20250804152344.1109310-15-daniel.lezcano@linaro.org
12 daysclocksource/drivers/vf-pit: Encapsulate clocksource enable / disableDaniel Lezcano1-2/+12
For the sake of lisibility, let's encapsulate the writel calls to enable and disable the timer into a function with a self-explainatory name. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20250804152344.1109310-14-daniel.lezcano@linaro.org
12 daysclocksource/drivers/vf-pit: Use the node name for the interrupt and timer namesDaniel Lezcano1-9/+11
In order to differentiate from userspace the pit timer given the device tree, let's use the node name for the interrupt and the timer names. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20250804152344.1109310-13-daniel.lezcano@linaro.org
12 daysclocksource/drivers/vf-pit: Encapsulate the PTLCVAL macroDaniel Lezcano1-7/+7
Pass the channel and the base address to the PITLCVAL macro so it is possible to use multiple instances of the timer with the macro. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20250804152344.1109310-12-daniel.lezcano@linaro.org
12 daysclocksource/drivers/vf-pit: Encapsulate the macrosDaniel Lezcano1-16/+18
Pass the base address to the macro, so we can use the macro with multiple instances of the timer because we deal with different base address. At the same time, change writes to the register to the existing corresponding functions. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20250804152344.1109310-11-daniel.lezcano@linaro.org
12 daysclocksource/drivers/vf-pit: Register the clocksource from the driverDaniel Lezcano1-2/+18
The function clocksource_mmio_init() uses its own global static clocksource variable making no possible to have several instances of a clocksource using this function. In order to support that, let's add the clocksource structure to the pit structure and use the clocksource_register_hz() function instead. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20250804152344.1109310-10-daniel.lezcano@linaro.org
12 daysclocksource/drivers/vf-pit: Convert raw values to BIT macrosDaniel Lezcano1-4/+4
Use the BIT macros instead of the shifting syntax. No functional change intended. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20250804152344.1109310-9-daniel.lezcano@linaro.org
12 daysclocksource/drivers/vf-pit: Allocate the struct timer at init timeDaniel Lezcano1-11/+37
Instead of having a static global structure for a timer, let's allocate it dynamically so we can create multiple instances in the future to support multiple timers. At the same time, add the rollbacking code in case of error. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20250804152344.1109310-8-daniel.lezcano@linaro.org
12 daysclocksource/drivers/vf-pit: Encapsulate the initialization of the ↵Daniel Lezcano1-1/+1
cycles_per_jiffy Move the cycles_per_jiffy initialization to the same place where the other pit timer fields are initialized. No functional changes intended. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20250804152344.1109310-7-daniel.lezcano@linaro.org
12 daysclocksource/drivers/vf-pit: Pass the cpu number as parameterDaniel Lezcano1-3/+3
In order to initialize the timer with a cpumask tied to a cpu, let's pass it as a parameter instead of hardwiring it in the init function. No functional changes intended. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20250804152344.1109310-6-daniel.lezcano@linaro.org
12 daysclocksource/drivers/vf-pit: Rework the base address usageDaniel Lezcano1-13/+22
This change passes the base address to the clockevent and clocksource initialization functions in order to use different base address in the next changes. No functional changes intended. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20250804152344.1109310-5-daniel.lezcano@linaro.org
12 daysclocksource/drivers/vf-pit: Set the scene for multiple timersDaniel Lezcano1-49/+72
The driver is implemented as using a single timer and a single clocksource. In order to take advantage of the multiple timers supported in the PIT hardware and introduce different setup for a new platform, let's encapsulate the data into a structure and pass this structure around in the function parameter. The structure will be a per timer instansiation in the next changes. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20250804152344.1109310-4-daniel.lezcano@linaro.org
12 daysclocksource/drivers/vf-pit: Replace raw_readl/writel to readl/writelDaniel Lezcano1-11/+11
The driver uses the raw_readl() and raw_writel() functions. Those are not for MMIO devices. Replace them with readl() and writel() [ dlezcano: Fixed typo in the subject s/reald/readl/ ] Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Cc: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20250804152344.1109310-2-daniel.lezcano@linaro.org
2021-03-23timekeeping, clocksource: Fix various typos in commentsIngo Molnar1-1/+1
Fix ~56 single-word typos in timekeeping & clocksource code comments. Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: John Stultz <john.stultz@linaro.org> Cc: Stephen Boyd <sboyd@kernel.org> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: linux-kernel@vger.kernel.org
2020-04-05clocksource/drivers/timer-vf-pit: Add missing parenthesisafzal mohammed1-1/+1
Recently all usage of setup_irq() was replaced by request_irq(). The replacement in timer-vf-pit.c missed closing parentheses resulting in a build error (vf610m4_defconfig). Fix it. Fixes: cc2550b421aa ("clocksource: Replace setup_irq() by request_irq()") Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: afzal mohammed <afzal.mohd.ma@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20200323061130.GA6286@afzalpc
2020-02-27clocksource: Replace setup_irq() by request_irq()afzal mohammed1-8/+2
request_irq() is preferred over setup_irq(). The early boot setup_irq() invocations happen either via 'init_IRQ()' or 'time_init()', while memory allocators are ready by 'mm_init()'. Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized. Hence replace setup_irq() by request_irq(). Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq(). A build error that was reported by kbuild test robot <lkp@intel.com> in the previous version of the patch also has been fixed. [1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos Signed-off-by: afzal mohammed <afzal.mohd.ma@gmail.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/91961c77c1cf93d41523f5e1ac52043f32f97077.1582799709.git.afzal.mohd.ma@gmail.com
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152Thomas Gleixner1-5/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 3029 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-03clocksource/drivers: Unify the names to timer-* formatDaniel Lezcano1-0/+204
In order to make some housekeeping in the directory, this patch renames drivers to the timer-* format in order to unify their names. There is no functional changes. Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Vladimir Zapolskiy <vz@mleia.com> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>