alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Ola Lilja <ola.o.lilja@stericsson.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	Liam Girdwood <lrg@ti.com>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH 7/8] ASoC: codecs: Add AB8500 codec-driver
Date: Fri, 27 Apr 2012 10:35:17 +0100	[thread overview]
Message-ID: <20120427093516.GB18260@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <4F9A649E.4000300@stericsson.com>


[-- Attachment #1.1: Type: text/plain, Size: 3089 bytes --]

On Fri, Apr 27, 2012 at 11:19:26AM +0200, Ola Lilja wrote:
> On 04/23/2012 08:59 PM, Mark Brown wrote:

> > This won't work with probe deferral - if we need to defer then the
> > driver will squash down the -EPROBE_DEFER and fail totally.  Not a big
> > deal, though.

> Hmm, OK, how should I solve this?

Just passing back the first error you get should do the trick.

> > Similarly this is just a REGULATOR_SUPPLY.

> Is there already support for this in the core?

If you search the code for REGULATOR_SUPPLY... :)

> >> +static const struct soc_enum enum_mic1breg_sel = SOC_ENUM_SINGLE(0, 0, 2,
> >> +								enum_micreg);
> >> +static const struct snd_kcontrol_new dapm_mic1breg_mux[] = {
> >> +				SOC_DAPM_ENUM_VIRT("Mic 1b Regulator Select",
> >> +						enum_mic1breg_sel),
> >> +};

> > Can you explain how this hardware works in more detail?  It seems very
> > odd to be changing the regulator used to supply something at runtime.

> Yes, different customers have different regulators tied to the different mics.
> E.g. VMIC1 can be used with MIC2 etc. These settings are stored in a DB in
> userspace and therefor we have it as a control reachable from userspace, but I
> see the point that this could also be put in the mach-folder and thus fixed
> during build-time.

What are these regulators?  Are they internal PGA supplies or are they
microphone biases?

> >> +static int mclk_input_control_put(struct snd_kcontrol *kcontrol,
> >> +				struct snd_ctl_elem_value *ucontrol)
> >> +{
> >> +	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
> >> +	struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev);
> >> +	unsigned int val;
> >> +
> >> +	val = (ucontrol->value.enumerated.item[0] != 0);
> >> +	if (drvdata->mclk_sel == val)
> >> +		return 0;
> >> +
> >> +	drvdata->mclk_sel = val;
> >> +
> >> +	return 1;
> >> +}

> > This is really weird

> This is a way of selecting what clock is to be used during a plaback/capture.
> It cannot direclty turn on/off the clock because this is not allowed for
> power-saving reasons. Also, it needs to be accessible from user-space as we have
> code in user-space which makes this decision during runtime.

Normally the clocking control is under the control of the machine driver
and if the machine driver wants to offer any options to userspace it'd
provide its own control - usually there's way more stuff going on here
than just selecting a source and much more coordination needed with the
drivers involved.

> The same goes here... customers set this value in the database to match their
> board-design. It is not a matter of being able to reconfigure this during
> runtime but it is stored in the database, being one common place for most
> settings; runtime or one-time-settings.
> Also this could be put as a hard-coded parameter in the machine-driver.

Or put in platform data as I've repeatedly suggested.  This is the
standard way of providing per-board fixed configuration to devices in
Linux, the fact that you have a proprietary mechanism for doing this
shouldn't really influence upstream too much.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2012-04-27  9:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1334914402-27554-1-git-send-email-ola.o.lilja@stericsson.com>
2012-04-23 18:59 ` [PATCH 7/8] ASoC: codecs: Add AB8500 codec-driver Mark Brown
2012-04-27  9:19   ` Ola Lilja
2012-04-27  9:35     ` Mark Brown [this message]
2012-04-27 10:54       ` Ola Lilja
2012-04-27 11:11         ` Mark Brown
2012-04-30  8:50           ` Ola Lilja
2012-04-30  9:56             ` 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=20120427093516.GB18260@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=linus.walleij@linaro.org \
    --cc=lrg@ti.com \
    --cc=ola.o.lilja@stericsson.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;
as well as URLs for NNTP newsgroup(s).