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