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
This commit is contained in:
Shunhua Lan
2021-04-23 18:43:59 +08:00
committed by Tao Huang
parent 5e5a7e0cfb
commit 0071310637

View File

@@ -1064,7 +1064,7 @@ static void rk628_csi_delayed_work_audio(struct work_struct *work)
/* fout=128*fs=ftmds*N/CTS */
regmap_read(csi->hdmirx_regmap, HDMI_RX_HDMI_CKM_RESULT, &clkrate);
clkrate = clkrate & 0xfff;
clkrate = clkrate & 0xffff;
/* tmdsclk = (clkrate/1000) * 49500000 */
tmdsclk = clkrate * (49500000 / 1000);
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)
if (cts_decoded != 0) {
fs_audio = div_u64((tmdsclk * n_decoded), cts_decoded);
fs_audio = div_u64(fs_audio, 128);
fs_audio = div_u64(fs_audio + 50, 100);
fs_audio *= 100;
}
v4l2_dbg(2, debug, sd,
"%s: clkrate:%d tmdsclk:%llu, n_decoded:%d, cts_decoded:%d, fs_audio:%llu\n",