linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liam Girdwood <lrg@ti.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: "Ujfalusi, Peter" <peter.ujfalusi@ti.com>,
	Tony Lindgren <tony@atomide.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"Lopez Cruz, Misael" <misael.lopez@ti.com>,
	"Guiriec, Sebastien" <s-guiriec@ti.com>,
	"Cousson, Benoit" <b-cousson@ti.com>
Subject: Re: [PATCH 1/3] ASoC: omap-mcpdm: Replace legacy driver
Date: Thu, 7 Jul 2011 17:32:42 +0100	[thread overview]
Message-ID: <4E15DFAA.7030508@ti.com> (raw)
In-Reply-To: <20110707155742.GC16325@opensource.wolfsonmicro.com>

On 07/07/11 16:57, Mark Brown wrote:
> On Thu, Jul 07, 2011 at 03:27:50PM +0300, Peter Ujfalusi wrote:
> 
>> The current McPDM driver design is not suitable to support both
>> the ABE and Legacy DMA operating modes. Therefore remove most
> 
> In what way is it not suitable?

It cant support both the ABE and Legacy DMA modes without adding some unnecessary and complicated logic. My preference is 1 driver to support both modes of operation and this is the easiest way to do so (also keeping the maintenance easier too).

> 
>> +/*
>> + * Enables the transfer through the PDM interface to/from the Phoenix
>> + * codec by enabling the corresponding UP or DN channels.
>> + */
>> +static void omap_mcpdm_start(struct omap_mcpdm *mcpdm)
>> +{
>> +	u32 ctrl = omap_mcpdm_read(mcpdm, MCPDM_REG_CTRL);
>> +
>> +	ctrl |= (MCPDM_SW_DN_RST | MCPDM_SW_UP_RST);
>> +	omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL, ctrl);
>> +
>> +	ctrl |= mcpdm->dn_channels | mcpdm->up_channels;
>> +	omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL, ctrl);
>> +
>> +	ctrl &= ~(MCPDM_SW_DN_RST | MCPDM_SW_UP_RST);
>> +	omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL, ctrl);
>> +}
> 
> Presumably this works with any PDM input/output?

Yes.

> 
>> +/* work to delay McPDM shutdown */
>> +static void playback_work(struct work_struct *work)
>> +{
>> +	struct omap_mcpdm *mcpdm = container_of(work,
>> +					struct omap_mcpdm, delayed_work.work);
>> +
>> +	if (!mcpdm->active && omap_mcpdm_active(mcpdm)) {
>> +		omap_mcpdm_stop(mcpdm);
>> +		omap_mcpdm_close_streams(mcpdm);
>> +	}
>> +
>> +	if (!omap_mcpdm_active(mcpdm))
>> +		pm_runtime_put_sync(mcpdm->dev);
>> +}
> 
> It occurs to me that it'd be much simpler to implement this by doing the
> cleanup in your runtime suspend callback, it looks like you're working
> around the pm_runtime framework rather than using it.  If you need to do
> some cleanup when the device goes idle and you can't do it within a
> framework designed to suspend the device when it goes idle then there's
> an issue there.
> 
> Alternatively, why is this deferred?

There are some power, clock and pop dependencies here between the CODEC, ABE and McPDM interface and this deferred work allows us to shutwdown McPDM (in a pop free manner) and satisfy the dependencies without causing a data abort and/or locking the ABE firmware.

Liam


  reply	other threads:[~2011-07-07 16:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-07 12:27 [PATCH 0/3] OMAP4/ASoC: New McPDM driver Peter Ujfalusi
2011-07-07 12:27 ` [PATCH 1/3] ASoC: omap-mcpdm: Replace legacy driver Peter Ujfalusi
2011-07-07 15:57   ` Mark Brown
2011-07-07 16:32     ` Liam Girdwood [this message]
2011-07-07 16:53       ` Mark Brown
2011-07-07 17:19         ` Péter Ujfalusi
2011-07-07 19:55         ` Liam Girdwood
2011-07-08 14:28           ` Mark Brown
2011-07-08 15:02             ` Péter Ujfalusi
2011-07-09  1:08               ` Mark Brown
2011-07-12 19:35                 ` Péter Ujfalusi
2011-07-12 23:25                   ` Mark Brown
2011-07-07 12:27 ` [PATCH 2/3] OMAP: McPDM: Convert McPDM device to omap_device Peter Ujfalusi
2011-07-07 15:58   ` Mark Brown
2011-07-07 12:27 ` [PATCH 3/3] OMAP4: hwmod: enable mcpdm hwmod device Peter Ujfalusi
2011-07-07 15:58   ` Mark Brown
2011-07-26 13:46   ` Cousson, Benoit

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=4E15DFAA.7030508@ti.com \
    --to=lrg@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=b-cousson@ti.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=misael.lopez@ti.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=s-guiriec@ti.com \
    --cc=tony@atomide.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).