blob: 20268fa084e4eaac894e4aea6471c26fb3577e15 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0 */
Tom Rixdd2d1cc2009-05-15 23:48:36 +02002/*
3 * Copyright (c) 2009 Wind River Systems, Inc.
4 * Tom Rix <Tom.Rix@windriver.com>
5 *
Tom Rixdd2d1cc2009-05-15 23:48:36 +02006 * 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 Rixdd2d1cc2009-05-15 23:48:36 +020019 */
20#ifndef _GPIO_H
21#define _GPIO_H
22
Aneesh V9a390882011-07-21 09:29:29 -040023#include <asm/arch/cpu.h>
Tom Rixdd2d1cc2009-05-15 23:48:36 +020024
Simon Glass1a96d7f2014-10-22 21:37:09 -060025#ifdef CONFIG_DM_GPIO
26
27/* Information about a GPIO bank */
28struct omap_gpio_platdata {
29 int bank_index;
30 ulong base; /* address of registers in physical memory */
Tom Rini7bc2bca2015-07-31 19:55:09 -040031 const char *port_name;
Simon Glass1a96d7f2014-10-22 21:37:09 -060032};
33
34#else
35
Tom Rixdd2d1cc2009-05-15 23:48:36 +020036struct gpio_bank {
37 void *base;
Tom Rixdd2d1cc2009-05-15 23:48:36 +020038};
39
Aneesh V9a390882011-07-21 09:29:29 -040040extern const struct gpio_bank *const omap_gpio_bank;
41
Nikita Kiryanove3cb9c12012-11-27 22:40:57 +000042/**
43 * Check if gpio is valid.
44 *
45 * @param gpio GPIO number
46 * @return 1 if ok, 0 on error
47 */
48int gpio_is_valid(int gpio);
Simon Glass1a96d7f2014-10-22 21:37:09 -060049#endif
50
Tom Rixdd2d1cc2009-05-15 23:48:36 +020051#endif /* _GPIO_H_ */