drm/mgag200: Introduce separate variable for PLL S parameter

The S parameter is controls the loop filter bandwidth when programming
the PLL. It's currently stored as part of P (i.e., the clock divider.)

Add a separate variable for S prepares the PLL code for further
refactoring. The value of s is currently 0, so it has not yet an effect
on the programming.

v2:
	* add a note on the current value of s to commit message

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210714142240.21979-6-tzimmermann@suse.de
This commit is contained in:
Thomas Zimmermann 2021-07-14 16:22:32 +02:00
parent f86c3ed559
commit d9d992238a

View file

@ -208,18 +208,17 @@ static int mgag200_compute_pixpll_values_g200se(struct mga_device *mdev, long cl
unsigned int vcomax, vcomin, pllreffreq;
unsigned int delta, tmpdelta, permitteddelta;
unsigned int testp, testm, testn;
unsigned int p, m, n;
unsigned int p, m, n, s;
unsigned int computed;
unsigned int fvv;
unsigned int i;
if (unique_rev_id <= 0x03) {
m = n = p = s = 0;
m = n = p = 0;
if (unique_rev_id <= 0x03) {
vcomax = 320000;
vcomin = 160000;
pllreffreq = 25000;
delta = 0xffffffff;
permitteddelta = clock * 5 / 1000;
@ -247,9 +246,6 @@ static int mgag200_compute_pixpll_values_g200se(struct mga_device *mdev, long cl
}
}
} else {
m = n = p = 0;
vcomax = 1600000;
vcomin = 800000;
pllreffreq = 25000;
@ -310,7 +306,7 @@ static int mgag200_compute_pixpll_values_g200se(struct mga_device *mdev, long cl
pixpllc->m = m;
pixpllc->n = n;
pixpllc->p = p;
pixpllc->s = 0;
pixpllc->s = s;
return 0;
}
@ -344,10 +340,10 @@ static int mgag200_compute_pixpll_values_g200wb(struct mga_device *mdev, long cl
unsigned int vcomax, vcomin, pllreffreq;
unsigned int delta, tmpdelta;
unsigned int testp, testm, testn, testp2;
unsigned int p, m, n;
unsigned int p, m, n, s;
unsigned int computed;
m = n = p = 0;
m = n = p = s = 0;
delta = 0xffffffff;
@ -421,7 +417,7 @@ static int mgag200_compute_pixpll_values_g200wb(struct mga_device *mdev, long cl
pixpllc->m = m;
pixpllc->n = n;
pixpllc->p = p;
pixpllc->s = 0;
pixpllc->s = s;
return 0;
}
@ -542,10 +538,10 @@ static int mgag200_compute_pixpll_values_g200ev(struct mga_device *mdev, long cl
unsigned int vcomax, vcomin, pllreffreq;
unsigned int delta, tmpdelta;
unsigned int testp, testm, testn;
unsigned int p, m, n;
unsigned int p, m, n, s;
unsigned int computed;
m = n = p = 0;
m = n = p = s = 0;
vcomax = 550000;
vcomin = 150000;
pllreffreq = 50000;
@ -579,7 +575,7 @@ static int mgag200_compute_pixpll_values_g200ev(struct mga_device *mdev, long cl
pixpllc->m = m;
pixpllc->n = n;
pixpllc->p = p;
pixpllc->s = 0;
pixpllc->s = s;
return 0;
}
@ -652,10 +648,10 @@ static int mgag200_compute_pixpll_values_g200eh(struct mga_device *mdev, long cl
unsigned int vcomax, vcomin, pllreffreq;
unsigned int delta, tmpdelta;
unsigned int testp, testm, testn;
unsigned int p, m, n;
unsigned int p, m, n, s;
unsigned int computed;
m = n = p = 0;
m = n = p = s = 0;
if (mdev->type == G200_EH3) {
vcomax = 3000000;
@ -727,7 +723,7 @@ static int mgag200_compute_pixpll_values_g200eh(struct mga_device *mdev, long cl
pixpllc->m = m;
pixpllc->n = n;
pixpllc->p = p;
pixpllc->s = 0;
pixpllc->s = s;
return 0;
}
@ -801,10 +797,10 @@ static int mgag200_compute_pixpll_values_g200er(struct mga_device *mdev, long cl
unsigned int vcomax, vcomin, pllreffreq;
unsigned int delta, tmpdelta;
int testr, testn, testm, testo;
unsigned int p, m, n;
unsigned int p, m, n, s;
unsigned int computed, vco;
m = n = p = 0;
m = n = p = s = 0;
vcomax = 1488000;
vcomin = 1056000;
pllreffreq = 48000;
@ -846,7 +842,7 @@ static int mgag200_compute_pixpll_values_g200er(struct mga_device *mdev, long cl
pixpllc->m = m;
pixpllc->n = n;
pixpllc->p = p;
pixpllc->s = 0;
pixpllc->s = s;
return 0;
}