Varshit Pandya | 95d78d9 | 2023-10-04 19:30:21 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <amdblocks/gpio.h> |
| 4 | #include <soc/gpio.h> |
| 5 | #include <types.h> |
| 6 | |
| 7 | /* see the IOMUX function table for the mapping from GPIO number to GEVENT number */ |
| 8 | static const struct soc_amd_event gpio_event_table[] = { |
| 9 | { GPIO_0, GEVENT_21 }, /* GPIO0 may only be used as PWR_BTN_L in ACPI */ |
| 10 | { GPIO_1, GEVENT_19 }, |
| 11 | { GPIO_2, GEVENT_8 }, |
| 12 | { GPIO_3, GEVENT_2 }, |
| 13 | { GPIO_4, GEVENT_4 }, |
| 14 | { GPIO_5, GEVENT_7 }, |
| 15 | { GPIO_6, GEVENT_10 }, |
| 16 | { GPIO_16, GEVENT_12 }, |
| 17 | { GPIO_17, GEVENT_13 }, |
| 18 | { GPIO_21, GEVENT_5 }, |
| 19 | { GPIO_22, GEVENT_3 }, |
| 20 | { GPIO_23, GEVENT_16 }, |
| 21 | { GPIO_24, GEVENT_14 }, |
| 22 | { GPIO_26, GEVENT_15 }, |
| 23 | { GPIO_76, GEVENT_11 }, |
| 24 | { GPIO_86, GEVENT_9 }, |
| 25 | { GPIO_89, GEVENT_0 }, |
| 26 | { GPIO_104, GEVENT_20 }, |
| 27 | { GPIO_105, GEVENT_22 }, |
| 28 | { GPIO_106, GEVENT_23 }, |
| 29 | { GPIO_115, GEVENT_1 }, |
| 30 | { GPIO_116, GEVENT_6 }, |
| 31 | { GPIO_129, GEVENT_17 }, |
| 32 | }; |
| 33 | |
| 34 | void soc_get_gpio_event_table(const struct soc_amd_event **table, size_t *items) |
| 35 | { |
| 36 | *table = gpio_event_table; |
| 37 | *items = ARRAY_SIZE(gpio_event_table); |
| 38 | } |