-----Original Message----- From: Mark Brown [mailto:broonie@kernel.org] Sent: 03 January 2023 11:39 PM To: Padmanabhan Rajanbabu p.rajanbabu@samsung.com Cc: lgirdwood@gmail.com; robh+dt@kernel.org; krzysztof.kozlowski+dt@linaro.org; s.nawrocki@samsung.com; perex@perex.cz; tiwai@suse.com; pankaj.dubey@samsung.com; alim.akhtar@samsung.com; rcsekar@samsung.com; aswani.reddy@samsung.com; alsa-devel@alsa-project.org; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux-samsung- soc@vger.kernel.org Subject: Re: [PATCH v2 2/5] ASoC: samsung: i2s: add support for FSD I2S
On Tue, Jan 03, 2023 at 10:26:10AM +0530, Padmanabhan Rajanbabu wrote:
+void fsd_i2s_fixup_early(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
+{
- struct snd_soc_pcm_runtime *rtd =
asoc_substream_to_rtd(substream);
- struct i2s_dai *i2s = to_info(asoc_rtd_to_cpu(rtd, 0));
- struct i2s_dai *other = get_other_dai(i2s);
- if (!is_opened(other)) {
i2s_set_sysclk(dai, SAMSUNG_I2S_CDCLK, 192,
SND_SOC_CLOCK_OUT);
i2s_set_sysclk(dai, SAMSUNG_I2S_OPCLK, 0,
MOD_OPCLK_PCLK);
- }
+}
This looks like we're just hard coding to 192kHz?
Not actually. The value 192 being passed is for the RFS divider based on which the Root clock source is divided to generate bit-clock and frame-clock in master mode.
But, FSD SoC is utilizing the Exynos7-I2S controller in slave mode, where bit-clock and frame-clock is sourced by the codec. Therefore the sampling of data happens with codec clock source and not based on the clock source from RCLK. However, we still need RFS and BFS configured to default value for the proper operation of the controller.
The current operation being performed above is to change the Codec clock direction to "out", so that codec will use this clock source to generate bit clock and frame clock from its own PLL.
I'll make the changes in the next patch set to pass 0 instead of 192 here, so that RFS and BFS will be configured to default value in config_setup function.
Thanks, Padmanabhan R.