3 Jun
2015
3 Jun
'15
7:58 p.m.
On Fri, May 29, 2015 at 09:31:21PM +0800, Jun Nie wrote:
+int zx_hdmi_audio_cfg(int audio_codec, int audio_way,
u32 sample_rate, u32 sample_len);
+void zx_hdmi_audio_en(int on);
It's a bit hard to review this properly without knowing what these functions do.
+static int zx_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
+{ +#ifdef CONFIG_ZX_HDMI_SND_SPDIF
- zx_hdmi_audio_cfg(1, 0, params_rate(params),
+#endif +#ifdef CONFIG_ZX_HDMI_SND_I2S
- zx_hdmi_audio_cfg(1, 1, params_rate(params),
+#endif
params_physical_width(params));
- return 0;
+}
The magic numbers aren't great and it does seem a bit odd to call both I2S and S/PDIF versions always - but I guess this will be restructured following our discussion in the other thread anyway.