* [PATCH 1/2] ASoC: tas2770: Fix calling reset in probe
@ 2020-09-18 16:18 ` Dan Murphy
0 siblings, 0 replies; 6+ messages in thread
From: Dan Murphy @ 2020-09-18 16:18 UTC (permalink / raw)
To: lgirdwood, broonie, tiwai; +Cc: alsa-devel, linux-kernel, Dan Murphy
tas2770_reset is called during i2c probe. The reset calls the
snd_soc_component_write which depends on the tas2770->component being
available. The component pointer is not set until codec_probe so move
the reset to the codec_probe after the pointer is set.
Fixes: 1a476abc723e6 ("tas2770: add tas2770 smart PA kernel driver")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
sound/soc/codecs/tas2770.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c
index c09851834395..03d7ad1885b8 100644
--- a/sound/soc/codecs/tas2770.c
+++ b/sound/soc/codecs/tas2770.c
@@ -575,6 +575,8 @@ static int tas2770_codec_probe(struct snd_soc_component *component)
tas2770->component = component;
+ tas2770_reset(tas2770);
+
return 0;
}
@@ -771,8 +773,6 @@ static int tas2770_i2c_probe(struct i2c_client *client,
tas2770->channel_size = 0;
tas2770->slot_width = 0;
- tas2770_reset(tas2770);
-
result = tas2770_register_codec(tas2770);
if (result)
dev_err(tas2770->dev, "Register codec failed.\n");
--
2.28.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 1/2] ASoC: tas2770: Fix calling reset in probe
@ 2020-09-18 16:18 ` Dan Murphy
0 siblings, 0 replies; 6+ messages in thread
From: Dan Murphy @ 2020-09-18 16:18 UTC (permalink / raw)
To: lgirdwood, broonie, tiwai; +Cc: alsa-devel, linux-kernel, Dan Murphy
tas2770_reset is called during i2c probe. The reset calls the
snd_soc_component_write which depends on the tas2770->component being
available. The component pointer is not set until codec_probe so move
the reset to the codec_probe after the pointer is set.
Fixes: 1a476abc723e6 ("tas2770: add tas2770 smart PA kernel driver")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
sound/soc/codecs/tas2770.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c
index c09851834395..03d7ad1885b8 100644
--- a/sound/soc/codecs/tas2770.c
+++ b/sound/soc/codecs/tas2770.c
@@ -575,6 +575,8 @@ static int tas2770_codec_probe(struct snd_soc_component *component)
tas2770->component = component;
+ tas2770_reset(tas2770);
+
return 0;
}
@@ -771,8 +773,6 @@ static int tas2770_i2c_probe(struct i2c_client *client,
tas2770->channel_size = 0;
tas2770->slot_width = 0;
- tas2770_reset(tas2770);
-
result = tas2770_register_codec(tas2770);
if (result)
dev_err(tas2770->dev, "Register codec failed.\n");
--
2.28.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] ASoC: tas2770: Add missing bias level power states
2020-09-18 16:18 ` Dan Murphy
@ 2020-09-18 16:18 ` Dan Murphy
-1 siblings, 0 replies; 6+ messages in thread
From: Dan Murphy @ 2020-09-18 16:18 UTC (permalink / raw)
To: lgirdwood, broonie, tiwai; +Cc: alsa-devel, linux-kernel, Dan Murphy
Add the BIAS_STANDBY and BIAS_PREPARE to the set_bias_level or else the
driver will return -EINVAL which is not correct as they are valid
states.
Fixes: 1a476abc723e6 ("tas2770: add tas2770 smart PA kernel driver")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
sound/soc/codecs/tas2770.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c
index 03d7ad1885b8..7c6f61946ab3 100644
--- a/sound/soc/codecs/tas2770.c
+++ b/sound/soc/codecs/tas2770.c
@@ -57,7 +57,12 @@ static int tas2770_set_bias_level(struct snd_soc_component *component,
TAS2770_PWR_CTRL_MASK,
TAS2770_PWR_CTRL_ACTIVE);
break;
-
+ case SND_SOC_BIAS_STANDBY:
+ case SND_SOC_BIAS_PREPARE:
+ snd_soc_component_update_bits(component,
+ TAS2770_PWR_CTRL,
+ TAS2770_PWR_CTRL_MASK, TAS2770_PWR_CTRL_MUTE);
+ break;
case SND_SOC_BIAS_OFF:
snd_soc_component_update_bits(component,
TAS2770_PWR_CTRL,
--
2.28.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] ASoC: tas2770: Add missing bias level power states
@ 2020-09-18 16:18 ` Dan Murphy
0 siblings, 0 replies; 6+ messages in thread
From: Dan Murphy @ 2020-09-18 16:18 UTC (permalink / raw)
To: lgirdwood, broonie, tiwai; +Cc: alsa-devel, linux-kernel, Dan Murphy
Add the BIAS_STANDBY and BIAS_PREPARE to the set_bias_level or else the
driver will return -EINVAL which is not correct as they are valid
states.
Fixes: 1a476abc723e6 ("tas2770: add tas2770 smart PA kernel driver")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
sound/soc/codecs/tas2770.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c
index 03d7ad1885b8..7c6f61946ab3 100644
--- a/sound/soc/codecs/tas2770.c
+++ b/sound/soc/codecs/tas2770.c
@@ -57,7 +57,12 @@ static int tas2770_set_bias_level(struct snd_soc_component *component,
TAS2770_PWR_CTRL_MASK,
TAS2770_PWR_CTRL_ACTIVE);
break;
-
+ case SND_SOC_BIAS_STANDBY:
+ case SND_SOC_BIAS_PREPARE:
+ snd_soc_component_update_bits(component,
+ TAS2770_PWR_CTRL,
+ TAS2770_PWR_CTRL_MASK, TAS2770_PWR_CTRL_MUTE);
+ break;
case SND_SOC_BIAS_OFF:
snd_soc_component_update_bits(component,
TAS2770_PWR_CTRL,
--
2.28.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] ASoC: tas2770: Fix calling reset in probe
2020-09-18 16:18 ` Dan Murphy
@ 2020-09-18 18:18 ` Dan Murphy
-1 siblings, 0 replies; 6+ messages in thread
From: Dan Murphy @ 2020-09-18 18:18 UTC (permalink / raw)
To: lgirdwood, broonie, tiwai; +Cc: alsa-devel, linux-kernel
All
On 9/18/20 11:18 AM, Dan Murphy wrote:
> tas2770_reset is called during i2c probe. The reset calls the
> snd_soc_component_write which depends on the tas2770->component being
> available. The component pointer is not set until codec_probe so move
> the reset to the codec_probe after the pointer is set.
I have been updating the tas2770 to add another device to the driver and
I have quite a few unexpected patches on top of these.
I am not even sure how this driver is even working at the moment.
I will re-submit the complete set of patches as Mark pointed out in
another email chain.
So please ignore these patches for now plus the DT binding patch.
Dan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] ASoC: tas2770: Fix calling reset in probe
@ 2020-09-18 18:18 ` Dan Murphy
0 siblings, 0 replies; 6+ messages in thread
From: Dan Murphy @ 2020-09-18 18:18 UTC (permalink / raw)
To: lgirdwood, broonie, tiwai; +Cc: alsa-devel, linux-kernel
All
On 9/18/20 11:18 AM, Dan Murphy wrote:
> tas2770_reset is called during i2c probe. The reset calls the
> snd_soc_component_write which depends on the tas2770->component being
> available. The component pointer is not set until codec_probe so move
> the reset to the codec_probe after the pointer is set.
I have been updating the tas2770 to add another device to the driver and
I have quite a few unexpected patches on top of these.
I am not even sure how this driver is even working at the moment.
I will re-submit the complete set of patches as Mark pointed out in
another email chain.
So please ignore these patches for now plus the DT binding patch.
Dan
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-09-18 18:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18 16:18 [PATCH 1/2] ASoC: tas2770: Fix calling reset in probe Dan Murphy
2020-09-18 16:18 ` Dan Murphy
2020-09-18 16:18 ` [PATCH 2/2] ASoC: tas2770: Add missing bias level power states Dan Murphy
2020-09-18 16:18 ` Dan Murphy
2020-09-18 18:18 ` [PATCH 1/2] ASoC: tas2770: Fix calling reset in probe Dan Murphy
2020-09-18 18:18 ` Dan Murphy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.