From patchwork Mon Mar 31 10:44:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 14033466 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88993C3600C for ; Mon, 31 Mar 2025 10:47:01 +0000 (UTC) Received: from OS0P286CU010.outbound.protection.outlook.com (OS0P286CU010.outbound.protection.outlook.com [40.107.74.63]) by mx.groups.io with SMTP id smtpd.web10.49079.1743418013966373336 for ; Mon, 31 Mar 2025 03:46:54 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@bp.renesas.com header.s=selector1 header.b=K4TQTXdR; spf=pass (domain: bp.renesas.com, ip: 40.107.74.63, mailfrom: tommaso.merciai.xr@bp.renesas.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vSY4l3sM47Fzn78hjoXAnoyIqnS29saIQ/oywtoHefpRvyErr+dVXYsx3XZFKwMbZ3/unZhWxbV4iGQJUw2M/8VKzIa6r+VZqkBYurN0MsfzVFmfoJWMBKcOnWhSagSbM/XpVjzqQdj6N7OdirEhdxayM91bDHFSnCuhfVNodlnKV9ffZn22kn9i2l+GBHy1AumOSBbD3A6BxdrMwpawcODd+MieOZu/4DRgoFn02W4yeWj1ItlEIl/+08KTyn1dB5Jcf+2PlqzFFPMSygF0nntHeDvslN7kf/ga0b14v0Yg/01zeXo4Zn9Hs6JhBXtwQCFUAPOUUv6ay/YaO4Y9zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=UBEFhnT3CVets8zI9wLf/TNnBdIi5ovNKxwzfsR7gLA=; b=F/TZlPtbwAGFT+rC9kfCVNHH6/P2xlWdgTIViOkP9DjnOrk1cI/8YQpJDfuZE08xs1mXw8nXfJMp9ymVbp8zY2cYUxg2Z/jgb4JZ62OtTtuatvhBI/eCUXrS0ej4OTRiVs+dCUaAfwbRgcABX00IZOW2vSiBVBiCjZ4uEUszo/RbCSd6SAX0TqkvItaRqGrtKikMB/RAh1AfM2GHP1+dfWwkNs1zjsQ2Rr6iOkvgjqOdbG4pVZpjtfJGp2APfCSoB43j8ja0l7X3gWBMoWTvcsBGD9vCLtK7slitXp/oTj/BPkQFfvGt9E3gwPEDPThdGdZ3EQPrJ/gAZEO3aRX8vA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bp.renesas.com; dmarc=pass action=none header.from=bp.renesas.com; dkim=pass header.d=bp.renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bp.renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UBEFhnT3CVets8zI9wLf/TNnBdIi5ovNKxwzfsR7gLA=; b=K4TQTXdRxok9J94wYsC//zRh1C5nqfnCXyi6rZ9xrQYqDh+eRPMROdnTXYNV7J7Kv+v8oxInFvBb6koEv9kA6NM40YyFy/jGMfWWZAedbOY82Vq2puWBZFlF9ZCDOXX26BXy0ifSImWBFb3P/zmHuDlN7ZDOHpngDvG3pWeCxiQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=bp.renesas.com; Received: from OS9PR01MB13950.jpnprd01.prod.outlook.com (2603:1096:604:35e::5) by TY7PR01MB13744.jpnprd01.prod.outlook.com (2603:1096:405:1ef::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8583.33; Mon, 31 Mar 2025 10:46:52 +0000 Received: from OS9PR01MB13950.jpnprd01.prod.outlook.com ([fe80::244d:8815:7064:a9f3]) by OS9PR01MB13950.jpnprd01.prod.outlook.com ([fe80::244d:8815:7064:a9f3%5]) with mapi id 15.20.8583.036; Mon, 31 Mar 2025 10:46:52 +0000 From: Tommaso Merciai To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek CC: Biju Das , Lad Prabhakar , tomm.merciai@gmail.com Subject: [PATCH 6.1.y-cip 27/43] pinctrl: renesas: rzg2l: Return -EINVAL if the pin doesn't support PIN_CFG_OEN Date: Mon, 31 Mar 2025 12:44:58 +0200 Message-ID: <20250331104514.79090-28-tommaso.merciai.xr@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250331104514.79090-1-tommaso.merciai.xr@bp.renesas.com> References: <20250331104514.79090-1-tommaso.merciai.xr@bp.renesas.com> X-ClientProxiedBy: FR4P281CA0148.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b8::13) To OS9PR01MB13950.jpnprd01.prod.outlook.com (2603:1096:604:35e::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS9PR01MB13950:EE_|TY7PR01MB13744:EE_ X-MS-Office365-Filtering-Correlation-Id: 5cddcc72-9fc9-44c7-7a0c-08dd70415889 X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|52116014|376014|366016|38350700014; X-Microsoft-Antispam-Message-Info: sZCwE9T1I1AFJ6uguGvgNu8ZkHnwLfbx5ZrtlKbgUw1e+FyUu9dviMD2CI0s4QyQl7gypVLJzMOQa6zSbfS2JpaXYKFuybTfUCCL0fKDOLIr/DTJwcbqq0x8pcXoFiccGn6WbubhxGHgkj8qXpM5t8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ZvuRgoDtgxdypN4nlh9fcTKiD6pPX5EHGMAfwjbrm7+sP6HqPIMuLf0LQoBWtSE6dNj2YkPuSizb+J4/rj5EBp+KkEChaw7q4YnMsDy+wQiA8Yr6FGTtoqaHP/jt1ddeVi76qDqjjovXYlSyfQzOYciSjzjOej8eatp3mruFh2TKPob5jpCJq33zgxteoPjnsDTQP++FeQ13jL55mUpEXgoKK5Zm7ZOaP1qwZM4Z2/SxCBQ4T6BYZ6FmUGPNI7l82alTpRit X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9PR01MB13950.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(52116014)(376014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0I44g4RXXRDkL1sclyImFAl56qSgQOoigW8RUwJc69YQFZkG45okYbVLaz1Fv4cwZdNx3DcYYIlncbzmRFKTHJ0B5CD31J1FrPrVoUvYDOqFzbbBqJewg/4rYagF61hu/fiF/wtU1wFbRvuq671idibmf1on+g7tp37XbfeF6UjKyT5cdEsEovG96wnt+EOnJmulCHJJugz2pQIwQ6chBzr97wLuoKjUPeduMmLMlAtjKzkvuc03g2hXgBW/msTRPN0J/pzpBxLaSCBphTuttCcghDUJREIiKv7v/ra5d+ckG3nEd5V6XIfBe61SNDELfQlJbPtz1J5cbQN9QC3+I4czkzrXLARffGjvJRIawnuk6h5ZGg9YlF6Rw7IL69mMoOmiT1d6eEftoVoXU+i0nudjI1ehS8CzUAgXjifdzDmvfizxQf/e/PQKgg8B1ssjrJzmq7YpKloepb5pqiQClSWv35Zo8QWwkYpxdNEK/wplfooAQSdyUA0rGRg3KCnOrGBRAmRdWEd7wzeLNqOCItbBzigWLoVVlotagBZ8w2OycZ3OHmFbA65yGOeU3CJpRQMkvebnerICzqLZlocaQfBed76wChpWh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c72-9fc9-44c7-7a0c-08dd70415889 X-MS-Exchange-CrossTenant-AuthSource: OS9PR01MB13950.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2025 10:46:52.0405 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ucjlLfOqSopVbY1sFLg49qSWwZMKqwcL2fUdVNbyvBv5HuEiU/VhcTyG2ykw7BPanTiEo7Am9bSqEILVO/WuVYnbIJ2CXt9dgUTDgkan4zGKgMuX+jRzxywACgLUqwm1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY7PR01MB13744 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 31 Mar 2025 10:47:01 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/18415 From: Lad Prabhakar commit d56abfed1c02814b5ee96b0ed1f989ea9d7f6cbb upstream. Update the rzg2l_pinctrl_pinconf_get() function to return -EINVAL for PIN_CONFIG_OUTPUT_ENABLE config if the pin doesn't support the PIN_CFG_OEN configuration. -EINVAL is a valid error when dumping the pin configurations. Returning -EOPNOTSUPP for a pin that does not support PIN_CFG_OEN resulted in the message 'ERROR READING CONFIG SETTING 16' being printed during dumping pinconf-pins. For consistency do similar change in rzg2l_pinctrl_pinconf_set() for PIN_CONFIG_OUTPUT_ENABLE config. Fixes: a9024a323af2 ("pinctrl: renesas: rzg2l: Clean up and refactor OEN read/write functions") Signed-off-by: Lad Prabhakar Tested-by: Claudiu Beznea Reviewed-by: Paul Barker Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/20240723164744.505233-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven Signed-off-by: Tommaso Merciai --- drivers/pinctrl/renesas/pinctrl-rzg2l.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c index ba0122b46da08..7168495da5659 100644 --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c @@ -1261,7 +1261,9 @@ static int rzg2l_pinctrl_pinconf_get(struct pinctrl_dev *pctldev, break; case PIN_CONFIG_OUTPUT_ENABLE: - if (!pctrl->data->oen_read || !(cfg & PIN_CFG_OEN)) + if (!(cfg & PIN_CFG_OEN)) + return -EINVAL; + if (!pctrl->data->oen_read) return -EOPNOTSUPP; arg = pctrl->data->oen_read(pctrl, _pin); if (!arg) @@ -1402,7 +1404,9 @@ static int rzg2l_pinctrl_pinconf_set(struct pinctrl_dev *pctldev, case PIN_CONFIG_OUTPUT_ENABLE: arg = pinconf_to_config_argument(_configs[i]); - if (!pctrl->data->oen_write || !(cfg & PIN_CFG_OEN)) + if (!(cfg & PIN_CFG_OEN)) + return -EINVAL; + if (!pctrl->data->oen_write) return -EOPNOTSUPP; ret = pctrl->data->oen_write(pctrl, _pin, !!arg); if (ret)