aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorDuc-Long, Le <duclong.linux@gmail.com>2023-10-14 20:19:46 -0400
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2024-02-05 12:57:44 +0100
commit35546945e5e5cce825d2b92e1ecc3f4ac70ec1dc (patch)
treeeedf289016b0e439cb4bc1e927a047cda385d529 /drivers/media
parentfeb8831be9d468ee961289c6a275536a1ee0011c (diff)
downloadlinux-35546945e5e5cce825d2b92e1ecc3f4ac70ec1dc.tar.gz
media: tc358746: fix the pll calculating function
Following formula of Pll_clk in 5.2 section, 50th page of TC358746AXBG/748XBG/748IXBG Functional Specification Rev 1.1 document. The formula of fout is as below: fout = refclk * mul / (prediv * postdiv) Remove "p" to avoid using 2 times of prediv in pll calculating function. Signed-off-by: Duc-Long, Le <duclong.linux@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/i2c/tc358746.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/i2c/tc358746.c b/drivers/media/i2c/tc358746.c
index 106de4271d2ef..d676adc4401bb 100644
--- a/drivers/media/i2c/tc358746.c
+++ b/drivers/media/i2c/tc358746.c
@@ -843,14 +843,14 @@ static unsigned long tc358746_find_pll_settings(struct tc358746 *tc358746,
if (fin < 4 * HZ_PER_MHZ || fin > 40 * HZ_PER_MHZ)
continue;
- tmp = fout * p * postdiv;
+ tmp = fout * postdiv;
do_div(tmp, fin);
mul = tmp;
if (mul > 511)
continue;
tmp = mul * fin;
- do_div(tmp, p * postdiv);
+ do_div(tmp, postdiv);
delta = abs(fout - tmp);
if (delta < min_delta) {