All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Varadarajan, Charulatha" <charu@ti.com>
To: David Lambert <dlambert@ti.com>
Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org,
	Tony Lindgren <tony@atomide.com>, Paul Walmsley <paul@pwsan.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lrg@slimlogic.co.uk>
Subject: Re: [PATCH v3 1/4] ASoC: DMIC: Adding the OMAP DMIC driver
Date: Fri, 28 Jan 2011 14:15:36 +0530	[thread overview]
Message-ID: <AANLkTikZExkXPSzD3OrhZgC2pdoL5Lw8AqK6Ocso0mnq@mail.gmail.com> (raw)
In-Reply-To: <1295992862-6154-2-git-send-email-dlambert@ti.com>

<<snip>>

> +
> +static int omap_dmic_set_dai_sysclk(struct snd_soc_dai *dai,
> +                                   int clk_id, unsigned int freq,
> +                                   int dir)
> +{
> +       struct omap_dmic *dmic = snd_soc_dai_get_drvdata(dai);
> +       struct clk *dmic_clk, *parent_clk;
> +       int ret = 0;
> +
> +       dmic_clk = clk_get(NULL, "dmic_fck");

It is preferred to use device pointer. instead of NULL.
(Applicable elsewhere)

> +       if (IS_ERR(dmic_clk))
> +               return -ENODEV;
> +
> +       switch (clk_id) {
> +       case OMAP_DMIC_SYSCLK_PAD_CLKS:
> +               parent_clk = clk_get(NULL, "pad_clks_ck");
> +               if (IS_ERR(parent_clk)) {
> +                       ret = -ENODEV;
> +                       goto err_par;
> +               }
> +               break;
> +       case OMAP_DMIC_SYSCLK_SLIMBLUS_CLKS:
> +               parent_clk = clk_get(NULL, "slimbus_clk");
> +               if (IS_ERR(parent_clk)) {
> +                       ret = -ENODEV;
> +                       goto err_par;
> +               }
> +               break;
> +       case OMAP_DMIC_SYSCLK_SYNC_MUX_CLKS:
> +               parent_clk = clk_get(NULL, "dmic_sync_mux_ck");
> +               if (IS_ERR(parent_clk)) {
> +                       ret = -ENODEV;
> +                       goto err_par;
> +               }
> +               break;
> +       default:
> +               dev_err(dai->dev, "clk_id not supported %d\n", clk_id);
> +               ret = -EINVAL;
> +               goto err_par;
> +       }
> +
> +       if (dmic->sysclk != clk_id) {
> +               /* reparent not allowed if a stream is ongoing */
> +               if (dmic->active > 1) {
> +                       ret = -EBUSY;
> +                       goto err_busy;
> +               }
> +
> +               /* disable clock while reparenting */
> +               if (dmic->active == 1)
> +                       pm_runtime_put_sync(dmic->dev);
> +
> +               ret = clk_set_parent(dmic_clk, parent_clk);
> +
> +               if (dmic->active == 1)
> +                       pm_runtime_get_sync(dmic->dev);
> +
> +               dmic->sysclk = clk_id;
> +       }
> +
> +       dmic->clk_freq = clk_get_rate(dmic_clk);
> +
> +err_busy:
> +       clk_put(parent_clk);
> +err_par:
> +       clk_put(dmic_clk);
> +
> +       return ret;
> +}
> +

<<snip>>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2011-01-28  8:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-25 22:00 [PATCH v3 0/4] Adding OMAP DMIC driver to kernel David Lambert
2011-01-25 22:00 ` [PATCH v3 1/4] ASoC: DMIC: Adding the OMAP DMIC driver David Lambert
2011-01-28  7:43   ` Varadarajan, Charulatha
2011-01-28  8:45   ` Varadarajan, Charulatha [this message]
2011-01-25 22:01 ` [PATCH v3 2/4] OMAP4: hwmod: add entries for " David Lambert
2011-01-25 23:54   ` Paul Walmsley
2011-01-26 12:55     ` Lambert, David
2011-01-26 17:28       ` Paul Walmsley
2011-02-14 15:36   ` Cousson, Benoit
2011-01-25 22:01 ` [PATCH v3 3/4] OMAP4: DMIC: initializes the " David Lambert
2011-01-28  7:46   ` Varadarajan, Charulatha
2011-01-25 22:01 ` [PATCH v3 4/4] OMAP4: DMIC: Add DMIC codec platform devices David Lambert
2011-01-26  1:22 ` [PATCH v3 0/4] Adding OMAP DMIC driver to kernel G, Manjunath Kondaiah

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=AANLkTikZExkXPSzD3OrhZgC2pdoL5Lw8AqK6Ocso0mnq@mail.gmail.com \
    --to=charu@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dlambert@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=paul@pwsan.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 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.