* [PATCH 0/2] Correct widget and PLL handling
@ 2010-05-20 22:53 Jorge Eduardo Candelaria
2010-05-20 22:53 ` [PATCH 1/2] ASoC: TWL6040: Fix playback with 19.2 Mhz MCLK Jorge Eduardo Candelaria
0 siblings, 1 reply; 6+ messages in thread
From: Jorge Eduardo Candelaria @ 2010-05-20 22:53 UTC (permalink / raw)
To: alsa-devel; +Cc: broonie, lrg
Fix an issue when using 19.2 Mhz as clock input for TWL6040.
Also, Drivers in TWL6040 can be modeled after PGA components of DAPM.
This allows for better power management and also ensures that
the DACs are enabled before the Drivers, reducing this way a
pop-noise heard when powering up components.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] ASoC: TWL6040: Fix playback with 19.2 Mhz MCLK
2010-05-20 22:53 [PATCH 0/2] Correct widget and PLL handling Jorge Eduardo Candelaria
@ 2010-05-20 22:53 ` Jorge Eduardo Candelaria
2010-05-20 22:53 ` [PATCH 2/2] ASoC: TWL6040: Correct widget handling for drivers Jorge Eduardo Candelaria
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Jorge Eduardo Candelaria @ 2010-05-20 22:53 UTC (permalink / raw)
To: alsa-devel
Cc: Margarita Olaya Cabrera, Jorge Eduardo Candelaria, broonie, lrg
When using MCLK is configured for 19.2 Mhz, clock slicer should be
enabled and HPPLL should be bypassed in clock path.
Signed-off-by: Jorge Eduardo Candelaria <jorge.candelaria@ti.com>
Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
---
sound/soc/codecs/twl6040.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index af36346..85dd4fb 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -928,7 +928,7 @@ static int twl6040_set_dai_sysclk(struct snd_soc_dai *codec_dai,
case 19200000:
/* mclk input, pll disabled */
hppllctl |= TWL6040_MCLK_19200KHZ |
- TWL6040_HPLLSQRBP |
+ TWL6040_HPLLSQRENA |
TWL6040_HPLLBP;
break;
case 26000000:
--
1.6.3.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] ASoC: TWL6040: Correct widget handling for drivers
2010-05-20 22:53 ` [PATCH 1/2] ASoC: TWL6040: Fix playback with 19.2 Mhz MCLK Jorge Eduardo Candelaria
@ 2010-05-20 22:53 ` Jorge Eduardo Candelaria
2010-05-20 23:18 ` Mark Brown
2010-05-20 23:44 ` [PATCH 1/2] ASoC: TWL6040: Fix playback with 19.2 Mhz MCLK Mark Brown
2010-05-21 9:49 ` Liam Girdwood
2 siblings, 1 reply; 6+ messages in thread
From: Jorge Eduardo Candelaria @ 2010-05-20 22:53 UTC (permalink / raw)
To: alsa-devel
Cc: Margarita Olaya Cabrera, Jorge Eduardo Candelaria, broonie, lrg
In order to reduce pop-noise at powering up/down of the DACs and Drivers,
these components have to be handled in a specific sequence. Headset,
Handsfree, and Earphone drivers are now registered as PGA components to
ensure DACs are enabled first.
Also, add a pop_time of 1 ms to leave time for DACs to settle before
continuing power up/down sequence.
Signed-off-by: Jorge Eduardo Candelaria <jorge.candelaria@ti.com>
Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
---
sound/soc/codecs/twl6040.c | 36 ++++++++++++------------------------
1 files changed, 12 insertions(+), 24 deletions(-)
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index 85dd4fb..746c569 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -471,20 +471,6 @@ static const struct snd_kcontrol_new hfdacl_switch_controls =
static const struct snd_kcontrol_new hfdacr_switch_controls =
SOC_DAPM_SINGLE("Switch", TWL6040_REG_HFRCTL, 2, 1, 0);
-/* Headset driver switches */
-static const struct snd_kcontrol_new hsl_driver_switch_controls =
- SOC_DAPM_SINGLE("Switch", TWL6040_REG_HSLCTL, 2, 1, 0);
-
-static const struct snd_kcontrol_new hsr_driver_switch_controls =
- SOC_DAPM_SINGLE("Switch", TWL6040_REG_HSRCTL, 2, 1, 0);
-
-/* Handsfree driver switches */
-static const struct snd_kcontrol_new hfl_driver_switch_controls =
- SOC_DAPM_SINGLE("Switch", TWL6040_REG_HFLCTL, 4, 1, 0);
-
-static const struct snd_kcontrol_new hfr_driver_switch_controls =
- SOC_DAPM_SINGLE("Switch", TWL6040_REG_HFRCTL, 4, 1, 0);
-
static const struct snd_kcontrol_new ep_driver_switch_controls =
SOC_DAPM_SINGLE("Switch", TWL6040_REG_EARCTL, 0, 1, 0);
@@ -571,18 +557,19 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
SND_SOC_DAPM_SWITCH("HFDAC Right Playback",
SND_SOC_NOPM, 0, 0, &hfdacr_switch_controls),
- SND_SOC_DAPM_SWITCH("Headset Left Driver",
- SND_SOC_NOPM, 0, 0, &hsl_driver_switch_controls),
- SND_SOC_DAPM_SWITCH("Headset Right Driver",
- SND_SOC_NOPM, 0, 0, &hsr_driver_switch_controls),
- SND_SOC_DAPM_SWITCH_E("Handsfree Left Driver",
- SND_SOC_NOPM, 0, 0, &hfl_driver_switch_controls,
+ /* Analog playback drivers */
+ SND_SOC_DAPM_PGA_E("Handsfree Left Driver",
+ TWL6040_REG_HFLCTL, 4, 0, NULL, 0,
twl6040_power_mode_event,
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
- SND_SOC_DAPM_SWITCH_E("Handsfree Right Driver",
- SND_SOC_NOPM, 0, 0, &hfr_driver_switch_controls,
+ SND_SOC_DAPM_PGA_E("Handsfree Right Driver",
+ TWL6040_REG_HFRCTL, 4, 0, NULL, 0,
twl6040_power_mode_event,
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
+ SND_SOC_DAPM_PGA("Headset Left Driver",
+ TWL6040_REG_HSLCTL, 2, 0, NULL, 0),
+ SND_SOC_DAPM_PGA("Headset Right Driver",
+ TWL6040_REG_HSRCTL, 2, 0, NULL, 0),
SND_SOC_DAPM_SWITCH_E("Earphone Driver",
SND_SOC_NOPM, 0, 0, &ep_driver_switch_controls,
twl6040_power_mode_event,
@@ -616,8 +603,8 @@ static const struct snd_soc_dapm_route intercon[] = {
{"HSDAC Left Playback", "Switch", "HSDAC Left"},
{"HSDAC Right Playback", "Switch", "HSDAC Right"},
- {"Headset Left Driver", "Switch", "HSDAC Left Playback"},
- {"Headset Right Driver", "Switch", "HSDAC Right Playback"},
+ {"Headset Left Driver", NULL, "HSDAC Left Playback"},
+ {"Headset Right Driver", NULL, "HSDAC Right Playback"},
{"HSOL", NULL, "Headset Left Driver"},
{"HSOR", NULL, "Headset Right Driver"},
@@ -1105,6 +1092,7 @@ static int __devinit twl6040_codec_probe(struct platform_device *pdev)
priv->naudint = naudint;
codec = &priv->codec;
+ codec->pop_time = 1;
codec->dev = &pdev->dev;
twl6040_dai.dev = &pdev->dev;
--
1.6.3.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] ASoC: TWL6040: Correct widget handling for drivers
2010-05-20 22:53 ` [PATCH 2/2] ASoC: TWL6040: Correct widget handling for drivers Jorge Eduardo Candelaria
@ 2010-05-20 23:18 ` Mark Brown
0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2010-05-20 23:18 UTC (permalink / raw)
To: Jorge Eduardo Candelaria; +Cc: Margarita Olaya Cabrera, alsa-devel, lrg
On Thu, 2010-05-20 at 17:53 -0500, Jorge Eduardo Candelaria wrote:
> Also, add a pop_time of 1 ms to leave time for DACs to settle before
> continuing power up/down sequence.
...
> @@ -1105,6 +1092,7 @@ static int __devinit twl6040_codec_probe(struct platform_device *pdev)
> priv->naudint = naudint;
>
> codec = &priv->codec;
> + codec->pop_time = 1;
> codec->dev = &pdev->dev;
> twl6040_dai.dev = &pdev->dev;
That's not something you should be doing in your CODEC driver. pop_time
is a debugging tool which can be enabled by users but should not be used
in production. Besides, it'll also apply to all power changes in the
CODEC, not just the ones that need it, and so make the general operation
of the device much slower than it needs to be.
If you need to insert a delay after power up of the DAC widgets use the
_E variant of the DAC widget and have a POST_PMU event handler which
does the sleep.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] ASoC: TWL6040: Fix playback with 19.2 Mhz MCLK
2010-05-20 22:53 ` [PATCH 1/2] ASoC: TWL6040: Fix playback with 19.2 Mhz MCLK Jorge Eduardo Candelaria
2010-05-20 22:53 ` [PATCH 2/2] ASoC: TWL6040: Correct widget handling for drivers Jorge Eduardo Candelaria
@ 2010-05-20 23:44 ` Mark Brown
2010-05-21 9:49 ` Liam Girdwood
2 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2010-05-20 23:44 UTC (permalink / raw)
To: Jorge Eduardo Candelaria; +Cc: Margarita Olaya Cabrera, alsa-devel, lrg
On Thu, May 20, 2010 at 05:53:07PM -0500, Jorge Eduardo Candelaria wrote:
> When using MCLK is configured for 19.2 Mhz, clock slicer should be
> enabled and HPPLL should be bypassed in clock path.
>
> Signed-off-by: Jorge Eduardo Candelaria <jorge.candelaria@ti.com>
> Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] ASoC: TWL6040: Fix playback with 19.2 Mhz MCLK
2010-05-20 22:53 ` [PATCH 1/2] ASoC: TWL6040: Fix playback with 19.2 Mhz MCLK Jorge Eduardo Candelaria
2010-05-20 22:53 ` [PATCH 2/2] ASoC: TWL6040: Correct widget handling for drivers Jorge Eduardo Candelaria
2010-05-20 23:44 ` [PATCH 1/2] ASoC: TWL6040: Fix playback with 19.2 Mhz MCLK Mark Brown
@ 2010-05-21 9:49 ` Liam Girdwood
2 siblings, 0 replies; 6+ messages in thread
From: Liam Girdwood @ 2010-05-21 9:49 UTC (permalink / raw)
To: Jorge Eduardo Candelaria; +Cc: Margarita Olaya Cabrera, alsa-devel, broonie
On Thu, 2010-05-20 at 17:53 -0500, Jorge Eduardo Candelaria wrote:
> When using MCLK is configured for 19.2 Mhz, clock slicer should be
> enabled and HPPLL should be bypassed in clock path.
>
> Signed-off-by: Jorge Eduardo Candelaria <jorge.candelaria@ti.com>
> Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
> ---
Applied.
Thanks
Liam
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-05-21 9:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-20 22:53 [PATCH 0/2] Correct widget and PLL handling Jorge Eduardo Candelaria
2010-05-20 22:53 ` [PATCH 1/2] ASoC: TWL6040: Fix playback with 19.2 Mhz MCLK Jorge Eduardo Candelaria
2010-05-20 22:53 ` [PATCH 2/2] ASoC: TWL6040: Correct widget handling for drivers Jorge Eduardo Candelaria
2010-05-20 23:18 ` Mark Brown
2010-05-20 23:44 ` [PATCH 1/2] ASoC: TWL6040: Fix playback with 19.2 Mhz MCLK Mark Brown
2010-05-21 9:49 ` Liam Girdwood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).