diff options
author | Ramesh Thomas <ramesh.thomas@intel.com> | 2016-03-23 23:23:10 -0700 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2016-03-26 14:35:11 -0400 |
commit | 4104bbfb0800dc271446adced1f2bea2e5248dbb (patch) | |
tree | 360fac92745c5c99c34e28aecd01762db1cff187 /include/gpio.h | |
parent | bb19e6f82f9f570efd26958bab9ac6241109aec9 (diff) |
power_mgmt: Add device power management support
Added device power management hook infrastructure. Added
DEVICE_INIT_PM and SYS_INIT_PM macros that creates device
structures with the supplied device_ops structure containing
the hooks.
Added example support in gpio_dw driver. Updated the sample
app and tested using LPS and Device Suspend Only policies.
Change-Id: I2fe347f8d8fd1041d8318e02738990deb8c5d68e
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Diffstat (limited to 'include/gpio.h')
-rw-r--r-- | include/gpio.h | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/include/gpio.h b/include/gpio.h index b79c393f9..b4407fb03 100644 --- a/include/gpio.h +++ b/include/gpio.h @@ -150,8 +150,6 @@ typedef int (*gpio_enable_callback_t)(struct device *port, typedef int (*gpio_disable_callback_t)(struct device *port, int access_op, uint32_t pin); -typedef int (*gpio_suspend_port_t)(struct device *port); -typedef int (*gpio_resume_port_t)(struct device *port); struct gpio_driver_api { gpio_config_t config; @@ -160,8 +158,6 @@ struct gpio_driver_api { gpio_set_callback_t set_callback; gpio_enable_callback_t enable_callback; gpio_disable_callback_t disable_callback; - gpio_suspend_port_t suspend; - gpio_resume_port_t resume; }; /** * @endcond @@ -325,31 +321,6 @@ static inline int gpio_port_disable_callback(struct device *port) return api->disable_callback(port, GPIO_ACCESS_BY_PORT, 0); } -/** - * @brief Save the state of the device and make it go to the - * low power state. - * @param port Pointer to the device structure for the driver instance. - */ -static inline int gpio_suspend(struct device *port) -{ - struct gpio_driver_api *api; - - api = (struct gpio_driver_api *) port->driver_api; - return api->suspend(port); -} - -/** - * @brief Restore the state stored during suspend and resume operation. - * @param port Pointer to the device structure for the driver instance. - */ -static inline int gpio_resume(struct device *port) -{ - struct gpio_driver_api *api; - - api = (struct gpio_driver_api *) port->driver_api; - return api->resume(port); -} - #ifdef __cplusplus } #endif |