Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e533705 authored by Ville Syrjala's avatar Ville Syrjala Committed by Linus Torvalds
Browse files

sm501fb: fix timing limits



Vertical sync height register can only hold 6 bits.  Fix the hsync start test
to use > instead of >=.  Also add a few clarifying comments.

Signed-off-by: default avatarVille Syrjala <syrjala@sci.fi>
Acked-by: default avatarBen Dooks <ben-linux@fluff.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 19d06eff
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -237,12 +237,14 @@ static int sm501fb_check_var(struct fb_var_screeninfo *var,


	/* check we can fit these values into the registers */
	/* check we can fit these values into the registers */


	if (var->hsync_len > 255 || var->vsync_len > 255)
	if (var->hsync_len > 255 || var->vsync_len > 63)
		return -EINVAL;
		return -EINVAL;


	if ((var->xres + var->right_margin) >= 4096)
	/* hdisplay end and hsync start */
	if ((var->xres + var->right_margin) > 4096)
		return -EINVAL;
		return -EINVAL;


	/* vdisplay end and vsync start */
	if ((var->yres + var->lower_margin) > 2048)
	if ((var->yres + var->lower_margin) > 2048)
		return -EINVAL;
		return -EINVAL;