From patchwork Mon Mar 27 06:27:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chester Lin X-Patchwork-Id: 667672 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4F2EC76195 for ; Mon, 27 Mar 2023 06:28:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230379AbjC0G2J (ORCPT ); Mon, 27 Mar 2023 02:28:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229950AbjC0G2I (ORCPT ); Mon, 27 Mar 2023 02:28:08 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2059.outbound.protection.outlook.com [40.107.20.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 928BF199; Sun, 26 Mar 2023 23:28:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S6ySsj8Huz29P9+UcYIm31FW+3dgujHeatXgpB5pqZvq1hNjBgHfR2TU7CGQ0j/mZb4g2gVl05/YF1wPmn+jqYwqzOpKb20CwZU+NXbF28YAdU5HZ2z7hpgMelnkW+X4xQQ/9s8mRunpHagDCCypf/aM63qUxW5g+Bsgv8mdc5lOOygTYneDpM+wnmQc+nNtjRjJ2xwngXsmOCdOjCiuZVOey2qEYWIZPyYiQgMpQRXFy8zFFQmgxp0IOsLWvxwpFJwm4TW0W0EVxlGVswvDrdqgSfjfQm9qAMTogHf93PxmTnwiS/nLQrx/Rnx9tWxDYaBkgVb8Kbwv3BQ9T+BaUQ== 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=qDkdd2nHilE5C8H9srDosu1X7h4B7kQSiOChnwNBojg=; b=Z0IdaqhmExFG5nPaFSDT6y5ex2Z21fN0KTnDPiOq3h1GT5fbSpZ58IQJgYoChfubtoqJL56GRwV3zCowtZyNrsFfTeSaIeaeDH4NLmpGIhObKDTR1TyOrawC1BQ5I+9yK5AXy1cV1OueSKETsC32ife6VeRp0rfcLHCcRBp9qlWvs42Fym/87VzAseqC9vOTaPTUAZUVfn8TIfGtlpO/w1/jqyylug/b/Eg0BRs9ox0PFusFir6uoKsH7CQHXAIphx4s7PFMyAfhEmnoiEkW+ucSZ6U57XVkrxsP4pGQlxYgtm4D7VgNbIWQLP7EJoB9UhlVOK1pLzGjLRe/GE18ug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qDkdd2nHilE5C8H9srDosu1X7h4B7kQSiOChnwNBojg=; b=RfrLeJGmk28hbpNyBhBM4sGNoEHUG5yJPnS2na7CB+lUuJJragDFAJO8Xyrr74TKLehOlggtJ4JlbUS+7FNlG1vNCgNfkcBLyEY3Os3uIoRXKitQyUePE/0kNzvyfFvIFXeIwwB4Yd7GtKOQpFGWXBt+PNEWkEFjcD4oOqwp6z/eEFsZEChDNb7936M2eWNkae8VO04Nv3wGIoRe7SspVEy7ntix5bIdwdlAHBWSqyMGm2geUY8l80ws361PngqlQo66iqH+q94yoovFniAuUa9dsjc+j49z3lFwxFJuIuL9pN44afCbN8p+mzBi4OigaPJN/BveLVu2OYPo61CP9A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from VI1PR0402MB3439.eurprd04.prod.outlook.com (2603:10a6:803:4::13) by DBBPR04MB7930.eurprd04.prod.outlook.com (2603:10a6:10:1ea::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.30; Mon, 27 Mar 2023 06:28:05 +0000 Received: from VI1PR0402MB3439.eurprd04.prod.outlook.com ([fe80::6802:b2c3:5f12:8f9f]) by VI1PR0402MB3439.eurprd04.prod.outlook.com ([fe80::6802:b2c3:5f12:8f9f%2]) with mapi id 15.20.6178.041; Mon, 27 Mar 2023 06:28:05 +0000 From: Chester Lin To: Linus Walleij , Andy Shevchenko Cc: Chester Lin , NXP S32 Linux Team , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ghennadi Procopciuc , Andrei Stefanescu , Radu Pirea , =?utf-8?q?Andreas_F=C3=A4rber?= , Matthias Brugger Subject: [PATCH v5 0/5] pinctrl: s32: driver improvements and generic struct use Date: Mon, 27 Mar 2023 14:27:49 +0800 Message-Id: <20230327062754.3326-1-clin@suse.com> X-Mailer: git-send-email 2.37.3 X-ClientProxiedBy: TY2PR06CA0015.apcprd06.prod.outlook.com (2603:1096:404:42::27) To VI1PR0402MB3439.eurprd04.prod.outlook.com (2603:10a6:803:4::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR0402MB3439:EE_|DBBPR04MB7930:EE_ X-MS-Office365-Filtering-Correlation-Id: daa6379b-5f51-451c-a3ef-08db2e8c6bd0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EjEMvcGvZwI6Oc7mSOXVuGPba6KZo2NJVAc3Ne5gDuw7RHVMUblgjP2A2DfkWS6B9v7oMvBt1dMlRegnVLmF8R3qewLu9E4H/UhP4I0EEX7Rh72AyzgQ02aBWOsBiF4Bn4O0rhpWww6v+Dh3T8z4WTXF3valIqRvfNBMaA4JlZu/YFgIhtgT1z357Xobc7aeaCGMRq1cBqUvW2RJZySL5WFgArlRFkuXu1N8nnreLrjWJ3BN5loKzJ5mM919CX4Oz5w7xQFrdNAeYhzsP4Ke70+0j1+VutQhS7L0UV5rgL+QVM4nw02eUQI6tY7tKBLF+fXtj/voukz5fW2OE7AJlIHa6hflTC1fgNqVBsyeN5hVwnerS5mbUj1iT+AO1wsAsf8aQ0R/63ghgQzCfODudz9jHA6gXofbPie9PeHJVQ3DlD5bQa8u81Ln3w4m8LpBor2a49edsdgXm+9wktYFJkH9EhGLXtnRsdX9e6SRYaBRbXEBTabYTerjmduS/IqYnhT6cyvzOE/WyxWAyA69E/dKjj/4a8BV0bXdzWn7xu/9tN815m/vYszjeDavfOzpXJ+bBNmjYw61hqQejDVAJxkarL6HUXRVXl5zReAqHv6r23EGu892WGw6VeIp/ipMx7EeAThi8v+Z7KAIdpoexA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0402MB3439.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(39860400002)(376002)(396003)(346002)(366004)(136003)(451199021)(316002)(110136005)(54906003)(478600001)(5660300002)(8936002)(36756003)(86362001)(38100700002)(7416002)(2906002)(4326008)(66556008)(66476007)(8676002)(66946007)(41300700001)(107886003)(6666004)(186003)(6512007)(6506007)(1076003)(26005)(2616005)(83380400001)(6486002)(966005)(41533002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8pRDuOlWFn2ufB0FXdFuZ4vtItYVS+YfUneIcIyCWc7fDX1hvUUawViYldm9MWHtt4fCM0m0XaEycSPAzbkxeWJEfC38P6WBsUk9B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0updGjpTtfaR8RNswBKIw4utMfPW2dpVxN+pS+FKgUDB/Nh0d96839XUhOxLhGv87iKnfGjVUOUdAcNQNjhH8QHF9pYuY+pD5+efGB7gqKARz6uKBN6pEFKM0Sgh8loCuJ6IJhVgcXXlTa41xoxqMucxEXP7lpkEqj/5Smuo6TvG6OEM1hRznGtV7XtyDC7rQmwlooc6UfSUj2Fmz53mAIH2xrHJGqnodpW8ILzfTU6u+Zo5qK5fEUvfJsYyEK7HhCIAwQcrIJRRImdJZZKGrKXys5zVlO/xvR+JVA7k2mxKyeqVvdigPkI9NLyhFRC9l2prG61N38uV3lHrakQYgdFco3tnldclImIoZmtIR2vPbuzDjzfeSnA1HwRBEn6AyE0nYZTp33iqRI= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: daa6379b-5f51-451c-a3ef-08db2e8c6bd0 X-MS-Exchange-CrossTenant-AuthSource: VI1PR0402MB3439.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Mar 2023 06:28:04.5941 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vnPA7hTJHG3kbmtomgr6W7+Naw1tqbyJHo+KLnhSDr6DDvFvKTmYclx+7xHrZTaD X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7930 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Hello, This patch series contains some improvements for s32 pinctrl drivers suggested by upstream[1], such as - Fix error shadowings and improve return value handlings. - Fix print format. - Remove unnecessary blanks. - Use proper macros and helpers to simplify codes. - Refactor config param parsing and remove config arguments that are never used. - Use generic struct pingroup and struct pinfunction to describe pin data. Regards, Chester [1] https://lore.kernel.org/all/20230220023320.3499-1-clin@suse.com/ Changes in v5: - Remove unnecessary (void *) type casting found in pinctrl-s32g2. Changes in v4: - Link: https://lore.kernel.org/lkml/20230324143626.16336-1-clin@suse.com/ - Merge the of_device_get_match_data() patch [v3 1/6] into the last patch [v4 5/5, "pinctrl: s32: separate const device data ..."] in order to solve compiler warning properly. Changes in v3: - Link: https://lore.kernel.org/lkml/20230323144833.28562-1-clin@suse.com/ - Remove unnecessary type casting and correct type qualifiers. - Split the previous generic-struct patch [v2 4/4] into two separate patches. - Add a new patch [v3 6/6] to attach a real const .data with of_device_id. Changes in v2: - Link: https://lore.kernel.org/lkml/20230320163823.886-1-clin@suse.com/ - Use of_device_get_match_data() to get matched of_device_id data. - Enhance sizeof() arguments. - Fix blanks and remove unnecessary parentheses. - Drop unnecessary marcos and s32_pin_config() implemented in v1 and set/clear mask/config values transparently. - Put pull-function related cases together in s32_pin_set_pull(). - Simply use generic 'struct pinfunction' rather than having extra 'struct s32_pmx_func'. Chester Lin (5): pinctrl: s32: refine error/return/config checks and simplify driver codes pinctrl: s32cc: refactor pin config parsing pinctrl: s32cc: embed generic struct pingroup pinctrl: s32cc: Use generic struct data to describe pin function pinctrl: s32: separate const device data from struct s32_pinctrl_soc_info drivers/pinctrl/nxp/pinctrl-s32.h | 40 ++-- drivers/pinctrl/nxp/pinctrl-s32cc.c | 282 ++++++++++++++++------------ drivers/pinctrl/nxp/pinctrl-s32g2.c | 17 +- 3 files changed, 178 insertions(+), 161 deletions(-)