Skip to content

Commit 3349b3d

Browse files
TE-N-ShengjiuWangbroonie
authored andcommitted
ASoC: imx-card: Need special setting for ak4497 on i.MX8MQ
The SAI on i.MX8MQ don't support one2one ratio for mclk:bclk, so the mclk frequency exceeds the supported range of codec for the case that sample rate is larger than 705kHZ and format is S32_LE. Update the supported width for such case. Fixes: aa73670 ("ASoC: imx-card: Add imx-card machine driver") Signed-off-by: Shengjiu Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent e4c35e7 commit 3349b3d

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

sound/soc/fsl/imx-card.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,23 @@ static int imx_card_parse_of(struct imx_card_data *data)
553553
link_data->cpu_sysclk_id = FSL_SAI_CLK_MAST1;
554554

555555
/* sai may support mclk/bclk = 1 */
556-
if (of_find_property(np, "fsl,mclk-equal-bclk", NULL))
556+
if (of_find_property(np, "fsl,mclk-equal-bclk", NULL)) {
557557
link_data->one2one_ratio = true;
558+
} else {
559+
int i;
560+
561+
/*
562+
* i.MX8MQ don't support one2one ratio, then
563+
* with ak4497 only 16bit case is supported.
564+
*/
565+
for (i = 0; i < ARRAY_SIZE(ak4497_fs_mul); i++) {
566+
if (ak4497_fs_mul[i].rmin == 705600 &&
567+
ak4497_fs_mul[i].rmax == 768000) {
568+
ak4497_fs_mul[i].wmin = 32;
569+
ak4497_fs_mul[i].wmax = 32;
570+
}
571+
}
572+
}
558573
}
559574

560575
link->cpus->of_node = args.np;

0 commit comments

Comments
 (0)