All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: "Harsha, Priya" <priya.harsha@intel.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: question on snd_soc_jack_report
Date: Fri, 14 Jan 2011 12:00:23 +0000	[thread overview]
Message-ID: <20110114120022.GB20846@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <98769532B4BB14429434178695419EAE08C0C1E3E0@bgsmsx501.gar.corp.intel.com>

On Fri, Jan 14, 2011 at 05:10:01PM +0530, Harsha, Priya wrote:

> struct snd_soc_jack *soc_jack;
> snd_soc_jack_report (soc_jack, SND_JACK_HEADPHONE, SND_JACK_HEADPHONE);

> I don't find the reporting to be happening. When I looked at the snd_jack_report 
> code, I found that jack->type needs to be set and that was not being set.
> So when I added the following line in my code, it started reporting.
> soc_jack->jack->type = SND_JACK_HEADPHONE;

> Is it expected that the driver sets the 'type' of the instance of 'snd_jack' inside 
> snd_soc_jack structure. I was actually thinking that snd_soc_jack_report would 
> need to do this.

> I did not find any other drivers doing that. Is there something that I am 
> missing?

No, you should be passing the full set of capabilities for the jack in
when you call snd_soc_jack_new().  It's not possible to change the
capabilities dynamically at runtime, these need to be fixed when
registering the jack.

> Also, to report button press events, I had to add the following line of code
> soc_jack->jack->key[0] = BTN_0;
> Is this also an expected thing to be set.

You've not said where you did this but the API for configuring button
types is snd_jac_set_key().  BTN_0 should be being used as a default
when the jack is registered if nothing has been explicitly configured
(see snd_jack_register()).  If you're not specifying the capabilities as
your above issue suggests this won't happen.

      reply	other threads:[~2011-01-14 12:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-14 11:40 question on snd_soc_jack_report Harsha, Priya
2011-01-14 12:00 ` Mark Brown [this message]

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=20110114120022.GB20846@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=priya.harsha@intel.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 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.