linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: randy.dunlap@oracle.com (Randy Dunlap)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] nand: Fix S3C NAND clock stop
Date: Sun, 10 Apr 2011 19:05:14 -0700	[thread overview]
Message-ID: <4DA261DA.2050404@oracle.com> (raw)
In-Reply-To: <1302485262-8401-1-git-send-email-jiri.pinkava@vscht.cz>

On 4/10/2011 6:27 PM, Jiri Pinkava wrote:
> Current implementation of s3c2410_nand_select_chip call
> clk_disable every time when chip = -1 (de-select). This happend
> multiple times even if chip was already de-selected. This causes
> disabling clock even if they are already disabled and due to
> nature of clock subsytem implementation this causes nand clock
> to be disabled and newer enabled again.
>
> Signed-off-by: Jiri Pinkava<jiri.pinkava@vscht.cz>
> ---
>   drivers/mtd/nand/s3c2410.c |   57 +++++++++++++++++++++++++++++++------------
>   1 files changed, 41 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
> index 33d832d..79e18a3 100644
> --- a/drivers/mtd/nand/s3c2410.c
> +++ b/drivers/mtd/nand/s3c2410.c

> @@ -159,11 +165,33 @@ static struct s3c2410_platform_nand *to_nand_plat(struct platform_device *dev)
>   	return dev->dev.platform_data;
>   }
>
> -static inline int allow_clk_stop(struct s3c2410_nand_info *info)
> +static inline int allow_clk_suspend(struct s3c2410_nand_info *info)
>   {
>   	return clock_stop;
>   }
>
> +/**
> + * s3c2410_nand_clk_set_state - Enable, disable or suspend NAND clock.
> + * @info: The controller instance.
> + * @state: State to which clock should be set.

       @new_state:

> + */
> +static void s3c2410_nand_clk_set_state(struct s3c2410_nand_info *info,
> +		int new_state)
> +{
> +	if (!allow_clk_suspend(info)&&  new_state == CLOCK_SUSPEND)
> +		return;
> +
> +	if (clock_state == CLOCK_ENABLE) {
> +		if (new_state != CLOCK_ENABLE)
> +			clk_disable(info->clk);
> +	} else {
> +		if (new_state == CLOCK_ENABLE)
> +			clk_enable(info->clk);
> +	}
> +
> +	clock_state = new_state;
> +}

  reply	other threads:[~2011-04-11  2:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-11  1:27 [PATCH] nand: Fix S3C NAND clock stop Jiri Pinkava
2011-04-11  2:05 ` Randy Dunlap [this message]
2011-04-11  3:15   ` Jiří Pinkava
  -- strict thread matches above, loose matches on Subject: below --
2011-04-11  1:20 Jiri Pinkava

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=4DA261DA.2050404@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=linux-arm-kernel@lists.infradead.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).