mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] phy: freescale: fsl-samsung-hdmi: Expand Integer divider range
@ 2024-10-20 16:50 Adam Ford
  2024-10-20 16:50 ` [PATCH 2/3] phy: freescale: fsl-samsung-hdmi: Stop searching when exact match is found Adam Ford
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Adam Ford @ 2024-10-20 16:50 UTC (permalink / raw)
  To: linux-phy
  Cc: aford, sandor.yu, Adam Ford, Vinod Koul, Kishon Vijay Abraham I,
	Frieder Schrempf, Dominique Martinet, Marco Felsch,
	Uwe Kleine-König, Lucas Stach, linux-kernel

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>
---
 drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
index 2c8038864357..3f9578f3f0ac 100644
--- a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
+++ b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
@@ -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,
+			 * bit it does show it as an 8-bit value, so we'll 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
-- 
2.45.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-10-23 15:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-20 16:50 [PATCH 1/3] phy: freescale: fsl-samsung-hdmi: Expand Integer divider range Adam Ford
2024-10-20 16:50 ` [PATCH 2/3] phy: freescale: fsl-samsung-hdmi: Stop searching when exact match is found Adam Ford
2024-10-22  7:06   ` Frieder Schrempf
2024-10-20 16:50 ` [PATCH 3/3] phy: freescale: fsl-samsung-hdmi: Clean up fld_tg_code calculation Adam Ford
2024-10-22  7:16   ` Frieder Schrempf
2024-10-22  7:04 ` [PATCH 1/3] phy: freescale: fsl-samsung-hdmi: Expand Integer divider range Frieder Schrempf
2024-10-23 15:04   ` Adam Ford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®