Skip to contentSkip to conversation

ASoC: omap: rx51: Add stereo output support to audio jack

PATCH In review Jarkko Nikula 3 participants 5 messages Jan 5, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: omap: rx51: Add stereo output support to audio jack

Audio jack in Nokia RX-51/N900 is driven by TPA6130 headphone amplifier. This patch adds support for it and stereo output can be active when "Jack Function" == "TV-OUT" || "Headphone".

As the TPA6130 can output very high volume levels the output is limited with snd_soc_limit_volume. Limiting value is found from Maemo kernel sources.

---
This support could have been implemented earlier but I was targeting to have ASoC cross-device support first. But as there's no DAPM widgets anymore in TPA6130, I don't see any other way to implement this than by registering TPA6130 controls to aic34a with tpa6130a2_add_controls and by using tpa6130a2_stereo_enable.

This is from top of "ASoC: Remove needless inclusion of tlv320aic3x.h from machine drivers" but applies also into lrg's tree.

---
 sound/soc/omap/Kconfig |    1 +
 sound/soc/omap/rx51.c  |   43 +++++++++++++++++++++++++++++++++++++++----
 2 files changed, 40 insertions(+), 4 deletions(-)
sound/soc/omap/Kconfig +1 -0
index a088db6..b592298 100644
@@ -24,6 +24,7 @@ config SND_OMAP_SOC_RX51
 	select OMAP_MCBSP
 	select SND_OMAP_SOC_MCBSP
 	select SND_SOC_TLV320AIC3X
+	select SND_SOC_TPA6130A2
 	help
 	  Say Y if you want to add support for SoC audio on Nokia RX-51
 	  hardware. This is also known as Nokia N900 product.
sound/soc/omap/rx51.c +39 -4

97 lines not on this page · raw message

Signature · 1 line
1.7.2.3
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Jarkko Nikula

This support could have been implemented earlier but I was targeting to have ASoC cross-device support first. But as there's no DAPM widgets anymore in TPA6130, I don't see any other way to implement this than by registering TPA6130 controls to aic34a with tpa6130a2_add_controls and by using tpa6130a2_stereo_enable.

Having thought about it for at least a second I think we should have a DAPM context in the cards for all the board-level stuff - does that seem resonable? The patch itself looks good:

in the context of the current APIs, though.

#2 lore raw
Quoted 8 lines · On Wed, 5 Jan 2011 15:55:09 +0000 Mark Brown…
Quoted 5 lines · Jarkko Nikula

This support could have been implemented earlier but I was targeting to have ASoC cross-device support first. But as there's no DAPM widgets anymore in TPA6130, I don't see any other way to implement this than by registering TPA6130 controls to aic34a with tpa6130a2_add_controls and by using tpa6130a2_stereo_enable.

Quoted 4 lines

Having thought about it for at least a second I think we should have a DAPM context in the cards for all the board-level stuff - does that seem resonable? The patch itself looks good:

I don't know. Probably it would be good if machine widgets are in own context. Like having own debugfs/sysfs directory for them etc.

In this case it would be just enough if the tpa6130 is a codec driver having DAPM widgets. Then machine driver wouldn't need any these exported special tpa6130a2_ functions and soc-dapm could take care of power changes according to audio map and other info.

But as far as I understood there's no any better way to get rid of pops in tpa6130a2.

Signature · 1 line
Jarkko
#3 lore raw
Quoted 8 lines · Jarkko Nikula
Quoted 3 lines · Mark Brown

Having thought about it for at least a second I think we should have a DAPM context in the cards for all the board-level stuff - does that seem resonable? The patch itself looks good:

I don't know. Probably it would be good if machine widgets are in own context. Like having own debugfs/sysfs directory for them etc.

Yes, exactly.

Quoted 7 lines

In this case it would be just enough if the tpa6130 is a codec driver having DAPM widgets. Then machine driver wouldn't need any these exported special tpa6130a2_ functions and soc-dapm could take care of power changes according to audio map and other info.

But as far as I understood there's no any better way to get rid of pops in tpa6130a2.

As far as I remember from the previous discussion that had been that making it a CODEC driver would be the simplest thing. Peter said in reply to my mail saying this:

| At least with my device I need to add some delay before enabling the amp, so | anyway I need to ahve the DAPM_HP in the machine driver.

but it'd seem that the amp driver could do this just as well, possibly based off platform data?

#4 lore raw
Quoted 11 lines

________________________________________
From: ext Mark Brown [[email protected]]
Sent: Wednesday, January 05, 2011 18:39
To: Jarkko Nikula
Cc: [email protected]; Liam Girdwood; Ujfalusi Peter (Nokia-MS/Tampere)
Subject: Re: [PATCH] ASoC: omap: rx51: Add stereo output support to audio jack

As far as I remember from the previous discussion that had been that making it a CODEC driver would be the simplest thing. Peter said in reply to my mail saying this:

Quoted 5 lines

| At least with my device I need to add some delay before enabling the amp, so | anyway I need to ahve the DAPM_HP in the machine driver.

but it'd seem that the amp driver could do this just as well, possibly based off platform data?

Yes that could be done with platform data (the additional delay after amp enable). The only thing is that the tpa6130a2 driver must have DAPM_HP widget.
If we do that, than it would be also useful to have the SOC_DAPM_PIN_SWITCH() defined in the tpa6130a2 driver, which might cause some problems with the rx51 machine driver, as Jarkko handling the pins within that.
In rx51, we have several functions on the jack, so SOC_DAPM_PIN_SWITCH() will not going to work there, but in my board, I'm using that.
While we are here, I'd also like to customize the DAPM_HP name as well, since I do not want to have TPA6XXXX HP or something visible for user space.
Also:
Calling dapm_sync from machine driver might cause some locking issues:
http://mailman.alsa-project.org/pipermail/alsa-devel/2010-November/033362.html

I have another issue with my setup, which needs the exported enable/disable function, which is the playback start, while the codec BIAS is on, since I need to do some tricks to remove some unwanted clicks.

We can add optional DAPM widget to the driver, as I already commented, I have no problems with that, but it has to be really optional.

Peter