mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
This commit is contained in:
parent
8fffed8cfd
commit
cf24dc85ff
2 changed files with 6 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue