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)
21 #define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
22 #define GPIO_MAX_PIN_NUM 176
24 #define ARCH_NR_GPIOS GPIO_MAX_PIN_NUM
26 //#define gpio_get_value __gpio_get_value
27 //#define gpio_set_value __gpio_set_value
28 //#define gpio_to_irq __gpio_to_irq
30 //extern __must_check int sprd_alloc_gpio_irq(unsigned gpio);
31 extern int sprd_alloc_gpio_irq(unsigned gpio);
32 extern int irq_to_gpio(unsigned long irq);
33 extern void sprd_free_gpio_irq(int irq);
34 #include <asm/arch/asm_generic_gpio.h>
35 #include <asm/arch/gpio_phy.h>
37 //extern void __init sprd_gpio_init(void);