Commit aa5ed7b3 authored by Sai Krishna Potthuri's avatar Sai Krishna Potthuri Committed by Linus Walleij

firmware: xilinx: Add version check for TRISTATE configuration

Support for configuring TRISTATE parameter is added in ZYNQMP PMUFW(Xilinx
ZynqMP Platform Management Firmware) Configuration Param Set version 2.0.
If the requested configuration is TRISTATE and platform is ZYNQMP then
check the version before requesting Xilinx firmware to set the
configuration.
Signed-off-by: default avatarSai Krishna Potthuri <sai.krishna.potthuri@amd.com>
Reviewed-by: default avatarMichal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20230731095026.3766675-3-sai.krishna.potthuri@amd.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 03ffa9af
......@@ -1156,6 +1156,15 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_get_config);
int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param,
u32 value)
{
int ret;
if (pm_family_code == ZYNQMP_FAMILY_CODE &&
param == PM_PINCTRL_CONFIG_TRI_STATE) {
ret = zynqmp_pm_feature(PM_PINCTRL_CONFIG_PARAM_SET);
if (ret < PM_PINCTRL_PARAM_SET_VERSION)
return -EOPNOTSUPP;
}
return zynqmp_pm_invoke_fn(PM_PINCTRL_CONFIG_PARAM_SET, pin,
param, value, 0, NULL);
}
......
......@@ -34,6 +34,8 @@
/* PM API versions */
#define PM_API_VERSION_2 2
#define PM_PINCTRL_PARAM_SET_VERSION 2
#define ZYNQMP_FAMILY_CODE 0x23
#define VERSAL_FAMILY_CODE 0x26
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment