]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00279368-3 mxc: asrc: Add missing clock control
authorNicolin Chen <b42378@freescale.com>
Thu, 12 Sep 2013 06:56:36 +0000 (14:56 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 20 Aug 2014 08:06:31 +0000 (10:06 +0200)
* Add missing clock control
* Set ASRC clock to 7.5MHz as 3.0.35 does
* Use the same divisor for ideal ratio mode as 3.0.35 does

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
arch/arm/mach-imx/clk-imx6q.c
drivers/mxc/asrc/mxc_asrc.c
include/linux/mxc_asrc.h

index f90b62f12c07194cac218bc251a95a08a7d942eb..a7996f63a014618768af6471ea898d1ddf9f6c93 100644 (file)
@@ -515,6 +515,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
 
        /* Audio-related clocks configuration */
        clk_set_parent(clk[spdif_sel], clk[pll3_pfd3_454m]);
+       clk_set_parent(clk[asrc_sel], clk[pll3_usb_otg]);
+       clk_set_rate(clk[asrc_sel], 7500000);
 
        /* All existing boards with PCIe use LVDS1 */
        if (IS_ENABLED(CONFIG_PCI_IMX6))
index 3bba8f46980aeb57eec87f91c36a1a60a32dc03c..5ae42217b77c7df7bf8349fd40b898cb016ddd8a 100644 (file)
@@ -680,6 +680,8 @@ EXPORT_SYMBOL(asrc_get_per_addr);
 
 static int mxc_init_asrc(void)
 {
+       clk_enable(asrc->asrc_clk);
+
        /* Halt ASRC internal FP when input FIFO needs data for pair A, B, C */
        asrc_regmap_write(asrc->regmap, REG_ASRCTR, ASRCTR_ASRCEN);
 
@@ -708,6 +710,8 @@ static int mxc_init_asrc(void)
        /* Set the processing clock for 56KHz, 133M */
        asrc_regmap_write(asrc->regmap, REG_ASR56K, 0x0947);
 
+       clk_disable(asrc->asrc_clk);
+
        return 0;
 }
 
@@ -1927,7 +1931,7 @@ static int mxc_asrc_probe(struct platform_device *pdev)
                goto err_iomap;
        }
 #ifndef ASRC_USE_REGMAP
-       clk_prepare_enable(asrc->asrc_clk);
+       clk_prepare(asrc->asrc_clk);
 #endif
 
        ret = of_property_read_u32_array(pdev->dev.of_node,
@@ -1984,6 +1988,9 @@ err_iomap:
 
 static int mxc_asrc_remove(struct platform_device *pdev)
 {
+#ifndef ASRC_USE_REGMAP
+       clk_unprepare(asrc->asrc_clk);
+#endif
        asrc_proc_remove();
        misc_deregister(&asrc_miscdev);
 
index 9f742a9da80e5eba3587711c26538e1fde018996..ecee963193af493c50c6aea723cb00a98a258ea3 100644 (file)
@@ -30,7 +30,7 @@
 
 
 /* Ideal Ratio mode doesn't care the outclk frequency, so be fixed */
-#define ASRC_PRESCALER_IDEAL_RATIO     7
+#define ASRC_PRESCALER_IDEAL_RATIO     5
 /* SPDIF rxclk pulse rate is 128 * samplerate, so 2 ^ 7 */
 #define ASRC_PRESCALER_SPDIF_RX                7
 /* SPDIF txclk pulse rate is 64 * samplerate, so 2 ^ 6 */