aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/board-ap4evb.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2010-10-15 01:15:05 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-10-15 05:58:41 -0400
commit69ce8aa4925a54de192cf64e99abd294586c1984 (patch)
treeda14c4a51e4000f50b10508a580b993b7917d032 /arch/arm/mach-shmobile/board-ap4evb.c
parent685e4080c62b4b5c6f67c7b088e416e98d06f7e6 (diff)
ARM: mach-shmobile: clock-sh7372: FSI parent select support
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile/board-ap4evb.c')
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c70
1 files changed, 41 insertions, 29 deletions
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index f879eb3c3427..1e7beee79086 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -546,27 +546,6 @@ static struct platform_device *qhd_devices[] __initdata = {
546 546
547/* FSI */ 547/* FSI */
548#define IRQ_FSI evt2irq(0x1840) 548#define IRQ_FSI evt2irq(0x1840)
549#define FSIACKCR 0xE6150018
550static void fsiackcr_init(struct clk *clk)
551{
552 u32 status = __raw_readl(clk->enable_reg);
553
554 /* use external clock */
555 status &= ~0x000000ff;
556 status |= 0x00000080;
557 __raw_writel(status, clk->enable_reg);
558}
559
560static struct clk_ops fsiackcr_clk_ops = {
561 .init = fsiackcr_init,
562};
563
564static struct clk fsiackcr_clk = {
565 .ops = &fsiackcr_clk_ops,
566 .enable_reg = (void __iomem *)FSIACKCR,
567 .rate = 0, /* unknown */
568};
569
570static struct sh_fsi_platform_info fsi_info = { 549static struct sh_fsi_platform_info fsi_info = {
571 .porta_flags = SH_FSI_BRS_INV | 550 .porta_flags = SH_FSI_BRS_INV |
572 SH_FSI_OUT_SLAVE_MODE | 551 SH_FSI_OUT_SLAVE_MODE |
@@ -817,6 +796,47 @@ out:
817 796
818device_initcall(hdmi_init_pm_clock); 797device_initcall(hdmi_init_pm_clock);
819 798
799#define FSIACK_DUMMY_RATE 48000
800static int __init fsi_init_pm_clock(void)
801{
802 struct clk *fsia_ick;
803 int ret;
804
805 /*
806 * FSIACK is connected to AK4642,
807 * and the rate is depend on playing sound rate.
808 * So, set dummy rate (= 48k) here
809 */
810 ret = clk_set_rate(&sh7372_fsiack_clk, FSIACK_DUMMY_RATE);
811 if (ret < 0) {
812 pr_err("Cannot set FSIACK dummy rate: %d\n", ret);
813 return ret;
814 }
815
816 fsia_ick = clk_get(&fsi_device.dev, "icka");
817 if (IS_ERR(fsia_ick)) {
818 ret = PTR_ERR(fsia_ick);
819 pr_err("Cannot get FSI ICK: %d\n", ret);
820 return ret;
821 }
822
823 ret = clk_set_parent(fsia_ick, &sh7372_fsiack_clk);
824 if (ret < 0) {
825 pr_err("Cannot set FSI-A parent: %d\n", ret);
826 goto out;
827 }
828
829 ret = clk_set_rate(fsia_ick, FSIACK_DUMMY_RATE);
830 if (ret < 0)
831 pr_err("Cannot set FSI-A rate: %d\n", ret);
832
833out:
834 clk_put(fsia_ick);
835
836 return ret;
837}
838device_initcall(fsi_init_pm_clock);
839
820/* 840/*
821 * FIXME !! 841 * FIXME !!
822 * 842 *
@@ -1007,14 +1027,6 @@ static void __init ap4evb_init(void)
1007 clk_put(clk); 1027 clk_put(clk);
1008 } 1028 }
1009 1029
1010 /* change parent of FSI A */
1011 clk = clk_get(NULL, "fsia_clk");
1012 if (!IS_ERR(clk)) {
1013 clk_register(&fsiackcr_clk);
1014 clk_set_parent(clk, &fsiackcr_clk);
1015 clk_put(clk);
1016 }
1017
1018 /* 1030 /*
1019 * set irq priority, to avoid sound chopping 1031 * set irq priority, to avoid sound chopping
1020 * when NFS rootfs is used 1032 * when NFS rootfs is used