blob: 5578b9803fc677e10e2ee01ba146bc0039f09541 [file] [log] [blame]
Lennert Buytenhek9569dae2008-10-20 01:51:03 +02001/*
2 * arch/arm/plat-orion/include/plat/gpio.h
3 *
4 * Marvell Orion SoC GPIO handling.
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __PLAT_GPIO_H
12#define __PLAT_GPIO_H
13
Martin Michlmayr3e475f52009-08-17 23:34:10 -100014#include <linux/init.h>
Lennert Buytenhek9eac6d02010-12-14 12:54:03 +010015#include <asm-generic/gpio.h>
Martin Michlmayr3e475f52009-08-17 23:34:10 -100016
Lennert Buytenhek9569dae2008-10-20 01:51:03 +020017/*
18 * GENERIC_GPIO primitives.
19 */
Erik Benadaa8865652009-05-28 17:08:55 -070020#define gpio_get_value __gpio_get_value
21#define gpio_set_value __gpio_set_value
22#define gpio_cansleep __gpio_cansleep
Lennert Buytenhek9eac6d02010-12-14 12:54:03 +010023#define gpio_to_irq __gpio_to_irq
Lennert Buytenhek9569dae2008-10-20 01:51:03 +020024
25/*
26 * Orion-specific GPIO API extensions.
27 */
28void orion_gpio_set_unused(unsigned pin);
Lennert Buytenhek9569dae2008-10-20 01:51:03 +020029void orion_gpio_set_blink(unsigned pin, int blink);
30
Erik Benadaa8865652009-05-28 17:08:55 -070031#define GPIO_INPUT_OK (1 << 0)
32#define GPIO_OUTPUT_OK (1 << 1)
Nicolas Pitre28d27cf2009-02-02 15:27:55 -050033void orion_gpio_set_valid(unsigned pin, int mode);
34
Erik Benadaa8865652009-05-28 17:08:55 -070035/* Initialize gpiolib. */
Lennert Buytenhek9eac6d02010-12-14 12:54:03 +010036void __init orion_gpio_init(int gpio_base, int ngpio,
37 u32 base, int mask_offset, int secondary_irq_base);
Erik Benadaa8865652009-05-28 17:08:55 -070038
Lennert Buytenhek07332312008-10-20 01:51:03 +020039/*
40 * GPIO interrupt handling.
41 */
Nicolas Pitrefd4b9b32009-02-17 20:45:50 +010042extern struct irq_chip orion_gpio_irq_chip;
Lennert Buytenhek07332312008-10-20 01:51:03 +020043void orion_gpio_irq_handler(int irqoff);
44
Lennert Buytenhek9569dae2008-10-20 01:51:03 +020045
46#endif