From patchwork Fri Mar 24 14:36:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chester Lin X-Patchwork-Id: 666746 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 28C72C6FD20 for ; Fri, 24 Mar 2023 14:37:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230366AbjCXOhG (ORCPT ); Fri, 24 Mar 2023 10:37:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230025AbjCXOhF (ORCPT ); Fri, 24 Mar 2023 10:37:05 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2055.outbound.protection.outlook.com [40.107.22.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43BCE10EB; Fri, 24 Mar 2023 07:37:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XQ1odqTm9wAiVm8jgnWSwTuwRokr+9WZCxvBxTxezJpj91gpkoQYS4mOO8kVBMxgQewI8CtTjDFEN9+ugJbuA7ryDIF/kE7IBQMSg+XNc2V50Thkf4yLQV5YMKyTfaFntk5MtKoCnE78Zvo0ZO5DcRpcdKlEsE5mCtOJ/lRYvQG6hBmNjNcwE93m9glRsoaN38nTUEH215/jmI/pIatJtuNfGZjh+NeSrpmcGmFEeDUA9wmftWi6Q6SUkHCvVzJzuj/yUxcYN7kQ+1RHMuoYq6RByHph5hjTAOTLCe35ideand76kX3A+ZlskO+uztvlRHh7whbjbgtPy28BFZricg== 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=lVsHlmmOZnH5Pscvqqk8V4t+npY30iT2/Gs3LMFbQbg=; b=Oe8MKqE1TdxcwtzZbKK2VsHKQWHZKOPzEPR2U6sHQZ95hunFDuzU+uMW9297dZYmv9tW7LZjxtxYXWo2V+XftXYbD5RcN1XlpEaqJF+cWkWuqYqAkYUxA+xG8bG0PDpRsAhLuHZbs7sEZcJwAP36rn7T5gHCjZ4VnFDPb+gbNqDkNCEor06fcOuvIlVbAUG2KYucF+i1FtWv3EPnJu0Y8TrTtZaZ97FnqG+NOc3rlFLA3/WyTUK9kDLaOFttGBClqrljgWQS94K2+g/BoBV+Wl3IUTYCprq4DiVaK5Bj6qDw+mhoT/iljWWaJ76zP5JLSQ1fREw9slZG0HZ2JTZGCA== 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=lVsHlmmOZnH5Pscvqqk8V4t+npY30iT2/Gs3LMFbQbg=; b=Ni80TAgACUJJFGEIXp94w1fT7TGwh5g+YfAPl0FhKE8Armo1sbRNpPaCaR3ZbfQEX4lOCn8UcQ9ZijM7drULp4Wzp4D9RsCDWPL9acIdNATRWdlJOrUT6lbS19raMXfZMUgWCLPWMrBla4K3MNHqJSIImv5BeqzEtC4poREG/IAGJtooWQO6RntEVBy4ILWWs99L58d5lu2cjilk9bg/Ta/fVjUH+dt7txy+hcRrCBz32U0fbBt58V4ffWViM9xzFtGReaHDAOYmwrS2lRiiwtnIzFAvpj6E6zTuDAkVjNmgQGB0ksyHg301kLfOOc3j+esv4LfrEjyWKjQmVMZiIA== 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 VE1PR04MB7454.eurprd04.prod.outlook.com (2603:10a6:800:1a8::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.38; Fri, 24 Mar 2023 14:37:01 +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.038; Fri, 24 Mar 2023 14:37:00 +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 v4 0/5] pinctrl: s32: driver improvements and generic struct use Date: Fri, 24 Mar 2023 22:36:21 +0800 Message-Id: <20230324143626.16336-1-clin@suse.com> X-Mailer: git-send-email 2.37.3 X-ClientProxiedBy: TYCPR01CA0013.jpnprd01.prod.outlook.com (2603:1096:405::25) To VI1PR0402MB3439.eurprd04.prod.outlook.com (2603:10a6:803:4::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR0402MB3439:EE_|VE1PR04MB7454:EE_ X-MS-Office365-Filtering-Correlation-Id: 8923ee34-99b9-4cc8-538b-08db2c753a5a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tkwYg5EAx4GJ9gxthv7W/1gE7z8CX+7GJjS9Z775QBtq99XSTMYlTQ91mo5bs2qZucSTQHb4WFR0NKTLwtrhdS5lA0iRL0wpaUZ1HYxpHLpFpTbY+LB+hmMLE0CIJ2CuA8l4Ra5LWtkHYCSGFmTyPWvssf4NgIPBOmDy5GIgjZumM8Vl/776rK/8L6gaF6RQl6bSUB8TQY2R8Kios/e8geux1Bx3SDKxNKgiro8/Z+E+QXtjYcXryGuX2Z2ukJGnDwAo+ieCELPW5kKyJIkSs9FrF29ZzPGbbjPPlMg+4SZU4ni3otBrdw85xxyHJ1lbCcoyg7xpEt1Obk6n3R6IdBnN1geHWymXFSmil4YlU+fGtrX68008eEHSTTrNN6kb8RJodgtr3tkZfTq9ypLOrugpgQorMW8nmKAqMN8374aepto3HuBBB//XgxvATkUPnKJpI7b0Wrv2rwtW48ifR0afaNvaEw7I2xflL/md9213PP4AvLK/18e4Ye/0rwIwiH5TCfUA+E7uG8USRysFIlClCp6Gm9BJNeY0q/kf9wkRkwJs0U6Bnlkg77SlxIbGZ+rhOait2oqEccmdQ67stmje/0j0ZLurMPKZ5OZXNIZMJHJ1+jUYYiT479W1bBtyy6+/zYXb5JbuV8rVSQqUnFQgJn/pJ9+3T+DEuACwCE5XGDRWa59B+W8M16BUDJmUasZvIM41BNfIKw9Qh3CfOMBhZlyTuOjWSJ+pDGCSOzk= 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:(13230025)(346002)(396003)(366004)(136003)(376002)(39850400004)(451199018)(8936002)(66946007)(66476007)(66556008)(41300700001)(4326008)(86362001)(8676002)(36756003)(38100700002)(6506007)(1076003)(6512007)(6666004)(26005)(83380400001)(186003)(2616005)(107886003)(316002)(6486002)(54906003)(110136005)(478600001)(966005)(5660300002)(7416002)(2906002)(41533002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: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01ZfxGeS1OlfQ6GV7q3rwdALNWx511tam9mpd12LLxqg8FRP6EhOawaKMLTNbQGv0OX6/vKhQBsj4l9fHRmHAa58H4htoJoFk82HF2NKIqgcvZeBW/GKpyqgxQcIHeceSCw7q0o6h+XJ3x0bZpV3BTSOdxg0bJxdOSJKZ2FK0wFgoGxu1iJt8nGzYgNM7LNLRVdeMASZV9xF2ZvcdqLQz4ZOqN0WrFeplhVsrvwZE9SyxqPn9yrxP9b1CNF54qVMgCC/pd8OW1WCA0qt0jjbsYDCFM5VErujZ0LNvJ9UTpHNVy5kEKHCpX9hTygsIvpX2lagT0AhmH6UgtsH/b7guN76WodAlIAL/TUM0KXMp8nJ1Dn2QFbkdu1eIVtYswM7rbVfN1V5bDd/L0wTmLd5PvHWLZl3LaJa5eQ4JhABmocDQrzEIx83pJ2k251TuG29/Z+5utC6IaCoqclVDHaKf0uLuh1zKYw140xdgZD7xlVKg+3oFk= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8923ee34-99b9-4cc8-538b-08db2c753a5a X-MS-Exchange-CrossTenant-AuthSource: VI1PR0402MB3439.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2023 14:37:00.6725 (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: FgqlkK4GL8XgUiILzgfizpzHJaZML/RAA/vHC+djtBZ0BhXwyhzyvr7DT5bOdZ2x X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7454 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 v4: - 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(-) Reviewed-by: Andy Shevchenko