From: Xiubo Li Date: Mon, 23 Dec 2013 07:25:38 +0000 (+0800) Subject: ASoC: simple-card: Add device's module clock selection. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=71467e46414d3bab220de77d3d085be0c0aa03e1;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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: Xiubo Li Signed-off-by: Mark Brown --- diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 3ba65bb63439..58c217e403ae 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -90,14 +90,29 @@ asoc_simple_card_sub_parse_of(struct device_node *np, * dai->sysclk come from * "clocks = <&xxx>" (if system has common clock) * or "system-clock-frequency = " + * or device's module clock. */ - clk = of_clk_get(np, 0); - if (IS_ERR(clk)) + if (of_property_read_bool(np, "clocks")) { + 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, "system-clock-frequency", &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); + } ret = 0;