Skip to contentSkip to conversation

sh: sh7724: Add workaround for FSI sound

PATCH In review Kuninori Morimoto 2 participants 3 messages Feb 19, 2010 – Feb 22, 2010 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh: sh7724: Add workaround for FSI sound

When FSI and Network (= NFS file system) had been used at the same time, the I/O of FSI was unstable.
This patch modify the SPU2 clock which is used for FSI as nearly equal system clock for stable continuous operation. Special thanks to Jeremy.

---
 arch/sh/boards/mach-ecovec24/setup.c |   34 ++++++++++++++++++++++++++
 arch/sh/boards/mach-se/7724/setup.c  |   44 ++++++++++++++++++++++++++++++----
 2 files changed, 73 insertions(+), 5 deletions(-)
arch/sh/boards/mach-ecovec24/setup.c +34 -0
index 5c24628..4caa8a0 100644
@@ -690,6 +690,34 @@ static struct platform_device camera_devices[] = {
 	},
 };
 
+/*
+ * SPU2
+ *
+ * used to clock core of FSI,
+ * set close to 12.288MHz,
+ * see
+ *    Table 45.9  point 4 of 7724 manual (English ver)
+ *    Table 45.11 point 4 of 7724 manual (Japanese ver)
+ */
+#define SPUCLKCR	0xA415003C
+static void spuclkcr_init(struct clk *clk)
+{
+	/* 333 MHz / (27 + 1) = 11.9 MHz */
+	ctrl_outl(0x000001B, clk->enable_reg);
+}
+
+static struct clk_ops spuclkcr_clk_ops = {
+	.init = spuclkcr_init,
+};
+
+static struct clk spuclkcr_clk = {
+	.name		= "spuclkcr_clk",
+	.id		= -1,
+	.ops		= &spuclkcr_clk_ops,
+	.enable_reg	= (void __iomem *)SPUCLKCR,
+	.rate		= 11904761, /* 11.9 MHz */
+};
+
 /* FSI */
 /*
  * FSI-B use external clock which came from da7210.
@@ -1107,6 +1135,12 @@ static int __init arch_setup(void)
 	gpio_request(GPIO_FN_FSIOBLRCK,  NULL);
 	gpio_request(GPIO_FN_CLKAUDIOBO, NULL);
 
+	/* change parent of SPU2 */
+	clk = clk_get(NULL, "spu_clk");
+	clk_register(&spuclkcr_clk);
+	clk_set_parent(clk, &spuclkcr_clk);
+	clk_put(clk);
+
 	/* change parent of FSI B */
 	clk = clk_get(NULL, "fsib_clk");
 	clk_register(&fsimckb_clk);
arch/sh/boards/mach-se/7724/setup.c +39 -5

65 lines not on this page · raw message

Signature · 1 line
1.6.3.3
#1 lore raw
Quoted 6 lines

When FSI and Network (= NFS file system) had been used at the same time, the I/O of FSI was unstable.
This patch modify the SPU2 clock which is used for FSI as nearly equal system clock for stable continuous operation. Special thanks to Jeremy.

I sent this patch, but I should used set_rate function. And I wonder should I add it in FSI driver ?

Best regards
--
Kuninori Morimoto

#2 lore raw
In reply to Kuninori Morimoto
Quoted 8 lines · Kuninori Morimoto
Quoted 5 lines

When FSI and Network (= NFS file system) had been used at the same time, the I/O of FSI was unstable.
This patch modify the SPU2 clock which is used for FSI as nearly equal system clock for stable continuous operation. Special thanks to Jeremy.

I sent this patch, but I should used set_rate function. And I wonder should I add it in FSI driver ?

I guess you want to set "spu_clk" to 12.288MHz?

Please use clk_set_rate() and clk_round_rate() like this patch:

http://marc.info/?l=linux-sh&m6657205426784&w=2

Thanks,

/ magnus