Patrick Georgi | ac95903 | 2020-05-05 22:49:26 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Subrata Banik | 73b1bd7 | 2019-11-28 13:56:24 +0530 | [diff] [blame] | 2 | |
| 3 | #include <intelblocks/gpio.h> |
| 4 | #include <soc/soc_chip.h> |
| 5 | |
| 6 | /* |
| 7 | * Routine to perform below operations: |
Angel Pons | 73a22ed | 2021-04-05 12:26:51 +0200 | [diff] [blame] | 8 | * 1. SoC routine to fill GPIO PM mask and value for GPIO_MISCCFG register |
Subrata Banik | 73b1bd7 | 2019-11-28 13:56:24 +0530 | [diff] [blame] | 9 | * 2. Program GPIO PM configuration based on PM mask and value |
| 10 | */ |
| 11 | void soc_gpio_pm_configuration(void) |
| 12 | { |
| 13 | uint8_t value[TOTAL_GPIO_COMM]; |
| 14 | const config_t *config = config_of_soc(); |
| 15 | |
| 16 | if (config->gpio_override_pm) |
Angel Pons | 0c0d492 | 2021-04-05 13:02:45 +0200 | [diff] [blame] | 17 | memcpy(value, config->gpio_pm, sizeof(value)); |
Subrata Banik | 73b1bd7 | 2019-11-28 13:56:24 +0530 | [diff] [blame] | 18 | else |
Angel Pons | 0c0d492 | 2021-04-05 13:02:45 +0200 | [diff] [blame] | 19 | memset(value, MISCCFG_GPIO_PM_CONFIG_BITS, sizeof(value)); |
Subrata Banik | 73b1bd7 | 2019-11-28 13:56:24 +0530 | [diff] [blame] | 20 | |
| 21 | gpio_pm_configure(value, TOTAL_GPIO_COMM); |
| 22 | } |