All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@nokia.com>
To: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Tony Lindgren <tony@atomide.com>,
	linux-mtd Mailing List <linux-mtd@lists.infradead.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Artem Bityutskiy <dedekind1@gmail.com>
Subject: Re: [PATCH 2/7] mtd: OneNAND: add enable / disable methods to onenand_chip
Date: Wed, 15 Dec 2010 11:33:53 +0200	[thread overview]
Message-ID: <4D088B81.2000804@nokia.com> (raw)
In-Reply-To: <AANLkTi=0W8NuF3SNhWwjwDZtuCzyOM8219_pXG=9pU6O@mail.gmail.com>


 From ece28a7fdec36fb40d60d35a5639326871c162f6 Mon Sep 17 00:00:00 2001
From: Adrian Hunter <adrian.hunter@nokia.com>
Date: Fri, 19 Feb 2010 15:39:52 +0100
Subject: [PATCH V2 2/7] mtd: OneNAND: add enable / disable methods to onenand_chip

Add enable / disable methods called from get_device() / release_device().
These can be used, for example, to allow the driver to prevent the voltage
regulator from being put to sleep while OneNAND is in use.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
---
  drivers/mtd/onenand/onenand_base.c |    4 ++++
  include/linux/mtd/onenand.h        |    2 ++
  2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index c38bf9c..5639e43 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -948,6 +948,8 @@ static int onenand_get_device(struct mtd_info *mtd, int new_state)
  		if (this->state == FL_READY) {
  			this->state = new_state;
  			spin_unlock(&this->chip_lock);
+			if (new_state != FL_PM_SUSPENDED && this->enable)
+				this->enable(mtd);
  			break;
  		}
  		if (new_state == FL_PM_SUSPENDED) {
@@ -974,6 +976,8 @@ static void onenand_release_device(struct mtd_info *mtd)
  {
  	struct onenand_chip *this = mtd->priv;
  
+	if (this->state != FL_PM_SUSPENDED && this->disable)
+		this->disable(mtd);
  	/* Release the chip */
  	spin_lock(&this->chip_lock);
  	this->state = FL_READY;
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index 6da3fe3..ae418e4 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -118,6 +118,8 @@ struct onenand_chip {
  	int (*chip_probe)(struct mtd_info *mtd);
  	int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
  	int (*scan_bbt)(struct mtd_info *mtd);
+	int (*enable)(struct mtd_info *mtd);
+	int (*disable)(struct mtd_info *mtd);
  
  	struct completion	complete;
  	int			irq;
-- 
1.7.0.4

  parent reply	other threads:[~2010-12-15  9:41 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-13 12:20 [PATCH 0/7] OneNAND OMAP patches (resent) Adrian Hunter
2010-12-13 12:20 ` [PATCH 1/7] mtd: OneNAND: OMAP2/3: add support for command line partitioning Adrian Hunter
2010-12-15 14:04   ` Artem Bityutskiy
2011-01-05 11:02     ` Adrian Hunter
2011-01-05 12:12       ` Artem Bityutskiy
2011-01-05 12:24         ` Adrian Hunter
2011-01-05 12:45           ` Artem Bityutskiy
2010-12-15 14:06   ` Artem Bityutskiy
2010-12-13 12:20 ` [PATCH 2/7] mtd: OneNAND: add enable / disable methods to onenand_chip Adrian Hunter
2010-12-14  0:17   ` Kyungmin Park
2010-12-15  7:31     ` Adrian Hunter
2010-12-15  9:33     ` Adrian Hunter [this message]
2010-12-13 12:21 ` [PATCH 3/7] mtd: OneNAND: OMAP2/3: prevent regulator sleeping while OneNAND is in use Adrian Hunter
2010-12-13 12:21 ` [PATCH 4/7] OMAP2/3: GPMC: put sync_clk value in picoseconds instead of nanoseconds Adrian Hunter
2010-12-15  1:29   ` Tony Lindgren
2010-12-15  6:54     ` Adrian Hunter
2010-12-15  6:54       ` Adrian Hunter
2010-12-15  6:54       ` Adrian Hunter
2010-12-21  1:23   ` Tony Lindgren
2010-12-13 12:21 ` [PATCH 5/7] OMAP2/3: OneNAND: add 104MHz support Adrian Hunter
2010-12-13 12:21 ` [PATCH 6/7] OMAP2/3: OneNAND: add platform data callback for PM constraints Adrian Hunter
2010-12-13 12:21 ` [PATCH 7/7] mtd: OneNAND: lighten scary initial bad block messages Adrian Hunter
2010-12-14  0:21   ` Kyungmin Park
2010-12-15 13:58   ` Artem Bityutskiy
  -- strict thread matches above, loose matches on Subject: below --
2010-12-13 12:11 [PATCH 0/7] OneNAND OMAP patches Adrian Hunter
2010-12-13 12:12 ` [PATCH 2/7] mtd: OneNAND: add enable / disable methods to onenand_chip Adrian Hunter
2010-02-19 14:39 Adrian Hunter
2010-02-19 14:39 Adrian Hunter

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=4D088B81.2000804@nokia.com \
    --to=adrian.hunter@nokia.com \
    --cc=dedekind1@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-mtd@lists.infradead.org \
    --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.