@@ -74,6 +74,23 @@ static int twd_set_next_event(unsigned long evt,
return 0;
}
+static void twd_update_freq(enum clock_event_mode mode,
+ struct clock_event_device *clk)
+{
+ /*
+ * The only thing we need to handle here is for the periodic mode,
+ * where the loaded value needs to be reprogrammed so the new
+ * frequency is used for the next event.
+ */
+ switch (mode) {
+ case CLOCK_EVT_MODE_PERIODIC:
+ __raw_writel(twd_timer_rate / HZ, twd_base + TWD_TIMER_LOAD);
+ break;
+ default:
+ break;
+ }
+}
+
/*
* local_timer_ack: checks for a local timer interrupt.
*
@@ -245,6 +262,7 @@ static int __cpuinit twd_timer_setup(struct clock_event_device *clk)
clk->rating = 350;
clk->set_mode = twd_set_mode;
clk->set_next_event = twd_set_next_event;
+ clk->update_freq = twd_update_freq;
clk->irq = twd_ppi;
this_cpu_clk = __this_cpu_ptr(twd_evt);