Linux-2.6.12-rc2
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / include / asm-arm / arch-s3c2410 / hardware.h
blob48a39918a76094a579cf8e7465e997715ddbaafe
1 /* linux/include/asm-arm/arch-s3c2410/hardware.h
3 * (c) 2003 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
6 * S3C2410 - hardware
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
12 * Changelog:
13 * 21-May-2003 BJD Created file
14 * 06-Jun-2003 BJD Added CPU frequency settings
15 * 03-Sep-2003 BJD Linux v2.6 support
16 * 12-Mar-2004 BJD Fixed include protection, fixed type of clock vars
17 * 14-Sep-2004 BJD Added misccr and getpin to gpio
18 * 01-Oct-2004 BJD Added the new gpio functions
19 * 16-Oct-2004 BJD Removed the clock variables
22 #ifndef __ASM_ARCH_HARDWARE_H
23 #define __ASM_ARCH_HARDWARE_H
25 #ifndef __ASSEMBLY__
27 /* external functions for GPIO support
29 * These allow various different clients to access the same GPIO
30 * registers without conflicting. If your driver only owns the entire
31 * GPIO register, then it is safe to ioremap/__raw_{read|write} to it.
34 /* s3c2410_gpio_cfgpin
36 * set the configuration of the given pin to the value passed.
38 * eg:
39 * s3c2410_gpio_cfgpin(S3C2410_GPA0, S3C2410_GPA0_ADDR0);
40 * s3c2410_gpio_cfgpin(S3C2410_GPE8, S3C2410_GPE8_SDDAT1);
43 extern void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function);
45 extern unsigned int s3c2410_gpio_getcfg(unsigned int pin);
47 /* s3c2410_gpio_getirq
49 * turn the given pin number into the corresponding IRQ number
51 * returns:
52 * < 0 = no interrupt for this pin
53 * >=0 = interrupt number for the pin
56 extern int s3c2410_gpio_getirq(unsigned int pin);
58 /* s3c2410_gpio_irqfilter
60 * set the irq filtering on the given pin
62 * on = 0 => disable filtering
63 * 1 => enable filtering
65 * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with
66 * width of filter (0 through 63)
71 extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
72 unsigned int config);
74 /* s3c2410_gpio_pullup
76 * configure the pull-up control on the given pin
78 * to = 1 => disable the pull-up
79 * 0 => enable the pull-up
81 * eg;
83 * s3c2410_gpio_pullup(S3C2410_GPB0, 0);
84 * s3c2410_gpio_pullup(S3C2410_GPE8, 0);
87 extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to);
89 extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to);
91 extern unsigned int s3c2410_gpio_getpin(unsigned int pin);
93 extern unsigned int s3c2410_modify_misccr(unsigned int clr, unsigned int chg);
95 #endif /* __ASSEMBLY__ */
97 #include <asm/sizes.h>
98 #include <asm/arch/map.h>
100 /* machine specific hardware definitions should go after this */
102 /* currently here until moved into config (todo) */
103 #define CONFIG_NO_MULTIWORD_IO
105 #endif /* __ASM_ARCH_HARDWARE_H */