提交 71467e46 编写于 作者: X Xiubo Li 提交者: Mark Brown

ASoC: simple-card: Add device's module clock selection.

Try to get the device's module clock if the dt has no clocks and
system-clock-frequency properties.
Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 e874ddea
...@@ -90,14 +90,29 @@ asoc_simple_card_sub_parse_of(struct device_node *np, ...@@ -90,14 +90,29 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
* dai->sysclk come from * dai->sysclk come from
* "clocks = <&xxx>" (if system has common clock) * "clocks = <&xxx>" (if system has common clock)
* or "system-clock-frequency = <xxx>" * or "system-clock-frequency = <xxx>"
* or device's module clock.
*/ */
clk = of_clk_get(np, 0); if (of_property_read_bool(np, "clocks")) {
if (IS_ERR(clk)) clk = of_clk_get(np, 0);
if (IS_ERR(clk)) {
ret = PTR_ERR(clk);
goto parse_error;
}
dai->sysclk = clk_get_rate(clk);
} else if (of_property_read_bool(np, "system-clock-frequency")) {
of_property_read_u32(np, of_property_read_u32(np,
"system-clock-frequency", "system-clock-frequency",
&dai->sysclk); &dai->sysclk);
else } else {
clk = of_clk_get(*node, 0);
if (IS_ERR(clk)) {
ret = PTR_ERR(clk);
goto parse_error;
}
dai->sysclk = clk_get_rate(clk); dai->sysclk = clk_get_rate(clk);
}
ret = 0; ret = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册