From: Mark Brown <broonie@sirena.org.uk>
To: "Lopez Cruz, Misael" <x0052729@ti.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH 1/3] ASoC: Add GPIO support for jack reporting interface
Date: Fri, 27 Feb 2009 13:05:03 +0000 [thread overview]
Message-ID: <20090227130502.GA4415@sirena.org.uk> (raw)
In-Reply-To: <2C7D3DF36ADFFC479B44490D912B616705ECC76DF8@dlee07.ent.ti.com>
On Fri, Feb 27, 2009 at 04:52:35AM -0600, Lopez Cruz, Misael wrote:
> * Create a new structure "snd_soc_jack_gpio" holding info specific for a
> gpio pin like: gpio, irq, irqflags, irqhandler, private data (to be
> passed to irqhandler).
Yes, roughly. The jack_gpio will also need to know the status bits to
update and which jack to update. I'd expect something along the lines
of:
struct snd_soc_jack_gpio {
struct snd_soc_jack *jack;
int report; /* Value to report when jack detected */
int invert_report; /* Report presence when GPIO low */
int gpio; /* GPIO to read */
};
possibly with some other data stored (eg, a debounce time). You can use
gpio_to_irq() to get the interrupt number.
If the machine drivers need to customise the IRQ handler code itself
then it's probably getting to the point where another detection method
should be written, though perhaps I'm missing something?
> * Create a new function "snd_soc_jack_add_gpios" to add all jack_gpios that
> belong to a specific jack. This function should add all gpio pin references
> in a linked list as it's done for dapm pins. The linked list will be
> useful to be able to release acquired resources in another function
> "snd_soc_jack_free_gpios".
Since the detection mechanism will need to know the jack it's notifying
it should be possible to set up every GPIO detector at once - they'll
all have to know which jack to point to anyway. Given that it'd be as
easy to use an array and not bother with the linked list. The reason
the pins are added to a list is that we need to iterate over them all
whenever the jack status changes to update the status of the pins.
> * Machine driver will be responsible to call add_gpios function passing an
> array of gpios related to each jack.
Yes, the machine driver should set up that link.
> * Machine driver will tie each jack_gpio with corresponding jack in a
> machine specific jack_data structure, one hook per jack_gpio in the jack.
> A handler will also be associated to the jack_data structure. This
> jack_data struct will be passed to the gpio irqhandler as private data.
I'd *expect* you can live without the custom handler, though I could be
wrong.
next prev parent reply other threads:[~2009-02-27 13:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-26 7:57 [PATCH 1/3] ASoC: Add GPIO support for jack reporting interface Lopez Cruz, Misael
2009-02-26 11:52 ` [alsa-devel] " Mark Brown
2009-02-27 10:52 ` Lopez Cruz, Misael
2009-02-27 13:05 ` Mark Brown [this message]
2009-03-02 1:54 ` Lopez Cruz, Misael
2009-03-02 11:38 ` [alsa-devel] " Mark Brown
2009-03-02 21:16 ` Lopez Cruz, Misael
2009-03-02 22:55 ` [alsa-devel] " Mark Brown
2009-03-03 0:03 ` Lopez Cruz, Misael
2009-03-03 0:43 ` [alsa-devel] " Mark Brown
2009-03-03 0:47 ` Lopez Cruz, Misael
2009-02-26 18:52 ` David Brownell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090227130502.GA4415@sirena.org.uk \
--to=broonie@sirena.org.uk \
--cc=alsa-devel@alsa-project.org \
--cc=linux-omap@vger.kernel.org \
--cc=x0052729@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox