2 * linux/arch/arm/mach-sprd/gpio.h
4 * Generic SPRD GPIO handling
6 * Author: Yingchun Li(yingchun.li@spreadtrum.com)
7 * Created: March 10, 2010
8 * Copyright: Spreadtrum Inc.
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.
14 #ifndef __ARCH_ARM_MACH_GPIO_H_
15 #define __ARCH_ARM_MACH_GPIO_H_
17 //#include <linux/init.h>
20 # define WARN(num, fmt...) printf(fmt)
24 # define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
27 #define GPIO_MAX_PIN_NUM 205
29 #define ARCH_NR_GPIOS GPIO_MAX_PIN_NUM
31 #define CHG_GPIO_NUM 162
33 #define POWER_BUTTON_GPIO_NUM 163
34 //#define gpio_get_value __gpio_get_value
35 //#define gpio_set_value __gpio_set_value
36 //#define gpio_to_irq __gpio_to_irq
38 //extern __must_check int sprd_alloc_gpio_irq(unsigned gpio);
39 extern int sprd_alloc_gpio_irq(unsigned gpio);
40 extern int irq_to_gpio(unsigned long irq);
41 extern void sprd_free_gpio_irq(int irq);
42 extern int board_gpio_init(void);
43 #include <asm/arch/asm_generic_gpio.h>
44 #include <asm/arch/gpio_phy.h>
46 //extern void __init sprd_gpio_init(void);