linux-mips
[Top] [All Lists]

[PATCH V2 02/14] MIPS: lantiq: helper functions for SoC detection

To: Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH V2 02/14] MIPS: lantiq: helper functions for SoC detection
From: John Crispin <blogic@openwrt.org>
Date: Thu, 23 Feb 2012 17:03:01 +0100
Cc: linux-mips@linux-mips.org, John Crispin <blogic@openwrt.org>
In-reply-to: <1330012993-13510-1-git-send-email-blogic@openwrt.org>
References: <1330012993-13510-1-git-send-email-blogic@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
Add additional functions for runtime soc detection. We need these for the
serial driver.

Signed-off-by: John Crispin <blogic@openwrt.org>
---
 .../include/asm/mach-lantiq/falcon/lantiq_soc.h    |   16 ++++++++++++++--
 .../mips/include/asm/mach-lantiq/xway/lantiq_soc.h |    5 +++++
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/arch/mips/include/asm/mach-lantiq/falcon/lantiq_soc.h 
b/arch/mips/include/asm/mach-lantiq/falcon/lantiq_soc.h
index 1a4b836..fd7f9fd 100644
--- a/arch/mips/include/asm/mach-lantiq/falcon/lantiq_soc.h
+++ b/arch/mips/include/asm/mach-lantiq/falcon/lantiq_soc.h
@@ -149,8 +149,20 @@ extern int ltq_gpio_mux_set(unsigned int pin, unsigned int 
mux);
 #define LTQ_EIU_BASE_ADDR      0
 #define LTQ_EBU_PCC_ISTAT      0
 
-#define ltq_is_ar9()   0
-#define ltq_is_vr9()   0
+static inline int ltq_is_ar9(void)
+{
+       return 0;
+}
+
+static inline int ltq_is_vr9(void)
+{
+       return 0;
+}
+
+static inline int ltq_is_falcon(void)
+{
+       return 1;
+}
 
 #endif /* CONFIG_SOC_FALCON */
 #endif /* _LTQ_XWAY_H__ */
diff --git a/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h 
b/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
index 4213926..1b60181 100644
--- a/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
+++ b/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
@@ -186,5 +186,10 @@ static inline int ltq_is_vr9(void)
        return (ltq_get_soc_type() == SOC_TYPE_VR9);
 }
 
+static inline int ltq_is_falcon(void)
+{
+       return 0;
+}
+
 #endif /* CONFIG_SOC_TYPE_XWAY */
 #endif /* _LTQ_XWAY_H__ */
-- 
1.7.7.1


<Prev in Thread] Current Thread [Next in Thread>