forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/gpu/drm/msm/dsi/phy/dsi_phy_10nm.c
....@@ -42,6 +42,9 @@
4242 u8 tx_dctrl[] = { 0x00, 0x00, 0x00, 0x04, 0x01 };
4343 void __iomem *lane_base = phy->lane_base;
4444
45
+ if (phy->cfg->quirks & V3_0_0_10NM_OLD_TIMINGS_QUIRK)
46
+ tx_dctrl[3] = 0x02;
47
+
4548 /* Strength ctrl settings */
4649 for (i = 0; i < 5; i++) {
4750 dsi_phy_write(lane_base + REG_DSI_10nm_PHY_LN_LPTX_STR_CTRL(i),
....@@ -74,9 +77,11 @@
7477 tx_dctrl[i]);
7578 }
7679
77
- /* Toggle BIT 0 to release freeze I/0 */
78
- dsi_phy_write(lane_base + REG_DSI_10nm_PHY_LN_TX_DCTRL(3), 0x05);
79
- dsi_phy_write(lane_base + REG_DSI_10nm_PHY_LN_TX_DCTRL(3), 0x04);
80
+ if (!(phy->cfg->quirks & V3_0_0_10NM_OLD_TIMINGS_QUIRK)) {
81
+ /* Toggle BIT 0 to release freeze I/0 */
82
+ dsi_phy_write(lane_base + REG_DSI_10nm_PHY_LN_TX_DCTRL(3), 0x05);
83
+ dsi_phy_write(lane_base + REG_DSI_10nm_PHY_LN_TX_DCTRL(3), 0x04);
84
+ }
8085 }
8186
8287 static int dsi_10nm_phy_enable(struct msm_dsi_phy *phy, int src_pll_id,
....@@ -93,7 +98,7 @@
9398 DBG("");
9499
95100 if (msm_dsi_dphy_timing_calc_v3(timing, clk_req)) {
96
- dev_err(&phy->pdev->dev,
101
+ DRM_DEV_ERROR(&phy->pdev->dev,
97102 "%s: D-PHY timing calculation failed\n", __func__);
98103 return -EINVAL;
99104 }
....@@ -172,7 +177,7 @@
172177
173178 ret = msm_dsi_pll_set_usecase(phy->pll, phy->usecase);
174179 if (ret) {
175
- dev_err(&phy->pdev->dev, "%s: set pll usecase failed, %d\n",
180
+ DRM_DEV_ERROR(&phy->pdev->dev, "%s: set pll usecase failed, %d\n",
176181 __func__, ret);
177182 return ret;
178183 }
....@@ -196,7 +201,7 @@
196201 phy->lane_base = msm_ioremap(pdev, "dsi_phy_lane",
197202 "DSI_PHY_LANE");
198203 if (IS_ERR(phy->lane_base)) {
199
- dev_err(&pdev->dev, "%s: failed to map phy lane base\n",
204
+ DRM_DEV_ERROR(&pdev->dev, "%s: failed to map phy lane base\n",
200205 __func__);
201206 return -ENOMEM;
202207 }
....@@ -221,3 +226,22 @@
221226 .io_start = { 0xae94400, 0xae96400 },
222227 .num_dsi_phy = 2,
223228 };
229
+
230
+const struct msm_dsi_phy_cfg dsi_phy_10nm_8998_cfgs = {
231
+ .type = MSM_DSI_PHY_10NM,
232
+ .src_pll_truthtable = { {false, false}, {true, false} },
233
+ .reg_cfg = {
234
+ .num = 1,
235
+ .regs = {
236
+ {"vdds", 36000, 32},
237
+ },
238
+ },
239
+ .ops = {
240
+ .enable = dsi_10nm_phy_enable,
241
+ .disable = dsi_10nm_phy_disable,
242
+ .init = dsi_10nm_phy_init,
243
+ },
244
+ .io_start = { 0xc994400, 0xc996400 },
245
+ .num_dsi_phy = 2,
246
+ .quirks = V3_0_0_10NM_OLD_TIMINGS_QUIRK,
247
+};