sched/wake_q: Clarify queue reinit comment
[cris-mirror.git] / include / linux / platform_data / gpio-davinci.h
blob6ace3fd32b6afc4322efd59a053dc592cb2d1bb8
1 /*
2 * DaVinci GPIO Platform Related Defines
4 * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #ifndef __DAVINCI_GPIO_PLATFORM_H
17 #define __DAVINCI_GPIO_PLATFORM_H
19 #include <linux/io.h>
20 #include <linux/spinlock.h>
22 #include <asm-generic/gpio.h>
24 struct davinci_gpio_platform_data {
25 u32 ngpio;
26 u32 gpio_unbanked;
30 struct davinci_gpio_controller {
31 struct gpio_chip chip;
32 struct irq_domain *irq_domain;
33 /* Serialize access to GPIO registers */
34 spinlock_t lock;
35 void __iomem *regs;
36 void __iomem *set_data;
37 void __iomem *clr_data;
38 void __iomem *in_data;
39 int gpio_unbanked;
40 unsigned gpio_irq;
44 * basic gpio routines
46 #define GPIO(X) (X) /* 0 <= X <= (DAVINCI_N_GPIO - 1) */
48 /* Convert GPIO signal to GPIO pin number */
49 #define GPIO_TO_PIN(bank, gpio) (16 * (bank) + (gpio))
51 static inline u32 __gpio_mask(unsigned gpio)
53 return 1 << (gpio % 32);
55 #endif