mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-16 08:13:17 +00:00
83d290c56f
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
44 lines
1.4 KiB
C
44 lines
1.4 KiB
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/*
|
|
* arch/asm-arm/mach-kirkwood/include/mach/gpio.h
|
|
*/
|
|
|
|
/*
|
|
* Based on (mostly copied from) plat-orion based Linux 2.6 kernel driver.
|
|
* Removed kernel level irq handling. Took some macros from kernel to
|
|
* allow build.
|
|
*
|
|
* Dieter Kiermaier dk-arm-linux@gmx.de
|
|
*/
|
|
|
|
#ifndef __KIRKWOOD_GPIO_H
|
|
#define __KIRKWOOD_GPIO_H
|
|
|
|
#define GPIO_MAX 50
|
|
#define GPIO_OFF(pin) (((pin) >> 5) ? 0x0040 : 0x0000)
|
|
#define GPIO_OUT(pin) (MVEBU_GPIO0_BASE + GPIO_OFF(pin) + 0x00)
|
|
#define GPIO_IO_CONF(pin) (MVEBU_GPIO0_BASE + GPIO_OFF(pin) + 0x04)
|
|
#define GPIO_BLINK_EN(pin) (MVEBU_GPIO0_BASE + GPIO_OFF(pin) + 0x08)
|
|
#define GPIO_IN_POL(pin) (MVEBU_GPIO0_BASE + GPIO_OFF(pin) + 0x0c)
|
|
#define GPIO_DATA_IN(pin) (MVEBU_GPIO0_BASE + GPIO_OFF(pin) + 0x10)
|
|
#define GPIO_EDGE_CAUSE(pin) (MVEBU_GPIO0_BASE + GPIO_OFF(pin) + 0x14)
|
|
#define GPIO_EDGE_MASK(pin) (MVEBU_GPIO0_BASE + GPIO_OFF(pin) + 0x18)
|
|
#define GPIO_LEVEL_MASK(pin) (MVEBU_GPIO0_BASE + GPIO_OFF(pin) + 0x1c)
|
|
|
|
/*
|
|
* Kirkwood-specific GPIO API
|
|
*/
|
|
|
|
void kw_gpio_set_valid(unsigned pin, int mode);
|
|
int kw_gpio_is_valid(unsigned pin, int mode);
|
|
int kw_gpio_direction_input(unsigned pin);
|
|
int kw_gpio_direction_output(unsigned pin, int value);
|
|
int kw_gpio_get_value(unsigned pin);
|
|
void kw_gpio_set_value(unsigned pin, int value);
|
|
void kw_gpio_set_blink(unsigned pin, int blink);
|
|
void kw_gpio_set_unused(unsigned pin);
|
|
|
|
#define GPIO_INPUT_OK (1 << 0)
|
|
#define GPIO_OUTPUT_OK (1 << 1)
|
|
|
|
#endif
|