clocksource/drivers/stm32: Add oneshot mode
authorBenjamin Gaignard <benjamin.gaignard@st.com>
Mon, 8 Jan 2018 13:28:55 +0000 (14:28 +0100)
committerIngo Molnar <mingo@kernel.org>
Mon, 8 Jan 2018 16:57:26 +0000 (17:57 +0100)
commit8e82df381b676ae5f6c93ab4a75f56d8f61babc4
tree371c81f9c8cbde911b4aa678d78d513308054454
parent4744daa10dcd3a1470fbeba4945fbf44dcb1b0d1
clocksource/drivers/stm32: Add oneshot mode

The stm32 timer block is able to have a counter and a comparator.

Instead of using the auto-reload register for periodic events, we switch
to oneshot mode by using the comparator register.

The timer is able to generate an interrupt when the counter overflows but
we don't want that as this counter will be use as a clocksource in the next
patches. So it is disabled by the UDIS bit of the control register.

Tested-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1515418139-23276-16-git-send-email-daniel.lezcano@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
drivers/clocksource/timer-stm32.c