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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73823C19F2A for ; Wed, 3 Aug 2022 17:11:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235697AbiHCRLV (ORCPT ); Wed, 3 Aug 2022 13:11:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237411AbiHCRLR (ORCPT ); Wed, 3 Aug 2022 13:11:17 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C81C61ADB3; Wed, 3 Aug 2022 10:11:16 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id dc19so9883537ejb.12; Wed, 03 Aug 2022 10:11:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=8oQ+hf3D0+Iz/d+O+xc/TfT4v6mJXLjzNBvcBlenzqY=; b=ov6hOt/BSeqHJycDTI4xQ8tHEssAK4e6pv8KL2MGFYp5an1I+hA2JKmORXNMnc/BC0 JLzyM8gGPgfC0f/MbA19BRta3K0YAMCcNkhAuj1W1f1wBbhgRqbsVg/kzQvg1YyqK49K CnQKlSx/EYBXxsTJUbBnRhmHKQruwbpNZCcPSfHJpD7fw3czkgyD0E0mHiKFlijV7F7s 8a+IVQcSRjjkiI9aPMrKiUSZPk3jQEBZOFN4quS8DPu1Q3X25Lf2rlYUl6dZ6bxfx8SX WcLv4WSddaqNFmrF39M5hln8GcLMf74Xv44vmCRoFzSM/KyBDJDIH2dyopAYijD6iiGM kOtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=8oQ+hf3D0+Iz/d+O+xc/TfT4v6mJXLjzNBvcBlenzqY=; b=4PO8SVjxlTLp3ow2MnFF1bd8Cg/39HFoF7/L1m5gWYf1PZzwK3AAiyGWLXKMoWFlg7 fLx6EokIGcyZdlPqAeorPVlLvOHhDrN9UaAd9dtBYk+/zos2SVWnKhM8AMaS1QSB9bqi Apzn8+7x/x34z7vwkf4PX52TaGRLON0Uv3om954eSVWXShj2cavGL4sLtg7vyT6XFSRg /ykkfJzSN0Nb06A/1G/yLT1BaZjtH0y1yQ6VFhNNjPA0dX/VAGyibEOhi2tIEf+uMlBt hKMpd+nq92ZPlFHrG0cXyV9EMLLWR/rRRBIAH5uUW2qfrZBd1Gl0gWbqIB7VQRMnqVxo eCDQ== X-Gm-Message-State: AJIora9yfro7XgEuQ+7blDT8xUD/4Da/ImI2C0ulUjI70S2MxI923kgD Am/qasr2upLt/n+rSielhbUc8NfYuDXZzHE6ldw= X-Google-Smtp-Source: AGRyM1tTTR3G9549yX73eQmQTpxd1p9fgq0l/oy3EMq/u9/1sLQ+bNeKFbPKdFBm+Otw2j6/Zefjxq05v3uZxvWohXs= X-Received: by 2002:a17:906:7950:b0:72f:d4a4:564d with SMTP id l16-20020a170906795000b0072fd4a4564dmr20739399ejo.479.1659546675350; Wed, 03 Aug 2022 10:11:15 -0700 (PDT) MIME-Version: 1.0 References: <20220803054728.1541104-1-colin.foster@in-advantage.com> <20220803054728.1541104-10-colin.foster@in-advantage.com> In-Reply-To: From: Andy Shevchenko Date: Wed, 3 Aug 2022 19:10:38 +0200 Message-ID: Subject: Re: [PATCH v15 mfd 9/9] mfd: ocelot: add support for the vsc7512 chip via spi To: Colin Foster Cc: linux-arm Mailing List , "open list:GPIO SUBSYSTEM" , netdev , Linux Kernel Mailing List , devicetree , Terry Bowman , Vladimir Oltean , Wolfram Sang , Microchip Linux Driver Support , Steen Hegelund , Lars Povlsen , Linus Walleij , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Russell King , Heiner Kallweit , Andrew Lunn , Krzysztof Kozlowski , Rob Herring , Lee Jones , katie.morris@in-advantage.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 3, 2022 at 5:56 PM Colin Foster wrote: > On Wed, Aug 03, 2022 at 01:45:04PM +0200, Andy Shevchenko wrote: > > On Wed, Aug 3, 2022 at 7:48 AM Colin Foster > > wrote: ... > > > + regmap_config.max_register = res->end - res->start; > > > > Hmm... First of all, resource_size() is for that (with - 1 to the > > result). But don't you need to use stride in the calculations? > > DEFINE_RES_NAMED populates the resource .end with (_start) + (_size) - 1 > so I don't think resource_size is correct to use here. Have you read what I put in parentheses? Basically it becomes very well the same as a result, but in a cleaner manner (you calculate resource size - 1 which will be exactly the last byte offset of the register file), no? > reg_stride gets handled at the top of regmap_read(), so I don't think > that's really needed either. Okay. > For reference: > > #define VSC7512_DEVCPU_ORG_RES_START 0x71000000 > #define VSC7512_DEVCPU_ORG_RES_SIZE 0x38 Right, for 0x38 you supply 0x37, which is exactly resource_size() - 1. > # cat range > 0-34 -- With Best Regards, Andy Shevchenko