Skip to content

Commit dd1df82

Browse files
dolcinibebarino
authored andcommitted
clk: keystone: syscon-clk: Fix audio refclk
Audio REFCLK's are not working correctly, trying to use them lead to the following errors: [ 6.575277] of_clk_hw_onecell_get: invalid index 4294934528 [ 6.581515] wm8904 1-001a: Failed to get MCLK [ 6.586290] wm8904: probe of 1-001a failed with error -2 The issue is that Audio REFCLK has #clock-cells = 0 [1], while the driver is registering those clocks assuming they have one cells. Fix this by registering the clock with of_clk_hw_simple_get() when there is only one instance, e.g. "audio_refclk". [1] Documentation/devicetree/bindings/clock/ti,am62-audio-refclk.yaml Fixes: 6acab96 ("clk: keystone: syscon-clk: Add support for audio refclk") Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com> Link: https://lore.kernel.org/r/20230728222639.110409-1-francesco@dolcini.it [sboyd@kernel.org: Simplify if-return-else logic] Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent ae9b145 commit dd1df82

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/clk/keystone/syscon-clk.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,10 @@ static int ti_syscon_gate_clk_probe(struct platform_device *pdev)
151151
data[i].name);
152152
}
153153

154-
return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
155-
hw_data);
154+
if (num_clks == 1)
155+
return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get,
156+
hw_data->hws[0]);
157+
return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, hw_data);
156158
}
157159

158160
#define TI_SYSCON_CLK_GATE(_name, _offset, _bit_idx) \

0 commit comments

Comments
 (0)