forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-02-19 151fecfb72a0d602dfe79790602ef64b4e241574
kernel/drivers/gpu/drm/msm/dsi/pll/dsi_pll_28nm.c
....@@ -1,14 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 and
6
- * only version 2 as published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope that it will be useful,
9
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- * GNU General Public License for more details.
124 */
135
146 #include <linux/clk.h>
....@@ -156,7 +148,7 @@
156148 if (rate <= lpfr_lut[i].vco_rate)
157149 break;
158150 if (i == LPFR_LUT_SIZE) {
159
- dev_err(dev, "unable to get loop filter resistance. vco=%lu\n",
151
+ DRM_DEV_ERROR(dev, "unable to get loop filter resistance. vco=%lu\n",
160152 rate);
161153 return -EINVAL;
162154 }
....@@ -386,7 +378,7 @@
386378 }
387379
388380 if (unlikely(!locked))
389
- dev_err(dev, "DSI PLL lock failed\n");
381
+ DRM_DEV_ERROR(dev, "DSI PLL lock failed\n");
390382 else
391383 DBG("DSI PLL Lock success");
392384
....@@ -429,7 +421,7 @@
429421 locked = pll_28nm_poll_for_ready(pll_28nm, max_reads, timeout_us);
430422
431423 if (unlikely(!locked))
432
- dev_err(dev, "DSI PLL lock failed\n");
424
+ DRM_DEV_ERROR(dev, "DSI PLL lock failed\n");
433425 else
434426 DBG("DSI PLL lock success");
435427
....@@ -468,7 +460,7 @@
468460 ret = dsi_pll_28nm_clk_set_rate(&pll->clk_hw,
469461 cached_state->vco_rate, 0);
470462 if (ret) {
471
- dev_err(&pll_28nm->pdev->dev,
463
+ DRM_DEV_ERROR(&pll_28nm->pdev->dev,
472464 "restore vco rate failed. ret=%d\n", ret);
473465 return ret;
474466 }
....@@ -562,9 +554,9 @@
562554 snprintf(parent1, 32, "dsi%dvco_clk", pll_28nm->id);
563555 snprintf(parent2, 32, "dsi%dindirect_path_div2_clk", pll_28nm->id);
564556 clks[num++] = clk_register_mux(dev, clk_name,
565
- (const char *[]){
557
+ ((const char *[]){
566558 parent1, parent2
567
- }, 2, CLK_SET_RATE_PARENT, pll_28nm->mmio +
559
+ }), 2, CLK_SET_RATE_PARENT, pll_28nm->mmio +
568560 REG_DSI_28nm_PHY_PLL_VREG_CFG, 1, 1, 0, NULL);
569561
570562 snprintf(clk_name, 32, "dsi%dpllbyte", pll_28nm->id);
....@@ -581,7 +573,7 @@
581573 ret = of_clk_add_provider(dev->of_node,
582574 of_clk_src_onecell_get, &pll_28nm->clk_data);
583575 if (ret) {
584
- dev_err(dev, "failed to register clk provider: %d\n", ret);
576
+ DRM_DEV_ERROR(dev, "failed to register clk provider: %d\n", ret);
585577 return ret;
586578 }
587579
....@@ -607,7 +599,7 @@
607599
608600 pll_28nm->mmio = msm_ioremap(pdev, "dsi_pll", "DSI_PLL");
609601 if (IS_ERR_OR_NULL(pll_28nm->mmio)) {
610
- dev_err(&pdev->dev, "%s: failed to map pll base\n", __func__);
602
+ DRM_DEV_ERROR(&pdev->dev, "%s: failed to map pll base\n", __func__);
611603 return ERR_PTR(-ENOMEM);
612604 }
613605
....@@ -633,13 +625,13 @@
633625 pll->en_seq_cnt = 1;
634626 pll->enable_seqs[0] = dsi_pll_28nm_enable_seq_lp;
635627 } else {
636
- dev_err(&pdev->dev, "phy type (%d) is not 28nm\n", type);
628
+ DRM_DEV_ERROR(&pdev->dev, "phy type (%d) is not 28nm\n", type);
637629 return ERR_PTR(-EINVAL);
638630 }
639631
640632 ret = pll_28nm_register(pll_28nm);
641633 if (ret) {
642
- dev_err(&pdev->dev, "failed to register PLL: %d\n", ret);
634
+ DRM_DEV_ERROR(&pdev->dev, "failed to register PLL: %d\n", ret);
643635 return ERR_PTR(ret);
644636 }
645637