summaryrefslogtreecommitdiff
path: root/target/linux/lantiq/patches/850-falcon-sysctrl-compatibility.patch
blob: 4f54a9b5003e5ad740d0b3066be07e8ab8f6a877 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
--- a/arch/mips/include/asm/mach-lantiq/falcon/sysctrl.h
+++ b/arch/mips/include/asm/mach-lantiq/falcon/sysctrl.h
@@ -20,23 +20,41 @@
 #ifndef __FALCON_SYSCTRL_H
 #define __FALCON_SYSCTRL_H
 
-extern void sys1_hw_activate(u32 mask);
-extern void sys1_hw_deactivate(u32 mask);
-extern void sys1_hw_clk_enable(u32 mask);
-extern void sys1_hw_clk_disable(u32 mask);
-extern void sys1_hw_activate_or_reboot(u32 mask);
+#include <falcon/lantiq_soc.h>
 
-extern void sys_eth_hw_activate(u32 mask);
-extern void sys_eth_hw_deactivate(u32 mask);
-extern void sys_eth_hw_clk_enable(u32 mask);
-extern void sys_eth_hw_clk_disable(u32 mask);
-extern void sys_eth_hw_activate_or_reboot(u32 mask);
+static inline void sys1_hw_activate(u32 mask)
+{ ltq_sysctl_activate(SYSCTL_SYS1, mask); }
+static inline void sys1_hw_deactivate(u32 mask)
+{ ltq_sysctl_deactivate(SYSCTL_SYS1, mask); }
+static inline void sys1_hw_clk_enable(u32 mask)
+{ ltq_sysctl_clken(SYSCTL_SYS1, mask); }
+static inline void sys1_hw_clk_disable(u32 mask)
+{ ltq_sysctl_clkdis(SYSCTL_SYS1, mask); }
+static inline void sys1_hw_activate_or_reboot(u32 mask)
+{ ltq_sysctl_reboot(SYSCTL_SYS1, mask); }
 
-extern void sys_gpe_hw_activate(u32 mask);
-extern void sys_gpe_hw_deactivate(u32 mask);
-extern void sys_gpe_hw_clk_enable(u32 mask);
-extern void sys_gpe_hw_clk_disable(u32 mask);
-extern void sys_gpe_hw_activate_or_reboot(u32 mask);
-extern int sys_gpe_hw_is_activated(u32 mask);
+static inline void sys_eth_hw_activate(u32 mask)
+{ ltq_sysctl_activate(SYSCTL_SYSETH, mask); }
+static inline void sys_eth_hw_deactivate(u32 mask)
+{ ltq_sysctl_deactivate(SYSCTL_SYSETH, mask); }
+static inline void sys_eth_hw_clk_enable(u32 mask)
+{ ltq_sysctl_clken(SYSCTL_SYSETH, mask); }
+static inline void sys_eth_hw_clk_disable(u32 mask)
+{ ltq_sysctl_clkdis(SYSCTL_SYSETH, mask); }
+static inline void sys_eth_hw_activate_or_reboot(u32 mask)
+{ ltq_sysctl_reboot(SYSCTL_SYSETH, mask); }
+
+static inline void sys_gpe_hw_activate(u32 mask)
+{ ltq_sysctl_activate(SYSCTL_SYSGPE, mask); }
+static inline void sys_gpe_hw_deactivate(u32 mask)
+{ ltq_sysctl_deactivate(SYSCTL_SYSGPE, mask); }
+static inline void sys_gpe_hw_clk_enable(u32 mask)
+{ ltq_sysctl_clken(SYSCTL_SYSGPE, mask); }
+static inline void sys_gpe_hw_clk_disable(u32 mask)
+{ ltq_sysctl_clkdis(SYSCTL_SYSGPE, mask); }
+static inline void sys_gpe_hw_activate_or_reboot(u32 mask)
+{ ltq_sysctl_reboot(SYSCTL_SYSGPE, mask); }
+static inline int sys_gpe_hw_is_activated(u32 mask)
+{ return 1; }
 
 #endif /* __FALCON_SYSCTRL_H */