xref: /OK3568_Linux_fs/kernel/include/linux/platform_data/gpio-davinci.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * DaVinci GPIO Platform Related Defines
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * Copyright (C) 2013 Texas Instruments Incorporated - https://www.ti.com/
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * This program is free software; you can redistribute it and/or
7*4882a593Smuzhiyun  * modify it under the terms of the GNU General Public License as
8*4882a593Smuzhiyun  * published by the Free Software Foundation version 2.
9*4882a593Smuzhiyun  *
10*4882a593Smuzhiyun  * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11*4882a593Smuzhiyun  * kind, whether express or implied; without even the implied warranty
12*4882a593Smuzhiyun  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13*4882a593Smuzhiyun  * GNU General Public License for more details.
14*4882a593Smuzhiyun  */
15*4882a593Smuzhiyun 
16*4882a593Smuzhiyun #ifndef __DAVINCI_GPIO_PLATFORM_H
17*4882a593Smuzhiyun #define __DAVINCI_GPIO_PLATFORM_H
18*4882a593Smuzhiyun 
19*4882a593Smuzhiyun struct davinci_gpio_platform_data {
20*4882a593Smuzhiyun 	bool	no_auto_base;
21*4882a593Smuzhiyun 	u32	base;
22*4882a593Smuzhiyun 	u32	ngpio;
23*4882a593Smuzhiyun 	u32	gpio_unbanked;
24*4882a593Smuzhiyun };
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun /* Convert GPIO signal to GPIO pin number */
27*4882a593Smuzhiyun #define GPIO_TO_PIN(bank, gpio)	(16 * (bank) + (gpio))
28*4882a593Smuzhiyun 
29*4882a593Smuzhiyun #endif
30