PM: Add activity domain to all PM callbacks
This commit is contained in:
parent
83aa1bebf3
commit
0e8ff50d18
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* configs/cloudctrl/src/stm32_autoleds.c
|
||||
*
|
||||
* Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012, 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Darcy Gong <darcy.gong@gmail.com>
|
||||
*
|
||||
@ -145,8 +145,10 @@ static void led_setonoff(unsigned int bits);
|
||||
/* LED Power Management */
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void led_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static void led_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@ -284,7 +286,8 @@ static void led_setonoff(unsigned int bits)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static void led_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
switch (pmstate)
|
||||
{
|
||||
@ -339,7 +342,8 @@ static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int led_pm_prepare(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
/* No preparation to change power modes is required by the LEDs driver.
|
||||
* We always accept the state change by returning OK.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* configs/efm32-g8xx-stk/src/efm32_userleds.c
|
||||
*
|
||||
* Copyright (C) 2014-2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2014-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -88,8 +88,10 @@ static gpio_pinset_t g_ledcfg[BOARD_NLEDS] =
|
||||
/* LED Power Management */
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void led_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static void led_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@ -118,7 +120,8 @@ static struct pm_callback_s g_ledscb =
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static void led_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
switch (pmstate)
|
||||
{
|
||||
@ -173,7 +176,8 @@ static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int led_pm_prepare(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
/* No preparation to change power modes is required by the LEDs driver.
|
||||
* We always accept the state change by returning OK.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* configs/fire-stm32v2/src/stm32_autoleds.c
|
||||
*
|
||||
* Copyright (C) 2012-2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012-2013, 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -149,8 +149,10 @@ static void led_setonoff(unsigned int bits);
|
||||
/* LED Power Management */
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void led_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static void led_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@ -265,7 +267,8 @@ static void led_setonoff(unsigned int bits)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static void led_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
switch (pmstate)
|
||||
{
|
||||
@ -320,7 +323,8 @@ static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int led_pm_prepare(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
/* No preparation to change power modes is required by the LEDs driver.
|
||||
* We always accept the state change by returning OK.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* configs/mikroe_stm32f4/src/stm32_idle.c
|
||||
*
|
||||
* Copyright (C) 2012-2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved.
|
||||
* Authors: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Diego Sanchez <dsanchez@nx-engineering.com>
|
||||
*
|
||||
@ -84,6 +84,8 @@
|
||||
# define CONFIG_PM_ALARM_NSEC 0
|
||||
#endif
|
||||
|
||||
#define PM_IDLE_DOMAIN 0 /* Revisit */
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
@ -129,12 +131,12 @@ static void up_idlepm(void)
|
||||
|
||||
/* Force the global state change */
|
||||
|
||||
ret = pm_changestate(newstate);
|
||||
ret = pm_changestate(PM_IDLE_DOMAIN, newstate);
|
||||
if (ret < 0)
|
||||
{
|
||||
/* The new state change failed, revert to the preceding state */
|
||||
|
||||
(void)pm_changestate(oldstate);
|
||||
(void)pm_changestate(PM_IDLE_DOMAIN, oldstate);
|
||||
|
||||
/* No state change... */
|
||||
|
||||
@ -190,7 +192,7 @@ static void up_idlepm(void)
|
||||
#endif
|
||||
/* Resume normal operation */
|
||||
|
||||
pm_changestate(PM_NORMAL);
|
||||
pm_changestate(PM_IDLE_DOMAIN, PM_NORMAL);
|
||||
newstate = PM_NORMAL;
|
||||
}
|
||||
break;
|
||||
@ -236,7 +238,7 @@ static void up_alarmcb(void)
|
||||
* PM_STANDBY period. So just go to sleep.
|
||||
*/
|
||||
|
||||
pm_changestate(PM_SLEEP);
|
||||
pm_changestate(PM_IDLE_DOMAIN, PM_SLEEP);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* configs/nucleo-f4x1re/src/stm32_userleds.c
|
||||
*
|
||||
* Copyright (C) 2014-2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2014-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -81,8 +81,10 @@
|
||||
/* LED Power Management */
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void led_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static void led_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@ -111,7 +113,8 @@ static struct pm_callback_s g_ledscb =
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static void led_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
switch (pmstate)
|
||||
{
|
||||
@ -166,7 +169,8 @@ static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int led_pm_prepare(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
/* No preparation to change power modes is required by the LEDs driver.
|
||||
* We always accept the state change by returning OK.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* configs/nucleo-l476rg/src/stm32_userleds.c
|
||||
*
|
||||
* Copyright (C) 2014-2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2014-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -81,8 +81,10 @@
|
||||
/* LED Power Management */
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void led_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static void led_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@ -111,7 +113,8 @@ static struct pm_callback_s g_ledscb =
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static void led_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
switch (pmstate)
|
||||
{
|
||||
@ -166,7 +169,8 @@ static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int led_pm_prepare(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
/* No preparation to change power modes is required by the LEDs driver.
|
||||
* We always accept the state change by returning OK.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* configs/shenzhou/src/stm32_autoleds.c
|
||||
*
|
||||
* Copyright (C) 2012-2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012-2013, 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -144,8 +144,10 @@ static void led_setonoff(unsigned int bits);
|
||||
/* LED Power Management */
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void led_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static void led_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@ -281,7 +283,8 @@ static void led_setonoff(unsigned int bits)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static void led_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
switch (pmstate)
|
||||
{
|
||||
@ -336,7 +339,8 @@ static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int led_pm_prepare(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
/* No preparation to change power modes is required by the LEDs driver.
|
||||
* We always accept the state change by returning OK.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* configs/stm3210e-eval/src/stm32_idle.c
|
||||
*
|
||||
* Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012, 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Authors: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Diego Sanchez <dsanchez@nx-engineering.com>
|
||||
*
|
||||
@ -119,6 +119,8 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define PM_IDLE_DOMAIN 0 /* Revisit */
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
@ -294,12 +296,12 @@ static void stm32_idlepm(void)
|
||||
|
||||
/* Force the global state change */
|
||||
|
||||
ret = pm_changestate(newstate);
|
||||
ret = pm_changestate(PM_IDLE_DOMAIN, newstate);
|
||||
if (ret < 0)
|
||||
{
|
||||
/* The new state change failed, revert to the preceding state */
|
||||
|
||||
(void)pm_changestate(oldstate);
|
||||
(void)pm_changestate(PM_IDLE_DOMAIN, oldstate);
|
||||
|
||||
/* No state change... */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**************************************************************************************
|
||||
* configs/stm3210e-eval/src/stm32_lcd.c
|
||||
*
|
||||
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011-2012, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* With power management enhancements by:
|
||||
@ -410,8 +410,10 @@ static int stm3210e_setcontrast(struct lcd_dev_s *dev, unsigned int contrast);
|
||||
/* LCD Power Management */
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void stm3210e_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static int stm3210e_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static void stm3210e_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
static int stm3210e_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
#endif
|
||||
|
||||
/* Initialization */
|
||||
@ -1153,7 +1155,8 @@ static int stm3210e_setcontrast(struct lcd_dev_s *dev, unsigned int contrast)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void stm3210e_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static void stm3210e_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
#ifdef CONFIG_STM3210E_LCD_PWM
|
||||
uint32_t frac;
|
||||
@ -1290,7 +1293,8 @@ static void stm3210e_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstat
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int stm3210e_pm_prepare(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static int stm3210e_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
/* No preparation to change power modes is required by the LCD driver. We always
|
||||
* accept the state change by returning OK.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* configs/stm3210e_eval/src/stm32_leds.c
|
||||
*
|
||||
* Copyright (C) 2009-2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009-2013, 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -144,8 +144,10 @@ static void led_setonoff(unsigned int bits);
|
||||
/* LED Power Management */
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void led_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static void led_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@ -277,7 +279,8 @@ static void led_setonoff(unsigned int bits)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static void led_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
switch (pmstate)
|
||||
{
|
||||
@ -332,7 +335,8 @@ static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int led_pm_prepare(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
/* No preparation to change power modes is required by the LEDs driver.
|
||||
* We always accept the state change by returning OK.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* configs/stm32f429i-disco/src/stm32_idle.c
|
||||
*
|
||||
* Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012, 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Authors: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Diego Sanchez <dsanchez@nx-engineering.com>
|
||||
*
|
||||
@ -84,6 +84,8 @@
|
||||
# define CONFIG_PM_ALARM_NSEC 0
|
||||
#endif
|
||||
|
||||
#define PM_IDLE_DOMAIN 0 /* Revisit */
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
@ -129,12 +131,12 @@ static void stm32_idlepm(void)
|
||||
|
||||
/* Force the global state change */
|
||||
|
||||
ret = pm_changestate(newstate);
|
||||
ret = pm_changestate(PM_IDLE_DOMAIN, newstate);
|
||||
if (ret < 0)
|
||||
{
|
||||
/* The new state change failed, revert to the preceding state */
|
||||
|
||||
(void)pm_changestate(oldstate);
|
||||
(void)pm_changestate(PM_IDLE_DOMAIN, oldstate);
|
||||
|
||||
/* No state change... */
|
||||
|
||||
@ -190,7 +192,7 @@ static void stm32_idlepm(void)
|
||||
#endif
|
||||
/* Resume normal operation */
|
||||
|
||||
pm_changestate(PM_NORMAL);
|
||||
pm_changestate(PM_IDLE_DOMAIN, PM_NORMAL);
|
||||
newstate = PM_NORMAL;
|
||||
}
|
||||
break;
|
||||
@ -236,7 +238,7 @@ static void stm32_alarmcb(void)
|
||||
* PM_STANDBY period. So just go to sleep.
|
||||
*/
|
||||
|
||||
pm_changestate(PM_SLEEP);
|
||||
pm_changestate(PM_IDLE_DOMAIN, PM_SLEEP);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* configs/stm32f429i-disco/src/stm32_userleds.c
|
||||
*
|
||||
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011, 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -87,8 +87,10 @@ static uint32_t g_ledcfg[BOARD_NLEDS] =
|
||||
/* LED Power Management */
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void led_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static void led_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
#endif
|
||||
|
||||
|
||||
@ -118,7 +120,8 @@ static struct pm_callback_s g_ledscb =
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static void led_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
switch (pmstate)
|
||||
{
|
||||
@ -173,7 +176,8 @@ static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int led_pm_prepare(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
/* No preparation to change power modes is required by the LEDs driver.
|
||||
* We always accept the state change by returning OK.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* configs/stm32f4discovery/src/stm32_idle.c
|
||||
*
|
||||
* Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012, 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Authors: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Diego Sanchez <dsanchez@nx-engineering.com>
|
||||
*
|
||||
@ -84,6 +84,8 @@
|
||||
# define CONFIG_PM_ALARM_NSEC 0
|
||||
#endif
|
||||
|
||||
#define PM_IDLE_DOMAIN 0 /* Revisit */
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
@ -126,12 +128,12 @@ static void stm32_idlepm(void)
|
||||
|
||||
/* Force the global state change */
|
||||
|
||||
ret = pm_changestate(newstate);
|
||||
ret = pm_changestate(PM_IDLE_DOMAIN, newstate);
|
||||
if (ret < 0)
|
||||
{
|
||||
/* The new state change failed, revert to the preceding state */
|
||||
|
||||
(void)pm_changestate(oldstate);
|
||||
(void)pm_changestatePM_IDLE_DOMAIN, oldstate);
|
||||
|
||||
/* No state change... */
|
||||
|
||||
@ -187,7 +189,7 @@ static void stm32_idlepm(void)
|
||||
#endif
|
||||
/* Resume normal operation */
|
||||
|
||||
pm_changestate(PM_NORMAL);
|
||||
pm_changestate(PM_IDLE_DOMAIN, PM_NORMAL);
|
||||
newstate = PM_NORMAL;
|
||||
}
|
||||
break;
|
||||
@ -233,7 +235,7 @@ static void up_alarmcb(void)
|
||||
* PM_STANDBY period. So just go to sleep.
|
||||
*/
|
||||
|
||||
pm_changestate(PM_SLEEP);
|
||||
pm_changestate(PM_IDLE_DOMAIN, PM_SLEEP);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* configs/stm32f4discovery/src/stm32_userleds.c
|
||||
*
|
||||
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011, 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -88,8 +88,10 @@ static uint32_t g_ledcfg[BOARD_NLEDS] =
|
||||
/* LED Power Management */
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void led_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static void led_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
#endif
|
||||
|
||||
|
||||
@ -119,7 +121,8 @@ static struct pm_callback_s g_ledscb =
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static void led_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
switch (pmstate)
|
||||
{
|
||||
@ -174,7 +177,8 @@ static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int led_pm_prepare(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
/* No preparation to change power modes is required by the LEDs driver.
|
||||
* We always accept the state change by returning OK.
|
||||
|
@ -65,8 +65,10 @@
|
||||
/* Button Power Management */
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void button_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static int button_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static void button_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
static int button_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@ -111,7 +113,8 @@ static struct pm_callback_s g_buttonscb =
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void button_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static void button_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
switch (pmstate)
|
||||
{
|
||||
@ -201,7 +204,8 @@ static int button_handler(int irq, FAR void *context)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int button_pm_prepare(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static int button_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
/* No preparation to change power modes is required by the Buttons driver.
|
||||
* We always accept the state change by returning OK.
|
||||
|
@ -77,8 +77,10 @@
|
||||
/* LED Power Management */
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void led_pm_notify(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, enum pm_state_e pmstate);
|
||||
static void led_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@ -107,7 +109,8 @@ static struct pm_callback_s g_ledscb =
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static void led_pm_notify(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
switch (pmstate)
|
||||
{
|
||||
@ -169,7 +172,8 @@ static void led_pm_notify(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
static int led_pm_prepare(struct pm_callback_s *cb , enum pm_state_e pmstate)
|
||||
static int led_pm_prepare(struct pm_callback_s *cb, int domain,
|
||||
enum pm_state_e pmstate)
|
||||
{
|
||||
/* No preparation to change power modes is required by the LEDs driver.
|
||||
* We always accept the state change by returning OK.
|
||||
|
Loading…
Reference in New Issue
Block a user