static int sunxi_spdif_suspend(struct snd_soc_dai *cpu_dai) { u32 reg_val; printk("[SPDIF]Enter %s\n", __func__); reg_val = readl(sunxi_spdif.regs + SUNXI_SPDIF_CTL); reg_val &= ~SUNXI_SPDIF_CTL_GEN; writel(reg_val, sunxi_spdif.regs + SUNXI_SPDIF_CTL); spdifregsave(); if ((NULL == spdif_moduleclk) ||(IS_ERR(spdif_moduleclk))) { printk("spdif_moduleclk handle is invalid, just return\n"); return -EFAULT; } else { /*disable the module clock*/ clk_disable(spdif_moduleclk); } #ifdef CONFIG_ARCH_SUN9IW1 if (spdif_vol) { regulator_disable(spdif_vol); regulator_put(spdif_vol); spdif_vol = NULL; } else { printk("regulator_disable failed: spdif_vol is null!!\n"); } #endif return 0; }
//#ifdef CONFIG_PM static int sun5i_spdif_suspend(struct snd_soc_dai *cpu_dai) { u32 reg_val; printk("[SPDIF]Enter %s\n", __func__); reg_val = readl(sun5i_spdif.regs + SUN5I_SPDIF_CTL); reg_val &= ~SUN5I_SPDIF_CTL_GEN; writel(reg_val, sun5i_spdif.regs + SUN5I_SPDIF_CTL); spdifregsave(); //disable the module clock clk_disable(spdif_moduleclk); clk_disable(spdif_apbclk); printk("[SPDIF]SPECIAL CLK 0x01c20068 = %#x, line= %d\n", *(volatile int*)0xF1C20068, __LINE__); printk("[SPDIF]SPECIAL CLK 0x01c200C0 = %#x, line= %d\n", *(volatile int*)0xF1C200C0, __LINE__); return 0; }