Received: by 2002:ac0:c50a:0:0:0:0:0 with SMTP id y10csp1249884imi; Fri, 1 Jul 2022 06:13:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vkKZUnU1er20oLyk5MwbzzC3JqAp6Hiy5a4W3R92uyHiJm358W+YUg5zvkabCX19WYR1xh X-Received: by 2002:a05:6402:3220:b0:435:8b50:e995 with SMTP id g32-20020a056402322000b004358b50e995mr19178698eda.293.1656681213921; Fri, 01 Jul 2022 06:13:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656681213; cv=none; d=google.com; s=arc-20160816; b=rYW2mvfmsIEmsBpqfYXydnNgSZ+nYb7jS+3hPCAcwi7IVxsXoKdTtnUcKHWoNTO4D4 BtikxiC2cPdRx7EQ2w4vKBaSez4I3936Vezrro14pkHtyub7ShWVbQuL5xRmnGN97hEU BY3KvcbqbOa5LcpVXzOgzXyfPqU/gDZJcre74YK03TZ4NW+pAe0GxzmP+iPS+2Tqgk1o 3w/zWzpu5l72FfyZSTqr4WepKeqypMCZJq7LgCkGHr66YEDRzvtODqeSjtYu+qSkP7Wc HBMgJ/68cE00TOwT3KEohEkx30hzpeSMq1zE1wI9HtEFHGopw7FuxpgzBoAMZjFcH7u0 dh9Q== ARC-Message-Signature: i=1; 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; bh=oPsIu/62osPOrkMnRd8uZX1hklfm69NUSiALm+5Vubs=; b=wmO30zuslcgwG53UrfpPdnvE5upUmgOn8ZdFxAvTyz3FI6+4bzVGZEkvQNYGW7bSM9 KYkgiFQNyyhukazVdppZovcPBXzBbA0qnvUinkzi/R+zqVneaoPs8X1LfCWL4dNzh8L5 +akTKsd9fHxJ8NFn1tv3dVGQo8ntuxrx/j2/ExjTyvZCNaWefchGqXZq66t3/wxTDSr9 7/HNabWCcOWCqz8xfUQIx2b4BTNvHWyhcJALPKydAuwXKoYIlgtCU/nLo9/nhHtAwBz0 ItcgKjLv8vWHi+OZijHI6GAysTdmphZBmYM7LZ9pEXz4IiMuBQQh5cN7F6kl8tBFir06 oWKQ== ARC-Authentication-Results: i=1; mx.google.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=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bx21-20020a0564020b5500b0043580fc2e3dsi24732203edb.472.2022.07.01.06.13.08; Fri, 01 Jul 2022 06:13:33 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237010AbiGANH6 (ORCPT + 99 others); Fri, 1 Jul 2022 09:07:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234234AbiGANH5 (ORCPT ); Fri, 1 Jul 2022 09:07:57 -0400 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBCAF5073D; Fri, 1 Jul 2022 06:07:52 -0700 (PDT) Received: from p508fd39e.dip0.t-ipconnect.de ([80.143.211.158] helo=phil.localnet) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1o7GN7-0001bD-JW; Fri, 01 Jul 2022 15:07:45 +0200 From: Heiko Stuebner To: Chen-Yu Tsai , Jernej Skrabec , Linus Walleij , linux-arm-kernel@lists.infradead.org Cc: Samuel Holland , Krzysztof Kozlowski , Maxime Ripard , Ondrej Jirman , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, Samuel Holland Subject: Re: [PATCH 4/6] pinctrl: sunxi: Refactor register/offset calculation Date: Fri, 01 Jul 2022 15:07:45 +0200 Message-ID: <20243196.sWSEgdgrri@phil> In-Reply-To: <20220626021148.56740-5-samuel@sholland.org> References: <20220626021148.56740-1-samuel@sholland.org> <20220626021148.56740-5-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS, T_SCC_BODY_TEXT_LINE,T_SPF_HELO_TEMPERROR autolearn=ham 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: X-Mailing-List: linux-kernel@vger.kernel.org Am Sonntag, 26. Juni 2022, 04:11:45 CEST schrieb Samuel Holland: > Starting with the D1/D1s/T113 SoC, Allwinner changed the layout of the > pinctrl registers. This new layout widens the drive level field, which > affects the pull register offset and the overall bank size. > > As a first step to support this, combine the register and offset > calculation functions, and refactor the math to depend on one constant > for field widths instead of three. This minimizes the code size impact > of making some of the factors dynamic. > > While rewriting these functions, move them to the implementation file, > since that is the only file where they are used. And make the comment > more generic, without mentioning specific offsets/sizes. > > The callers are updated to expect a shifted mask, and to use consistent > terminology (reg/shift/mask/val). > > Signed-off-by: Samuel Holland On a D1-Nezha Tested-by: Heiko Stuebner Change also looks good Reviewed-by: Heiko Stuebner