Skip to content

Commit ed3d2ca

Browse files
author
Shunhua Lan
committed
media: i2c: rk628csi: fix mask for clkrate and fs audio align to 100
Signed-off-by: Shunhua Lan <lsh@rock-chips.com> Change-Id: I15b290319463f1b41e6908e54caa99ef9c6db4f4
1 parent 0453e3f commit ed3d2ca

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/media/i2c/rk628_csi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ static void rk628_csi_delayed_work_audio(struct work_struct *work)
10641064

10651065
/* fout=128*fs=ftmds*N/CTS */
10661066
regmap_read(csi->hdmirx_regmap, HDMI_RX_HDMI_CKM_RESULT, &clkrate);
1067-
clkrate = clkrate & 0xfff;
1067+
clkrate = clkrate & 0xffff;
10681068
/* tmdsclk = (clkrate/1000) * 49500000 */
10691069
tmdsclk = clkrate * (49500000 / 1000);
10701070
regmap_read(csi->hdmirx_regmap, HDMI_RX_PDEC_ACR_CTS, &cts_decoded);
@@ -1073,6 +1073,8 @@ static void rk628_csi_delayed_work_audio(struct work_struct *work)
10731073
if (cts_decoded != 0) {
10741074
fs_audio = div_u64((tmdsclk * n_decoded), cts_decoded);
10751075
fs_audio = div_u64(fs_audio, 128);
1076+
fs_audio = div_u64(fs_audio + 50, 100);
1077+
fs_audio *= 100;
10761078
}
10771079
v4l2_dbg(2, debug, sd,
10781080
"%s: clkrate:%d tmdsclk:%llu, n_decoded:%d, cts_decoded:%d, fs_audio:%llu\n",

0 commit comments

Comments
 (0)