aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32
diff options
context:
space:
mode:
authorHaavard Skinnemoen <hskinnemoen@atmel.com>2007-08-16 05:12:47 -0400
committerHaavard Skinnemoen <hskinnemoen@atmel.com>2007-10-11 05:38:41 -0400
commit2417a130bd4013f804983c62cb116bc9ec7f8e2d (patch)
tree7b87c05ca3ff524990c2e5d98e69f02283728a51 /arch/avr32
parentbbf25010f1a6b761914430f5fca081ec8c7accd1 (diff)
[AVR32] Move AT32_PM_BASE definition into pm.h
We don't want to redefine this in every file that needs to access the PM. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Diffstat (limited to 'arch/avr32')
-rw-r--r--arch/avr32/mach-at32ap/at32ap7000.c6
-rw-r--r--arch/avr32/mach-at32ap/pm.h8
2 files changed, 8 insertions, 6 deletions
diff --git a/arch/avr32/mach-at32ap/at32ap7000.c b/arch/avr32/mach-at32ap/at32ap7000.c
index 64cc5583ddfb..373242aab976 100644
--- a/arch/avr32/mach-at32ap/at32ap7000.c
+++ b/arch/avr32/mach-at32ap/at32ap7000.c
@@ -25,12 +25,6 @@
25#include "pio.h" 25#include "pio.h"
26#include "pm.h" 26#include "pm.h"
27 27
28/*
29 * We can reduce the code size a bit by using a constant here. Since
30 * this file is completely chip-specific, it's safe to not use
31 * ioremap. Generic drivers should of course never do this.
32 */
33#define AT32_PM_BASE 0xfff00000
34 28
35#define PBMEM(base) \ 29#define PBMEM(base) \
36 { \ 30 { \
diff --git a/arch/avr32/mach-at32ap/pm.h b/arch/avr32/mach-at32ap/pm.h
index a1f8aced0a8c..47efd0d1951f 100644
--- a/arch/avr32/mach-at32ap/pm.h
+++ b/arch/avr32/mach-at32ap/pm.h
@@ -4,6 +4,14 @@
4#ifndef __ARCH_AVR32_MACH_AT32AP_PM_H__ 4#ifndef __ARCH_AVR32_MACH_AT32AP_PM_H__
5#define __ARCH_AVR32_MACH_AT32AP_PM_H__ 5#define __ARCH_AVR32_MACH_AT32AP_PM_H__
6 6
7/*
8 * We can reduce the code size a bit by using a constant here. Since
9 * this file is only used on AVR32 AP CPUs with segmentation enabled,
10 * it's safe to not use ioremap. Generic drivers should of course
11 * never do this.
12 */
13#define AT32_PM_BASE 0xfff00000
14
7/* PM register offsets */ 15/* PM register offsets */
8#define PM_MCCTRL 0x0000 16#define PM_MCCTRL 0x0000
9#define PM_CKSEL 0x0004 17#define PM_CKSEL 0x0004
span class="hl com"> * This may allow us to change the internal structure of the image * in the future with considerably less effort. */ struct snapshot_handle { unsigned int cur; /* number of the block of PAGE_SIZE bytes the * next operation will refer to (ie. current) */ void *buffer; /* address of the block to read from * or write to */ int sync_read; /* Set to one to notify the caller of * snapshot_write_next() that it may * need to call wait_on_bio_chain() */ }; /* This macro returns the address from/to which the caller of * snapshot_read_next()/snapshot_write_next() is allowed to * read/write data after the function returns */ #define data_of(handle) ((handle).buffer) extern unsigned int snapshot_additional_pages(struct zone *zone); extern unsigned long snapshot_get_image_size(void); extern int snapshot_read_next(struct snapshot_handle *handle); extern int snapshot_write_next(struct snapshot_handle *handle); extern void snapshot_write_finalize(struct snapshot_handle *handle); extern int snapshot_image_loaded(struct snapshot_handle *handle); /* If unset, the snapshot device cannot be open. */ extern atomic_t snapshot_device_available; extern sector_t alloc_swapdev_block(int swap); extern void free_all_swap_pages(int swap); extern int swsusp_swap_in_use(void); /* * Flags that can be passed from the hibernatig hernel to the "boot" kernel in * the image header. */ #define SF_PLATFORM_MODE 1 #define SF_NOCOMPRESS_MODE 2 #define SF_CRC32_MODE 4 /* kernel/power/hibernate.c */ extern int swsusp_check(void); extern void swsusp_free(void); extern int swsusp_read(unsigned int *flags_p); extern int swsusp_write(unsigned int flags); extern void swsusp_close(fmode_t); #ifdef CONFIG_SUSPEND extern int swsusp_unmark(void); #endif /* kernel/power/block_io.c */ extern struct block_device *hib_resume_bdev; extern int hib_bio_read_page(pgoff_t page_off, void *addr, struct bio **bio_chain); extern int hib_bio_write_page(pgoff_t page_off, void *addr, struct bio **bio_chain); extern int hib_wait_on_bio_chain(struct bio **bio_chain); struct timeval; /* kernel/power/swsusp.c */ extern void swsusp_show_speed(struct timeval *, struct timeval *, unsigned int, char *); #ifdef CONFIG_SUSPEND /* kernel/power/suspend.c */ extern const char *const pm_states[]; extern bool valid_state(suspend_state_t state); extern int suspend_devices_and_enter(suspend_state_t state); #else /* !CONFIG_SUSPEND */ static inline int suspend_devices_and_enter(suspend_state_t state) { return -ENOSYS; } static inline bool valid_state(suspend_state_t state) { return false; } #endif /* !CONFIG_SUSPEND */ #ifdef CONFIG_PM_TEST_SUSPEND /* kernel/power/suspend_test.c */ extern void suspend_test_start(void); extern void suspend_test_finish(const char *label); #else /* !CONFIG_PM_TEST_SUSPEND */ static inline void suspend_test_start(void) {} static inline void suspend_test_finish(const char *label) {} #endif /* !CONFIG_PM_TEST_SUSPEND */ #ifdef CONFIG_PM_SLEEP /* kernel/power/main.c */ extern int pm_notifier_call_chain(unsigned long val); #endif #ifdef CONFIG_HIGHMEM int restore_highmem(void); #else static inline unsigned int count_highmem_pages(void) { return 0; } static inline int restore_highmem(void) { return 0; } #endif /* * Suspend test levels */ enum { /* keep first */ TEST_NONE, TEST_CORE, TEST_CPUS, TEST_PLATFORM, TEST_DEVICES, TEST_FREEZER, /* keep last */ __TEST_AFTER_LAST }; #define TEST_FIRST TEST_NONE #define TEST_MAX (__TEST_AFTER_LAST - 1) extern int pm_test_level; #ifdef CONFIG_SUSPEND_FREEZER static inline int suspend_freeze_processes(void) { int error; error = freeze_processes(); /* * freeze_processes() automatically thaws every task if freezing * fails. So we need not do anything extra upon error. */ if (error) return error; error = freeze_kernel_threads(); /* * freeze_kernel_threads() thaws only kernel threads upon freezing * failure. So we have to thaw the userspace tasks ourselves. */ if (error) thaw_processes(); return error; } static inline void suspend_thaw_processes(void) { thaw_processes(); } #else static inline int suspend_freeze_processes(void) { return 0; } static inline void suspend_thaw_processes(void) { } #endif #ifdef CONFIG_PM_AUTOSLEEP /* kernel/power/autosleep.c */ extern int pm_autosleep_init(void); extern int pm_autosleep_lock(void); extern void pm_autosleep_unlock(void); extern suspend_state_t pm_autosleep_state(void); extern int pm_autosleep_set_state(suspend_state_t state); #else /* !CONFIG_PM_AUTOSLEEP */ static inline int pm_autosleep_init(void) { return 0; } static inline int pm_autosleep_lock(void) { return 0; } static inline void pm_autosleep_unlock(void) {} static inline suspend_state_t pm_autosleep_state(void) { return PM_SUSPEND_ON; } #endif /* !CONFIG_PM_AUTOSLEEP */ #ifdef CONFIG_PM_WAKELOCKS /* kernel/power/wakelock.c */ extern ssize_t pm_show_wakelocks(char *buf, bool show_active); extern int pm_wake_lock(const char *buf); extern int pm_wake_unlock(const char *buf); #endif /* !CONFIG_PM_WAKELOCKS */