Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Tom Rix | dd2d1cc | 2009-05-15 23:48:36 +0200 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2009 Wind River Systems, Inc. |
| 4 | * Tom Rix <Tom.Rix@windriver.com> |
| 5 | * |
Tom Rix | dd2d1cc | 2009-05-15 23:48:36 +0200 | [diff] [blame] | 6 | * This work is derived from the linux 2.6.27 kernel source |
| 7 | * To fetch, use the kernel repository |
| 8 | * git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git |
| 9 | * Use the v2.6.27 tag. |
| 10 | * |
| 11 | * Below is the original's header including its copyright |
| 12 | * |
| 13 | * linux/arch/arm/plat-omap/gpio.c |
| 14 | * |
| 15 | * Support functions for OMAP GPIO |
| 16 | * |
| 17 | * Copyright (C) 2003-2005 Nokia Corporation |
| 18 | * Written by Juha Yrjölä <juha.yrjola@nokia.com> |
Tom Rix | dd2d1cc | 2009-05-15 23:48:36 +0200 | [diff] [blame] | 19 | */ |
| 20 | #ifndef _GPIO_H |
| 21 | #define _GPIO_H |
| 22 | |
Aneesh V | 9a39088 | 2011-07-21 09:29:29 -0400 | [diff] [blame] | 23 | #include <asm/arch/cpu.h> |
Tom Rix | dd2d1cc | 2009-05-15 23:48:36 +0200 | [diff] [blame] | 24 | |
Simon Glass | fa4689a | 2019-12-06 21:41:35 -0700 | [diff] [blame] | 25 | #if CONFIG_IS_ENABLED(DM_GPIO) |
Simon Glass | 1a96d7f | 2014-10-22 21:37:09 -0600 | [diff] [blame] | 26 | |
| 27 | /* Information about a GPIO bank */ |
Simon Glass | b75b15b | 2020-12-03 16:55:23 -0700 | [diff] [blame] | 28 | struct omap_gpio_plat { |
Simon Glass | 1a96d7f | 2014-10-22 21:37:09 -0600 | [diff] [blame] | 29 | int bank_index; |
| 30 | ulong base; /* address of registers in physical memory */ |
Tom Rini | 7bc2bca | 2015-07-31 19:55:09 -0400 | [diff] [blame] | 31 | const char *port_name; |
Simon Glass | 1a96d7f | 2014-10-22 21:37:09 -0600 | [diff] [blame] | 32 | }; |
| 33 | |
| 34 | #else |
| 35 | |
Tom Rix | dd2d1cc | 2009-05-15 23:48:36 +0200 | [diff] [blame] | 36 | struct gpio_bank { |
| 37 | void *base; |
Tom Rix | dd2d1cc | 2009-05-15 23:48:36 +0200 | [diff] [blame] | 38 | }; |
| 39 | |
Aneesh V | 9a39088 | 2011-07-21 09:29:29 -0400 | [diff] [blame] | 40 | extern const struct gpio_bank *const omap_gpio_bank; |
| 41 | |
Nikita Kiryanov | e3cb9c1 | 2012-11-27 22:40:57 +0000 | [diff] [blame] | 42 | /** |
| 43 | * Check if gpio is valid. |
| 44 | * |
| 45 | * @param gpio GPIO number |
Heinrich Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 46 | * Return: 1 if ok, 0 on error |
Nikita Kiryanov | e3cb9c1 | 2012-11-27 22:40:57 +0000 | [diff] [blame] | 47 | */ |
| 48 | int gpio_is_valid(int gpio); |
Simon Glass | 1a96d7f | 2014-10-22 21:37:09 -0600 | [diff] [blame] | 49 | #endif |
| 50 | |
Tom Rix | dd2d1cc | 2009-05-15 23:48:36 +0200 | [diff] [blame] | 51 | #endif /* _GPIO_H_ */ |