summaryrefslogtreecommitdiff
path: root/arch/arm/include/asm/arch-mxs/regs-ssp.h
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-03-15 15:18:31 +0100
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-03-15 15:18:31 +0100
commit6579d15c58e2b6b051f126ea8b77dd767252aa14 (patch)
treecac9f9205db8c28a764ad8282d3a909bf95e8db4 /arch/arm/include/asm/arch-mxs/regs-ssp.h
parentc44bb3a30f5a1332176edce1a91c0e2cf666ee8f (diff)
parent19a0f7fa271de0345bb2df90d443c547c41e8037 (diff)
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
Diffstat (limited to 'arch/arm/include/asm/arch-mxs/regs-ssp.h')
-rw-r--r--arch/arm/include/asm/arch-mxs/regs-ssp.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-mxs/regs-ssp.h b/arch/arm/include/asm/arch-mxs/regs-ssp.h
index 9b30f56f54..5920f9b4dc 100644
--- a/arch/arm/include/asm/arch-mxs/regs-ssp.h
+++ b/arch/arm/include/asm/arch-mxs/regs-ssp.h
@@ -74,6 +74,32 @@ struct mxs_ssp_regs {
};
#endif
+static inline int mxs_ssp_bus_id_valid(int bus)
+{
+#if defined(CONFIG_MX23)
+ const unsigned int mxs_ssp_chan_count = 2;
+#elif defined(CONFIG_MX28)
+ const unsigned int mxs_ssp_chan_count = 4;
+#endif
+
+ if (bus >= mxs_ssp_chan_count)
+ return 0;
+
+ if (bus < 0)
+ return 0;
+
+ return 1;
+}
+
+static inline int mxs_ssp_clock_by_bus(unsigned int clock)
+{
+#if defined(CONFIG_MX23)
+ return 0;
+#elif defined(CONFIG_MX28)
+ return clock;
+#endif
+}
+
static inline struct mxs_ssp_regs *mxs_ssp_regs_by_bus(unsigned int port)
{
switch (port) {