diff options
Diffstat (limited to 'include/linux/platform_data')
| -rw-r--r-- | include/linux/platform_data/gpio-davinci.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/linux/platform_data/gpio-davinci.h b/include/linux/platform_data/gpio-davinci.h index 2fcc125af1aa..6efd20264585 100644 --- a/include/linux/platform_data/gpio-davinci.h +++ b/include/linux/platform_data/gpio-davinci.h | |||
| @@ -16,10 +16,45 @@ | |||
| 16 | #ifndef __DAVINCI_GPIO_PLATFORM_H | 16 | #ifndef __DAVINCI_GPIO_PLATFORM_H |
| 17 | #define __DAVINCI_GPIO_PLATFORM_H | 17 | #define __DAVINCI_GPIO_PLATFORM_H |
| 18 | 18 | ||
| 19 | #include <linux/io.h> | ||
| 20 | #include <linux/spinlock.h> | ||
| 21 | |||
| 22 | #include <asm-generic/gpio.h> | ||
| 23 | |||
| 24 | enum davinci_gpio_type { | ||
| 25 | GPIO_TYPE_TNETV107X = 0, | ||
| 26 | }; | ||
| 27 | |||
| 19 | struct davinci_gpio_platform_data { | 28 | struct davinci_gpio_platform_data { |
| 20 | u32 ngpio; | 29 | u32 ngpio; |
| 21 | u32 gpio_unbanked; | 30 | u32 gpio_unbanked; |
| 22 | u32 intc_irq_num; | 31 | u32 intc_irq_num; |
| 23 | }; | 32 | }; |
| 24 | 33 | ||
| 34 | |||
| 35 | struct davinci_gpio_controller { | ||
| 36 | struct gpio_chip chip; | ||
| 37 | int irq_base; | ||
| 38 | /* Serialize access to GPIO registers */ | ||
| 39 | spinlock_t lock; | ||
| 40 | void __iomem *regs; | ||
| 41 | void __iomem *set_data; | ||
| 42 | void __iomem *clr_data; | ||
| 43 | void __iomem *in_data; | ||
| 44 | int gpio_unbanked; | ||
| 45 | unsigned gpio_irq; | ||
| 46 | }; | ||
| 47 | |||
| 48 | /* | ||
| 49 | * basic gpio routines | ||
| 50 | */ | ||
| 51 | #define GPIO(X) (X) /* 0 <= X <= (DAVINCI_N_GPIO - 1) */ | ||
| 52 | |||
| 53 | /* Convert GPIO signal to GPIO pin number */ | ||
| 54 | #define GPIO_TO_PIN(bank, gpio) (16 * (bank) + (gpio)) | ||
| 55 | |||
| 56 | static inline u32 __gpio_mask(unsigned gpio) | ||
| 57 | { | ||
| 58 | return 1 << (gpio % 32); | ||
| 59 | } | ||
| 25 | #endif | 60 | #endif |
