aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-s3c/include
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2008-10-31 12:14:31 -0400
committerBen Dooks <ben-linux@fluff.org>2008-12-15 18:33:20 -0500
commit7db6c82a37beabef7b76d232e3d20efacd74bd3a (patch)
treedcd673614883eba53a207aca9f136c6e7b490c4e /arch/arm/plat-s3c/include
parentefd3a8eb150e383305c36eedc78c29cab910158e (diff)
[ARM] S3C: Move common GPIO code from plat-s3c24xx
Move the common parts of the GPIO code into plat-s3c for use with both the s3c24xx and s3c64xx systems. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s3c/include')
-rw-r--r--arch/arm/plat-s3c/include/plat/gpio-core.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c/include/plat/gpio-core.h b/arch/arm/plat-s3c/include/plat/gpio-core.h
new file mode 100644
index 000000000000..3cb9105c4811
--- /dev/null
+++ b/arch/arm/plat-s3c/include/plat/gpio-core.h
@@ -0,0 +1,49 @@
1/* linux/arch/arm/plat-s3c/include/plat/gpio-core.h
2 *
3 * Copyright 2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C Platform - GPIO core
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14/* Define the core gpiolib support functions that the s3c platforms may
15 * need to extend or change depending on the hardware and the s3c chip
16 * selected at build or found at run time.
17 *
18 * These definitions are not intended for driver inclusion, there is
19 * nothing here that should not live outside the platform and core
20 * specific code.
21*/
22
23/**
24 * struct s3c_gpio_chip - wrapper for specific implementation of gpio
25 * @chip: The chip structure to be exported via gpiolib.
26 * @base: The base pointer to the gpio configuration registers.
27 *
28 * This wrapper provides the necessary information for the Samsung
29 * specific gpios being registered with gpiolib.
30 */
31struct s3c_gpio_chip {
32 struct gpio_chip chip;
33 void __iomem *base;
34};
35
36static inline struct s3c_gpio_chip *to_s3c_gpio(struct gpio_chip *gpc)
37{
38 return container_of(gpc, struct s3c_gpio_chip, chip);
39}
40
41/** s3c_gpiolib_add() - add the s3c specific version of a gpio_chip.
42 * @chip: The chip to register
43 *
44 * This is a wrapper to gpiochip_add() that takes our specific gpio chip
45 * information and makes the necessary alterations for the platform and
46 * notes the information for use with the configuration systems and any
47 * other parts of the system.
48 */
49extern void s3c_gpiolib_add(struct s3c_gpio_chip *chip);