]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/include/asm/arch-mxs/regs-ssp.h
ARM: AM43xx: Add support for RTC only + DDR in self-refresh mode
[u-boot] / arch / arm / include / asm / arch-mxs / regs-ssp.h
index 9b30f56f54c841057271668bc50eb1b5b7907f94..12a5dab73aec8b443a7bde3b38a708e8fbccd757 100644 (file)
@@ -6,26 +6,13 @@
  * Based on code from LTIB:
  * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved.
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
- *
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #ifndef __MX28_REGS_SSP_H__
 #define __MX28_REGS_SSP_H__
 
-#include <asm/arch/regs-common.h>
+#include <asm/mach-imx/regs-common.h>
 
 #ifndef        __ASSEMBLY__
 #if defined(CONFIG_MX23)
@@ -74,6 +61,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) {