Received: by 2002:ac0:de83:0:0:0:0:0 with SMTP id b3csp120352imk; Sat, 2 Jul 2022 13:36:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sqKNMfoPSKUGUyBRRzP9VtDArz26+k8g7d23qGbDew8bVmCpF99saAxs8YXCq4DmtaabvL X-Received: by 2002:a17:902:9f97:b0:16a:9b9:fb63 with SMTP id g23-20020a1709029f9700b0016a09b9fb63mr27250793plq.7.1656794171624; Sat, 02 Jul 2022 13:36:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656794171; cv=none; d=google.com; s=arc-20160816; b=Oz+/f/xeyDrYma4NFOH1AcWgoVDjP/KuIq/dNzy+aUfuWH6RcmMAq+at4a+LP+xuBQ zuiiQqWTIhQii80AB3hmDVfBke0n584o/W8qGuODscayMGIl65SjIfHbVVZ8aMMynUo7 CI6LS4S6ErtQLCkL4USC0gP1AAapgw9fZtm8eaNTkA7c6vFKlI0PN0BRSD/Tpo5Jy2vi pisDybhQH0YQ3pij2G38DmD1MT2XcizSCdk/+klZYUgJOtlh/YFSg+Z4zCXqL4atkh0F BUFL6WMQpLX14U1BkC6cT5Vu7f0Rlp6CZIsgJPmHPDwYKG3bBd/9hGFzbp+40Jbh9+9z p3nw== 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 :dkim-signature; bh=OV+VH3ejxTOPhJCvTbtM9lAhiNsNlXfTZrLr2VYv0q0=; b=ba90Vo0jndv8+d87juVz1F+JSbSMMSq9d7DOqXQ1ibnvlYrVqmnj1QPOQ9iOXXjX0k gzg0If490SIYn6hDJMEAfW4giJ0FaXy31kqRQ2iWq95vN7XBcuttRjJns1R7jK1Dnuew iFDUWTC+XnCjwC+DNrkfEJrYKBWWDeyNWvmR5ieH8OSphRgXQPdkIoCjG8rhNlkn4EDk 8EWQmo+6WtkwUH8d//4RhkeMzRWxUHv05k7AU0cej1S0/r4hhZRUYHQVCrkFqGMZuo9D mJEQKaZZHnI/t3iOKvvU1tvFIn2NRtQfe3bgiJPW8CzguznfZrJqXqWRNItdKJKu56ql d7Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=p6yaS1FS; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mh11-20020a17090b4acb00b001ca64c6f839si13170140pjb.15.2022.07.02.13.35.58; Sat, 02 Jul 2022 13:36:11 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=p6yaS1FS; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229959AbiGBU3k (ORCPT + 99 others); Sat, 2 Jul 2022 16:29:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbiGBU3j (ORCPT ); Sat, 2 Jul 2022 16:29:39 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C98BFBF5D; Sat, 2 Jul 2022 13:29:38 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id e40so6885426eda.2; Sat, 02 Jul 2022 13:29:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OV+VH3ejxTOPhJCvTbtM9lAhiNsNlXfTZrLr2VYv0q0=; b=p6yaS1FSKTSFFsBMibD0IXB/DFpLrMLuxJoB/xOJqUUETATFYdIeuvRIPb6scPfoYG bSBoGR+QqhIYT3TWBWtAm0QuiVPumg+J6McmYxRjmBTl1k/1U61sqpCL1fGgnaUPjf80 1YOYE4aw5YmfMDeRal07dHj0VObpCtPjQKAAkDWblzmqLGeE7myuyhoz9aMMvKljTqmF iShG3lBuPgvyrC9sC+jbLGpDnAZYc3QvtXMskZEPP/07Rx5yrT4VKILdlW0/NRj6m0Pj F6ZCY1pzkZ7VZf5UtMz/EvUIw25vP5aljBf7xdxxw1RQQhrgN6gtshZ9yimNcG13SH5a lmtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OV+VH3ejxTOPhJCvTbtM9lAhiNsNlXfTZrLr2VYv0q0=; b=BpMLl41tXDFjMqWiIMfGEmwQr/jIA6C7gATQD6HHqyOgtb/VCTy2dRRPQnq6DvDbd6 +1iB55AP8k8GACSJ7CXo1vwyjWS26c5AzLPQZ/9PMtXcWgu47KurXn4r1SFp7dT9gdco wGIxgjas6H7NWg/QpcJRw1d0QGNNOykpRaAH3lH4DOt6ZxVBHu+9GK86ZDok2Z+q1JEE aaih5F9I5OdD+a8GasAjDuuLn+uxIYSi89czZRQi710FHOFHnWGoSDRw+c8bzHu2WzT2 juxtSrGtNXuxntJNrhj3s49pU4B9h3lBYVGipf+xxhSrAWmHfZGtH3ascSjY9ExZlAah FaIw== X-Gm-Message-State: AJIora9ZHOeFllNQ+oMhJ8N9pjplWxkh2ApBeljOo0wWJyeP1lcocId5 wUsPwr/DVXuMz/IqQMZXUJE= X-Received: by 2002:a50:fd16:0:b0:435:9170:8e2c with SMTP id i22-20020a50fd16000000b0043591708e2cmr27500981eds.216.1656793777413; Sat, 02 Jul 2022 13:29:37 -0700 (PDT) Received: from jernej-laptop.localnet (89-212-118-115.static.t-2.net. [89.212.118.115]) by smtp.gmail.com with ESMTPSA id g20-20020a50d5d4000000b0042617ba63c2sm17553929edj.76.2022.07.02.13.29.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Jul 2022 13:29:36 -0700 (PDT) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: Chen-Yu Tsai , Linus Walleij , Samuel Holland 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 Subject: Re: [PATCH 4/6] pinctrl: sunxi: Refactor register/offset calculation Date: Sat, 02 Jul 2022 22:29:35 +0200 Message-ID: <2116734.Icojqenx9y@jernej-laptop> 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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Dne nedelja, 26. junij 2022 ob 04:11:45 CEST je Samuel Holland napisal(a): > 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 Nice cleanup. Reviewed-by: Jernej Skrabec Best regards, Jernej