]> asedeno.scripts.mit.edu Git - linux.git/commit
ASoC: sun4i-i2s: Show detailed error when DAI configuration callbacks fail
authorChen-Yu Tsai <wens@csie.org>
Thu, 14 Dec 2017 07:29:28 +0000 (15:29 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 14 Dec 2017 11:12:28 +0000 (11:12 +0000)
commit2ff739b9bdd3199cd52e450097cb0f7fc4e1e9e8
tree8aac3f85afc1f206202f7bcbe95d258d195b9821
parent4fbd8d194f06c8a3fd2af1ce560ddb31f7ec8323
ASoC: sun4i-i2s: Show detailed error when DAI configuration callbacks fail

When any of the DAI hardware configuration callbacks (.hw_param,
.set_fmt, .set_sysclk) fails, there is no explanation about why it
failed. This is particularly confusing for .hw_param, which covers
many parameters of the DAI. Telling the users what parameter isn't
supported, and what the requested value was goes a long way for
developers trying to combine sun4i-i2s with external codecs.

This patch adds dev_err calls explaining what isn't supported or
failed, and what the value was. sun4i_i2s_set_clk_rate()'s first
parameter was changed to a struct snd_soc_dai *dai, so we can
get the underlying device.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Marcus Cooper <codekipper@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sunxi/sun4i-i2s.c