]> git.baikalelectronics.ru Git - kernel.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)
commit6b8b4af9489bd0605e22cb31d1e9e7545052b53d
tree8aac3f85afc1f206202f7bcbe95d258d195b9821
parentfc34a8d7a6e80eb2c2304f3fb1526e012599ae42
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