25 #include <linux/kernel.h>
29 static void stmmac_timer_handler(
void *
data)
36 #define STMMAC_TIMER_MSG(timer, freq) \
37 printk(KERN_INFO "stmmac_timer: %s Timer ON (freq %dHz)\n", timer, freq);
39 #if defined(CONFIG_STMMAC_RTC_TIMER)
40 #include <linux/rtc.h>
44 static void stmmac_rtc_start(
unsigned int new_freq)
50 static void stmmac_rtc_stop(
void)
58 stmmac_task.
func = stmmac_timer_handler;
61 if (stmmac_rtc ==
NULL) {
62 pr_err(
"open rtc device failed\n");
70 pr_err(
"set periodic failed\n");
92 #elif defined(CONFIG_STMMAC_TMU_TIMER)
94 #define TMU_CHANNEL "tmu2_clk"
95 static struct clk *timer_clock;
97 static void stmmac_tmu_start(
unsigned int new_freq)
100 clk_prepare_enable(timer_clock);
103 static void stmmac_tmu_stop(
void)
105 clk_disable_unprepare(timer_clock);
112 if (IS_ERR(timer_clock))
115 if (tmu2_register_user(stmmac_timer_handler, (
void *)dev) < 0) {
129 clk_disable_unprepare(timer_clock);
130 tmu2_unregister_user();