Commit graph

17 commits

Author SHA1 Message Date
Yoshinori Sato d33f250af4 clocksource/drivers/h8300: Use ioread / iowrite
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-16 17:20:13 +01:00
Yoshinori Sato 6f2b611db2 clocksource/drivers/h8300: Initializer cleanup.
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-16 11:33:35 +01:00
Yoshinori Sato f37632d1e9 clocksource/drivers/h8300: Simplify delta handling
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-16 11:33:33 +01:00
Daniel Lezcano 751605152b h8300: Rename ctlr_out/in[bwl] to raw_read/write[bwl]
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>
2015-12-15 10:12:03 +01:00
Daniel Lezcano cce483e0ee clocksource/drivers/h8300_timer8: Retrieve the clock rate at init time
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>
2015-12-15 09:42:20 +01:00
Daniel Lezcano 254d8b5d59 clocksource/drivers/h8300_timer8: Remove irq and lock legacy code
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>
2015-12-15 09:42:18 +01:00
Daniel Lezcano 7053fdac76 clocksource/drivers/h8300_timer8: Remove pointless irq re-entrant safe code
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>
2015-12-15 09:42:16 +01:00
Daniel Lezcano 54a0cd5a7e clocksource/drivers/h8300_timer8: Fix irq return value check
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>
2015-12-15 09:42:14 +01:00
Daniel Lezcano 1f058d52b3 clocksource/drivers/h8300_timer8: Remove PERIODIC and ONESHOT macro
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>
2015-12-15 09:42:13 +01:00
Daniel Lezcano 7116ae437f clocksource/drivers/h8300_timer8: Remove unused macros
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15 09:42:11 +01:00
Daniel Lezcano d1f9db13e3 clocksource/drivers/h8300_timer8: Remove unused headers
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
2015-12-15 09:42:09 +01:00
Daniel Lezcano 8c09b7d6ba clocksource/drivers/h8300_timer8: Fix compilation error with dev_warn
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>
2015-12-15 09:42:04 +01:00
Yoshinori Sato 4633f4cac8 clocksource/drivers/h8300: Cleanup startup and remove module code.
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>
2015-12-15 09:42:02 +01:00
Alexey Klimov ba49af35be clocksource/drivers/h8300_*: Remove unneeded memset()s
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>
2015-10-15 17:42:02 +02:00
Viresh Kumar fc2b2f5df6 clockevents/drivers/h8300_timer8: Migrate to new 'set-state' interface
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>
2015-08-10 11:40:58 +02:00
Yoshinori Sato 07834743f4 h8300: fix typo.
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
2015-06-23 13:36:00 +09:00
Yoshinori Sato 618b902d8c h8300: clocksource
h8300_timer8: 8bit clockevent device
h8300_timer16 / h8300_tpu: 16bit clocksource

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
2015-06-23 13:35:55 +09:00