Path: blob/master/arch/arm/mach-ixp4xx/include/mach/gpio.h
17745 views
/*1* arch/arm/mach-ixp4xx/include/mach/gpio.h2*3* IXP4XX GPIO wrappers for arch-neutral GPIO calls4*5* Written by Milan Svoboda <[email protected]>6* Based on PXA implementation by Philipp Zabel <[email protected]>7*8* This program is free software; you can redistribute it and/or modify9* it under the terms of the GNU General Public License as published by10* the Free Software Foundation; either version 2 of the License, or11* (at your option) any later version.12*13* This program is distributed in the hope that it will be useful,14* but WITHOUT ANY WARRANTY; without even the implied warranty of15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16* GNU General Public License for more details.17*18* You should have received a copy of the GNU General Public License19* along with this program; if not, write to the Free Software20* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA21*22*/2324#ifndef __ASM_ARCH_IXP4XX_GPIO_H25#define __ASM_ARCH_IXP4XX_GPIO_H2627#include <linux/kernel.h>28#include <mach/hardware.h>2930static inline int gpio_request(unsigned gpio, const char *label)31{32return 0;33}3435static inline void gpio_free(unsigned gpio)36{37might_sleep();3839return;40}4142static inline int gpio_direction_input(unsigned gpio)43{44gpio_line_config(gpio, IXP4XX_GPIO_IN);45return 0;46}4748static inline int gpio_direction_output(unsigned gpio, int level)49{50gpio_line_set(gpio, level);51gpio_line_config(gpio, IXP4XX_GPIO_OUT);52return 0;53}5455static inline int gpio_get_value(unsigned gpio)56{57int value;5859gpio_line_get(gpio, &value);6061return value;62}6364static inline void gpio_set_value(unsigned gpio, int value)65{66gpio_line_set(gpio, value);67}6869#include <asm-generic/gpio.h> /* cansleep wrappers */7071extern int gpio_to_irq(int gpio);72extern int irq_to_gpio(unsigned int irq);7374#endif75767778