Hi Mark
- clk_orig = clk_get(dev, NULL);
- adg->clk[CLKA] = clk_get(dev, "clk_a");
- adg->clk[CLKB] = clk_get(dev, "clk_b");
- adg->clk[CLKC] = clk_get(dev, "clk_c");
- adg->clk[CLKI] = clk_get(dev, "clk_i");
- for_each_rsnd_clk(clk, adg, i) {
if (clk_orig == clk) {
dev_warn(dev,
"Audio clock doesn't support new style,"
"use old style\n");
use_old_style = true;
break;
}
- }
This looks really strange though I appreciate it's a workaround for a custom clock implementation. I guess it's not possible for a kernel to be built with both common and legacy clock implementations? If that is the case I think it would be clearer to just use an ifdef.
Sorry, I guess my comment makes confusion. Here "new style" means "external sound clock has relationship with sound driver", "old style" means "external sound clock is independent clock"
This patch adds new clock-relationship rule to rsnd <-> platform. (sound clock should has relationship to sound drvier)
The external sound clocks (= clk_a/b/c/i) are "independent" clock in current linus/master. Then, all clk_get(dev, xxx) will be same clock (= module clock) (It was not strange if clk_get(dev, xxx) returns NULL though, but...)
# Above code can works well both common/legacy clock implementations. # And, it can't select both common/legacy clock in same time.
I will exchange git log comment (= about "new/old" clock), is it OK ?
It's also better to not split error messages between lines, that makes it easier to grep for the code that generated the error.
I see I will fix it in v2 patch