]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/include/asm/arch-mxs/regs-ssp.h
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
[u-boot] / arch / arm / include / asm / arch-mxs / regs-ssp.h
index 9b30f56f54c841057271668bc50eb1b5b7907f94..5920f9b4dc7bf3b2a9daf82a610dbfe59b748c6b 100644 (file)
@@ -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) {