Michael Buesch | 7444a72 | 2008-07-25 01:46:11 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Generic GPIO API implementation for x86. |
| 3 | * |
| 4 | * Derived from the generic GPIO API for powerpc: |
| 5 | * |
| 6 | * Copyright (c) 2007-2008 MontaVista Software, Inc. |
| 7 | * |
| 8 | * Author: Anton Vorontsov <avorontsov@ru.mvista.com> |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by |
| 12 | * the Free Software Foundation; either version 2 of the License, or |
| 13 | * (at your option) any later version. |
| 14 | */ |
| 15 | |
Florian Fainelli | a608295 | 2008-01-30 13:33:35 +0100 | [diff] [blame] | 16 | #ifndef _ASM_I386_GPIO_H |
| 17 | #define _ASM_I386_GPIO_H |
| 18 | |
Michael Buesch | 7444a72 | 2008-07-25 01:46:11 -0700 | [diff] [blame] | 19 | #ifdef CONFIG_X86_RDC321X |
Florian Fainelli | a608295 | 2008-01-30 13:33:35 +0100 | [diff] [blame] | 20 | #include <gpio.h> |
Michael Buesch | 7444a72 | 2008-07-25 01:46:11 -0700 | [diff] [blame] | 21 | #else /* CONFIG_X86_RDC321X */ |
| 22 | |
| 23 | #include <asm-generic/gpio.h> |
| 24 | |
| 25 | #ifdef CONFIG_GPIOLIB |
| 26 | |
| 27 | /* |
| 28 | * Just call gpiolib. |
| 29 | */ |
| 30 | static inline int gpio_get_value(unsigned int gpio) |
| 31 | { |
| 32 | return __gpio_get_value(gpio); |
| 33 | } |
| 34 | |
| 35 | static inline void gpio_set_value(unsigned int gpio, int value) |
| 36 | { |
| 37 | __gpio_set_value(gpio, value); |
| 38 | } |
| 39 | |
| 40 | static inline int gpio_cansleep(unsigned int gpio) |
| 41 | { |
| 42 | return __gpio_cansleep(gpio); |
| 43 | } |
| 44 | |
| 45 | /* |
| 46 | * Not implemented, yet. |
| 47 | */ |
| 48 | static inline int gpio_to_irq(unsigned int gpio) |
| 49 | { |
| 50 | return -ENOSYS; |
| 51 | } |
| 52 | |
| 53 | static inline int irq_to_gpio(unsigned int irq) |
| 54 | { |
| 55 | return -EINVAL; |
| 56 | } |
| 57 | |
| 58 | #endif /* CONFIG_GPIOLIB */ |
| 59 | |
| 60 | #endif /* CONFIG_X86_RDC321X */ |
Florian Fainelli | a608295 | 2008-01-30 13:33:35 +0100 | [diff] [blame] | 61 | |
| 62 | #endif /* _ASM_I386_GPIO_H */ |