From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 068D5C43334 for ; Sat, 2 Jul 2022 20:30:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VRoVc1ic5N1KlvED3CdLxPdHZtKzoFTSa+Tr48KR+o4=; b=eZfu4t9uCxAYfH VTw+w+XbHkSd+KSB5RHNEAQgcKKbesuQ8M41Oi1dJu/3JfaZAnM00a0HL5zjz4q/QNYWgcUFYgpwp RyH2smy68lzT3LfzWF+jy5m5uw6YkFMeH9it0VlRlSb/wkwZeeVS1he/0msA+/0y0tjhENgzZHS0Y rk1TnOAontV09tqsP6nLLzVl8OzgA3GJZyR438u1srxPcWVKTQE1qScS2nXnCmWl3CcqSPaVXmBnJ RgzOOvmUR1f1LIhLpPkuCSJnhbL9KaZer40stSWT4s838D18BOmd19X24m3Y5qvSQC2j/diwAgGKh TosZz4Z9BEC1UoyEpTBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7jkM-00BMkv-St; Sat, 02 Jul 2022 20:29:43 +0000 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7jkJ-00BMjd-63 for linux-arm-kernel@lists.infradead.org; Sat, 02 Jul 2022 20:29:40 +0000 Received: by mail-ed1-x532.google.com with SMTP id ej4so6853272edb.7 for ; 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=p7mxSfuoXadMHNjGGEWrFIBVt5CGFyz3+ioNY4+ex3obzO11a26sFYMeD43Kkh7Ake 2g9al4FTTbL+e6Ls2z9XIOc+JsatKeZlu90jq63SR5Oggy2AE8OXDF0kwGtq9XCRi0Fq 72Wjb96xvVu1wsmuzKrXsh3HMcUEHVv666IGBuc2aeqnpqSmiXeAOwvS5qraF7oc0Dmq nklI3bMXyYzHsbvTfWET4l00fL1iXzEOVdeNq1qcpTQGwDoftF1GoZ7t6c19yr2dkQnq xXQg++aeHH/Qi87H/1xzjQZg6dpihsDHMugQPCHJiVSa7hEpwH0QH4Vznjdw/qisWbMv mM6A== X-Gm-Message-State: AJIora8Q2RKyVyTQVJU2gHmwqhPHuVuk5JZhilCq7KN5XySYFcQokr/Z 8Es1r7I3hgbWdzqPnQk4enw= X-Google-Smtp-Source: AGRyM1uKvqc3mvz9z8LqDdfV/Fy8cu02zPY3BhLSn/f525LA7ITVIhC/aHi3rQLrgIafrQHlFTnG6Q== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220702_132939_275626_9B8482ED X-CRM114-Status: GOOD ( 14.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel