| .. | .. |
|---|
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
|---|
| 2 | 2 | /* |
|---|
| 3 | + * Copyright (C) 2020-2022 MaxLinear, Inc. |
|---|
| 3 | 4 | * Copyright (C) 2020 Intel Corporation. |
|---|
| 4 | | - * Zhu YiXin <yixin.zhu@intel.com> |
|---|
| 5 | | - * Rahul Tanwar <rahul.tanwar@intel.com> |
|---|
| 5 | + * Zhu Yixin <yzhu@maxlinear.com> |
|---|
| 6 | + * Rahul Tanwar <rtanwar@maxlinear.com> |
|---|
| 6 | 7 | */ |
|---|
| 7 | 8 | #include <linux/clk-provider.h> |
|---|
| 9 | +#include <linux/mfd/syscon.h> |
|---|
| 8 | 10 | #include <linux/of.h> |
|---|
| 9 | 11 | #include <linux/platform_device.h> |
|---|
| 10 | 12 | #include <dt-bindings/clock/intel,lgm-clk.h> |
|---|
| .. | .. |
|---|
| 253 | 255 | LGM_FIXED(LGM_CLK_SLIC, "slic", NULL, 0, CGU_IF_CLK1, |
|---|
| 254 | 256 | 8, 2, CLOCK_FLAG_VAL_INIT, 8192000, 2), |
|---|
| 255 | 257 | LGM_FIXED(LGM_CLK_DOCSIS, "v_docsis", NULL, 0, 0, 0, 0, 0, 16000000, 0), |
|---|
| 256 | | - LGM_DIV(LGM_CLK_DCL, "dcl", "v_ifclk", 0, CGU_PCMCR, |
|---|
| 257 | | - 25, 3, 0, 0, 0, 0, dcl_div), |
|---|
| 258 | + LGM_DIV(LGM_CLK_DCL, "dcl", "v_ifclk", CLK_SET_RATE_PARENT, CGU_PCMCR, |
|---|
| 259 | + 25, 3, 0, 0, DIV_CLK_NO_MASK, 0, dcl_div), |
|---|
| 258 | 260 | LGM_MUX(LGM_CLK_PCM, "pcm", pcm_p, 0, CGU_C55_PCMCR, |
|---|
| 259 | 261 | 0, 1, CLK_MUX_ROUND_CLOSEST, 0), |
|---|
| 260 | 262 | LGM_FIXED_FACTOR(LGM_CLK_DDR_PHY, "ddr_phy", "ddr", |
|---|
| .. | .. |
|---|
| 433 | 435 | |
|---|
| 434 | 436 | ctx->clk_data.num = CLK_NR_CLKS; |
|---|
| 435 | 437 | |
|---|
| 436 | | - ctx->membase = devm_platform_ioremap_resource(pdev, 0); |
|---|
| 437 | | - if (IS_ERR(ctx->membase)) |
|---|
| 438 | + ctx->membase = syscon_node_to_regmap(np); |
|---|
| 439 | + if (IS_ERR(ctx->membase)) { |
|---|
| 440 | + dev_err(dev, "Failed to get clk CGU iomem\n"); |
|---|
| 438 | 441 | return PTR_ERR(ctx->membase); |
|---|
| 442 | + } |
|---|
| 443 | + |
|---|
| 439 | 444 | |
|---|
| 440 | 445 | ctx->np = np; |
|---|
| 441 | 446 | ctx->dev = dev; |
|---|
| 442 | | - spin_lock_init(&ctx->lock); |
|---|
| 443 | 447 | |
|---|
| 444 | 448 | ret = lgm_clk_register_plls(ctx, lgm_pll_clks, |
|---|
| 445 | 449 | ARRAY_SIZE(lgm_pll_clks)); |
|---|