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 5525AC6FD1D for ; Tue, 21 Mar 2023 05:03:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229949AbjCUFD3 (ORCPT ); Tue, 21 Mar 2023 01:03:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230135AbjCUFCz (ORCPT ); Tue, 21 Mar 2023 01:02:55 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on20600.outbound.protection.outlook.com [IPv6:2a01:111:f400:7d00::600]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51A1936473; Mon, 20 Mar 2023 22:02:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NuNujZizJFpi4Ed2mN06es6UqO+2m+ZR+r7cViXkrRyFSiJgQoV9BUU8Qk/nZz3s9V/ytTUufEKiXOI+0yTvHzI18pseE17BvqTbRnOIseruxmlWWe0rgMP8qsTr1+Lce3O9tVYIwkTnhwBQhHPLK4kS9b0ck4mWIPb/tXepFmZPAZVCZ1FM0ARxJYO3xVJq5yBpeJdUI/x2Spiw+vOpSm5F2w+scIzwewplDOLoD5s0ulzFa3NU6tfuY71D8m0Jl6e9VUMNkCl7EdLOE1dgHdz+m7fmVIuVjx+DGGE7cCRdAYCVCbefZmmtqqgfyXrxdc03T6VV0rYQUcjNRTv0IQ== 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=k0WcVAtnh6FN/Wl65r684DFwhHpzUCGGhsQMZWaHszg=; b=f1SvrQhyaA5rb0KHBcD75mNVV7hVCAnd9xHYi0KmrWrnG+y59a5bm5wtuLnBRJ9I7qywClrFmoTHw+PNAzgQQU1mleX7ZeD6hdwDN6wOBUtTunHbJC7Dy2SfbRE8haGiZGJ7xG9vktbCLVNmLpw8HJosZcZIRJoNThLZK2zMhXvbTUva6v/UuxgZpymvnnzUVA2ucZEP+hBGEj133diqfIhG7G1TIMFvS0MlWr/u3Re11Du2A2TeZOmQongcbdzu6hzO3yAxR7j9qFGHi/scGuNmSEqNko6HK8A+EAU+7oeAoRkAjvMb4IiY2Fd1hVREaUaSiZ4EFr4IFvML0Ug5fQ== 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=k0WcVAtnh6FN/Wl65r684DFwhHpzUCGGhsQMZWaHszg=; b=M9LSxn7VNNALsZRSUKtrWtiq+BcuNBcRiCOJ2M7BMworHHB/hPrfeQDjulyuRj4oObBnQo27TZmQ3zh32kX+nZq7gN/N7iARlGYA25KovVaRMlockGJu4Q5tUfiacV+1rXatrEVg23oPagJRVH/9VCFH10bKnhQFxGgUSgEaHqsA57l6xOS25UMF/jSJTmR1P44ZAv4VUf7lAbMMMctvkHsgKUmIzBn89kYjp2tp3RdzCzkxkoY3CqhgUzz26bk/afR8JGErmR2jL22V7SeNK9FFuwFXcA9syDxNZEV+cD0HI66YlnY83gyWPgp20joA+LB/zkngZ/m6+7UhFrC3Ew== 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 DUZPR04MB10013.eurprd04.prod.outlook.com (2603:10a6:10:4d8::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Tue, 21 Mar 2023 05:01:33 +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.037; Tue, 21 Mar 2023 05:01:32 +0000 Date: Tue, 21 Mar 2023 13:01:15 +0800 From: Chester Lin To: Andy Shevchenko Cc: Linus Walleij , 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 , Andreas =?iso-8859-1?Q?F=E4rber?= , Matthias Brugger Subject: Re: [PATCH v2 3/4] pinctrl: s32cc: refactor pin config parsing Message-ID: References: <20230320163823.886-1-clin@suse.com> <20230320163823.886-4-clin@suse.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: TYCPR01CA0177.jpnprd01.prod.outlook.com (2603:1096:400:2b2::16) To VI1PR0402MB3439.eurprd04.prod.outlook.com (2603:10a6:803:4::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR0402MB3439:EE_|DUZPR04MB10013:EE_ X-MS-Office365-Filtering-Correlation-Id: e6b4a162-d957-4911-50bd-08db29c956bc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gixqHaDNe7iGF+Nyoouaqlk1BP4MD0owyl9fzXSw2YHNx0AT2ZJMIz/uAZT38mBvoe4WFUrMM8upZY+Zl/xKmkqPjwwTLeijUcYG7Ks7XKj76eS7D54Iou44EnZGupIuJOrdH2Gee9j3T5zuaybtZELMlsWzc/AVh4JVuYGjOZbA3fR5hc8jCYVPWQdV+UJz1mVBFnU00KSjB1heM9GB6dkvcSCUhXYVW9QE4EAPeHYYiH/qSHM2nh9pL/tBVnRuKRSTl/zTDY4vwey/3rFjvjgM9jwV/wvjbV5j5xFotSDXCZShGrxWxNXVLTqnO4OyP9Jj7YlH5xwazZBTcubL1yaHpryHxFnoOr5dR1M8jBAZZCCbzXMuq1OB8lxpucKCyegPhyaQLpzWxIvTf/FSdJ933/g8BH7fkNWCEDAF7Sg5hkp993Q3qtovDSQ2rfgOVmENO9kYSzm2Sf5e72RmZP9vGOquS+nyjzYi1QEQRpIqxX2sMxfJ9xtU2FiIcCb6LBrNahxLyMGWDJqAn5askW5OfoDyqAJTAXZgkLgY9aRo+YIefI9ZZlTtkBaOaR7WQT9wJu68Vq9H2F9Xx1YX2imHE6S0vgQ2K6Y2Dw6mYsJ1WO4gNWKDFQcc5nLqDYliiF0SNlP6Ugigt2cHJYTbwQ== 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)(7916004)(136003)(366004)(376002)(346002)(39860400002)(396003)(451199018)(33716001)(107886003)(478600001)(83380400001)(316002)(6486002)(6512007)(54906003)(186003)(6666004)(53546011)(26005)(7416002)(6506007)(9686003)(8936002)(38100700002)(86362001)(2906002)(66946007)(5660300002)(6916009)(66556008)(66476007)(4326008)(41300700001)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?V1ZwbXVOUm8xc1IrNENGUjhWS2RnNTVuZUhVdldJbjB6WllTZGQ4a0JUNWsv?= =?utf-8?B?YzJnaXhWRkJlZWp5VThXMVdhMWtzQzlkNFd2N2F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SFpuMEpxai8wQ3FDN3pkZG1DK3hoSVJGN2IweFUzazZqaW1PTzNLcHZr?= =?utf-8?B?V2M5dDhSLytUeHh6ZDdlL0k2aTdPazFYTXNIVTZmcHlXSUdJdWdXMUlFaXIr?= =?utf-8?B?Y3k1MVpFU1FHQXFWS29IUzlDdzdDWWVOblU3RC9xemNLWmY3ZDFmaGErcWt5?= =?utf-8?B?ZDZoZ3NtM21STnlqNmtiV0d1MzFaQUtDQm52YkE0N3l6YWI3NitidGo4WU1V?= =?utf-8?Q?iMzA=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: e6b4a162-d957-4911-50bd-08db29c956bc X-MS-Exchange-CrossTenant-AuthSource: VI1PR0402MB3439.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2023 05:01:32.5591 (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: Q4cW9C3qIUe+I8U0QBM6Rh/1bAUvUFvNFhYVMb9pT1cMR+wZJQpRHM70pR8Q3jGY X-MS-Exchange-Transport-CrossTenantHeadersStamped: DUZPR04MB10013 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 20, 2023 at 07:06:53PM +0200, Andy Shevchenko wrote: > On Mon, Mar 20, 2023 at 6:39 PM Chester Lin wrote: > > > > Move common codes into smaller inline functions and remove some argument > > handlings that are not actually used by either S32 MSCR register or generic > > config params. > > ... > > > case PIN_CONFIG_OUTPUT_ENABLE: > > - if (arg) > > - *config |= S32_MSCR_OBE; > > - else > > - *config &= ~S32_MSCR_OBE; > > + *config |= S32_MSCR_OBE; > > *mask |= S32_MSCR_OBE; > > break; > > case PIN_CONFIG_INPUT_ENABLE: > > - if (arg) > > - *config |= S32_MSCR_IBE; > > - else > > - *config &= ~S32_MSCR_IBE; > > + *config |= S32_MSCR_IBE; > > *mask |= S32_MSCR_IBE; > > break; > > Isn't it a regression here? > Otherwise needs an explicit explanation in the commit message on > what's going on here and why it's not a regression. Oops, it's wrong implementation. The argument checks of OUTPUT_EN and INPUT_EN shouldn't be dropped. Thanks for the reminder and I will fix it. Regards, Chester > > ... > > > case PIN_CONFIG_BIAS_DISABLE: > > - *config &= ~(S32_MSCR_PUS | S32_MSCR_PUE); > > - *mask |= S32_MSCR_PUS | S32_MSCR_PUE; > > + s32_pin_set_pull(param, mask, config); > > break; > > This now can be unified with PU and PD cases above. > > -- > With Best Regards, > Andy Shevchenko