Commit 468f9e8d authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Use intel_de_rmw() in bxt/glk/cnl+ cdclk programming

Replace the hand rolled rmw sequences with intel_de_rmw().
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210430153444.29270-5-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 3b71a9b6
...@@ -1473,12 +1473,9 @@ static void bxt_de_pll_disable(struct drm_i915_private *dev_priv) ...@@ -1473,12 +1473,9 @@ static void bxt_de_pll_disable(struct drm_i915_private *dev_priv)
static void bxt_de_pll_enable(struct drm_i915_private *dev_priv, int vco) static void bxt_de_pll_enable(struct drm_i915_private *dev_priv, int vco)
{ {
int ratio = DIV_ROUND_CLOSEST(vco, dev_priv->cdclk.hw.ref); int ratio = DIV_ROUND_CLOSEST(vco, dev_priv->cdclk.hw.ref);
u32 val;
val = intel_de_read(dev_priv, BXT_DE_PLL_CTL); intel_de_rmw(dev_priv, BXT_DE_PLL_CTL,
val &= ~BXT_DE_PLL_RATIO_MASK; BXT_DE_PLL_RATIO_MASK, BXT_DE_PLL_RATIO(ratio));
val |= BXT_DE_PLL_RATIO(ratio);
intel_de_write(dev_priv, BXT_DE_PLL_CTL, val);
intel_de_write(dev_priv, BXT_DE_PLL_ENABLE, BXT_DE_PLL_PLL_ENABLE); intel_de_write(dev_priv, BXT_DE_PLL_ENABLE, BXT_DE_PLL_PLL_ENABLE);
...@@ -1492,11 +1489,8 @@ static void bxt_de_pll_enable(struct drm_i915_private *dev_priv, int vco) ...@@ -1492,11 +1489,8 @@ static void bxt_de_pll_enable(struct drm_i915_private *dev_priv, int vco)
static void cnl_cdclk_pll_disable(struct drm_i915_private *dev_priv) static void cnl_cdclk_pll_disable(struct drm_i915_private *dev_priv)
{ {
u32 val; intel_de_rmw(dev_priv, BXT_DE_PLL_ENABLE,
BXT_DE_PLL_PLL_ENABLE, 0);
val = intel_de_read(dev_priv, BXT_DE_PLL_ENABLE);
val &= ~BXT_DE_PLL_PLL_ENABLE;
intel_de_write(dev_priv, BXT_DE_PLL_ENABLE, val);
/* Timeout 200us */ /* Timeout 200us */
if (wait_for((intel_de_read(dev_priv, BXT_DE_PLL_ENABLE) & BXT_DE_PLL_LOCK) == 0, 1)) if (wait_for((intel_de_read(dev_priv, BXT_DE_PLL_ENABLE) & BXT_DE_PLL_LOCK) == 0, 1))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment