diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-08 13:54:23 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-08 13:54:23 -0500 |
| commit | 934648f0449fae00946f55d64cd998bb5587fa1f (patch) | |
| tree | a8c5e55cfbfff34497f6ec873ea31725fdb849ab | |
| parent | 8be5814c45d1412c6c16cf9be73e507f5fe53c1b (diff) | |
| parent | 65670a1b75874cf36c81456f2fb1e5ef6c6c0a55 (diff) | |
Merge branch 'rmobile-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* 'rmobile-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
mmc: sh_mmcif: Convert extern inline to static inline.
ARM: mach-shmobile: Allow GPIO chips to register IRQ mappings.
ARM: mach-shmobile: fix sh7372 after a recent clock framework rework
ARM: mach-shmobile: include drivers/sh/Kconfig
ARM: mach-shmobile: ap4evb: Add HDMI sound support
ARM: mach-shmobile: clock-sh7372: Add FSIDIV clock support
ARM: shmobile: remove sh_timer_config clk member
| -rw-r--r-- | arch/arm/mach-shmobile/Kconfig | 2 | ||||
| -rw-r--r-- | arch/arm/mach-shmobile/board-ap4evb.c | 46 | ||||
| -rw-r--r-- | arch/arm/mach-shmobile/clock-sh7372.c | 102 | ||||
| -rw-r--r-- | arch/arm/mach-shmobile/include/mach/gpio.h | 4 | ||||
| -rw-r--r-- | arch/arm/mach-shmobile/include/mach/sh7372.h | 2 | ||||
| -rw-r--r-- | drivers/clocksource/sh_cmt.c | 10 | ||||
| -rw-r--r-- | drivers/clocksource/sh_mtu2.c | 10 | ||||
| -rw-r--r-- | drivers/clocksource/sh_tmu.c | 10 | ||||
| -rw-r--r-- | include/linux/mmc/sh_mmcif.h | 18 | ||||
| -rw-r--r-- | include/linux/sh_timer.h | 1 |
10 files changed, 171 insertions, 34 deletions
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index 54b479c35ee0..51dcd59eda6a 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig | |||
| @@ -116,4 +116,6 @@ endmenu | |||
| 116 | config SH_CLK_CPG | 116 | config SH_CLK_CPG |
| 117 | bool | 117 | bool |
| 118 | 118 | ||
| 119 | source "drivers/sh/Kconfig" | ||
| 120 | |||
| 119 | endif | 121 | endif |
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index 46ca4d4abf91..32d9e2816e56 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c | |||
| @@ -565,12 +565,50 @@ static struct platform_device *qhd_devices[] __initdata = { | |||
| 565 | 565 | ||
| 566 | /* FSI */ | 566 | /* FSI */ |
| 567 | #define IRQ_FSI evt2irq(0x1840) | 567 | #define IRQ_FSI evt2irq(0x1840) |
| 568 | |||
| 569 | static int fsi_set_rate(int is_porta, int rate) | ||
| 570 | { | ||
| 571 | struct clk *fsib_clk; | ||
| 572 | struct clk *fdiv_clk = &sh7372_fsidivb_clk; | ||
| 573 | int ret; | ||
| 574 | |||
| 575 | /* set_rate is not needed if port A */ | ||
| 576 | if (is_porta) | ||
| 577 | return 0; | ||
| 578 | |||
| 579 | fsib_clk = clk_get(NULL, "fsib_clk"); | ||
| 580 | if (IS_ERR(fsib_clk)) | ||
| 581 | return -EINVAL; | ||
| 582 | |||
| 583 | switch (rate) { | ||
| 584 | case 48000: | ||
| 585 | clk_set_rate(fsib_clk, clk_round_rate(fsib_clk, 85428000)); | ||
| 586 | clk_set_rate(fdiv_clk, clk_round_rate(fdiv_clk, 12204000)); | ||
| 587 | ret = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64; | ||
| 588 | break; | ||
| 589 | default: | ||
| 590 | pr_err("unsupported rate in FSI2 port B\n"); | ||
| 591 | ret = -EINVAL; | ||
| 592 | break; | ||
| 593 | } | ||
| 594 | |||
| 595 | clk_put(fsib_clk); | ||
| 596 | |||
| 597 | return ret; | ||
| 598 | } | ||
| 599 | |||
| 568 | static struct sh_fsi_platform_info fsi_info = { | 600 | static struct sh_fsi_platform_info fsi_info = { |
| 569 | .porta_flags = SH_FSI_BRS_INV | | 601 | .porta_flags = SH_FSI_BRS_INV | |
| 570 | SH_FSI_OUT_SLAVE_MODE | | 602 | SH_FSI_OUT_SLAVE_MODE | |
| 571 | SH_FSI_IN_SLAVE_MODE | | 603 | SH_FSI_IN_SLAVE_MODE | |
| 572 | SH_FSI_OFMT(PCM) | | 604 | SH_FSI_OFMT(PCM) | |
| 573 | SH_FSI_IFMT(PCM), | 605 | SH_FSI_IFMT(PCM), |
| 606 | |||
| 607 | .portb_flags = SH_FSI_BRS_INV | | ||
| 608 | SH_FSI_BRM_INV | | ||
| 609 | SH_FSI_LRS_INV | | ||
| 610 | SH_FSI_OFMT(SPDIF), | ||
| 611 | .set_rate = fsi_set_rate, | ||
| 574 | }; | 612 | }; |
| 575 | 613 | ||
| 576 | static struct resource fsi_resources[] = { | 614 | static struct resource fsi_resources[] = { |
| @@ -634,6 +672,7 @@ static struct platform_device lcdc1_device = { | |||
| 634 | static struct sh_mobile_hdmi_info hdmi_info = { | 672 | static struct sh_mobile_hdmi_info hdmi_info = { |
| 635 | .lcd_chan = &sh_mobile_lcdc1_info.ch[0], | 673 | .lcd_chan = &sh_mobile_lcdc1_info.ch[0], |
| 636 | .lcd_dev = &lcdc1_device.dev, | 674 | .lcd_dev = &lcdc1_device.dev, |
| 675 | .flags = HDMI_SND_SRC_SPDIF, | ||
| 637 | }; | 676 | }; |
| 638 | 677 | ||
| 639 | static struct resource hdmi_resources[] = { | 678 | static struct resource hdmi_resources[] = { |
| @@ -992,6 +1031,7 @@ static void __init ap4evb_map_io(void) | |||
| 992 | 1031 | ||
| 993 | #define GPIO_PORT9CR 0xE6051009 | 1032 | #define GPIO_PORT9CR 0xE6051009 |
| 994 | #define GPIO_PORT10CR 0xE605100A | 1033 | #define GPIO_PORT10CR 0xE605100A |
| 1034 | #define USCCR1 0xE6058144 | ||
| 995 | static void __init ap4evb_init(void) | 1035 | static void __init ap4evb_init(void) |
| 996 | { | 1036 | { |
| 997 | u32 srcr4; | 1037 | u32 srcr4; |
| @@ -1062,7 +1102,7 @@ static void __init ap4evb_init(void) | |||
| 1062 | /* setup USB phy */ | 1102 | /* setup USB phy */ |
| 1063 | __raw_writew(0x8a0a, 0xE6058130); /* USBCR2 */ | 1103 | __raw_writew(0x8a0a, 0xE6058130); /* USBCR2 */ |
| 1064 | 1104 | ||
| 1065 | /* enable FSI2 */ | 1105 | /* enable FSI2 port A (ak4643) */ |
| 1066 | gpio_request(GPIO_FN_FSIAIBT, NULL); | 1106 | gpio_request(GPIO_FN_FSIAIBT, NULL); |
| 1067 | gpio_request(GPIO_FN_FSIAILR, NULL); | 1107 | gpio_request(GPIO_FN_FSIAILR, NULL); |
| 1068 | gpio_request(GPIO_FN_FSIAISLD, NULL); | 1108 | gpio_request(GPIO_FN_FSIAISLD, NULL); |
| @@ -1079,6 +1119,10 @@ static void __init ap4evb_init(void) | |||
| 1079 | gpio_request(GPIO_PORT41, NULL); | 1119 | gpio_request(GPIO_PORT41, NULL); |
| 1080 | gpio_direction_input(GPIO_PORT41); | 1120 | gpio_direction_input(GPIO_PORT41); |
| 1081 | 1121 | ||
| 1122 | /* setup FSI2 port B (HDMI) */ | ||
| 1123 | gpio_request(GPIO_FN_FSIBCK, NULL); | ||
| 1124 | __raw_writew(__raw_readw(USCCR1) & ~(1 << 6), USCCR1); /* use SPDIF */ | ||
| 1125 | |||
| 1082 | /* set SPU2 clock to 119.6 MHz */ | 1126 | /* set SPU2 clock to 119.6 MHz */ |
| 1083 | clk = clk_get(NULL, "spu_clk"); | 1127 | clk = clk_get(NULL, "spu_clk"); |
| 1084 | if (!IS_ERR(clk)) { | 1128 | if (!IS_ERR(clk)) { |
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c index 8565aefa21fd..7db31e6c6bf2 100644 --- a/arch/arm/mach-shmobile/clock-sh7372.c +++ b/arch/arm/mach-shmobile/clock-sh7372.c | |||
| @@ -50,6 +50,9 @@ | |||
| 50 | #define SMSTPCR3 0xe615013c | 50 | #define SMSTPCR3 0xe615013c |
| 51 | #define SMSTPCR4 0xe6150140 | 51 | #define SMSTPCR4 0xe6150140 |
| 52 | 52 | ||
| 53 | #define FSIDIVA 0xFE1F8000 | ||
| 54 | #define FSIDIVB 0xFE1F8008 | ||
| 55 | |||
| 53 | /* Platforms must set frequency on their DV_CLKI pin */ | 56 | /* Platforms must set frequency on their DV_CLKI pin */ |
| 54 | struct clk sh7372_dv_clki_clk = { | 57 | struct clk sh7372_dv_clki_clk = { |
| 55 | }; | 58 | }; |
| @@ -288,6 +291,7 @@ struct clk sh7372_pllc2_clk = { | |||
| 288 | .ops = &pllc2_clk_ops, | 291 | .ops = &pllc2_clk_ops, |
| 289 | .parent = &extal1_div2_clk, | 292 | .parent = &extal1_div2_clk, |
| 290 | .freq_table = pllc2_freq_table, | 293 | .freq_table = pllc2_freq_table, |
| 294 | .nr_freqs = ARRAY_SIZE(pllc2_freq_table) - 1, | ||
| 291 | .parent_table = pllc2_parent, | 295 | .parent_table = pllc2_parent, |
| 292 | .parent_num = ARRAY_SIZE(pllc2_parent), | 296 | .parent_num = ARRAY_SIZE(pllc2_parent), |
| 293 | }; | 297 | }; |
| @@ -417,6 +421,101 @@ static struct clk div6_reparent_clks[DIV6_REPARENT_NR] = { | |||
| 417 | fsibckcr_parent, ARRAY_SIZE(fsibckcr_parent), 6, 2), | 421 | fsibckcr_parent, ARRAY_SIZE(fsibckcr_parent), 6, 2), |
| 418 | }; | 422 | }; |
| 419 | 423 | ||
| 424 | /* FSI DIV */ | ||
| 425 | static unsigned long fsidiv_recalc(struct clk *clk) | ||
| 426 | { | ||
| 427 | unsigned long value; | ||
| 428 | |||
| 429 | value = __raw_readl(clk->mapping->base); | ||
| 430 | |||
| 431 | if ((value & 0x3) != 0x3) | ||
| 432 | return 0; | ||
| 433 | |||
| 434 | value >>= 16; | ||
| 435 | if (value < 2) | ||
| 436 | return 0; | ||
| 437 | |||
| 438 | return clk->parent->rate / value; | ||
| 439 | } | ||
| 440 | |||
| 441 | static long fsidiv_round_rate(struct clk *clk, unsigned long rate) | ||
| 442 | { | ||
| 443 | return clk_rate_div_range_round(clk, 2, 0xffff, rate); | ||
| 444 | } | ||
| 445 | |||
| 446 | static void fsidiv_disable(struct clk *clk) | ||
| 447 | { | ||
| 448 | __raw_writel(0, clk->mapping->base); | ||
| 449 | } | ||
| 450 | |||
| 451 | static int fsidiv_enable(struct clk *clk) | ||
| 452 | { | ||
