@@ -115,6 +115,13 @@
#define OMAP_DMMU_BASE 0x5D000000
#define OMAP_DMMU_SIZE 0x1000
+#define OMAP_SSI_BASE 0x48058000
+#define OMAP_SSI_SIZE 0x1000
+
+#define SSI_AUTOIDLE (1 << 0)
+#define SSI_SIDLE_SMARTIDLE (2 << 3)
+#define SSI_MIDLE_NOIDLE (1 << 12)
+
#define OMAP_PRCM_VDD1_DOMAIN 1
#define OMAP_PRCM_VDD2_DOMAIN 2
@@ -39,6 +39,7 @@
#include <dspbridge/std.h>
#include <dspbridge/dbdefs.h>
#include <dspbridge/errbase.h>
+#include <dspbridge/drv.h>
/* ----------------------------------- Trace & Debug */
#include <dspbridge/dbc.h>
@@ -54,11 +55,6 @@
typedef volatile unsigned long REG_UWORD32;
-#define SSI_Base 0x48058000
-
-#define SSI_BASE IO_ADDRESS(SSI_Base)
-
-
struct SERVICES_Clk_t {
struct clk *clk_handle;
const char *clk_name;
@@ -354,19 +350,25 @@ s32 CLK_Get_UseCnt(IN enum SERVICES_ClkId clk_id)
void SSI_Clk_Prepare(bool FLAG)
{
- u32 ssi_sysconfig;
- ssi_sysconfig = __raw_readl((SSI_BASE) + 0x10);
+ void __iomem *ssi_base;
+ unsigned int value;
+
+ ssi_base = ioremap(OMAP_SSI_BASE, OMAP_SSI_SIZE);
if (FLAG) {
- /* Set Autoidle, SIDLEMode to smart idle, and MIDLEmode to
- * no idle
+ /*
+ * Set Autoidle, SIDLEMode to smart idle, and MIDLEmode to
+ * no idle.
*/
- ssi_sysconfig = 0x1011;
+ value = SSI_AUTOIDLE | SSI_SIDLE_SMARTIDLE | SSI_MIDLE_NOIDLE;
} else {
- /* Set Autoidle, SIDLEMode to forced idle, and MIDLEmode to
- * forced idle
+ /*
+ * Set Autoidle, SIDLEMode to forced idle, and MIDLEmode to
+ * forced idle.
*/
- ssi_sysconfig = 0x1;
+ value = SSI_AUTOIDLE;
}
- __raw_writel((u32)ssi_sysconfig, SSI_BASE + 0x10);
+
+ __raw_writel(value, ssi_base + 0x10);
+ iounmap(ssi_base);
}