[alsa-devel] Jack insertion
Hello Alsa Devels
I am working on a OMAP3 + TWL4030 combination for audio (alsa soc) I could develop the ASOC drivers with limited kcontorls and DAPM widgets for the setup.
Now my issue is is there any work regarding the Headset JACK insertion/detection.
Earlier there was a proposal for a jack insertion layer.
Can anyone suggest me in this regard.
Thank You, (: Naveen Krishna Ch :)
Hi Naveen,
On Tue, Nov 18, 2008 at 12:16 PM, naveen krishna ch naveenkrishna.ch@gmail.com wrote:
Hello Alsa Devels
I am working on a OMAP3 + TWL4030 combination for audio (alsa soc) I could develop the ASOC drivers with limited kcontorls and DAPM widgets for the setup.
Now my issue is is there any work regarding the Headset JACK insertion/detection.
Check Jack Abstraction layer by Mark, it is already mainlined:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=in...
On Tue, Nov 18, 2008 at 12:16:18PM +0530, naveen krishna ch wrote:
Now my issue is is there any work regarding the Headset JACK insertion/detection.
Earlier there was a proposal for a jack insertion layer.
Can anyone suggest me in this regard.
The generic ALSA part of the API has been merged already - see include/sound/jack.h.
For ASoC drivers you need to implement the actual detection in your machine driver. Normally this would just hook into a GPIO. You can then update the DAPM widget for the jack to mark it as in use or not in use (some existing drivers do this) and also hook into the generic userspace API (that's not been implemented by anyone yet). Plan is to get something more generic into 2.6.30.
On Tue, Nov 18, 2008 at 4:33 PM, Mark Brown broonie@sirena.org.uk wrote:
On Tue, Nov 18, 2008 at 12:16:18PM +0530, naveen krishna ch wrote:
Now my issue is is there any work regarding the Headset JACK insertion/detection.
Earlier there was a proposal for a jack insertion layer.
Can anyone suggest me in this regard.
The generic ALSA part of the API has been merged already - see include/sound/jack.h.
For ASoC drivers you need to implement the actual detection in your machine driver. Normally this would just hook into a GPIO. You can then update the DAPM widget for the jack to mark it as in use or not in use (some existing drivers do this) and also hook into the generic userspace API (that's not been implemented by anyone yet). Plan is to get something more generic into 2.6.30.
Thanks for your early reply. I am a new to this SOC i started developing the driver taking the Gumsitcs OVERO + TWL4030 ASOC codec driver as reference.
But, i see the jack layer uses the structure
struct snd_device { struct list_head list; /* list of registered devices */ struct snd_card *card; /* card which holds this device */ snd_device_state_t state; /* state of the device */ snd_device_type_t type; /* device type */ void *device_data; /* device structure */ struct snd_device_ops *ops; /* operations */ };
The latest ALSA SOC drivers ( In my case my driver ) uses
struct snd_soc_device { struct device *dev; struct snd_soc_machine *machine; struct snd_soc_platform *platform; struct snd_soc_codec *codec; struct snd_soc_codec_device *codec_dev; struct delayed_work delayed_work; struct work_struct deferred_resume_work; void *codec_data; };
in this case what shall i do to make use of the jack abstraction layer. If cant use the jack abstraction layer, can any one suggest me the other way out
On Tue, Nov 18, 2008 at 7:07 PM, naveen krishna ch < naveenkrishna.ch@gmail.com> wrote:
On Tue, Nov 18, 2008 at 4:33 PM, Mark Brown broonie@sirena.org.uk wrote:
On Tue, Nov 18, 2008 at 12:16:18PM +0530, naveen krishna ch wrote:
Now my issue is is there any work regarding the Headset JACK insertion/detection.
Earlier there was a proposal for a jack insertion layer.
Can anyone suggest me in this regard.
The generic ALSA part of the API has been merged already - see include/sound/jack.h.
But, i see the jack layer uses the structure
struct snd_device { struct list_head list; /* list of registered devices */ struct snd_card *card; /* card which holds this device */ snd_device_state_t state; /* state of the device */ snd_device_type_t type; /* device type */ void *device_data; /* device structure */ struct snd_device_ops *ops; /* operations */ };
The latest ALSA SOC drivers ( In my case my driver ) uses
struct snd_soc_device { struct device *dev; struct snd_soc_machine *machine; struct snd_soc_platform *platform; struct snd_soc_codec *codec; struct snd_soc_codec_device *codec_dev; struct delayed_work delayed_work; struct work_struct deferred_resume_work; void *codec_data; };
in this case what shall i do to make use of the jack abstraction layer. If cant use the jack abstraction layer, can any one suggest me the other way out
For ASoC drivers you need to implement the actual detection in your machine driver. Normally this would just hook into a GPIO. You can then update the DAPM widget for the jack to mark it as in use or not in use (some existing drivers do this) and also hook into the generic userspace API (that's not been implemented by anyone yet). Plan is to get something more generic into 2.6.30.
Thanks for your early reply. I am a new to this SOC i started developing the driver taking the Gumsitcs OVERO + TWL4030 ASOC codec driver as reference.
In my case the Headset detect gpio is not from the machine (OMAP3) but from the CODEC(TWL4030) itself. Is there any previous case liek this
-- Thanks, (: Naveen Krishna Ch :)
On Tue, Nov 18, 2008 at 07:07:41PM +0530, naveen krishna ch wrote:
But, i see the jack layer uses the structure
struct snd_device { struct list_head list; /* list of registered devices */ struct snd_card *card; /* card which holds this device */
Look at how you register a jack - it's with the snd_card and....
The latest ALSA SOC drivers ( In my case my driver ) uses
struct snd_soc_device {
...the ASoC device is just a particular way of implementing the generic snd_card and has a snd_card as a member.
in this case what shall i do to make use of the jack abstraction layer. If cant use the jack abstraction layer, can any one suggest me the other way out
You can use the snd_card of the ASoC card directly.
participants (3)
-
Mark Brown
-
naveen krishna ch
-
Trilok Soni