Felix Held | 07462ef | 2020-12-11 15:55:45 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
Felix Held | dea4e0f | 2021-09-22 20:05:53 +0200 | [diff] [blame] | 3 | #include <amdblocks/gpio.h> |
Elyes Haouas | 5e2602a | 2023-01-14 05:46:25 +0100 | [diff] [blame] | 4 | #include <gpio.h> |
Felix Held | 51d6f5c | 2021-03-24 01:24:39 +0100 | [diff] [blame] | 5 | #include <types.h> |
Felix Held | 07462ef | 2020-12-11 15:55:45 +0100 | [diff] [blame] | 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_7, GEVENT_11 }, |
| 17 | { GPIO_8, GEVENT_23 }, |
| 18 | { GPIO_9, GEVENT_22 }, |
| 19 | { GPIO_16, GEVENT_12 }, |
| 20 | { GPIO_17, GEVENT_13 }, |
| 21 | { GPIO_18, GEVENT_14 }, |
| 22 | { GPIO_21, GEVENT_5 }, |
| 23 | { GPIO_22, GEVENT_3 }, |
| 24 | { GPIO_23, GEVENT_16 }, |
| 25 | { GPIO_24, GEVENT_15 }, |
| 26 | { GPIO_40, GEVENT_20 }, |
| 27 | { GPIO_84, GEVENT_18 }, |
| 28 | { GPIO_86, GEVENT_9 }, |
| 29 | { GPIO_89, GEVENT_0 }, |
| 30 | { GPIO_90, GEVENT_1 }, |
| 31 | { GPIO_91, GEVENT_6 }, |
| 32 | { GPIO_129, GEVENT_17 }, |
| 33 | }; |
| 34 | |
Felix Held | 07462ef | 2020-12-11 15:55:45 +0100 | [diff] [blame] | 35 | void soc_get_gpio_event_table(const struct soc_amd_event **table, size_t *items) |
| 36 | { |
| 37 | *table = gpio_event_table; |
| 38 | *items = ARRAY_SIZE(gpio_event_table); |
| 39 | } |