summaryrefslogtreecommitdiff
path: root/arch/mips/ath25/devices.h
diff options
context:
space:
mode:
authorSergey Ryazanov <ryazanov.s.a@gmail.com>2014-10-29 03:18:38 +0400
committerRalf Baechle <ralf@linux-mips.org>2014-11-24 07:45:26 +0100
commit43cc739fd98b8c517ad45756d869f866e746ba04 (patch)
treec358c406d9e102d83da4e7f1951b09b8ecb0ac91 /arch/mips/ath25/devices.h
parent484c344985ddf8e9ed12b8cf540eba0b1d869236 (diff)
MIPS: ath25: add common parts
Add common code for Atheros AR5312 and Atheros AR2315 SoCs families. Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com> Cc: Linux MIPS <linux-mips@linux-mips.org> Patchwork: https://patchwork.linux-mips.org/patch/8237 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/ath25/devices.h')
-rw-r--r--arch/mips/ath25/devices.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/mips/ath25/devices.h b/arch/mips/ath25/devices.h
new file mode 100644
index 000000000000..e25a3262256d
--- /dev/null
+++ b/arch/mips/ath25/devices.h
@@ -0,0 +1,18 @@
+#ifndef __ATH25_DEVICES_H
+#define __ATH25_DEVICES_H
+
+#include <linux/cpu.h>
+
+#define ATH25_REG_MS(_val, _field) (((_val) & _field##_M) >> _field##_S)
+
+static inline bool is_ar2315(void)
+{
+ return (current_cpu_data.cputype == CPU_4KEC);
+}
+
+static inline bool is_ar5312(void)
+{
+ return !is_ar2315();
+}
+
+#endif