Skip to content

Commit

Permalink
Restore the PM functionality
Browse files Browse the repository at this point in the history
The recent code has moved the system PM ops conditionally with
CONFIG_PM_SLEEP.  Also the more PM ops have been added in the upstream
and we need to follow that, too.

Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Apr 7, 2021
1 parent 5bc8773 commit 38272fc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/codec_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define CONFIG_SND_JACK

#define CONFIG_PM
#define CONFIG_PM_SLEEP
#define CONFIG_SND_HDA_POWER_SAVE_DEFAULT 0

#define CONFIG_SND_DEBUG
Expand Down
6 changes: 6 additions & 0 deletions include/linux/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,14 @@ struct dev_pm_info {

/* stripped version */
struct dev_pm_ops {
int (*prepare)(struct device *dev);
void (*complete)(struct device *dev);
int (*suspend)(struct device *dev);
int (*resume)(struct device *dev);
int (*freeze)(struct device *dev);
int (*thaw)(struct device *dev);
int (*poweroff)(struct device *dev);
int (*restore)(struct device *dev);
int (*runtime_suspend)(struct device *dev);
int (*runtime_resume)(struct device *dev);
int (*runtime_idle)(struct device *dev);
Expand Down
1 change: 1 addition & 0 deletions include/linux/pm_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ static inline void pm_runtime_get_noresume(struct device *dev) { dev->pmcnt++; }
static inline void pm_runtime_put_noidle(struct device *dev) { dev->pmcnt--; }

static inline int pm_runtime_set_suspended(struct device *dev) { return 0; } // XXX
static inline int pm_request_resume(struct device *dev) { return 0; } // XXX

int pm_runtime_get_sync(struct device *dev);
int pm_runtime_get_if_in_use(struct device *dev);
Expand Down

0 comments on commit 38272fc

Please sign in to comment.