diff --git a/sys/arm/allwinner/clk/aw_lcdclk.c b/sys/arm/allwinner/clk/aw_lcdclk.c index bebee0139683..1de6a493b814 100644 --- a/sys/arm/allwinner/clk/aw_lcdclk.c +++ b/sys/arm/allwinner/clk/aw_lcdclk.c @@ -266,7 +266,7 @@ static int aw_lcdclk_recalc_freq(struct clknode *clk, uint64_t *freq) { struct aw_lcdclk_softc *sc; - uint32_t val, m; + uint32_t val, m, src_sel; sc = clknode_get_softc(clk); @@ -281,7 +281,8 @@ aw_lcdclk_recalc_freq(struct clknode *clk, uint64_t *freq) *freq = *freq / m; if (sc->id == CLK_IDX_CH1_SCLK1) { - if ((val & CH1_SCLK1_SEL) == CH1_SCLK1_SEL_SCLK2_DIV2) + src_sel = (val & CH1_SCLK1_SEL) >> CH1_SCLK1_SEL_SHIFT; + if (src_sel == CH1_SCLK1_SEL_SCLK2_DIV2) *freq /= 2; }