Skip to content

Commit aa5ed7b

Browse files
Sai Krishna Potthurilinusw
authored andcommitted
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: Sai Krishna Potthuri <[email protected]> Reviewed-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 03ffa9a commit aa5ed7b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

drivers/firmware/xilinx/zynqmp.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,6 +1156,15 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_get_config);
11561156
int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param,
11571157
u32 value)
11581158
{
1159+
int ret;
1160+
1161+
if (pm_family_code == ZYNQMP_FAMILY_CODE &&
1162+
param == PM_PINCTRL_CONFIG_TRI_STATE) {
1163+
ret = zynqmp_pm_feature(PM_PINCTRL_CONFIG_PARAM_SET);
1164+
if (ret < PM_PINCTRL_PARAM_SET_VERSION)
1165+
return -EOPNOTSUPP;
1166+
}
1167+
11591168
return zynqmp_pm_invoke_fn(PM_PINCTRL_CONFIG_PARAM_SET, pin,
11601169
param, value, 0, NULL);
11611170
}

include/linux/firmware/xlnx-zynqmp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
/* PM API versions */
3535
#define PM_API_VERSION_2 2
3636

37+
#define PM_PINCTRL_PARAM_SET_VERSION 2
38+
3739
#define ZYNQMP_FAMILY_CODE 0x23
3840
#define VERSAL_FAMILY_CODE 0x26
3941

0 commit comments

Comments
 (0)