linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Magnus Damm <magnus.damm@gmail.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH 5/6] fbdev: sh_mobile_meram: Add clock enable/disble hooks
Date: Thu, 19 May 2011 00:52:44 +0000	[thread overview]
Message-ID: <BANLkTikXCN3zGbi_s2pxoanB+d3WwtX0ww@mail.gmail.com> (raw)
In-Reply-To: <1305717011-20742-6-git-send-email-dhobsong@igel.co.jp>

On Wed, May 18, 2011 at 8:10 PM, Damian Hobson-Garcia
<dhobsong@igel.co.jp> wrote:
> Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
> ---
>  drivers/video/sh_mobile_meram.c |   27 +++++++++++++++++++++++++++
>  include/video/sh_mobile_meram.h |    6 ++++++
>  2 files changed, 33 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/video/sh_mobile_meram.c b/drivers/video/sh_mobile_meram.c
> index 9170c82..5e4ce98 100644
> --- a/drivers/video/sh_mobile_meram.c
> +++ b/drivers/video/sh_mobile_meram.c
> @@ -12,6 +12,7 @@
>  #include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/device.h>
> +#include <linux/pm_runtime.h>
>  #include <linux/io.h>
>  #include <linux/slab.h>
>  #include <linux/platform_device.h>
> @@ -460,11 +461,33 @@ static int sh_mobile_meram_update(struct sh_mobile_meram_info *pdata,
>        return 0;
>  }
>
> +int sh_mobile_meram_clk_on(struct sh_mobile_meram_info *pdata)
> +{
> +       if (!pdata || !pdata->pdev)
> +               return -EINVAL;
> +
> +       dev_dbg(&pdata->pdev->dev, "Enabling sh_mobile_meram clock.");
> +       pm_runtime_get(&pdata->pdev->dev);

This should be pm_runtime_get_sync() to force block until the clock is enabled.

> diff --git a/include/video/sh_mobile_meram.h b/include/video/sh_mobile_meram.h
> index af602d6..3605874 100644
> --- a/include/video/sh_mobile_meram.h
> +++ b/include/video/sh_mobile_meram.h
> @@ -63,6 +63,12 @@ struct sh_mobile_meram_ops {
>                            unsigned long base_addr_c,
>                            unsigned long *icb_addr_y,
>                            unsigned long *icb_addr_c);
> +
> +       /* enable meram clock */
> +       int (*meram_clk_on)(struct sh_mobile_meram_info *meram_dev);
> +
> +       /* disable meram clock */
> +       int (*meram_clk_off)(struct sh_mobile_meram_info *meram_dev);

Hm, we need more than just clock control. Runtime PM is used for both
clock and power domain control. This means that after pm_runtime_put()
the power to the MERAM may be turned off. So you probably want to add
some context save/restore code to make sure the MERAM settings are
re-initialized after power-up. At this point there are no patches
upstream for this, but I think we should give it a try after
2.6.40-rc1 or rc2 is out.

Thanks,

/ magnus

  reply	other threads:[~2011-05-19  0:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18 11:10 [PATCH 5/6] fbdev: sh_mobile_meram: Add clock enable/disble hooks via runtime PM Damian Hobson-Garcia
2011-05-19  0:52 ` Magnus Damm [this message]
2011-05-24  3:04 ` [PATCH 5/6] fbdev: sh_mobile_meram: Add clock enable/disble hooks Damian Hobson-Garcia
2011-05-24  8:47 ` Magnus Damm

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=BANLkTikXCN3zGbi_s2pxoanB+d3WwtX0ww@mail.gmail.com \
    --to=magnus.damm@gmail.com \
    --cc=linux-sh@vger.kernel.org \
    /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).