linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Liam Girdwood <lrg@ti.com>, Tony Lindgren <tony@atomide.com>,
	linux-omap@vger.kernel.org, alsa-devel@alsa-project.org,
	Misael Lopez Cruz <misael.lopez@ti.com>,
	Sebastien Guiriec <s-guiriec@ti.com>,
	Benoit Coussoni <b-cousson@ti.com>
Subject: Re: [PATCH 1/3] ASoC: omap-mcpdm: Replace legacy driver
Date: Thu, 7 Jul 2011 08:57:43 -0700	[thread overview]
Message-ID: <20110707155742.GC16325@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1310041672-18634-2-git-send-email-peter.ujfalusi@ti.com>

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?

> +/*
> + * 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?

> +/* 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?

  reply	other threads:[~2011-07-07 15:57 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 [this message]
2011-07-07 16:32     ` Liam Girdwood
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=20110707155742.GC16325@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=b-cousson@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=lrg@ti.com \
    --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).