Angel Pons | ae59387 | 2020-04-04 18:50:57 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 2 | |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 3 | #include <amdblocks/gpio_banks.h> |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 4 | #include <soc/gpio.h> |
Felix Held | 51d6f5c | 2021-03-24 01:24:39 +0100 | [diff] [blame] | 5 | #include <types.h> |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 6 | |
| 7 | static const struct soc_amd_event gpio_event_table[] = { |
Marshall Dawson | 2e0f278 | 2019-06-14 09:51:02 -0600 | [diff] [blame] | 8 | { GPIO_0, GEVENT_21 }, /* GPIO0 may only be used as PWR_BTN_L in ACPI */ |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 9 | { GPIO_1, GEVENT_19 }, |
| 10 | { GPIO_2, GEVENT_8 }, |
| 11 | { GPIO_3, GEVENT_2 }, |
| 12 | { GPIO_4, GEVENT_4 }, |
| 13 | { GPIO_5, GEVENT_7 }, |
| 14 | { GPIO_6, GEVENT_10 }, |
| 15 | { GPIO_7, GEVENT_11 }, |
| 16 | { GPIO_8, GEVENT_23 }, |
| 17 | { GPIO_9, GEVENT_22 }, |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 18 | { GPIO_16, GEVENT_12 }, |
| 19 | { GPIO_17, GEVENT_13 }, |
| 20 | { GPIO_18, GEVENT_14 }, |
| 21 | { GPIO_21, GEVENT_5 }, |
| 22 | { GPIO_22, GEVENT_3 }, |
| 23 | { GPIO_23, GEVENT_16 }, |
| 24 | { GPIO_24, GEVENT_15 }, |
Marshall Dawson | 2e0f278 | 2019-06-14 09:51:02 -0600 | [diff] [blame] | 25 | { GPIO_40, GEVENT_20 }, |
| 26 | { GPIO_84, GEVENT_18 }, |
| 27 | { GPIO_86, GEVENT_9 }, |
| 28 | { GPIO_89, GEVENT_0 }, |
| 29 | { GPIO_90, GEVENT_1 }, |
| 30 | { GPIO_91, GEVENT_6 }, |
| 31 | { GPIO_129, GEVENT_17 }, |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 32 | }; |
| 33 | |
Martin Roth | 5c354b9 | 2019-04-22 14:55:16 -0600 | [diff] [blame] | 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 | } |