1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * (C) Copyright 2018 ABB
4 * Valentin Longchamp <valentin.longchamp@ch.abb.com>
11 #define QRIO_GPIO_A 0x40
12 #define QRIO_GPIO_B 0x60
14 int qrio_get_gpio(u8 port_off, u8 gpio_nr);
15 void qrio_set_opendrain_gpio(u8 port_off, u8 gpio_nr, u8 val);
16 void qrio_set_gpio(u8 port_off, u8 gpio_nr, bool value);
17 void qrio_gpio_direction_output(u8 port_off, u8 gpio_nr, bool value);
18 void qrio_gpio_direction_input(u8 port_off, u8 gpio_nr);
20 /* QRIO Periphery reset configurations */
21 #define PRSTCFG_POWUP_UNIT_CORE_RST 0x0
22 #define PRSTCFG_POWUP_UNIT_RST 0x1
23 #define PRSTCFG_POWUP_RST 0x3
25 void qrio_prst(u8 bit, bool en, bool wden);
26 void qrio_wdmask(u8 bit, bool wden);
27 void qrio_prstcfg(u8 bit, u8 mode);
28 void qrio_set_leds(void);
29 void qrio_enable_app_buffer(void);
30 void qrio_cpuwd_flag(bool flag);
31 bool qrio_reason_unitrst(void);
33 /* QRIO uP reset request configurations */
34 #define UPREQ_UNIT_RST 0x0
35 #define UPREQ_CORE_RST 0x1
37 void qrio_uprstreq(u8 mode);
39 void i2c_deblock_gpio_cfg(void);