1 /* arch/arm/mach-s3c2410/include/mach/gpio-fns.h
3 * Copyright (c) 2003,2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
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.
13 /* These functions are in the to-be-removed category and it is strongly
14 * encouraged not to use these in new code. They will be marked deprecated
17 * Most of the functionality can be either replaced by the gpiocfg calls
18 * for the s3c platform or by the generic GPIOlib API.
21 /* external functions for GPIO support
23 * These allow various different clients to access the same GPIO
24 * registers without conflicting. If your driver only owns the entire
25 * GPIO register, then it is safe to ioremap/__raw_{read|write} to it.
28 /* s3c2410_gpio_cfgpin
30 * set the configuration of the given pin to the value passed.
33 * s3c2410_gpio_cfgpin(S3C2410_GPA(0), S3C2410_GPA0_ADDR0);
34 * s3c2410_gpio_cfgpin(S3C2410_GPE(8), S3C2410_GPE8_SDDAT1);
37 extern void s3c2410_gpio_cfgpin(unsigned int pin
, unsigned int function
);
39 extern unsigned int s3c2410_gpio_getcfg(unsigned int pin
);
41 /* s3c2410_gpio_getirq
43 * turn the given pin number into the corresponding IRQ number
46 * < 0 = no interrupt for this pin
47 * >=0 = interrupt number for the pin
50 extern int s3c2410_gpio_getirq(unsigned int pin
);
52 #ifdef CONFIG_CPU_S3C2400
54 extern int s3c2400_gpio_getirq(unsigned int pin
);
56 #endif /* CONFIG_CPU_S3C2400 */
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
,
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
83 * s3c2410_gpio_pullup(S3C2410_GPB(0), 0);
84 * s3c2410_gpio_pullup(S3C2410_GPE(8), 0);
87 extern void s3c2410_gpio_pullup(unsigned int pin
, unsigned int to
);
89 /* s3c2410_gpio_getpull
91 * Read the state of the pull-up on a given pin
99 extern int s3c2410_gpio_getpull(unsigned int pin
);
101 extern void s3c2410_gpio_setpin(unsigned int pin
, unsigned int to
);
103 extern unsigned int s3c2410_gpio_getpin(unsigned int pin
);