Currently i2s0 capture rate is max at 48Khz on hikey960. On hikey970, the supported capture rate is upto 192 Khz. as per file sound/soc/hisilicon/hi6210-i2s.c
switch (params_rate(params)) {
case 8000:
rate = HII2S_FS_RATE_8KHZ;
break;
case 16000:
rate = HII2S_FS_RATE_16KHZ;
break;
case 32000:
rate = HII2S_FS_RATE_32KHZ;
break;
case 48000:
rate = HII2S_FS_RATE_48KHZ;
break;
case 96000:
rate = HII2S_FS_RATE_96KHZ;
break;
case 192000:
rate = HII2S_FS_RATE_192KHZ;
break;
default:
dev_err(cpu_dai->dev, “Bad rate: %d\n”, params_rate(params));
return -EINVAL;
}
in hikey960,we change 48k frequency i2s0 freqency to other frequencies by modifying
hisi_syscon_bits(i2s, HI_ASP_CFG_R_CLK3_DIV_REG, HI_ASP_MASK,
HI_ASP_CFG_R_CLK4_DIV_SEL);
where , HI_ASP_CFG_R_CLK4_DIV_SEL can be replaced by
#define HI_ASP_CFG_R_CLK4_DIV_SEL_3M 0x00ff000f // 48K freqeuncy
#define HI_ASP_CFG_R_CLK4_DIV_SEL_1M 0x00ff002f // 16K frequency
#define HI_ASP_CFG_R_CLK4_DIV_SEL_512K 0x00ff005f // 8K freqeuncy
How can I change FS frequency to 96khz or 192 khz for capturing audio at those sample rates? Can someone please tell me what should be the value of HI_ASP_CFG_R_CLK4_DIV_SEL?