]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/mgag200: Introduce separate variable for PLL S parameter
authorThomas Zimmermann <tzimmermann@suse.de>
Wed, 14 Jul 2021 14:22:32 +0000 (16:22 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Sun, 8 Aug 2021 18:13:45 +0000 (20:13 +0200)
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
drivers/gpu/drm/mgag200/mgag200_mode.c

index c9eb044bcb7d8d252a480a5197f848a0b8482212..6085d807bb203504c4966ba657ad93c0133dd01b 100644 (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;
 }