xref: /rk3399_rockchip-uboot/arch/arm/include/asm/omap_gpio.h (revision 0a9e34056fcf86fb64e70bd281875eb7bbdbabde)
125223a68SAneesh V /*
225223a68SAneesh V  * Copyright (c) 2009 Wind River Systems, Inc.
325223a68SAneesh V  * Tom Rix <Tom.Rix@windriver.com>
425223a68SAneesh V  *
5bcd4d4ebSWolfgang Denk  * SPDX-License-Identifier:	GPL-2.0
625223a68SAneesh V  *
725223a68SAneesh V  * This work is derived from the linux 2.6.27 kernel source
825223a68SAneesh V  * To fetch, use the kernel repository
925223a68SAneesh V  * git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
1025223a68SAneesh V  * Use the v2.6.27 tag.
1125223a68SAneesh V  *
1225223a68SAneesh V  * Below is the original's header including its copyright
1325223a68SAneesh V  *
1425223a68SAneesh V  *  linux/arch/arm/plat-omap/gpio.c
1525223a68SAneesh V  *
1625223a68SAneesh V  * Support functions for OMAP GPIO
1725223a68SAneesh V  *
1825223a68SAneesh V  * Copyright (C) 2003-2005 Nokia Corporation
1925223a68SAneesh V  * Written by Juha Yrjölä <juha.yrjola@nokia.com>
2025223a68SAneesh V  */
2125223a68SAneesh V #ifndef _GPIO_H
2225223a68SAneesh V #define _GPIO_H
2325223a68SAneesh V 
2425223a68SAneesh V #include <asm/arch/cpu.h>
2525223a68SAneesh V 
265915a2adSSimon Glass #ifdef CONFIG_DM_GPIO
275915a2adSSimon Glass 
285915a2adSSimon Glass /* Information about a GPIO bank */
295915a2adSSimon Glass struct omap_gpio_platdata {
305915a2adSSimon Glass 	int bank_index;
315915a2adSSimon Glass 	ulong base;	/* address of registers in physical memory */
32*0a9e3405STom Rini 	const char *port_name;
335915a2adSSimon Glass };
345915a2adSSimon Glass 
355915a2adSSimon Glass #else
365915a2adSSimon Glass 
3725223a68SAneesh V struct gpio_bank {
3825223a68SAneesh V 	void *base;
3925223a68SAneesh V };
4025223a68SAneesh V 
4125223a68SAneesh V extern const struct gpio_bank *const omap_gpio_bank;
4225223a68SAneesh V 
43dcee1ab3SNikita Kiryanov /**
44dcee1ab3SNikita Kiryanov  * Check if gpio is valid.
45dcee1ab3SNikita Kiryanov  *
46dcee1ab3SNikita Kiryanov  * @param gpio	GPIO number
47dcee1ab3SNikita Kiryanov  * @return 1 if ok, 0 on error
48dcee1ab3SNikita Kiryanov  */
49dcee1ab3SNikita Kiryanov int gpio_is_valid(int gpio);
505915a2adSSimon Glass #endif
515915a2adSSimon Glass 
5225223a68SAneesh V #endif /* _GPIO_H_ */
53