Skip to content

Commit b49178e

Browse files
committed
Merge tag 'phy-fixes-6.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy
Pull phy fixes from Vinod Koul: - Fix for mediatek driver warning for variable used uninitialized and for wrong pll math * tag 'phy-fixes-6.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: phy: mediatek: hdmi: mt8195: fix wrong pll calculus phy: mediatek: hdmi: mt8195: fix uninitialized variable usage in pll_calc
2 parents 084f51d + 9d9ff3d commit b49178e

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static int mtk_hdmi_pll_calc(struct mtk_hdmi_phy *hdmi_phy, struct clk_hw *hw,
213213
u64 tmds_clk, pixel_clk, da_hdmitx21_ref_ck, ns_hdmipll_ck, pcw;
214214
u8 txpredivs[4] = { 2, 4, 6, 12 };
215215
u32 fbkdiv_low;
216-
int i, ret;
216+
int i;
217217

218218
pixel_clk = rate;
219219
tmds_clk = pixel_clk;
@@ -271,7 +271,7 @@ static int mtk_hdmi_pll_calc(struct mtk_hdmi_phy *hdmi_phy, struct clk_hw *hw,
271271
* [32,24] 9bit integer, [23,0]:24bit fraction
272272
*/
273273
pcw = div_u64(((u64)ns_hdmipll_ck) << PCW_DECIMAL_WIDTH,
274-
da_hdmitx21_ref_ck / PLL_FBKDIV_HS3);
274+
da_hdmitx21_ref_ck * PLL_FBKDIV_HS3);
275275

276276
if (pcw > GENMASK_ULL(32, 0))
277277
return -EINVAL;
@@ -288,17 +288,13 @@ static int mtk_hdmi_pll_calc(struct mtk_hdmi_phy *hdmi_phy, struct clk_hw *hw,
288288
posdiv2 = 1;
289289

290290
/* Digital clk divider, max /32 */
291-
digital_div = div_u64((u64)ns_hdmipll_ck, posdiv1 / posdiv2 / pixel_clk);
291+
digital_div = div_u64(ns_hdmipll_ck, posdiv1 * posdiv2 * pixel_clk);
292292
if (!(digital_div <= 32 && digital_div >= 1))
293293
return -EINVAL;
294294

295-
mtk_hdmi_pll_set_hw(hw, PLL_PREDIV, fbkdiv_high, fbkdiv_low,
295+
return mtk_hdmi_pll_set_hw(hw, PLL_PREDIV, fbkdiv_high, fbkdiv_low,
296296
PLL_FBKDIV_HS3, posdiv1, posdiv2, txprediv,
297297
txposdiv, digital_div);
298-
if (ret)
299-
return -EINVAL;
300-
301-
return 0;
302298
}
303299

304300
static int mtk_hdmi_pll_drv_setting(struct clk_hw *hw)

0 commit comments

Comments
 (0)