blob: 1e1fa0160480d85756b25e99ae554d86d85a3a8c [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Haojian Zhuang157d2642011-10-17 20:37:52 +08002#ifndef __GPIO_PXA_H
3#define __GPIO_PXA_H
4
5#define GPIO_bit(x) (1 << ((x) & 0x1f))
6
7#define gpio_to_bank(gpio) ((gpio) >> 5)
8
9/* NOTE: some PXAs have fewer on-chip GPIOs (like PXA255, with 85).
10 * Those cases currently cause holes in the GPIO number space, the
11 * actual number of the last GPIO is recorded by 'pxa_last_gpio'.
12 */
13extern int pxa_last_gpio;
14
15extern int pxa_irq_to_gpio(int irq);
16
Robert Jarzmikb95ace52012-04-22 13:37:24 +020017struct pxa_gpio_platform_data {
Haojian Zhuangb8f649f2013-04-09 18:12:04 +080018 int irq_base;
Robert Jarzmikb95ace52012-04-22 13:37:24 +020019 int (*gpio_set_wake)(unsigned int gpio, unsigned int on);
20};
21
Haojian Zhuang157d2642011-10-17 20:37:52 +080022#endif /* __GPIO_PXA_H */