Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 567e0aee authored by Banajit Goswami's avatar Banajit Goswami
Browse files

ASoC: core: Remove sound card state check from read/write



Having sound card offline condition checks inside
register read/write functions will also avoid Asoc
cache writes. However, it is needed to update the
Asoc cache whenever user-space sends disable sequence
while sound card is in offline state. Remove the offline
check condition from ASoC read/writes and let the codec
driver take care of not sending bus read/writes if sound
card is in offline state.

Change-Id: I960b85a277a28dd05eb919c1c6abf7aa32a45265
Signed-off-by: default avatarPhani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: default avatarBanajit Goswami <bgoswami@codeaurora.org>
parent 70ef6c21
Loading
Loading
Loading
Loading
+0 −11
Original line number Original line Diff line number Diff line
@@ -195,14 +195,9 @@ EXPORT_SYMBOL_GPL(snd_soc_component_test_bits);


unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg)
unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg)
{
{
	struct snd_card *snd_card = codec->component.card->snd_card;
	unsigned int val;
	unsigned int val;
	int ret;
	int ret;


	if (unlikely(!snd_card_is_online_state(snd_card))) {
		dev_err(codec->dev, "read 0x%02x while offline\n", reg);
		return -ENODEV;
	}
	ret = snd_soc_component_read(&codec->component, reg, &val);
	ret = snd_soc_component_read(&codec->component, reg, &val);
	if (ret < 0)
	if (ret < 0)
		return -1;
		return -1;
@@ -214,12 +209,6 @@ EXPORT_SYMBOL_GPL(snd_soc_read);
int snd_soc_write(struct snd_soc_codec *codec, unsigned int reg,
int snd_soc_write(struct snd_soc_codec *codec, unsigned int reg,
	unsigned int val)
	unsigned int val)
{
{
	struct snd_card *snd_card = codec->component.card->snd_card;

	if (unlikely(!snd_card_is_online_state(snd_card))) {
		dev_err(codec->dev, "write 0x%02x while offline\n", reg);
		return -ENODEV;
	}
	return snd_soc_component_write(&codec->component, reg, val);
	return snd_soc_component_write(&codec->component, reg, val);
}
}
EXPORT_SYMBOL_GPL(snd_soc_write);
EXPORT_SYMBOL_GPL(snd_soc_write);