mgag200: fix g200eh pll picking code
Subsystems (3)
Dave Airlie
maintainerPATCH 1/1 mgag200: fix g200eh pll picking code
From: Dave Airlie <[email protected]>
This aligns this code more carefully with what is in the upstream X.org MGA driver.
The freq is a typo, and other changes ports from the same function in the X.org driver.
Signed-off-by Dave Airlie <[email protected]>
--- drivers/gpu/drm/mgag200/mgag200_mode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/mgag200/mgag200_mode.c +3 -3
@@ -382,12 +382,12 @@ static int mga_g200eh_set_plls(struct mga_device *mdev, long clock) m = n = p =0 ; vcomax =800000 ; vcomin =400000 ; - pllreffreq =3333 ; + pllreffreq =33333 ; delta =0xffffffff ; permitteddelta = clock *5 /1000 ; -for (testp =16 ; testp >0 ; testp--) { +for (testp =16 ; testp >0 ; testp >>=1 ) {if (clock * testp > vcomax)continue ;if (clock * testp < vcomin)
@@ -404,7 +404,7 @@ static int mga_g200eh_set_plls(struct mga_device *mdev, long clock)if (tmpdelta < delta) { delta = tmpdelta; n = testn -1 ; - m = (testm -1 ) | ((n >>1 ) &0x80 ); + m = testm -1 ; p = testp -1 ; }if ((clock * testp) >=600000 )
Signature · 1 line
1.8.1.2