This is a note to let you know that I've just added the patch titled

    mfd: adp5520: Restore mode bits on resume

to the 3.9-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mfd-adp5520-restore-mode-bits-on-resume.patch
and it can be found in the queue-3.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From c6cc25fda58da8685ecef3f179adc7b99c8253b2 Mon Sep 17 00:00:00 2001
From: Lars-Peter Clausen <[email protected]>
Date: Tue, 19 Feb 2013 11:51:22 +0100
Subject: mfd: adp5520: Restore mode bits on resume

From: Lars-Peter Clausen <[email protected]>

commit c6cc25fda58da8685ecef3f179adc7b99c8253b2 upstream.

The adp5520 unfortunately also clears the BL_EN bit when the nSTNDBY bit is
cleared. So we need to make sure to restore it during resume if it was set
before suspend.

Signed-off-by: Lars-Peter Clausen <[email protected]>
Acked-by: Michael Hennerich <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/mfd/adp5520.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- a/drivers/mfd/adp5520.c
+++ b/drivers/mfd/adp5520.c
@@ -36,6 +36,7 @@ struct adp5520_chip {
        struct blocking_notifier_head notifier_list;
        int irq;
        unsigned long id;
+       uint8_t mode;
 };
 
 static int __adp5520_read(struct i2c_client *client,
@@ -326,7 +327,10 @@ static int adp5520_suspend(struct device
        struct i2c_client *client = to_i2c_client(dev);
        struct adp5520_chip *chip = dev_get_drvdata(&client->dev);
 
-       adp5520_clr_bits(chip->dev, ADP5520_MODE_STATUS, ADP5520_nSTNBY);
+       adp5520_read(chip->dev, ADP5520_MODE_STATUS, &chip->mode);
+       /* All other bits are W1C */
+       chip->mode &= ADP5520_BL_EN | ADP5520_DIM_EN | ADP5520_nSTNBY;
+       adp5520_write(chip->dev, ADP5520_MODE_STATUS, 0);
        return 0;
 }
 
@@ -335,7 +339,7 @@ static int adp5520_resume(struct device
        struct i2c_client *client = to_i2c_client(dev);
        struct adp5520_chip *chip = dev_get_drvdata(&client->dev);
 
-       adp5520_set_bits(chip->dev, ADP5520_MODE_STATUS, ADP5520_nSTNBY);
+       adp5520_write(chip->dev, ADP5520_MODE_STATUS, chip->mode);
        return 0;
 }
 #endif


Patches currently in stable-queue which might be from [email protected] are

queue-3.9/mfd-adp5520-restore-mode-bits-on-resume.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to