added 2.6.29.6 aldebaran kernel
[nao-ulib.git] / kernel / 2.6.29.6-aldebaran-rt / arch / arm / mach-s3c2410 / include / mach / gpio-core.h
blob6c9fbb99ef14428d9d4e7231fdacdbdbf9ae7f65
1 /* arch/arm/mach-s3c24100/include/mach/gpio-core.h
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
8 * S3C2410 - GPIO core support
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
15 #ifndef __ASM_ARCH_GPIO_CORE_H
16 #define __ASM_ARCH_GPIO_CORE_H __FILE__
18 #include <plat/gpio-core.h>
19 #include <mach/regs-gpio.h>
21 extern struct s3c_gpio_chip s3c24xx_gpios[];
23 static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int pin)
25 struct s3c_gpio_chip *chip;
27 if (pin > S3C2410_GPG10)
28 return NULL;
30 chip = &s3c24xx_gpios[pin/32];
31 return (S3C2410_GPIO_OFFSET(pin) > chip->chip.ngpio) ? chip : NULL;
34 #endif /* __ASM_ARCH_GPIO_CORE_H */