Merge mulgrave-w:git/scsi-misc-2.6
[pandora-kernel.git] / include / asm-arm / arch-s3c2410 / hardware.h
1 /* linux/include/asm-arm/arch-s3c2410/hardware.h
2  *
3  * (c) 2003 Simtec Electronics
4  *  Ben Dooks <ben@simtec.co.uk>
5  *
6  * S3C2410 - hardware
7  *
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.
11 */
12
13 #ifndef __ASM_ARCH_HARDWARE_H
14 #define __ASM_ARCH_HARDWARE_H
15
16 #ifndef __ASSEMBLY__
17
18 /* external functions for GPIO support
19  *
20  * These allow various different clients to access the same GPIO
21  * registers without conflicting. If your driver only owns the entire
22  * GPIO register, then it is safe to ioremap/__raw_{read|write} to it.
23 */
24
25 /* s3c2410_gpio_cfgpin
26  *
27  * set the configuration of the given pin to the value passed.
28  *
29  * eg:
30  *    s3c2410_gpio_cfgpin(S3C2410_GPA0, S3C2410_GPA0_ADDR0);
31  *    s3c2410_gpio_cfgpin(S3C2410_GPE8, S3C2410_GPE8_SDDAT1);
32 */
33
34 extern void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function);
35
36 extern unsigned int s3c2410_gpio_getcfg(unsigned int pin);
37
38 /* s3c2410_gpio_getirq
39  *
40  * turn the given pin number into the corresponding IRQ number
41  *
42  * returns:
43  *      < 0 = no interrupt for this pin
44  *      >=0 = interrupt number for the pin
45 */
46
47 extern int s3c2410_gpio_getirq(unsigned int pin);
48
49 #ifdef CONFIG_CPU_S3C2400
50
51 extern int s3c2400_gpio_getirq(unsigned int pin);
52
53 #endif /* CONFIG_CPU_S3C2400 */
54
55 /* s3c2410_gpio_irqfilter
56  *
57  * set the irq filtering on the given pin
58  *
59  * on = 0 => disable filtering
60  *      1 => enable filtering
61  *
62  * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with
63  *          width of filter (0 through 63)
64  *
65  *
66 */
67
68 extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
69                                   unsigned int config);
70
71 /* s3c2410_gpio_pullup
72  *
73  * configure the pull-up control on the given pin
74  *
75  * to = 1 => disable the pull-up
76  *      0 => enable the pull-up
77  *
78  * eg;
79  *
80  *   s3c2410_gpio_pullup(S3C2410_GPB0, 0);
81  *   s3c2410_gpio_pullup(S3C2410_GPE8, 0);
82 */
83
84 extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to);
85
86 extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to);
87
88 extern unsigned int s3c2410_gpio_getpin(unsigned int pin);
89
90 extern unsigned int s3c2410_modify_misccr(unsigned int clr, unsigned int chg);
91
92 #ifdef CONFIG_CPU_S3C2440
93
94 extern int s3c2440_set_dsc(unsigned int pin, unsigned int value);
95
96 #endif /* CONFIG_CPU_S3C2440 */
97
98
99 #endif /* __ASSEMBLY__ */
100
101 #include <asm/sizes.h>
102 #include <asm/arch/map.h>
103
104 /* machine specific hardware definitions should go after this */
105
106 /* currently here until moved into config (todo) */
107 #define CONFIG_NO_MULTIWORD_IO
108
109 #endif /* __ASM_ARCH_HARDWARE_H */