diff options
author | Mika Westerberg <mika.westerberg@iki.fi> | 2010-05-11 10:34:54 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-05-13 07:19:52 -0400 |
commit | 4fec9978822a66b25f5645eb20c115034a18cfd1 (patch) | |
tree | fc6c064697704c5a86e2f6c7ac9ae77f60cbd80d /arch/arm/mach-ep93xx/clock.c | |
parent | 99e6a23adfadc2da2006f3715c4332c3bf502c07 (diff) |
ARM: 6124/1: ep93xx: SPI driver platform support code
This patch adds platform side support code for the EP93xx SPI
driver. This includes clock, resources and muxing. There is a new
function: ep93xx_register_spi() which can be used by board support
code to register new SPI devices for the board.
This patch depends on patch
5998/1 ep93xx: added chip revision reading function
Cc: Ryan Mallon <ryan@bluewatersys.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Martin Guy <martinwguy@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-ep93xx/clock.c')
-rw-r--r-- | arch/arm/mach-ep93xx/clock.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c index 5f80092b6ace..e29bdef9b2e2 100644 --- a/arch/arm/mach-ep93xx/clock.c +++ b/arch/arm/mach-ep93xx/clock.c | |||
@@ -96,6 +96,10 @@ static struct clk clk_keypad = { | |||
96 | .enable_mask = EP93XX_SYSCON_KEYTCHCLKDIV_KEN, | 96 | .enable_mask = EP93XX_SYSCON_KEYTCHCLKDIV_KEN, |
97 | .set_rate = set_keytchclk_rate, | 97 | .set_rate = set_keytchclk_rate, |
98 | }; | 98 | }; |
99 | static struct clk clk_spi = { | ||
100 | .parent = &clk_xtali, | ||
101 | .rate = EP93XX_EXT_CLK_RATE, | ||
102 | }; | ||
99 | static struct clk clk_pwm = { | 103 | static struct clk clk_pwm = { |
100 | .parent = &clk_xtali, | 104 | .parent = &clk_xtali, |
101 | .rate = EP93XX_EXT_CLK_RATE, | 105 | .rate = EP93XX_EXT_CLK_RATE, |
@@ -186,6 +190,7 @@ static struct clk_lookup clocks[] = { | |||
186 | INIT_CK("ep93xx-ohci", NULL, &clk_usb_host), | 190 | INIT_CK("ep93xx-ohci", NULL, &clk_usb_host), |
187 | INIT_CK("ep93xx-keypad", NULL, &clk_keypad), | 191 | INIT_CK("ep93xx-keypad", NULL, &clk_keypad), |
188 | INIT_CK("ep93xx-fb", NULL, &clk_video), | 192 | INIT_CK("ep93xx-fb", NULL, &clk_video), |
193 | INIT_CK("ep93xx-spi.0", NULL, &clk_spi), | ||
189 | INIT_CK(NULL, "pwm_clk", &clk_pwm), | 194 | INIT_CK(NULL, "pwm_clk", &clk_pwm), |
190 | INIT_CK(NULL, "m2p0", &clk_m2p0), | 195 | INIT_CK(NULL, "m2p0", &clk_m2p0), |
191 | INIT_CK(NULL, "m2p1", &clk_m2p1), | 196 | INIT_CK(NULL, "m2p1", &clk_m2p1), |
@@ -473,6 +478,14 @@ static int __init ep93xx_clock_init(void) | |||
473 | /* Initialize the pll2 derived clocks */ | 478 | /* Initialize the pll2 derived clocks */ |
474 | clk_usb_host.rate = clk_pll2.rate / (((value >> 28) & 0xf) + 1); | 479 | clk_usb_host.rate = clk_pll2.rate / (((value >> 28) & 0xf) + 1); |
475 | 480 | ||
481 | /* | ||
482 | * EP93xx SSP clock rate was doubled in version E2. For more information | ||
483 | * see: | ||
484 | * http://www.cirrus.com/en/pubs/appNote/AN273REV4.pdf | ||
485 | */ | ||
486 | if (ep93xx_chip_revision() < EP93XX_CHIP_REV_E2) | ||
487 | clk_spi.rate /= 2; | ||
488 | |||
476 | pr_info("PLL1 running at %ld MHz, PLL2 at %ld MHz\n", | 489 | pr_info("PLL1 running at %ld MHz, PLL2 at %ld MHz\n", |
477 | clk_pll1.rate / 1000000, clk_pll2.rate / 1000000); | 490 | clk_pll1.rate / 1000000, clk_pll2.rate / 1000000); |
478 | pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n", | 491 | pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n", |