Message ID | 20230724084554.1924378-3-sai.krishna.potthuri@amd.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp1698196vqg; Mon, 24 Jul 2023 03:15:47 -0700 (PDT) X-Google-Smtp-Source: APBJJlEvzf18WNMb3rKDa10eKSYV/F0Uv8n4K0rcjQxJ4wLjpoqzZkwMSRNQojhnndwKPrILEXiE X-Received: by 2002:a17:903:2449:b0:1bb:32de:95c5 with SMTP id l9-20020a170903244900b001bb32de95c5mr7643718pls.65.1690193747229; Mon, 24 Jul 2023 03:15:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1690193747; cv=pass; d=google.com; s=arc-20160816; b=xoflvaupBPsDDAlgpwl00jq/sJgD6Yl+t1646On8EckAVjAzJRpsCMnCGnA02BYmf7 DFXs4xAZVfzpKayNWTKqpWVP0Z+Z2wcTpcdTz9KxHtiAiSXJS3h05+CPNf7m5y2unF9b Mv2ONhSMulq3iBRsSpfldZX5e1m4xNto86/sXw8fcEi/0AQEfxzb1LvwIPz+4nb9uIXh SANNW9RAigLN/iNYKsXc1A1rqNyvho3Ch1vQ1ImpX6JBZQab1hQQzKu/kyk5TH1/rq+o NWE2RJySItfqEwk1m8zaFK8SsqVP90Xsyr2w/l8ZcJhenaFCQypWdYnT3hkHWEpmJ/Of uKSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cNUJM+IT9eeDSqiHSg2XEyk6HPpXY1Dn2TSB8BELFpE=; fh=xWVHyT5lQHsSnn3lvSFgsGvv8jauAnOU/6v8Rq4QerU=; b=0qOjuCPuq8gqGI369wLbyaizfYY1d5RJgbLZcY3T/tC69zK1U0XniA/BGJvj4Bk0U2 UFq6osH3yKu8rSbk5nmLr7SFZvL9/cS41bjjefXD7I58BZHObeNId5lR48WrIdNFPJGC pC2xVlmj8cAVYp6nnRtSHhA4QLW5IALBqqUtXfOON2G7E2Gfwkrlfw6qLxGgif6+Luyz okyJpS07/RfWtRY802A7dLaSo4AF65Sg0LVUGmFL7vZAsPLXYpy4CjYV7+VjOMdK80bO XnmJKaxP8F6uD1enU7RJPjhRyqdoGfnIgfnuSL6qSkNmHsPUWkaXLQczKsc1jJEGow4f X7Pw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=wJIOhABi; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e1-20020a17090301c100b001bb9c2bc8aasi2632040plh.401.2023.07.24.03.15.34; Mon, 24 Jul 2023 03:15:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=wJIOhABi; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231808AbjGXIrE (ORCPT <rfc822;kautuk.consul.80@gmail.com> + 99 others); Mon, 24 Jul 2023 04:47:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231416AbjGXIrA (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 24 Jul 2023 04:47:00 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2070.outbound.protection.outlook.com [40.107.93.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFAB418E; Mon, 24 Jul 2023 01:46:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cHMMFhyEJw/l4LPWm256YhBaxVeeMkYF5lJhMwRbe1rECedjD8BSviUEByEbyTBE4taMTh+Pb86xTR3yV9wvgGrjEuWDY4QUsJVU9WvZtAAAKM0qserJ5urQmCp4Lry73Wg1HzWY3y2qvQS10UacJOkQUmLiUgAJwqgz+o8jPJ4amdwF4PgNIr8R46mDoM1z09gCpmxwgVK2XKnC2teqTYI8hV3FmunoochO3TCopok4gtnrXh40ew7Y7ttrIre5nRNmpbYT7rtBt2JhyUQZ69av2QcGugPt7QNvVQU/Oo/RogxeAhCkPZnCwEXp218V4437II1lFHA5I07QhLcy3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cNUJM+IT9eeDSqiHSg2XEyk6HPpXY1Dn2TSB8BELFpE=; b=PC5catmzPm9LmkNySOkWQ2CB8ydmijV+P2DptAiXM9pkbv6MlK56KrNRloAo5+w5pGGDBOlVA5X/jMrpCK1jcUb77eee/yda/CQl7+XArUvtsTrNI6p6imFKwRbeKNiSgAYD4eWTUhHA90DT8ume4yhI8FcNEJOnIq57VHVvBrx8K40enfMoBdeE9Ts4H+pn0gA4aeu6+X6czzpLx2jXTlOT1OQ9+ir6TXQ9Uf/yQQBafSlo2zizNMlx/gV5MPCG3Cx/RqJ3ulx5fPCaBu7w81+u2AeOKu6UlFq2jtgGuLPSqq7WZcbmzbMvFUI3r4dy6CiJwgyP+u0H1xCPeoFcLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linaro.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cNUJM+IT9eeDSqiHSg2XEyk6HPpXY1Dn2TSB8BELFpE=; b=wJIOhABiDoqBuBs+CAd9/ZLTj+x1vdhQfqCk4WSFt/kE3vp5QuH0aL5BYOsHKWaDNeRWC9gGZIPRghaXfYLyTDykRlF1QevOgyVeHU3oDClTzN+wVx/7+/zkitQVMSakUHDeIzQJNALlHzRoKkgPLy41dq5A3MOActP5j38YvVc= Received: from BN9PR03CA0692.namprd03.prod.outlook.com (2603:10b6:408:ef::7) by SA1PR12MB7039.namprd12.prod.outlook.com (2603:10b6:806:24e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul 2023 08:46:56 +0000 Received: from BN8NAM11FT100.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ef:cafe::63) by BN9PR03CA0692.outlook.office365.com (2603:10b6:408:ef::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32 via Frontend Transport; Mon, 24 Jul 2023 08:46:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by BN8NAM11FT100.mail.protection.outlook.com (10.13.177.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6631.24 via Frontend Transport; Mon, 24 Jul 2023 08:46:55 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 24 Jul 2023 03:46:53 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 24 Jul 2023 03:46:21 -0500 Received: from xhdlakshmis40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Mon, 24 Jul 2023 03:46:16 -0500 From: Sai Krishna Potthuri <sai.krishna.potthuri@amd.com> To: Linus Walleij <linus.walleij@linaro.org>, Michal Simek <michal.simek@amd.com>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Mathieu Poirier <mathieu.poirier@linaro.org>, Tanmay Shah <tanmay.shah@amd.com>, Ben Levinsky <ben.levinsky@amd.com>, Marek Vasut <marex@denx.de>, Roman Gushchin <roman.gushchin@linux.dev>, Arnd Bergmann <arnd@arndb.de> CC: <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org>, <linux-gpio@vger.kernel.org>, <devicetree@vger.kernel.org>, <saikrishna12468@gmail.com>, <git@amd.com>, Sai Krishna Potthuri <sai.krishna.potthuri@amd.com> Subject: [PATCH v2 2/4] firmware: xilinx: Add version check for TRISTATE configuration Date: Mon, 24 Jul 2023 14:15:52 +0530 Message-ID: <20230724084554.1924378-3-sai.krishna.potthuri@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230724084554.1924378-1-sai.krishna.potthuri@amd.com> References: <20230724084554.1924378-1-sai.krishna.potthuri@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT100:EE_|SA1PR12MB7039:EE_ X-MS-Office365-Filtering-Correlation-Id: 64d3006a-4672-4c85-0519-08db8c228903 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eEdj69ns861gBTEYCkH5IAhy0PMR/eQkusgT/PNHu9fUWsQyl8DkmP1KcBkZnSJhG3tPLIEgHLpb5ucwnYV/OicQWHxCbO81JyPnB6vyeeiGAs5+fCngwtFcImG8hws8QDZU2Zb20qsQyeTBriyR9lowoPtvW8/09Wx5f20/ydDcVH2JDSKLgp0+DJzUxIxMrsSID2U+TcpKZOZrodcEk6ZvKT5x3QstqsOH40XhUC0qfDqWxEIvAwyOjuG3rpXJ5ZPQ6c9uOd1VmwZ7UWKCJ1OsFzHfF9ktkLUwabvWekMoUBzp0BTH5qBXtM7X/o3I5kJxC5kpJNrx9asU5xna1PoTQfw8zXLwT9lXjsxQGqDhDv9g8+mY96b9hrjS5fN3wfxLzLIhl88Dm/GptzS81OACaf8o3AXO+ePSI7Raw8GNuro1fFr+S0feq6/W7alPHyj9adSQrGn94Upj5U9bKX8ZG8T8Kh1lNpSADexAzgR8mZnMWjG0Ba5XCoFBOvqFOR4I+y39kcJU/9qghzKptOiCpB+ZlFht5PxLaRurJ5Tw4Dku2H7/8usR4IqerafDr84+TuMWraiGjUsWUcq2UTUfxxA2YaxFqRcQ6RGQXAYAPRjWr0gyGvs7jZkUGgrrax7N2OPK8gsJ5Wn+Vo/gGyYi049lpm/NeicBGlCdT7ws/yuOkGvlUSFl5ve0wyeGHDiIMU+v63L7NTOIN0XwxI40IQcSmpJ5iLLj7DShKZ8aNnqZDo7DMn8gLBvX7Ygm66tlvYB+7r++Zi9Pkb/Bq9KITkVf1G8ZSb7q47hEakA= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(376002)(136003)(346002)(396003)(451199021)(82310400008)(36840700001)(46966006)(40470700004)(478600001)(8676002)(110136005)(8936002)(2906002)(40480700001)(40460700003)(70586007)(70206006)(4326008)(316002)(41300700001)(103116003)(5660300002)(54906003)(36756003)(7416002)(82740400003)(86362001)(1076003)(336012)(186003)(26005)(47076005)(2616005)(426003)(81166007)(921005)(356005)(6666004)(36860700001)(83380400001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 08:46:55.8041 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 64d3006a-4672-4c85-0519-08db8c228903 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT100.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7039 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772296598486262010 X-GMAIL-MSGID: 1772296598486262010 |
Series |
pinctrl: pinctrl-zynqmp: Add tri-state configuration support
|
|
Commit Message
Sai Krishna Potthuri
July 24, 2023, 8:45 a.m. UTC
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>
---
drivers/firmware/xilinx/zynqmp.c | 9 +++++++++
include/linux/firmware/xlnx-zynqmp.h | 2 ++
2 files changed, 11 insertions(+)
Comments
On 7/24/23 10:45, Sai Krishna Potthuri wrote: > 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> > --- > drivers/firmware/xilinx/zynqmp.c | 9 +++++++++ > include/linux/firmware/xlnx-zynqmp.h | 2 ++ > 2 files changed, 11 insertions(+) > > diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c > index f9498e7ea694..307717f24a98 100644 > --- a/drivers/firmware/xilinx/zynqmp.c > +++ b/drivers/firmware/xilinx/zynqmp.c > @@ -1150,6 +1150,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); > } > diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h > index d7f94b42ad4c..6359eeea8dd7 100644 > --- a/include/linux/firmware/xlnx-zynqmp.h > +++ b/include/linux/firmware/xlnx-zynqmp.h > @@ -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 > Reviewed-by: Michal Simek <michal.simek@amd.com> Thanks, Michal
From: Shah, Tanmay <tanmay.shah@amd.com> Sent: Monday, July 24, 2023 8:57 PM To: Potthuri, Sai Krishna <sai.krishna.potthuri@amd.com>; Linus Walleij <linus.walleij@linaro.org>; Simek, Michal <michal.simek@amd.com>; Rob Herring <robh+dt@kernel.org>; Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley <conor+dt@kernel.org>; Mathieu Poirier <mathieu.poirier@linaro.org>; Levinsky, Ben <ben.levinsky@amd.com>; Marek Vasut <marex@denx.de>; Roman Gushchin <roman.gushchin@linux.dev>; Arnd Bergmann <arnd@arndb.de> Cc: linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; linux-gpio@vger.kernel.org; devicetree@vger.kernel.org; saikrishna12468@gmail.com; git (AMD-Xilinx) <git@amd.com> Subject: Re: [PATCH v2 2/4] firmware: xilinx: Add version check for TRISTATE configuration On 7/24/23 3:45 AM, Sai Krishna Potthuri wrote: 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 mailto:sai.krishna.potthuri@amd.com --- drivers/firmware/xilinx/zynqmp.c | 9 +++++++++ include/linux/firmware/xlnx-zynqmp.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index f9498e7ea694..307717f24a98 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -1150,6 +1150,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; Hi Sai, If you get version 1 as response of feature_check then, it is possible to handle call as per old payload arguments? something as following: if (ret == 2) { //hanlde modified payload as per v2 of this call } else if (ret == 1) { //handle original payload of this call as firmware is old. } else { //fail here with -EOPNOTSUPP as we don't support this version. } This way we can maintain backward compatibility with old firmware. Hi Tanmay, TRISTATE feature support added in version 2.0, hence we are checking the SET PARAM version if the requested configuration is TRISTATE. If the version is 2.0 then we are allowing the call otherwise will return error. This change will not impact the other configurations and not impact the backward compatibility as we are checking the version only for the TRISTATE configuration. Regards Sai Krishna + } + return zynqmp_pm_invoke_fn(PM_PINCTRL_CONFIG_PARAM_SET, pin, param, value, 0, NULL); } diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index d7f94b42ad4c..6359eeea8dd7 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -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
diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index f9498e7ea694..307717f24a98 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -1150,6 +1150,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); } diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index d7f94b42ad4c..6359eeea8dd7 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -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