diff options
| author | Hai Li <hali@codeaurora.org> | 2015-08-13 17:45:50 -0400 |
|---|---|---|
| committer | Rob Clark <robdclark@gmail.com> | 2015-08-15 18:27:27 -0400 |
| commit | fae11c1106ad8304c09e3b9bf95dd6d03f4a5afa (patch) | |
| tree | 3f90c74d1b1f723c74a2e1665b79ef00bffc9bea /drivers/gpu | |
| parent | 29f034d776209042f7aaaf1518a66841c1d42233 (diff) | |
drm/msm/dsi: Specify bitmask to set source PLL
The bit position to configure source PLL will change
on new types of PHYs. The caller should pass down
this information.
Signed-off-by: Hai Li <hali@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu')
| -rw-r--r-- | drivers/gpu/drm/msm/dsi/dsi_phy.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/gpu/drm/msm/dsi/dsi_phy.c b/drivers/gpu/drm/msm/dsi/dsi_phy.c index bd37e61123bf..799201e1a14f 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_phy.c +++ b/drivers/gpu/drm/msm/dsi/dsi_phy.c | |||
| @@ -157,17 +157,21 @@ fail: | |||
| 157 | return ret; | 157 | return ret; |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | static void dsi_phy_set_src_pll(struct msm_dsi_phy *phy, int pll_id, u32 reg) | 160 | static void dsi_phy_set_src_pll(struct msm_dsi_phy *phy, int pll_id, u32 reg, |
| 161 | u32 bit_mask) | ||
| 161 | { | 162 | { |
| 162 | int phy_id = phy->id; | 163 | int phy_id = phy->id; |
| 164 | u32 val; | ||
| 163 | 165 | ||
| 164 | if ((phy_id >= DSI_MAX) || (pll_id >= DSI_MAX)) | 166 | if ((phy_id >= DSI_MAX) || (pll_id >= DSI_MAX)) |
| 165 | return; | 167 | return; |
| 166 | 168 | ||
| 169 | val = dsi_phy_read(phy->base + reg); | ||
| 170 | |||
| 167 | if (phy->cfg->src_pll_truthtable[phy_id][pll_id]) | 171 | if (phy->cfg->src_pll_truthtable[phy_id][pll_id]) |
| 168 | dsi_phy_write(phy->base + reg, 0x01); | 172 | dsi_phy_write(phy->base + reg, val | bit_mask); |
| 169 | else | 173 | else |
| 170 | dsi_phy_write(phy->base + reg, 0x00); | 174 | dsi_phy_write(phy->base + reg, val & (~bit_mask)); |
| 171 | } | 175 | } |
| 172 | 176 | ||
| 173 | #define S_DIV_ROUND_UP(n, d) \ | 177 | #define S_DIV_ROUND_UP(n, d) \ |
| @@ -389,7 +393,8 @@ static int dsi_28nm_phy_enable(struct msm_dsi_phy *phy, int src_pll_id, | |||
| 389 | 393 | ||
| 390 | dsi_phy_write(base + REG_DSI_28nm_PHY_CTRL_0, 0x5f); | 394 | dsi_phy_write(base + REG_DSI_28nm_PHY_CTRL_0, 0x5f); |
| 391 | 395 | ||
| 392 | dsi_phy_set_src_pll(phy, src_pll_id, REG_DSI_28nm_PHY_GLBL_TEST_CTRL); | 396 | dsi_phy_set_src_pll(phy, src_pll_id, REG_DSI_28nm_PHY_GLBL_TEST_CTRL, |
| 397 | DSI_28nm_PHY_GLBL_TEST_CTRL_BITCLK_HS_SEL); | ||
| 393 | 398 | ||
| 394 | return 0; | 399 | return 0; |
| 395 | } | 400 | } |
| @@ -451,7 +456,8 @@ static int dsi_20nm_phy_enable(struct msm_dsi_phy *phy, int src_pll_id, | |||
| 451 | 456 | ||
| 452 | dsi_phy_write(base + REG_DSI_20nm_PHY_STRENGTH_0, 0xff); | 457 | dsi_phy_write(base + REG_DSI_20nm_PHY_STRENGTH_0, 0xff); |
| 453 | 458 | ||
| 454 | dsi_phy_set_src_pll(phy, src_pll_id, REG_DSI_20nm_PHY_GLBL_TEST_CTRL); | 459 | dsi_phy_set_src_pll(phy, src_pll_id, REG_DSI_20nm_PHY_GLBL_TEST_CTRL, |
| 460 | DSI_20nm_PHY_GLBL_TEST_CTRL_BITCLK_HS_SEL); | ||
| 455 | 461 | ||
| 456 | for (i = 0; i < 4; i++) { | 462 | for (i = 0; i < 4; i++) { |
| 457 | dsi_phy_write(base + REG_DSI_20nm_PHY_LN_CFG_3(i), | 463 | dsi_phy_write(base + REG_DSI_20nm_PHY_LN_CFG_3(i), |
