OMAP3+: OPP: Replace voltage values with Macros
[pandora-kernel.git] / arch / arm / mach-omap2 / clock2420_data.c
index fd5ba90..b6f65d4 100644 (file)
@@ -1,12 +1,12 @@
 /*
- *  linux/arch/arm/mach-omap2/clock2420_data.c
+ * OMAP2420 clock data
  *
- *  Copyright (C) 2005-2009 Texas Instruments, Inc.
- *  Copyright (C) 2004-2011 Nokia Corporation
+ * Copyright (C) 2005-2009 Texas Instruments, Inc.
+ * Copyright (C) 2004-2011 Nokia Corporation
  *
- *  Contacts:
- *  Richard Woodruff <r-woodruff2@ti.com>
- *  Paul Walmsley
+ * Contacts:
+ * Richard Woodruff <r-woodruff2@ti.com>
+ * Paul Walmsley
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
 /*
  * 2420 clock tree.
  *
- * NOTE:In many cases here we are assigning a 'default' parent.        In many
- *     cases the parent is selectable. The get/set parent calls will also
- *     switch sources.
- *
- *     Many some clocks say always_enabled, but they can be auto idled for
- *     power savings. They will always be available upon clock request.
+ * NOTE:In many cases here we are assigning a 'default' parent. In
+ *     many cases the parent is selectable. The set parent calls will
+ *     also switch sources.
  *
  *     Several sources are given initial rates which may be wrong, this will
  *     be fixed up in the init func.
  *
  *     Things are broadly separated below by clock domains. It is
- *     noteworthy that most periferals have dependencies on multiple clock
+ *     noteworthy that most peripherals have dependencies on multiple clock
  *     domains. Many get their interface clocks from the L4 domain, but get
  *     functional clocks from fixed sources or other core domain derived
  *     clocks.
@@ -116,7 +113,6 @@ static struct dpll_data dpll_dd = {
        .max_multiplier         = 1023,
        .min_divider            = 1,
        .max_divider            = 16,
-       .rate_tolerance         = DEFAULT_DPLL_RATE_TOLERANCE
 };
 
 /*
@@ -455,36 +451,22 @@ static struct clk dsp_fck = {
        .recalc         = &omap2_clksel_recalc,
 };
 
-/* DSP interface clock */
-static const struct clksel_rate dsp_irate_ick_rates[] = {
-       { .div = 1, .val = 1, .flags = RATE_IN_24XX },
-       { .div = 2, .val = 2, .flags = RATE_IN_24XX },
-       { .div = 0 },
-};
-
-static const struct clksel dsp_irate_ick_clksel[] = {
-       { .parent = &dsp_fck, .rates = dsp_irate_ick_rates },
+static const struct clksel dsp_ick_clksel[] = {
+       { .parent = &dsp_fck, .rates = dsp_ick_rates },
        { .parent = NULL }
 };
 
-/* This clock does not exist as such in the TRM. */
-static struct clk dsp_irate_ick = {
-       .name           = "dsp_irate_ick",
-       .ops            = &clkops_null,
-       .parent         = &dsp_fck,
-       .clksel_reg     = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
-       .clksel_mask    = OMAP24XX_CLKSEL_DSP_IF_MASK,
-       .clksel         = dsp_irate_ick_clksel,
-       .recalc         = &omap2_clksel_recalc,
-};
-
-/* 2420 only */
 static struct clk dsp_ick = {
        .name           = "dsp_ick",     /* apparently ipi and isp */
        .ops            = &clkops_omap2_iclk_dflt_wait,
-       .parent         = &dsp_irate_ick,
+       .parent         = &dsp_fck,
+       .clkdm_name     = "dsp_clkdm",
        .enable_reg     = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN),
        .enable_bit     = OMAP2420_EN_DSP_IPI_SHIFT,          /* for ipi */
+       .clksel_reg     = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
+       .clksel_mask    = OMAP24XX_CLKSEL_DSP_IF_MASK,
+       .clksel         = dsp_ick_clksel,
+       .recalc         = &omap2_clksel_recalc,
 };
 
 /*
@@ -826,6 +808,14 @@ static struct clk dss_54m_fck = {  /* Alt clk used in power management */
        .recalc         = &followparent_recalc,
 };
 
+static struct clk wu_l4_ick = {
+       .name           = "wu_l4_ick",
+       .ops            = &clkops_null,
+       .parent         = &sys_ck,
+       .clkdm_name     = "wkup_clkdm",
+       .recalc         = &followparent_recalc,
+};
+
 /*
  * CORE power domain ICLK & FCLK defines.
  * Many of the these can have more than one possible parent. Entries
@@ -847,8 +837,8 @@ static const struct clksel omap24xx_gpt_clksel[] = {
 static struct clk gpt1_ick = {
        .name           = "gpt1_ick",
        .ops            = &clkops_omap2_iclk_dflt_wait,
-       .parent         = &l4_ck,
-       .clkdm_name     = "core_l4_clkdm",
+       .parent         = &wu_l4_ick,
+       .clkdm_name     = "wkup_clkdm",
        .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
        .enable_bit     = OMAP24XX_EN_GPT1_SHIFT,
        .recalc         = &followparent_recalc,
@@ -994,6 +984,7 @@ static struct clk gpt7_ick = {
        .name           = "gpt7_ick",
        .ops            = &clkops_omap2_iclk_dflt_wait,
        .parent         = &l4_ck,
+       .clkdm_name     = "core_l4_clkdm",
        .enable_reg     = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
        .enable_bit     = OMAP24XX_EN_GPT7_SHIFT,
        .recalc         = &followparent_recalc,
@@ -1300,8 +1291,8 @@ static struct clk uart3_fck = {
 static struct clk gpios_ick = {
        .name           = "gpios_ick",
        .ops            = &clkops_omap2_iclk_dflt_wait,
-       .parent         = &l4_ck,
-       .clkdm_name     = "core_l4_clkdm",
+       .parent         = &wu_l4_ick,
+       .clkdm_name     = "wkup_clkdm",
        .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
        .enable_bit     = OMAP24XX_EN_GPIOS_SHIFT,
        .recalc         = &followparent_recalc,
@@ -1320,8 +1311,8 @@ static struct clk gpios_fck = {
 static struct clk mpu_wdt_ick = {
        .name           = "mpu_wdt_ick",
        .ops            = &clkops_omap2_iclk_dflt_wait,
-       .parent         = &l4_ck,
-       .clkdm_name     = "core_l4_clkdm",
+       .parent         = &wu_l4_ick,
+       .clkdm_name     = "wkup_clkdm",
        .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
        .enable_bit     = OMAP24XX_EN_MPU_WDT_SHIFT,
        .recalc         = &followparent_recalc,
@@ -1340,9 +1331,9 @@ static struct clk mpu_wdt_fck = {
 static struct clk sync_32k_ick = {
        .name           = "sync_32k_ick",
        .ops            = &clkops_omap2_iclk_dflt_wait,
-       .parent         = &l4_ck,
+       .parent         = &wu_l4_ick,
+       .clkdm_name     = "wkup_clkdm",
        .flags          = ENABLE_ON_INIT,
-       .clkdm_name     = "core_l4_clkdm",
        .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
        .enable_bit     = OMAP24XX_EN_32KSYNC_SHIFT,
        .recalc         = &followparent_recalc,
@@ -1351,8 +1342,8 @@ static struct clk sync_32k_ick = {
 static struct clk wdt1_ick = {
        .name           = "wdt1_ick",
        .ops            = &clkops_omap2_iclk_dflt_wait,
-       .parent         = &l4_ck,
-       .clkdm_name     = "core_l4_clkdm",
+       .parent         = &wu_l4_ick,
+       .clkdm_name     = "wkup_clkdm",
        .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
        .enable_bit     = OMAP24XX_EN_WDT1_SHIFT,
        .recalc         = &followparent_recalc,
@@ -1361,9 +1352,9 @@ static struct clk wdt1_ick = {
 static struct clk omapctrl_ick = {
        .name           = "omapctrl_ick",
        .ops            = &clkops_omap2_iclk_dflt_wait,
-       .parent         = &l4_ck,
+       .parent         = &wu_l4_ick,
+       .clkdm_name     = "wkup_clkdm",
        .flags          = ENABLE_ON_INIT,
-       .clkdm_name     = "core_l4_clkdm",
        .enable_reg     = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
        .enable_bit     = OMAP24XX_EN_OMAPCTRL_SHIFT,
        .recalc         = &followparent_recalc,
@@ -1805,7 +1796,6 @@ static struct omap_clk omap2420_clks[] = {
        CLK(NULL,       "mpu_ck",       &mpu_ck,        CK_242X),
        /* dsp domain clocks */
        CLK(NULL,       "dsp_fck",      &dsp_fck,       CK_242X),
-       CLK(NULL,       "dsp_irate_ick", &dsp_irate_ick, CK_242X),
        CLK(NULL,       "dsp_ick",      &dsp_ick,       CK_242X),
        CLK(NULL,       "iva1_ifck",    &iva1_ifck,     CK_242X),
        CLK(NULL,       "iva1_mpu_int_ifck", &iva1_mpu_int_ifck, CK_242X),
@@ -1825,6 +1815,7 @@ static struct omap_clk omap2420_clks[] = {
        /* L4 domain clocks */
        CLK(NULL,       "l4_ck",        &l4_ck,         CK_242X),
        CLK(NULL,       "ssi_l4_ick",   &ssi_l4_ick,    CK_242X),
+       CLK(NULL,       "wu_l4_ick",    &wu_l4_ick,     CK_242X),
        /* virtual meta-group clock */
        CLK(NULL,       "virt_prcm_set", &virt_prcm_set, CK_242X),
        /* general l4 interface ck, multi-parent functional clk */