blob: 20509e4540f6c277861c683505579675d202d263 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* linux/include/asm-arm/arch-s3c2410/hardware.h
2 *
Ben Dooksf0560762006-12-17 19:59:20 +01003 * Copyright (c) 2003 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 *
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.
Linus Torvalds1da177e2005-04-16 15:20:36 -070011*/
12
13#ifndef __ASM_ARCH_HARDWARE_H
14#define __ASM_ARCH_HARDWARE_H
15
Arnaud Patard431d2cd2006-12-27 22:56:44 +010016#ifndef __ASM_HARDWARE_H
17#error "Do not include this directly, instead #include <asm/hardware.h>"
18#endif
19
Linus Torvalds1da177e2005-04-16 15:20:36 -070020#ifndef __ASSEMBLY__
21
22/* external functions for GPIO support
23 *
24 * These allow various different clients to access the same GPIO
25 * registers without conflicting. If your driver only owns the entire
26 * GPIO register, then it is safe to ioremap/__raw_{read|write} to it.
27*/
28
29/* s3c2410_gpio_cfgpin
30 *
31 * set the configuration of the given pin to the value passed.
32 *
33 * eg:
34 * s3c2410_gpio_cfgpin(S3C2410_GPA0, S3C2410_GPA0_ADDR0);
35 * s3c2410_gpio_cfgpin(S3C2410_GPE8, S3C2410_GPE8_SDDAT1);
36*/
37
38extern void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function);
39
40extern unsigned int s3c2410_gpio_getcfg(unsigned int pin);
41
42/* s3c2410_gpio_getirq
43 *
44 * turn the given pin number into the corresponding IRQ number
45 *
46 * returns:
47 * < 0 = no interrupt for this pin
48 * >=0 = interrupt number for the pin
49*/
50
51extern int s3c2410_gpio_getirq(unsigned int pin);
52
Lucas Correia Villa Real0ca5bc32006-02-01 21:24:23 +000053#ifdef CONFIG_CPU_S3C2400
54
55extern int s3c2400_gpio_getirq(unsigned int pin);
56
57#endif /* CONFIG_CPU_S3C2400 */
58
Linus Torvalds1da177e2005-04-16 15:20:36 -070059/* s3c2410_gpio_irqfilter
60 *
61 * set the irq filtering on the given pin
62 *
63 * on = 0 => disable filtering
64 * 1 => enable filtering
65 *
66 * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with
67 * width of filter (0 through 63)
68 *
69 *
70*/
71
72extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on,
73 unsigned int config);
74
75/* s3c2410_gpio_pullup
76 *
77 * configure the pull-up control on the given pin
78 *
79 * to = 1 => disable the pull-up
80 * 0 => enable the pull-up
81 *
82 * eg;
83 *
84 * s3c2410_gpio_pullup(S3C2410_GPB0, 0);
85 * s3c2410_gpio_pullup(S3C2410_GPE8, 0);
86*/
87
88extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to);
89
Ben Dooksbb6d9b52008-01-28 13:01:23 +010090/* s3c2410_gpio_getpull
91 *
92 * Read the state of the pull-up on a given pin
93 *
94 * return:
95 * < 0 => error code
96 * 0 => enabled
97 * 1 => disabled
98*/
99
100extern int s3c2410_gpio_getpull(unsigned int pin);
101
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to);
103
104extern unsigned int s3c2410_gpio_getpin(unsigned int pin);
105
106extern unsigned int s3c2410_modify_misccr(unsigned int clr, unsigned int chg);
107
Ben Dooks9153bd72005-10-13 16:46:35 +0100108#ifdef CONFIG_CPU_S3C2440
109
110extern int s3c2440_set_dsc(unsigned int pin, unsigned int value);
111
112#endif /* CONFIG_CPU_S3C2440 */
113
Ben Dooks67d729a2008-01-28 13:01:19 +0100114#ifdef CONFIG_CPU_S3C2412
115
116extern int s3c2412_gpio_set_sleepcfg(unsigned int pin, unsigned int state);
117
118#endif /* CONFIG_CPU_S3C2412 */
Ben Dooks9153bd72005-10-13 16:46:35 +0100119
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120#endif /* __ASSEMBLY__ */
121
122#include <asm/sizes.h>
123#include <asm/arch/map.h>
124
125/* machine specific hardware definitions should go after this */
126
127/* currently here until moved into config (todo) */
128#define CONFIG_NO_MULTIWORD_IO
129
130#endif /* __ASM_ARCH_HARDWARE_H */