Skip to content
Snippets Groups Projects
Select Git revision
  • 06ae43f34bcc07a0b6be8bf78a1c895bcd12c839
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

read_write.c

Blame
  • main.c 8.35 KiB
    /*
     * kernel/power/main.c - PM subsystem core functionality.
     *
     * Copyright (c) 2003 Patrick Mochel
     * Copyright (c) 2003 Open Source Development Lab
     * 
     * This file is released under the GPLv2
     *
     */
    
    #include <linux/module.h>
    #include <linux/suspend.h>
    #include <linux/kobject.h>
    #include <linux/string.h>
    #include <linux/delay.h>
    #include <linux/errno.h>
    #include <linux/init.h>
    #include <linux/console.h>
    #include <linux/cpu.h>
    #include <linux/resume-trace.h>
    #include <linux/freezer.h>
    #include <linux/vmstat.h>
    #include <linux/syscalls.h>
    
    #include "power.h"
    
    BLOCKING_NOTIFIER_HEAD(pm_chain_head);
    
    DEFINE_MUTEX(pm_mutex);
    
    unsigned int pm_flags;
    EXPORT_SYMBOL(pm_flags);
    
    #ifdef CONFIG_SUSPEND
    
    /* This is just an arbitrary number */
    #define FREE_PAGE_NUMBER (100)
    
    static struct platform_suspend_ops *suspend_ops;
    
    /**
     *	suspend_set_ops - Set the global suspend method table.
     *	@ops:	Pointer to ops structure.
     */
    
    void suspend_set_ops(struct platform_suspend_ops *ops)
    {
    	mutex_lock(&pm_mutex);
    	suspend_ops = ops;
    	mutex_unlock(&pm_mutex);
    }
    
    /**
     * suspend_valid_only_mem - generic memory-only valid callback
     *
     * Platform drivers that implement mem suspend only and only need
     * to check for that in their .valid callback can use this instead
     * of rolling their own .valid callback.
     */
    int suspend_valid_only_mem(suspend_state_t state)
    {
    	return state == PM_SUSPEND_MEM;
    }
    
    /**
     *	suspend_prepare - Do prep work before entering low-power state.
     *
     *	This is common code that is called for each state that we're entering.
     *	Run suspend notifiers, allocate a console and stop all processes.
     */