Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915/dpll: use intel_de_wait_custom() instead of wait_for_us()

Prefer the register read specific wait function over i915 wait_for_us().

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://lore.kernel.org/r/d8c381524d721e01228b76b71080c6e4ccc528e9.1753956266.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

+14 -6
+14 -6
drivers/gpu/drm/i915/display/intel_dpll_mgr.c
··· 2046 2046 enum dpio_phy phy = DPIO_PHY0; 2047 2047 enum dpio_channel ch = DPIO_CH0; 2048 2048 u32 temp; 2049 + int ret; 2049 2050 2050 2051 bxt_port_to_phy_channel(display, port, &phy, &ch); 2051 2052 ··· 2057 2056 intel_de_rmw(display, BXT_PORT_PLL_ENABLE(port), 2058 2057 0, PORT_PLL_POWER_ENABLE); 2059 2058 2060 - if (wait_for_us((intel_de_read(display, BXT_PORT_PLL_ENABLE(port)) & 2061 - PORT_PLL_POWER_STATE), 200)) 2059 + ret = intel_de_wait_custom(display, BXT_PORT_PLL_ENABLE(port), 2060 + PORT_PLL_POWER_STATE, PORT_PLL_POWER_STATE, 2061 + 200, 0, NULL); 2062 + if (ret) 2062 2063 drm_err(display->drm, 2063 2064 "Power state not set for PLL:%d\n", port); 2064 2065 } ··· 2122 2119 intel_de_rmw(display, BXT_PORT_PLL_ENABLE(port), 0, PORT_PLL_ENABLE); 2123 2120 intel_de_posting_read(display, BXT_PORT_PLL_ENABLE(port)); 2124 2121 2125 - if (wait_for_us((intel_de_read(display, BXT_PORT_PLL_ENABLE(port)) & PORT_PLL_LOCK), 2126 - 200)) 2122 + ret = intel_de_wait_custom(display, BXT_PORT_PLL_ENABLE(port), 2123 + PORT_PLL_LOCK, PORT_PLL_LOCK, 2124 + 200, 0, NULL); 2125 + if (ret) 2127 2126 drm_err(display->drm, "PLL %d not locked\n", port); 2128 2127 2129 2128 if (display->platform.geminilake) { ··· 2149 2144 struct intel_dpll *pll) 2150 2145 { 2151 2146 enum port port = (enum port)pll->info->id; /* 1:1 port->PLL mapping */ 2147 + int ret; 2152 2148 2153 2149 intel_de_rmw(display, BXT_PORT_PLL_ENABLE(port), PORT_PLL_ENABLE, 0); 2154 2150 intel_de_posting_read(display, BXT_PORT_PLL_ENABLE(port)); ··· 2158 2152 intel_de_rmw(display, BXT_PORT_PLL_ENABLE(port), 2159 2153 PORT_PLL_POWER_ENABLE, 0); 2160 2154 2161 - if (wait_for_us(!(intel_de_read(display, BXT_PORT_PLL_ENABLE(port)) & 2162 - PORT_PLL_POWER_STATE), 200)) 2155 + ret = intel_de_wait_custom(display, BXT_PORT_PLL_ENABLE(port), 2156 + PORT_PLL_POWER_STATE, 0, 2157 + 200, 0, NULL); 2158 + if (ret) 2163 2159 drm_err(display->drm, 2164 2160 "Power state not reset for PLL:%d\n", port); 2165 2161 }