|
1 | 1 | /* |
2 | | - * Copyright (c) 2020 IoT.bzh |
| 2 | + * Copyright (c) 2020-2023 IoT.bzh |
3 | 3 | * |
4 | 4 | * SPDX-License-Identifier: Apache-2.0 |
5 | 5 | */ |
@@ -47,6 +47,7 @@ struct gpio_rcar_data { |
47 | 47 | #define FILONOFF 0x28 /* Chattering Prevention On/Off Register */ |
48 | 48 | #define OUTDTSEL 0x40 /* Output Data Select Register */ |
49 | 49 | #define BOTHEDGE 0x4c /* One Edge/Both Edge Select Register */ |
| 50 | +#define INEN 0x50 /* General Input Enable Register */ |
50 | 51 |
|
51 | 52 | static inline uint32_t gpio_rcar_read(const struct gpio_rcar_cfg *config, |
52 | 53 | uint32_t offs) |
@@ -104,6 +105,11 @@ static void gpio_rcar_config_general_input_output_mode( |
104 | 105 | /* Configure positive logic in POSNEG */ |
105 | 106 | gpio_rcar_modify_bit(config, POSNEG, gpio, false); |
106 | 107 |
|
| 108 | + /* Select "Input Enable/Disable" in INEN for Gen4 SoCs */ |
| 109 | +#ifdef CONFIG_SOC_SERIES_RCAR_GEN4 |
| 110 | + gpio_rcar_modify_bit(config, INEN, gpio, !output); |
| 111 | +#endif |
| 112 | + |
107 | 113 | /* Select "General Input/Output Mode" in IOINTSEL */ |
108 | 114 | gpio_rcar_modify_bit(config, IOINTSEL, gpio, false); |
109 | 115 |
|
@@ -231,6 +237,11 @@ static int gpio_rcar_pin_interrupt_configure(const struct device *dev, |
231 | 237 | gpio_rcar_modify_bit(config, BOTHEDGE, pin, true); |
232 | 238 | } |
233 | 239 |
|
| 240 | + /* Select "Input Enable" in INEN for Gen4 SoCs */ |
| 241 | +#ifdef CONFIG_SOC_SERIES_RCAR_GEN4 |
| 242 | + gpio_rcar_modify_bit(config, INEN, pin, true); |
| 243 | +#endif |
| 244 | + |
234 | 245 | gpio_rcar_modify_bit(config, IOINTSEL, pin, true); |
235 | 246 |
|
236 | 247 | if (mode == GPIO_INT_MODE_EDGE) { |
|
0 commit comments