]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
phy: freescale: fsl-samsung-hdmi: Expand Integer divider range
authorAdam Ford <aford173@gmail.com>
Sat, 26 Oct 2024 13:19:57 +0000 (08:19 -0500)
committerVinod Koul <vkoul@kernel.org>
Sun, 8 Dec 2024 15:51:20 +0000 (21:21 +0530)
The Integer divder uses values of P,M, and S to determine the PLL
rate.  Currently, the range of M was set based on a series of
table entries where the range was limited.  Since the ref manual
shows it is 8-bit wide, expand the range to be up to 255.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Link: https://lore.kernel.org/r/20241026132014.73050-1-aford173@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/freescale/phy-fsl-samsung-hdmi.c

index 2c8038864357b14b5f6fbd55312e006fb7cb855f..412c03b7dcd69b16c5d04ac7b9037c343ea45487 100644 (file)
@@ -406,16 +406,15 @@ static unsigned long fsl_samsung_hdmi_phy_find_pms(unsigned long fout, u8 *p, u1
                                continue;
 
                        /*
-                        * TODO: Ref Manual doesn't state the range of _m
-                        * so this should be further refined if possible.
-                        * This range was set based on the original values
-                        * in the lookup table
+                        * The Ref manual doesn't explicitly state the range of M,
+                        * but it does show it as an 8-bit value, so reject
+                        * any value above 255.
                         */
                        tmp = (u64)fout * (_p * _s);
                        do_div(tmp, 24 * MHZ);
-                       _m = tmp;
-                       if (_m < 0x30 || _m > 0x7b)
+                       if (tmp > 255)
                                continue;
+                       _m = tmp;
 
                        /*
                         * Rev 2 of the Ref Manual states the