Lines Matching refs:to
37 static u32 mtk_cpux_readl(u32 reg_idx, struct timer_of *to)
39 writel(reg_idx, timer_of_base(to) + CPUX_IDX_REG);
40 return readl(timer_of_base(to) + CPUX_CON_REG);
43 static void mtk_cpux_writel(u32 val, u32 reg_idx, struct timer_of *to)
45 writel(reg_idx, timer_of_base(to) + CPUX_IDX_REG);
46 writel(val, timer_of_base(to) + CPUX_CON_REG);
49 static void mtk_cpux_set_irq(struct timer_of *to, bool enable)
54 val = mtk_cpux_readl(CPUX_IDX_GLOBAL_IRQ, to);
61 mtk_cpux_writel(val, CPUX_IDX_GLOBAL_IRQ, to);
83 static struct timer_of to = {
105 /* If this fails, bad things are about to happen... */
106 ret = timer_of_init(node, &to);
115 * that makes it possible to still boot the kernel, even though
118 * possible for everyone and this gives a chance to retrieve kmsg
121 freq = timer_of_rate(&to);
125 /* Clock input is 26MHz, set DIV2 to achieve 13MHz clock */
126 val = mtk_cpux_readl(CPUX_IDX_GLOBAL_CTRL, &to);
129 mtk_cpux_writel(val, CPUX_IDX_GLOBAL_CTRL, &to);
132 val = mtk_cpux_readl(CPUX_IDX_GLOBAL_CTRL, &to);
133 mtk_cpux_writel(val | CPUX_ENABLE, CPUX_IDX_GLOBAL_CTRL, &to);
135 clockevents_config_and_register(&to.clkevt, timer_of_rate(&to),