summaryrefslogtreecommitdiff
path: root/drivers/clocksource/h8300_timer8.c
Commit message (Collapse)AuthorAgeFilesLines
* clocksource/drivers: Rename CLOCKSOURCE_OF_DECLARE to TIMER_OF_DECLAREDaniel Lezcano2017-06-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CLOCKSOURCE_OF_DECLARE macro is used widely for the timers to declare the clocksource at early stage. However, this macro is also used to initialize the clockevent if any, or the clockevent only. It was originally suggested to declare another macro to initialize a clockevent, so in order to separate the two entities even they belong to the same IP. This was not accepted because of the impact on the DT where splitting a clocksource/clockevent definition does not make sense as it is a Linux concept not a hardware description. On the other side, the clocksource has not interrupt declared while the clockevent has, so it is easy from the driver to know if the description is for a clockevent or a clocksource, IOW it could be implemented at the driver level. So instead of dealing with a named clocksource macro, let's use a more generic one: TIMER_OF_DECLARE. The patch has not functional changes. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: Heiko Stuebner <heiko@sntech.de> Acked-by: Neil Armstrong <narmstrong@baylibre.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Matthias Brugger <matthias.bgg@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
* clocksource: h8300_timer8: Don't reset rate in ->set_state_oneshot()Nicolai Stange2017-03-231-8/+0
| | | | | | | | | | | | | | | | | | | | | | | With the upcoming NTP correction related rate adjustments to be implemented in the clockevents core, the latter needs to get informed about every rate change of a clockevent device made after its registration. Currently, h8300_timer8 violates this requirement in that it registers its clockevent device with the correct rate, but resets its ->mult and ->rate values in timer8_clock_event_start(), called from its ->set_state_oneshot() function. It seems like commit 4633f4cac85a ("clocksource/drivers/h8300: Cleanup startup and remove module code."), which introduced the rate initialization at registration, missed to remove the manual setting of ->mult and ->shift from timer8_clock_event_start(). Purge the setting of ->mult, ->shift, ->min_delta_ns and ->max_delta_ns from timer8_clock_event_start(). Signed-off-by: Nicolai Stange <nicstange@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org>
* clocksources: Switch back to the clksrc tableDaniel Lezcano2016-06-281-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 <daniel.lezcano@linaro.org> For exynos_mct and samsung_pwm_timer: Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> For arch/arc: Acked-by: Vineet Gupta <vgupta@synopsys.com> For mediatek driver: Acked-by: Matthias Brugger <matthias.bgg@gmail.com> For the Rockchip-part Acked-by: Heiko Stuebner <heiko@sntech.de> For STi : Acked-by: Patrice Chotard <patrice.chotard@st.com> For the mps2-timer.c and versatile.c changes: Acked-by: Liviu Dudau <Liviu.Dudau@arm.com> For the OXNAS part : Acked-by: Neil Armstrong <narmstrong@baylibre.com> For LPC32xx driver: Acked-by: Sylvain Lemieux <slemieux.tyco@gmail.com> For Broadcom Kona timer change: Acked-by: Ray Jui <ray.jui@broadcom.com> For Sun4i and Sun5i: Acked-by: Chen-Yu Tsai <wens@csie.org> For Meson6: Acked-by: Carlo Caione <carlo@caione.org> For Keystone: Acked-by: Santosh Shilimkar <ssantosh@kernel.org> For NPS: Acked-by: Noam Camus <noamca@mellanox.com> For bcm2835: Acked-by: Eric Anholt <eric@anholt.net>
* clocksource/drivers/h8300_timer8: Convert init function to return errorDaniel Lezcano2016-06-281-5/+8
| | | | | | | | | | | | | | | | | | | | 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 <daniel.lezcano@linaro.org>
* clocksource/drivers/h8300: Use ioread / iowriteYoshinori Sato2015-12-161-11/+17
| | | | | Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
* clocksource/drivers/h8300: Initializer cleanup.Yoshinori Sato2015-12-161-9/+6
| | | | | Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
* clocksource/drivers/h8300: Simplify delta handlingYoshinori Sato2015-12-161-34/+6
| | | | | Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
* h8300: Rename ctlr_out/in[bwl] to raw_read/write[bwl]Daniel Lezcano2015-12-151-17/+17
| | | | | | | | | | | For the sake of consistency, let rename all ctrl_out/in calls to the write/read calls so we have the same API consistent with the other architectures hence open the door for the increasing of the test compilation coverage. The unsigned long coercive cast is removed because all variables are set to the right type "void __iomem *". Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
* clocksource/drivers/h8300_timer8: Retrieve the clock rate at init timeDaniel Lezcano2015-12-151-12/+14
| | | | | | | | | | The current code retrieves the rate value when the timer is enabled which occurs each time a timer is re-armed. Except if the clock frequency has changed magically I don't see why this should be done each time. Retrieve the clock rate value at init time only. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
* clocksource/drivers/h8300_timer8: Remove irq and lock legacy codeDaniel Lezcano2015-12-151-16/+0
| | | | | | | | | The time framawork takes care of disabling the interrupts and takes a lock to prevent races. Remove the legacy code in the driver taking care of the races. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
* clocksource/drivers/h8300_timer8: Remove pointless irq re-entrant safe codeDaniel Lezcano2015-12-151-9/+6
| | | | | | | | | | | The current code assumes the interrupt function is re-entrant. That is not correct. An interrupt handler is never invoked concurrently. The interrupt line is masked on all processors. Remove the chewing flags in the code. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
* clocksource/drivers/h8300_timer8: Fix irq return value checkDaniel Lezcano2015-12-151-1/+1
| | | | | | | The value returned in case of error for the 'irq_of_parse_and_map' function is zero in case of error. Fix the check in the init code. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
* clocksource/drivers/h8300_timer8: Remove PERIODIC and ONESHOT macroDaniel Lezcano2015-12-151-7/+4
| | | | | | | Specify the delta as parameter for the timer8_clock_event_start function instead of using a macro to tell PERIODIC or ONESHOT. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
* clocksource/drivers/h8300_timer8: Remove unused macrosDaniel Lezcano2015-12-151-4/+0
| | | | Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
* clocksource/drivers/h8300_timer8: Remove unused headersDaniel Lezcano2015-12-151-5/+0
| | | | Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
* clocksource/drivers/h8300_timer8: Fix compilation error with dev_warnDaniel Lezcano2015-12-151-1/+1
| | | | | | | | | The dev_warn is using the platform driver which was removed in the previous patch. Let's replace dev_warn by pr_warn. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
* clocksource/drivers/h8300: Cleanup startup and remove module code.Yoshinori Sato2015-12-151-99/+51
| | | | | | | | | Remove some legacy code and replace it by the clksrc-of code. Do some cleanup and code consolidation. Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
* clocksource/drivers/h8300_*: Remove unneeded memset()sAlexey Klimov2015-10-151-1/+0
| | | | | | | | | | Memory for timer16_priv, timer8_priv and tpu_priv structs is allocated by devm_kzalloc() in corresponding probe functions of drivers. No need to zero it one more time. Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
* clockevents/drivers/h8300_timer8: Migrate to new 'set-state' interfaceViresh Kumar2015-08-101-23/+28
| | | | | | | | | | | | Migrate h8300_timer8 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. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
* h8300: fix typo.Yoshinori Sato2015-06-231-1/+1
| | | | Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
* h8300: clocksourceYoshinori Sato2015-06-231-0/+313
h8300_timer8: 8bit clockevent device h8300_timer16 / h8300_tpu: 16bit clocksource Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>