xref: /optee_os/core/include/drivers/pl061_gpio.h (revision b0563631928755fe864b97785160fb3088e9efdc)
1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (c) 2016, Linaro Limited
4  */
5 
6 #ifndef __DRIVERS_PL061_GPIO_H
7 #define __DRIVERS_PL061_GPIO_H
8 
9 #include <drivers/gpio.h>
10 #include <types_ext.h>
11 
12 #define PL061_REG_SIZE	0x1000
13 
14 enum pl061_mode_control {
15 	PL061_MC_SW,
16 	PL061_MC_HW
17 };
18 
19 struct pl061_data {
20 	struct gpio_chip chip;
21 };
22 
23 void pl061_register(vaddr_t base_addr, unsigned int gpio_dev);
24 void pl061_init(struct pl061_data *pd);
25 enum pl061_mode_control pl061_get_mode_control(unsigned int gpio_pin);
26 void pl061_set_mode_control(unsigned int gpio_pin,
27 	enum pl061_mode_control hw_sw);
28 
29 #endif	/* __DRIVERS_PL061_GPIO_H */
30