diff options
author | Sai Krishna Potthuri <sai.krishna.potthuri@amd.com> | 2023-07-31 12:50:24 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2023-08-07 11:48:03 +0300 |
commit | aa5ed7b3fb3939ca6a3605c6fdc7399bb219ec23 (patch) | |
tree | a25ba8f94286d633a8d7ed78f123f6d349a7f3cc /drivers/firmware/xilinx | |
parent | 03ffa9af3a5ff88f9855b18584d00aca7eb43e6d (diff) | |
download | linux-aa5ed7b3fb3939ca6a3605c6fdc7399bb219ec23.tar.xz |
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 <sai.krishna.potthuri@amd.com>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20230731095026.3766675-3-sai.krishna.potthuri@amd.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/firmware/xilinx')
-rw-r--r-- | drivers/firmware/xilinx/zynqmp.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 45c73cb86477..4382884a5da5 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -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); } |