[ARM] 3284/1: S3C2400 - adds support to GPIO
[firewire-audio.git] / include / asm-arm / arch-s3c2410 / hardware.h
bloba2330bf83695a8da6fac9febfbf6458bb45acb0e
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
20 * 15-Jan-2006 LCVR Added s3c2400_gpio_getirq()
23 #ifndef __ASM_ARCH_HARDWARE_H
24 #define __ASM_ARCH_HARDWARE_H
26 #ifndef __ASSEMBLY__
28 /* external functions for GPIO support
30 * These allow various different clients to access the same GPIO
31 * registers without conflicting. If your driver only owns the entire
32 * GPIO register, then it is safe to ioremap/__raw_{read|write} to it.
35 /* s3c2410_gpio_cfgpin
37 * set the configuration of the given pin to the value passed.
39 * eg:
40 * s3c2410_gpio_cfgpin(S3C2410_GPA0, S3C2410_GPA0_ADDR0);
41 * s3c2410_gpio_cfgpin(S3C2410_GPE8, S3C2410_GPE8_SDDAT1);
44 extern void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function);
46 extern unsigned int s3c2410_gpio_getcfg(unsigned int pin);
48 /* s3c2410_gpio_getirq
50 * turn the given pin number into the corresponding IRQ number
52 * returns:
53 * < 0 = no interrupt for this pin
54 * >=0 = interrupt number for the pin
57 extern int s3c2410_gpio_getirq(unsigned int pin);
59 #ifdef CONFIG_CPU_S3C2400
61 extern int s3c2400_gpio_getirq(unsigned int pin);
63 #endif /* CONFIG_CPU_S3C2400 */
65 /* s3c2410_gpio_irqfilter
67 * set the irq filtering on the given pin
69 * on = 0 => disable filtering
70 * 1 => enable filtering
72 * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with
73 * width of filter (0 through 63)
78 extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
79 unsigned int config);
81 /* s3c2410_gpio_pullup
83 * configure the pull-up control on the given pin
85 * to = 1 => disable the pull-up
86 * 0 => enable the pull-up
88 * eg;
90 * s3c2410_gpio_pullup(S3C2410_GPB0, 0);
91 * s3c2410_gpio_pullup(S3C2410_GPE8, 0);
94 extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to);
96 extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to);
98 extern unsigned int s3c2410_gpio_getpin(unsigned int pin);
100 extern unsigned int s3c2410_modify_misccr(unsigned int clr, unsigned int chg);
102 #ifdef CONFIG_CPU_S3C2440
104 extern int s3c2440_set_dsc(unsigned int pin, unsigned int value);
106 #endif /* CONFIG_CPU_S3C2440 */
109 #endif /* __ASSEMBLY__ */
111 #include <asm/sizes.h>
112 #include <asm/arch/map.h>
114 /* machine specific hardware definitions should go after this */
116 /* currently here until moved into config (todo) */
117 #define CONFIG_NO_MULTIWORD_IO
119 #endif /* __ASM_ARCH_HARDWARE_H */