mfd: pm8xxx-misc: Add pm8xxx hard reset config API
The API configures PMIC for different behaviour on hard reset.
The different options are to disable hard reset, shutdown or
restart on hard reset.
Change-Id: I214d563e904dd7e73c98a454866718a60a11b6dd
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
diff --git a/include/linux/mfd/pm8xxx/misc.h b/include/linux/mfd/pm8xxx/misc.h
index 2bd2850..52fe31a 100644
--- a/include/linux/mfd/pm8xxx/misc.h
+++ b/include/linux/mfd/pm8xxx/misc.h
@@ -67,6 +67,12 @@
PM8XXX_SMPL_DELAY_2p0,
};
+enum pm8xxx_pon_config {
+ PM8XXX_DISABLE_HARD_RESET = 0,
+ PM8XXX_SHUTDOWN_ON_HARD_RESET,
+ PM8XXX_RESTART_ON_HARD_RESET,
+};
+
#if defined(CONFIG_MFD_PM8XXX_MISC) || defined(CONFIG_MFD_PM8XXX_MISC_MODULE)
/**
@@ -130,6 +136,17 @@
*/
int pm8xxx_watchdog_reset_control(int enable);
+/**
+ * pm8xxx_hard_reset_config - Allows different reset configurations
+ *
+ * config = DISABLE_HARD_RESET to disable hard reset
+ * = SHUTDOWN_ON_HARD_RESET to turn off the system on hard reset
+ * = RESTART_ON_HARD_RESET to restart the system on hard reset
+ *
+ * RETURNS: an appropriate -ERRNO error value on error, or zero for success.
+ */
+int pm8xxx_hard_reset_config(enum pm8xxx_pon_config config);
+
#else
static inline int pm8xxx_reset_pwr_off(int reset)
@@ -158,7 +175,10 @@
{
return -ENODEV;
}
-
+static inline int pm8xxx_hard_reset_config(enum pm8xxx_pon_config config)
+{
+ return -ENODEV;
+}
#endif
#endif