spdif:fix hclk
authorzyh <zyh@rock-chips.com>
Fri, 13 Jun 2014 12:37:46 +0000 (20:37 +0800)
committerzyh <zyh@rock-chips.com>
Fri, 13 Jun 2014 12:38:58 +0000 (20:38 +0800)
arch/arm/boot/dts/rk3288.dtsi
sound/soc/rockchip/rk_spdif.c

index e7f71f7e6c0e7163e37496bdd2ba3360a727285f..c36e5dd40bfe5d8a37eef4ea508e104d35d7cdfb 100755 (executable)
                compatible = "rockchip-spdif";
                reg = <0xff8b0000 0x10000>;     //8channel
                //reg = <ff880000 0x10000>;//2channel
-               clocks = <&clk_spdif>, <&clk_spdif_8ch>;
-               clock-names = "spdif_mclk","spdif_8ch_mclk";
+               clocks = <&clk_spdif>, <&clk_spdif_8ch>,<&clk_gates10 11>;
+               clock-names = "spdif_mclk","spdif_8ch_mclk","spdif_hclk";
                interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
                dmas = <&pdma0 3>;
                //dmas = <&pdma0 2>; //2channel
index 63cb2db70b80a1adbce2e6e42885d4d059ed2cec..0ea082b90542c3e48721b6f1de6c8b7a30367aa3 100755 (executable)
@@ -414,6 +414,7 @@ static int spdif_probe(struct platform_device *pdev)
 {
        struct resource *mem_res;
        struct rockchip_spdif_info *spdif;
+       struct clk *spdif_hclk;
        int ret;
 
        RK_SPDIF_DBG("Entered %s\n", __func__);
@@ -434,7 +435,7 @@ static int spdif_probe(struct platform_device *pdev)
                return -ENXIO;
        }
 
-       spdif->clk = clk_get(&pdev->dev, "spdif_mclk");
+       spdif->clk = clk_get(&pdev->dev, "spdif_8ch_mclk");
        if (IS_ERR(spdif->clk)) {
                dev_err(&pdev->dev, "Can't retrieve spdif clock\n");
                return PTR_ERR(spdif->clk);
@@ -443,6 +444,12 @@ static int spdif_probe(struct platform_device *pdev)
        clk_set_rate(spdif->clk, 11289600);
        clk_prepare_enable(spdif->clk);
 
+       spdif_hclk = clk_get(&pdev->dev, "spdif_hclk");
+       if(IS_ERR(spdif_hclk) ) {
+               dev_err(&pdev->dev, "get spdif_hclk failed.\n");
+       } else {
+               clk_prepare_enable(spdif_hclk);
+       }
 
        /* Request S/PDIF Register's memory region */
        if (!request_mem_region(mem_res->start,