Skip to content

Commit 1a500e0

Browse files
lumagandersson
authored andcommitted
clk: qcom: gcc-sm8350: fix PCIe PIPE clocks handling
On SM8350 platform the PCIe PIPE clocks require additional handling to function correctly. They are to be switched to the tcxo source before turning PCIe GDSCs off and should be switched to PHY PIPE source once they are working. Switch PCIe PHY clocks to use clk_regmap_phy_mux_ops, which provide support for this dance. Fixes: 44c20c9 ("clk: qcom: gcc: Add clock driver for SM8350") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230412134829.3686467-1-dmitry.baryshkov@linaro.org
1 parent aad09fc commit 1a500e0

File tree

1 file changed

+13
-34
lines changed

1 file changed

+13
-34
lines changed

drivers/clk/qcom/gcc-sm8350.c

Lines changed: 13 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "clk-regmap.h"
1818
#include "clk-regmap-divider.h"
1919
#include "clk-regmap-mux.h"
20+
#include "clk-regmap-phy-mux.h"
2021
#include "gdsc.h"
2122
#include "reset.h"
2223

@@ -158,26 +159,6 @@ static const struct clk_parent_data gcc_parent_data_3[] = {
158159
{ .fw_name = "bi_tcxo" },
159160
};
160161

161-
static const struct parent_map gcc_parent_map_4[] = {
162-
{ P_PCIE_0_PIPE_CLK, 0 },
163-
{ P_BI_TCXO, 2 },
164-
};
165-
166-
static const struct clk_parent_data gcc_parent_data_4[] = {
167-
{ .fw_name = "pcie_0_pipe_clk", },
168-
{ .fw_name = "bi_tcxo" },
169-
};
170-
171-
static const struct parent_map gcc_parent_map_5[] = {
172-
{ P_PCIE_1_PIPE_CLK, 0 },
173-
{ P_BI_TCXO, 2 },
174-
};
175-
176-
static const struct clk_parent_data gcc_parent_data_5[] = {
177-
{ .fw_name = "pcie_1_pipe_clk" },
178-
{ .fw_name = "bi_tcxo" },
179-
};
180-
181162
static const struct parent_map gcc_parent_map_6[] = {
182163
{ P_BI_TCXO, 0 },
183164
{ P_GCC_GPLL0_OUT_MAIN, 1 },
@@ -274,32 +255,30 @@ static const struct clk_parent_data gcc_parent_data_14[] = {
274255
{ .fw_name = "bi_tcxo" },
275256
};
276257

277-
static struct clk_regmap_mux gcc_pcie_0_pipe_clk_src = {
258+
static struct clk_regmap_phy_mux gcc_pcie_0_pipe_clk_src = {
278259
.reg = 0x6b054,
279-
.shift = 0,
280-
.width = 2,
281-
.parent_map = gcc_parent_map_4,
282260
.clkr = {
283261
.hw.init = &(struct clk_init_data){
284262
.name = "gcc_pcie_0_pipe_clk_src",
285-
.parent_data = gcc_parent_data_4,
286-
.num_parents = ARRAY_SIZE(gcc_parent_data_4),
287-
.ops = &clk_regmap_mux_closest_ops,
263+
.parent_data = &(const struct clk_parent_data){
264+
.fw_name = "pcie_0_pipe_clk",
265+
},
266+
.num_parents = 1,
267+
.ops = &clk_regmap_phy_mux_ops,
288268
},
289269
},
290270
};
291271

292-
static struct clk_regmap_mux gcc_pcie_1_pipe_clk_src = {
272+
static struct clk_regmap_phy_mux gcc_pcie_1_pipe_clk_src = {
293273
.reg = 0x8d054,
294-
.shift = 0,
295-
.width = 2,
296-
.parent_map = gcc_parent_map_5,
297274
.clkr = {
298275
.hw.init = &(struct clk_init_data){
299276
.name = "gcc_pcie_1_pipe_clk_src",
300-
.parent_data = gcc_parent_data_5,
301-
.num_parents = ARRAY_SIZE(gcc_parent_data_5),
302-
.ops = &clk_regmap_mux_closest_ops,
277+
.parent_data = &(const struct clk_parent_data){
278+
.fw_name = "pcie_1_pipe_clk",
279+
},
280+
.num_parents = 1,
281+
.ops = &clk_regmap_phy_mux_ops,
303282
},
304283
},
305284
};

0 commit comments

Comments
 (0)