Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp321534imn; Wed, 3 Aug 2022 05:23:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR6NQlXHBBp7lT5fS7Oeli8wk40s+SXD8Ek70aADcL9mhpmv/yh+V4teGIXlaqZmSEY6nOeZ X-Received: by 2002:a17:90a:68ce:b0:1f4:db83:1eea with SMTP id q14-20020a17090a68ce00b001f4db831eeamr4763993pjj.55.1659529413180; Wed, 03 Aug 2022 05:23:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659529413; cv=none; d=google.com; s=arc-20160816; b=MeEappl0GRXI0nT3oX/Zegkt0mG7xodoV9LD1vSTsrhzOGjVnXsBcQZVP6zYXsNJK8 e097A+T1jlbFdoFvLhsGH2uIo8d6Yj3tdr/Dohaed+D2xLQLitYf90mAjeT5mtoBe/EN l+Qx6zie1ABD+UN8RUHpWIlvwfcwPz3mb/Ob4HM5Mtcn35We24Rtj7+vxyiWBXYlEuAC 5TXs2XFAkDpLCsoaMKEFScvbSnDGUWlpuoe1QCdYqFy1XvUfY/uv814mEr+xIsN0bfl1 M6uM6oTS5DlDH0iBANzQf06Tt9qEbgmjdMgLW+Sv7q+yemdur0M2ohUTvIZjWKOtsHH0 3i6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=MggySC/34v95u8horOX4fhvIDiILlutWGFAft8N/YGI=; b=LqWnB3iPtnngp+gFAtvKmruaDwW9MfHcLdBpsRVuqToyJKZBnDK9KG5QqOoATU7gCf oPy3M7lAHqKlkqqkEF37nLjcWjPzIbpa6UDgtirOUaciDhWG3by7CXQltRNL1jv0Hxas XrgRO1J9lTyOzLy1npSAiT6m4IInRRvTSjHy6y6l81iKz5i8Dk8c2S9TfOK5/uPb4L2H 5z0g+O8CjB7coPx9Wk6UaAII4/dIMXbE1y3SH3b92mXx1VisloytsQIa+Qh0QoK1pixa hpUq76MiFQq3Hk0HlMgLHnLuoS/Wpwfy/4iVEv7KZ9Sqk29bY1RMY36iVUTTF9qOpi/L viug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IPDZD57K; 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 b4-20020a170903228400b0016a3e914a18si2450622plh.506.2022.08.03.05.23.04; Wed, 03 Aug 2022 05:23: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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IPDZD57K; 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 S237558AbiHCLpp (ORCPT + 99 others); Wed, 3 Aug 2022 07:45:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237770AbiHCLpn (ORCPT ); Wed, 3 Aug 2022 07:45:43 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D535A6424; Wed, 3 Aug 2022 04:45:42 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id s11so9703275edd.13; Wed, 03 Aug 2022 04:45:42 -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=MggySC/34v95u8horOX4fhvIDiILlutWGFAft8N/YGI=; b=IPDZD57KsnEyGS89rvUheSefbJXYPUJtoK0CSwXMzK58XhRxzE0DTIn7+JFvINSI42 jVUqGGST4/ZH9dmw39dr18oGorZ6giy5XSFBsIQ/JdDOYwgPg+47AO9lxfreDrhgOgi/ oZZNp7Do5VMiajL2NbDBOHfgGHnajgYfcyrDDpE2jZ45WTooSZuuGwT9pa4T7tx6f9qb iCrMkpNOtQmMP4zBRJO8WZ0mENu4ggXupks4zmuysNM3ESrWA3HMMAsynmaMcb/8AuBW TIICi+nukWmR4MQNbyPlsuz5Id/S/nk2VKDtYFJC0lAz3YTfm1mSIOojI+ewch+yqkCw qZZw== 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=MggySC/34v95u8horOX4fhvIDiILlutWGFAft8N/YGI=; b=5nef6sVwte4YcmFmJ6JC8VdiMmYCEsznW6QbprG53Y2eypOPamTwBlKnr9Pb2opN4S gMYfzvpkh8mGY3SBReGTq+xU/1wK7/v8wS61f5NmfxLNTu2o3u8Vf8kiEIpWPuMQxXFd SX/PXEnu6P+Qs4QmKyTOZljTmV4vkugkTHhhQW6CEWheNKsIE+uAwbY+9p5AyIoM5CFI KqG3PWXb/PrH5YEUNCIiZuLWxmbVabEonbBGsFhb9yLyAkwIuH4bNOjgCbvo/Sb54Ldx +js96vY3MmVsWwCRviwc+JvUmthfPtUKBwfI3WXAMcdNoEeXPtJP64ocpq47dBxDJO4/ FMGg== X-Gm-Message-State: AJIora8Mo27HOfoTBh99ouOVd3GGDdUot1GfTOKALuVM9t/MMZ+xs895 7fBKXy+qfFExmiD77FCaWe97D0BFiHfp8596JDo= X-Received: by 2002:a05:6402:280b:b0:43b:5d75:fcfa with SMTP id h11-20020a056402280b00b0043b5d75fcfamr24735742ede.114.1659527141436; Wed, 03 Aug 2022 04:45:41 -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: <20220803054728.1541104-10-colin.foster@in-advantage.com> From: Andy Shevchenko Date: Wed, 3 Aug 2022 13:45:04 +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" 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 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 On Wed, Aug 3, 2022 at 7:48 AM Colin Foster wrote: > > The VSC7512 is a networking chip that contains several peripherals. Many of > these peripherals are currently supported by the VSC7513 and VSC7514 chips, > but those run on an internal CPU. The VSC7512 lacks this CPU, and must be > controlled externally. > > Utilize the existing drivers by referencing the chip as an MFD. Add support > for the two MDIO buses, the internal phys, pinctrl, and serial GPIO. ... > +#include Not sure I see the user of this header. ... > +struct regmap *ocelot_spi_init_regmap(struct device *dev, const struct resource *res) > +{ > + struct regmap_config regmap_config; > + > + memcpy(®map_config, &ocelot_spi_regmap_config, sizeof(regmap_config)); > + > + regmap_config.name = res->name; > + 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? > + regmap_config.reg_base = res->start; > + > + return devm_regmap_init(dev, &ocelot_spi_regmap_bus, dev, ®map_config); > +} -- With Best Regards, Andy Shevchenko