blob: 68a6bedbc0b0aad718818cf30c4333f275bed6fb [file] [log] [blame]
Patrick Georgiac959032020-05-05 22:49:26 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Subrata Banik73b1bd72019-11-28 13:56:24 +05302
Dinesh Gehlot8a2c9042023-01-17 05:12:07 +00003#include <gpio.h>
Subrata Banik73b1bd72019-11-28 13:56:24 +05304#include <soc/soc_chip.h>
5
6/*
7 * Routine to perform below operations:
Angel Pons73a22ed2021-04-05 12:26:51 +02008 * 1. SoC routine to fill GPIO PM mask and value for GPIO_MISCCFG register
Subrata Banik73b1bd72019-11-28 13:56:24 +05309 * 2. Program GPIO PM configuration based on PM mask and value
10 */
11void 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 Pons0c0d4922021-04-05 13:02:45 +020017 memcpy(value, config->gpio_pm, sizeof(value));
Subrata Banik73b1bd72019-11-28 13:56:24 +053018 else
Angel Pons0c0d4922021-04-05 13:02:45 +020019 memset(value, MISCCFG_GPIO_PM_CONFIG_BITS, sizeof(value));
Subrata Banik73b1bd72019-11-28 13:56:24 +053020
21 gpio_pm_configure(value, TOTAL_GPIO_COMM);
22}