Skip to content

Commit

Permalink
drm/sun4i: hdmi ddc clk: Fix size of m divider
Browse files Browse the repository at this point in the history
m divider in DDC clock register is 4 bits wide. Fix that.

Fixes: 9c56810 ("drm/sun4i: Add HDMI support")
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20200413095457.1176754-1-jernej.skrabec@siol.net
  • Loading branch information
Jernej Skrabec authored and Maxime Ripard committed Jun 10, 2020
1 parent 968d81a commit 54e1e06
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/sun4i/sun4i_hdmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
#define SUN4I_HDMI_DDC_CMD_IMPLICIT_WRITE 3

#define SUN4I_HDMI_DDC_CLK_REG 0x528
#define SUN4I_HDMI_DDC_CLK_M(m) (((m) & 0x7) << 3)
#define SUN4I_HDMI_DDC_CLK_M(m) (((m) & 0xf) << 3)
#define SUN4I_HDMI_DDC_CLK_N(n) ((n) & 0x7)

#define SUN4I_HDMI_DDC_LINE_CTRL_REG 0x540
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static unsigned long sun4i_ddc_calc_divider(unsigned long rate,
unsigned long best_rate = 0;
u8 best_m = 0, best_n = 0, _m, _n;

for (_m = 0; _m < 8; _m++) {
for (_m = 0; _m < 16; _m++) {
for (_n = 0; _n < 8; _n++) {
unsigned long tmp_rate;

Expand Down

0 comments on commit 54e1e06

Please sign in to comment.