xref: /linux/arch/mips/include/asm/mach-loongson2ef/cs5536/cs5536_mfgpt.h (revision c95baf12f5077419db01313ab61c2aac007d40cd)
1*71e2f4ddSJiaxun Yang /* SPDX-License-Identifier: GPL-2.0 */
2*71e2f4ddSJiaxun Yang /*
3*71e2f4ddSJiaxun Yang  * cs5536 mfgpt header file
4*71e2f4ddSJiaxun Yang  */
5*71e2f4ddSJiaxun Yang 
6*71e2f4ddSJiaxun Yang #ifndef _CS5536_MFGPT_H
7*71e2f4ddSJiaxun Yang #define _CS5536_MFGPT_H
8*71e2f4ddSJiaxun Yang 
9*71e2f4ddSJiaxun Yang #include <cs5536/cs5536.h>
10*71e2f4ddSJiaxun Yang #include <cs5536/cs5536_pci.h>
11*71e2f4ddSJiaxun Yang 
12*71e2f4ddSJiaxun Yang #ifdef CONFIG_CS5536_MFGPT
13*71e2f4ddSJiaxun Yang extern void setup_mfgpt0_timer(void);
14*71e2f4ddSJiaxun Yang extern void disable_mfgpt0_counter(void);
15*71e2f4ddSJiaxun Yang extern void enable_mfgpt0_counter(void);
16*71e2f4ddSJiaxun Yang #else
setup_mfgpt0_timer(void)17*71e2f4ddSJiaxun Yang static inline void __maybe_unused setup_mfgpt0_timer(void)
18*71e2f4ddSJiaxun Yang {
19*71e2f4ddSJiaxun Yang }
disable_mfgpt0_counter(void)20*71e2f4ddSJiaxun Yang static inline void __maybe_unused disable_mfgpt0_counter(void)
21*71e2f4ddSJiaxun Yang {
22*71e2f4ddSJiaxun Yang }
enable_mfgpt0_counter(void)23*71e2f4ddSJiaxun Yang static inline void __maybe_unused enable_mfgpt0_counter(void)
24*71e2f4ddSJiaxun Yang {
25*71e2f4ddSJiaxun Yang }
26*71e2f4ddSJiaxun Yang #endif
27*71e2f4ddSJiaxun Yang 
28*71e2f4ddSJiaxun Yang #define MFGPT_TICK_RATE 14318000
29*71e2f4ddSJiaxun Yang #define COMPARE	 ((MFGPT_TICK_RATE + HZ/2) / HZ)
30*71e2f4ddSJiaxun Yang 
31*71e2f4ddSJiaxun Yang #define MFGPT_BASE	mfgpt_base
32*71e2f4ddSJiaxun Yang #define MFGPT0_CMP2	(MFGPT_BASE + 2)
33*71e2f4ddSJiaxun Yang #define MFGPT0_CNT	(MFGPT_BASE + 4)
34*71e2f4ddSJiaxun Yang #define MFGPT0_SETUP	(MFGPT_BASE + 6)
35*71e2f4ddSJiaxun Yang 
36*71e2f4ddSJiaxun Yang #endif /*!_CS5536_MFGPT_H */
37