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