regulator: s2mps11: add shutdown function
authorJaehoon Chung <jh80.chung@samsung.com>
Fri, 23 Jan 2015 09:16:54 +0000 (18:16 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 14 Dec 2016 04:49:50 +0000 (13:49 +0900)
This needs for poweroff on odroid xu3 board.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/regulator/s2mps11.c

index 8b978ad..6b8e8ae 100644 (file)
@@ -1082,6 +1082,13 @@ out:
        return ret;
 }
 
+static void s2mps11_pmic_shutdown(struct platform_device *pdev)
+{
+       struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent);
+
+       regmap_update_bits(iodev->regmap_pmic, S2MPS11_REG_CTRL1, 0xff, 0x00);
+}
+
 static const struct platform_device_id s2mps11_pmic_id[] = {
        { "s2mps11-pmic", S2MPS11X},
        { "s2mps13-pmic", S2MPS13X},
@@ -1096,6 +1103,7 @@ static struct platform_driver s2mps11_pmic_driver = {
                .name = "s2mps11-pmic",
        },
        .probe = s2mps11_pmic_probe,
+       .shutdown = s2mps11_pmic_shutdown,
        .id_table = s2mps11_pmic_id,
 };