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: "Koul, Vinod" <vinod.koul@intel.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"lrg@slimlogic.co.uk" <lrg@slimlogic.co.uk>
Subject: Re: [PATCH 1/3] ASoC: soc_jack - add function to determine jack type
Date: Tue, 1 Feb 2011 13:22:06 +0000	[thread overview]
Message-ID: <20110201132206.GE12743@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <98769532B4BB14429434178695419EAE08C0FE9A4D@bgsmsx501.gar.corp.intel.com>

On Tue, Feb 01, 2011 at 06:49:11PM +0530, Harsha, Priya wrote:

> >I think this is too minimal as an API for this.  There's two things I'm
> >missing here.  The major one is that there's no handling of debounce -
> >jack insertion is a very slow and very analogue process relative to CPUs
> >so taking a single reading is likely to give false measurements.

> I believe this should be part of codec driver that would make sure that it has
> determined the right adc value and then call the function to find the jack type. 

This is not in general possible - there are generally AUXADCs in many
devices, CPUs and PMICs both commonly have them, and the majority of
them just take a reading when asked to do so.  Generic software needs to
be able to handle this.

> In the sn95031 codec, this is handled in hardware with programmable debounce
> values. The default value  takes care of ensuring that the adc value is read is for
> right jack event.

That's great, but we can't rely on this in generic code.

> Later, I will add a kcontrol for the same to enable programming it.

Hrm?

> I can add a field "system_micbias" field and the ranges fields to snd_soc_jack
> structure. The machine driver can set these details when it creates a jack. The
> new API can give the jack or button type based on this range. This way its
> scalable. Will this help? Let us know, if there is a better way

Probably.

  reply	other threads:[~2011-02-01 13:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-28 17:09 [PATCH 1/3] ASoC: soc_jack - add function to determine jack type Harsha Priya
2011-01-31 12:06 ` Liam Girdwood
2011-01-31 12:08 ` Mark Brown
2011-02-01 13:19   ` Harsha, Priya
2011-02-01 13:22     ` Mark Brown [this message]
2011-02-01 13:35       ` Harsha, Priya
2011-02-01 13:43         ` Mark Brown

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=20110201132206.GE12743@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=priya.harsha@intel.com \
    --cc=vinod.koul@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.