summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2011-02-09 20:54:53 +0100
committerWolfgang Denk <wd@denx.de>2011-02-09 20:54:53 +0100
commit65b57ebb3031a60dddd451097dc5c435fb051b6f (patch)
tree5454164b2ec4bb59131b615360b31bf6c262588a /arch
parentfced09ae386d1aa7fcfdf9111c99da4be56e5b43 (diff)
parentd8a593c68bac7b9d9b26af6fa8c392671213ce93 (diff)
downloadu-boot-imx-65b57ebb3031a60dddd451097dc5c435fb051b6f.zip
u-boot-imx-65b57ebb3031a60dddd451097dc5c435fb051b6f.tar.gz
u-boot-imx-65b57ebb3031a60dddd451097dc5c435fb051b6f.tar.bz2
Merge branch 'next' of git://git.denx.de/u-boot-nios
Diffstat (limited to 'arch')
-rw-r--r--arch/nios2/include/asm/gpio.h12
-rw-r--r--arch/nios2/include/asm/posix_types.h2
2 files changed, 13 insertions, 1 deletions
diff --git a/arch/nios2/include/asm/gpio.h b/arch/nios2/include/asm/gpio.h
index cff1dd9..4b21c8f 100644
--- a/arch/nios2/include/asm/gpio.h
+++ b/arch/nios2/include/asm/gpio.h
@@ -26,6 +26,11 @@ static inline int gpio_request(unsigned gpio, const char *label)
return 0;
}
+static inline int gpio_free(unsigned gpio)
+{
+ return 0;
+}
+
static inline int gpio_direction_input(unsigned gpio)
{
writel(1, CONFIG_SYS_GPIO_BASE + (gpio << 2));
@@ -47,12 +52,19 @@ static inline void gpio_set_value(unsigned gpio, int value)
{
writel(value ? 3 : 2, CONFIG_SYS_GPIO_BASE + (gpio << 2));
}
+
+static inline int gpio_is_valid(int number)
+{
+ return ((unsigned)number) < CONFIG_SYS_GPIO_WIDTH;
+}
#else
extern int gpio_request(unsigned gpio, const char *label);
+extern int gpio_free(unsigned gpio);
extern int gpio_direction_input(unsigned gpio);
extern int gpio_direction_output(unsigned gpio, int value);
extern int gpio_get_value(unsigned gpio);
extern void gpio_set_value(unsigned gpio, int value);
+extern int gpio_is_valid(int number);
#endif /* CONFIG_SYS_GPIO_BASE */
#endif /* _ASM_NIOS2_GPIO_H_ */
diff --git a/arch/nios2/include/asm/posix_types.h b/arch/nios2/include/asm/posix_types.h
index c2deea6..6733640 100644
--- a/arch/nios2/include/asm/posix_types.h
+++ b/arch/nios2/include/asm/posix_types.h
@@ -17,7 +17,7 @@ typedef unsigned short __kernel_ipc_pid_t;
typedef unsigned short __kernel_uid_t;
typedef unsigned short __kernel_gid_t;
typedef unsigned long __kernel_size_t;
-typedef int __kernel_ssize_t;
+typedef long __kernel_ssize_t;
typedef int __kernel_ptrdiff_t;
typedef long __kernel_time_t;
typedef long __kernel_suseconds_t;