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 13/16] ASoC: codecs: Add AB8500 codec-driver
Date: Mon, 19 Mar 2012 15:43:41 +0000	[thread overview]
Message-ID: <20120319154341.GA5132@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <4F67489B.3050709@stericsson.com>


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

On Mon, Mar 19, 2012 at 03:54:19PM +0100, Ola Lilja wrote:

> We have a routing situation that could be rendered something like this:
> 
>                             D----->Speaker
>                             |
> I2S (playback)------>A----->B----->C----->Headset

> In this case, let's say that the bit at B needs to be set in HW before C is set
> to avoid pop/click noises.

This looks very standard, you've got a PGA at B and either further PGAs
or output drivers at C and D.

> If we just use a normal playback-switch that is associated with the bit at C,
> then this switch would directly set the C bit before the stream is active and
> then later when the stream is activated, the other widgets are enabled thus B
> would be set (i.e. after C was set which is not the desired order).
> Our solution to handle this is to introduce a virtual switch (in the form of an
> enum_virt) between B and Headset.

It sounds like this non-specific register bit is just the power control
for C in which case it should just be a DAPM widget and machines should
be using a pin switch or jack pins for the outputs.

> I2S (playback)------>A----->B----->C----->Headset
>                             ^
>                             |
>          LineIn----->D------E----->F----->I2S (capture)

> As you can see neither of the endpoints "belongs" to the bypass-path (E->B) and
> therefore I can't see how it should be possible to use a simple pin switch here
> as it would always affect other paths.

Again, this looks *very* standard - it's just a totally normal
bypass/sidetone path as far as I can see.  B is a mixer here and
presumably there's some control on B which turns on and off the path?

Depending on how the path is used you might want to mark the route as a
weak route to suppress power up from that path alone but really as with
the first example this doesn't seem at all unusual unless there's more
going on than your description.

> >> So, what you want is another device/driver pair where our current
> >> acc.det.-driver adds a driver to the device we add in the ASoC-driver?

> > I can't parse what you're saying here, sorry.

> OK, I was trying to understand what you meant with these comments:
> "breaking the device model" and "just embed a trivial input
> driver in the CODEC for the vibra if it's small enough."
> Could you explain this abit more?

The device model is this whole idea that we have devices which are
matched up automatically by the core.  "Embedding" means "putting in" -
see for example wm8962 which has a tiny little input driver in it.

> > No.  That's exactly the sort of stuff we don't want to see.  The fact
> > that the device needs power to operate isn't something that's specific
> > to a particular board, it's a property of the silicon.

> I agree that the fact that it needs power is not specific to the board, but we
> could have different regulators feeding the codec-chip. The regulators could be

You've completely failed to understand how requesting supplies in the
regulator API works, a regulator API like you describe would mean that
no chip driver was ever able to request a supply for itself.  The whole
point of the machine interface is to provide a mechanism for drivers to
talk about their supplies without having to know the details of how
they're wired up on an individual board.

Since your CODEC driver is a driver for a chip your CODEC driver should
be requesting whatever the supplies the chip has.

> > I've not suggested that.  Look at how other drivers manage their power.

> I have looked alot at other drivers, but in many cases I've found that our
> situation looks pretty different and often more complex.
> See the last comment below for more info on our regulator-usage.

I'm sorry but really I don't see anything in the text below which sounds
in the least bit unusual.  Could you be specific about what you think is
special about your device and/or system?

> > I'm not seeing any code in the driver which manages the regulators...

> This is all our regulator-widgets, currently located in the machine-driver and
> connected to chains located in the codec-driver:

Things that are in the machine driver are not in the CODEC driver and
need to be cut and pasted into individual machine drivers.  If it's
something that's genuinely machine specific that's fine but we're
talking about basic core device supplies here.

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

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



      reply	other threads:[~2012-03-19 15:43 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13 15:11 [PATCH 01/16] ASoC: core: Add multi reg control struct & macros Ola Lilja
2012-03-13 15:11 ` [PATCH 02/16] ASoC: core: Add 8bit multi reg control accessors Ola Lilja
2012-03-13 21:25   ` Mark Brown
2012-03-22 16:58     ` Kristoffer KARLSSON
2012-03-22 17:02       ` Mark Brown
2012-03-13 15:11 ` [PATCH 03/16] ASoC: core: Add range of " Ola Lilja
2012-03-13 21:23   ` Mark Brown
2012-03-13 15:11 ` [PATCH 04/16] ASoC: core: Add info accessor for mreg control Ola Lilja
2012-03-13 15:11 ` [PATCH 05/16] ASoC: core: Add strobe control Ola Lilja
2012-03-13 21:33   ` Mark Brown
2012-03-22 16:20     ` Kristoffer KARLSSON
2012-03-22 16:33       ` Mark Brown
2012-03-22 17:09         ` Kristoffer KARLSSON
2012-03-22 17:28           ` Mark Brown
2012-03-13 15:11 ` [PATCH 06/16] ASoC: core: Add macros for 8bit hwdep multi reg cntrl Ola Lilja
2012-03-13 21:36   ` Mark Brown
2012-03-13 15:11 ` [PATCH 07/16] ASoC: core: Add macro for hwdep range of regs control Ola Lilja
2012-03-13 15:11 ` [PATCH 08/16] ARM: ux500: Add DMA-channels for MSP Ola Lilja
2012-03-13 15:11 ` [PATCH 09/16] arm: ux500: Add audio-regulators Ola Lilja
2012-03-14 10:42   ` Linus Walleij
2012-03-13 15:11 ` [PATCH 10/16] arm: ux500: Add support for MSP I2S-devices Ola Lilja
2012-03-13 21:40   ` Mark Brown
2012-03-14  9:39     ` Linus Walleij
2012-03-14 11:44       ` Mark Brown
2012-03-13 15:11 ` [PATCH 11/16] ARM: ux500: Add placeholder for clk_set_parent Ola Lilja
2012-03-14 10:43   ` Linus Walleij
2012-03-13 15:11 ` [PATCH 14/16] ASoC: Ux500: Add platform-driver Ola Lilja
2012-03-13 22:48   ` Mark Brown
2012-03-14 10:50     ` Linus Walleij
2012-03-14 12:31       ` Mark Brown
2012-03-13 15:11 ` [PATCH 15/16] ASoC: Ux500: Activate the Ux500 ASoC-driver Ola Lilja
2012-03-13 15:11 ` [PATCH 16/16] ASoC: Ux500: Add machine-driver Ola Lilja
2012-03-13 23:03   ` Mark Brown
2012-03-13 21:39 ` [PATCH 01/16] ASoC: core: Add multi reg control struct & macros Mark Brown
2012-03-21 12:07   ` Kristoffer KARLSSON
2012-03-21 12:40     ` Mark Brown
2012-03-22 15:46       ` Kristoffer KARLSSON
2012-03-22 15:56         ` Mark Brown
     [not found] ` <1331651503-16917-13-git-send-email-ola.o.lilja@stericsson.com>
2012-03-13 22:11   ` [PATCH 12/16] ASoC: Ux500: Add MSP I2S-driver Mark Brown
     [not found] ` <1331651503-16917-14-git-send-email-ola.o.lilja@stericsson.com>
2012-03-13 22:45   ` [PATCH 13/16] ASoC: codecs: Add AB8500 codec-driver Mark Brown
2012-03-14 13:27     ` Ola LILJA2
2012-03-14 13:45       ` Mark Brown
2012-03-15 14:50         ` Ola Lilja
2012-03-15 15:29           ` Mark Brown
2012-03-16 13:09             ` Ola Lilja
2012-03-17 22:31               ` Mark Brown
2012-03-19  8:07                 ` Ola Lilja
2012-03-19  8:23                   ` Linus Walleij
2012-03-19 12:09                   ` Mark Brown
2012-03-19 14:54                     ` Ola Lilja
2012-03-19 15:43                       ` 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=20120319154341.GA5132@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).