Skip to content

Commit

Permalink
drm/sun4i: Fix dclk_set_phase
Browse files Browse the repository at this point in the history
Phase value is not shifted before writing.

Shift left of 28 bits to fit right bits

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1519836413-35023-1-git-send-email-giulio.benetti@micronovasrl.com
  • Loading branch information
Giulio Benetti authored and Maxime Ripard committed Mar 1, 2018
1 parent 9a191b1 commit e64b6af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/gpu/drm/sun4i/sun4i_dotclock.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,13 @@ static int sun4i_dclk_get_phase(struct clk_hw *hw)
static int sun4i_dclk_set_phase(struct clk_hw *hw, int degrees)
{
struct sun4i_dclk *dclk = hw_to_dclk(hw);
u32 val = degrees / 120;

val <<= 28;

regmap_update_bits(dclk->regmap, SUN4I_TCON0_IO_POL_REG,
GENMASK(29, 28),
degrees / 120);
val);

return 0;
}
Expand Down

0 comments on commit e64b6af

Please sign in to comment.