ASoC: soc-io: Fix snd_soc_component_update_bits_legacy
After the codec to component conversion codecs with custom read/write
function will no longer able to use update_bits as their io callbacks are
registered at component->driver level and not in component level.
To not complicate the code further, lets just use the
snd_soc_component_read/snd_soc_component_write function and let them sort
out the correct io function to call.
Fixes: d0ff8ba57d
("ASoC: add Component level .read/.write")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:

committed by
Mark Brown

parent
7928b2cbe5
commit
dead99e857
@@ -88,19 +88,16 @@ static int snd_soc_component_update_bits_legacy(
|
|||||||
unsigned int old, new;
|
unsigned int old, new;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!component->read || !component->write)
|
|
||||||
return -EIO;
|
|
||||||
|
|
||||||
mutex_lock(&component->io_mutex);
|
mutex_lock(&component->io_mutex);
|
||||||
|
|
||||||
ret = component->read(component, reg, &old);
|
ret = snd_soc_component_read(component, reg, &old);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
|
|
||||||
new = (old & ~mask) | (val & mask);
|
new = (old & ~mask) | (val & mask);
|
||||||
*change = old != new;
|
*change = old != new;
|
||||||
if (*change)
|
if (*change)
|
||||||
ret = component->write(component, reg, new);
|
ret = snd_soc_component_write(component, reg, new);
|
||||||
out_unlock:
|
out_unlock:
|
||||||
mutex_unlock(&component->io_mutex);
|
mutex_unlock(&component->io_mutex);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user