CHROMIUM: ARM: enable xclkout for audio on daisy/snow
authorOlof Johansson <olofj@chromium.org>
Tue, 12 Jun 2012 16:07:24 +0000 (09:07 -0700)
committerOlof Johansson <olofj@chromium.org>
Tue, 26 Jun 2012 18:20:40 +0000 (11:20 -0700)
Daisy/snow need xclkout to be enabled since it's their reference clock
for the audio codec. Enabling the output on smdk shouldn't be
harmful so just do it globally for now.

Note that this should be moved over to be a regular system clock instead
of just being forced on like this.

Change-Id: Ia4f612ff56c6715aa99e9b50e51b5e03874feb8a
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit-int.chromium.org/20545
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Ready: Olof Johansson <olofj@google.com>
Tested-by: Olof Johansson <olofj@google.com>
arch/arm/mach-exynos/mach-exynos5-dt.c

index 0deae34..1b796f8 100644 (file)
@@ -533,6 +533,22 @@ static struct exynos_dp_platdata smdk5250_dp_data __initdata = {
        .phy_exit       = s5p_dp_phy_exit,
 };
 
+#define S5P_PMU_DEBUG                          S5P_PMUREG(0x0A00)
+/* PMU_DEBUG bits [12:8] = 0x10000 selects XXTI clock source */
+#define PMU_DEBUG_XXTI                         (0x10 << 8)
+/* Mask bit[12:8] for xxti clock selection */
+#define PMU_DEBUG_CLKOUT_SEL_MASK              0x1f00
+
+static void __init enable_xclkout(void)
+{
+       unsigned int tmp;
+
+       tmp = readl(S5P_PMU_DEBUG);
+       tmp &= ~PMU_DEBUG_CLKOUT_SEL_MASK;
+       tmp |= PMU_DEBUG_XXTI;
+       writel(tmp, S5P_PMU_DEBUG);
+}
+
 static int exynos_cfg_i2s_gpio(struct platform_device *pdev)
 {
        int id;
@@ -808,6 +824,11 @@ static void __init exynos5250_dt_machine_init(void)
                i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
        }
 
+       /* XCLKOUT needs to be moved over to the clock interface, but enable it
+        * here for now.
+        */
+       enable_xclkout();
+
        spi_register_board_info(spi1_board_info, ARRAY_SIZE(spi1_board_info));
 
        of_platform_populate(NULL, of_default_bus_match_table,