2 * Copyright (C) 2005-2006 Atmel Corporation
4 * See file CREDITS for list of people who contributed to this
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22 #ifndef _ASM_AVR32_ARCH_PM_H
23 #define _ASM_AVR32_ARCH_PM_H
27 enum clock_domain_id {
51 /* GPIO controllers must be kept together */
63 #if defined(CFG_MACB0)
66 #if defined(CFG_MACB1)
72 #if defined(CFG_USART0)
75 #if defined(CFG_USART1)
78 #if defined(CFG_USART2)
81 #if defined(CFG_USART3)
95 enum resource_type type;
101 unsigned char nr_pins;
102 enum device_id gpio_dev;
104 unsigned short start;
107 enum clock_domain_id id;
115 unsigned int nr_resources;
116 const struct resource *resource;
119 struct clock_domain {
121 enum clock_domain_id id;
122 enum device_id bridge;
125 extern const struct device chip_device[NR_DEVICES];
126 extern const struct clock_domain chip_clock[NR_CLOCK_DOMAINS];
129 * Set up PIO, clock management and I/O memory for a device.
131 const struct device *get_device(enum device_id devid);
132 void put_device(const struct device *dev);
134 int gpio_set_func(enum device_id gpio_devid, unsigned int start,
135 unsigned int nr_pins, enum gpio_func func);
136 void gpio_free(enum device_id gpio_devid, unsigned int start,
137 unsigned int nr_pins);
140 int pm_enable_clock(enum clock_domain_id id, unsigned int index);
141 void pm_disable_clock(enum clock_domain_id id, unsigned int index);
142 unsigned long pm_get_clock_freq(enum clock_domain_id domain);
144 void cpu_enable_sdram(void);
146 #endif /* _ASM_AVR32_ARCH_PM_H */