]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: bcm2835: fix hw_params error when device is in prepared state
authorMatthias Reichl <hias@horus.com>
Wed, 17 Jan 2018 12:50:50 +0000 (13:50 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 18 Jan 2018 11:21:17 +0000 (11:21 +0000)
commitc190f4835ab1957dee2a43dac7d1312c4959910b
tree6190a3acc8c0355222550a611829e8261828614e
parentfc34a8d7a6e80eb2c2304f3fb1526e012599ae42
ASoC: bcm2835: fix hw_params error when device is in prepared state

If bcm2835 is configured as bitclock master calling hw_params()
after prepare() fails with EBUSY. This also makes it impossible to
use bcm2835 in full duplex mode.

The error is caused by the split clock setup: clk_set_rate
is called in hw_params, clk_prepare_enable in prepare. As hw_params
doesn't check if the clock was already enabled clk_set_rate
fails with EBUSY.

Fix this by moving clock startup from prepare to hw_params and
let hw_params properly deal with an already set up or enabled
clock.

Signed-off-by: Matthias Reichl <hias@horus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/bcm/bcm2835-i2s.c