reg = <0x0 0x100a0000 0x0 0x1000>;
clocks = <&clkgen JH7110_SPDIF_CLK_APB>,
<&clkgen JH7110_SPDIF_CLK_CORE>,
- <&clkgen JH7110_APB0>,
<&clkgen JH7110_AUDIO_ROOT>,
<&clkgen JH7110_MCLK_INNER>;
- clock-names = "spdif-apb", "spdif-core", "apb0",
+ clock-names = "spdif-apb", "spdif-core",
"audroot", "mclk_inner";
resets = <&rstgen RSTN_U0_CDNS_SPDIF_APB>;
reset-names = "rst_apb";
static struct clk_bulk_data clks[] = {
{ .id = "spdif-apb" }, /* clock-names in dts file */
{ .id = "spdif-core" },
- { .id = "apb0" },
{ .id = "audroot" },
{ .id = "mclk_inner"},
};
spdif->spdif_apb = clks[0].clk;
spdif->spdif_core = clks[1].clk;
- spdif->apb0_clk = clks[2].clk;
- spdif->audio_root = clks[3].clk;
- spdif->mclk_inner = clks[4].clk;
+ spdif->audio_root = clks[2].clk;
+ spdif->mclk_inner = clks[3].clk;
return ret;
}
goto disable_core_clk;
}
- ret = clk_prepare_enable(spdif->apb0_clk);
- if (ret) {
- dev_err(&pdev->dev, "failed to prepare enable apb0_clk\n");
- goto disable_apb0_clk;
- }
-
- ret = clk_prepare_enable(spdif->audio_root);
- if (ret) {
- dev_err(&pdev->dev, "failed to prepare enable spdif->audio_root\n");
- goto disable_audroot_clk;
- }
-
ret = clk_set_rate(spdif->audio_root, 204800000);
if (ret) {
dev_err(&pdev->dev, "failed to set rate for spdif audroot ret=%d\n", ret);
- goto disable_audroot_clk;
- }
-
- ret = clk_prepare_enable(spdif->mclk_inner);
- if (ret) {
- dev_err(&pdev->dev, "failed to prepare enable spdif->mclk_inner\n");
- goto disable_mclk_clk;
+ goto disable_core_clk;
}
ret = clk_set_rate(spdif->mclk_inner, 8192000);
if (ret) {
dev_err(&pdev->dev, "failed to set rate for spdif mclk_inner ret=%d\n", ret);
- goto disable_mclk_clk;
+ goto disable_core_clk;
}
dev_dbg(&pdev->dev, "spdif->spdif_apb = %lu\n", clk_get_rate(spdif->spdif_apb));
dev_dbg(&pdev->dev, "spdif->spdif_core = %lu\n", clk_get_rate(spdif->spdif_core));
- dev_dbg(&pdev->dev, "spdif->apb0_clk = %lu\n", clk_get_rate(spdif->apb0_clk));
ret = reset_control_deassert(spdif->rst_apb);
if (ret) {
dev_err(&pdev->dev, "failed to deassert apb\n");
- goto disable_mclk_clk;
+ goto disable_core_clk;
}
return 0;
-disable_mclk_clk:
- clk_disable_unprepare(spdif->mclk_inner);
-disable_audroot_clk:
- clk_disable_unprepare(spdif->audio_root);
-disable_apb0_clk:
- clk_disable_unprepare(spdif->apb0_clk);
disable_core_clk:
clk_disable_unprepare(spdif->spdif_core);
disable_apb_clk: