Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp321873imn; Wed, 3 Aug 2022 05:24:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Jj9ZIsdmQVA9ZPG8cCpEPfWZ2yI2lLZl2/FSHD+P+7QHg2gpbiCGCB0ALpmi31F75OVq4 X-Received: by 2002:a05:6a00:181f:b0:52d:87ef:f9bb with SMTP id y31-20020a056a00181f00b0052d87eff9bbmr13651789pfa.70.1659529465878; Wed, 03 Aug 2022 05:24:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659529465; cv=none; d=google.com; s=arc-20160816; b=P2JgO5emNKiXRNGfOsze3n/tAsi65uxKQDbfbYBuTTnQEXGHhp+vajEoTbBjk2sgsJ qUok/nHteywIVfhXjJ1EdUSaV/uPen54p8ynFkFmjwNd5dNOoFDshWBASOVk0CEFADvQ bqq2V+43l+acfg2KGhGzhz77mBFG/CYGLK7V0jS4xE9IbOXJU3nbHYSaOX4tyqBDGtiG KbLuwLDT8rbpevn3mWFMnbuU7v9hdIqdUPwUZPxscKtqdus6fgh+8payHqL5hSe02fvl 96uO4hi0brdqygr6y2LTT8vRkJrL5kyB9+/TwESeq/zHGDkhFO0kYB4vRDTB6y2S4kcB JD5g== 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=9eJR3E7r7PDYrwPyZgyOXsCTuvoCZ7sVt4yoqxYJPX4=; b=P5gwfTIiHYPrL41fJvjZP5t7BmaZ5dlriswxrqpEQCZMkf3Tc8OeTb9kBBcv8pJLOX fLv/mfjg6KxtHmTqG9j83eqTiHfhtjq6PqNwPjIeDkr/DPp4Ezy8Fm93k7zWFVWHaNu3 bbA7TeOqsLRnNV4xSxN3h4OYg4/9zbTRU5avnMJNu0+KQEdfGn2rUHyJs13Z/8uojDXw SaZcsC9xrqgZZFS8R+Ct40ZMyMF2MAJsPhhvTjGkhHSc0UcXN8ADTucTGlmdIfyNTpLF /2f6Wz5bnv3mpCUjBWvZ2HZ8V491c9jmWIjB1GANaVfxWc20RIaREEzPwUaaZzOr9CHW RHWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=o+b6PdvD; 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 c1-20020a170903234100b0016d854fd13dsi2459027plh.160.2022.08.03.05.24.01; Wed, 03 Aug 2022 05:24:25 -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=o+b6PdvD; 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 S237437AbiHCLdB (ORCPT + 99 others); Wed, 3 Aug 2022 07:33:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237482AbiHCLcz (ORCPT ); Wed, 3 Aug 2022 07:32:55 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 420753D595; Wed, 3 Aug 2022 04:32:54 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id dc19so8202908ejb.12; Wed, 03 Aug 2022 04:32:54 -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=9eJR3E7r7PDYrwPyZgyOXsCTuvoCZ7sVt4yoqxYJPX4=; b=o+b6PdvDZDHi+nrpABUNjbp4ZVQx6du6ZHu9GoXgPmUTTrA/+kwnw8G5mBplzCN0C7 ZIetmXEoNJfVr2FN7EwJjlYcRN6NNSEVk9xNLVbxKyAvdd4I+qf6X3CGa/KI1U0gzKpn ujQW5ZuCvqVsOz+IgiQdiIwg74oVc/j9WVb1L1B+Of/Mv+ZkthKmcULTU4gCmr3MfMKh nGFhdpSVwWZ57YnHrXpQSuoEZGoJ50GC2wKXtRhkMXYj3CTaWLN9n6DU5IuaBXfY1GCt 7PZu4AQS3JxFrqrgxJWDI4+dPT5uEQe5AYxlpcmNXzE7wKyeqTyp3SPdQrrkvy064Fai 8Q3w== 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=9eJR3E7r7PDYrwPyZgyOXsCTuvoCZ7sVt4yoqxYJPX4=; b=2yt/rSvUttWHi1zKC7Gj9KG+uFMRK1QCuRp56OXU9KA/a6t+Gtxi2R6YnPY7KXKYxf Tb1mpGQ5ss9Eminxg1TpcPP+6g0UHPPh5LtqFYggD5LDyHgPd4wousFF0D4nhh+Da5Ww IGr/G1l/ire2BoSdb8ynxmQyWFe+SmgUQI7FMVCBC/KVQvBEJhhPAh8rMB7eqvsAV9My jRNn+x10iMjBnPtVR0PlafdeQhSalAy3zF+KtAaeAiD+6F7Pi2ISAwa0g/XM/tSNmn7C ALyWjDqMR56K/r1lbAgascnqZ7IK80o98Ev7lNpL6l7UV5aTCTX0yhv72Gr6MozrIahq yoUA== X-Gm-Message-State: AJIora+HenZEtkNCUGUUcfPi5SHjfi6adDxpei16UVWRggXdNnoY/Csj 8K5JOtDhwk0+a1VtlcUGY2HSZyWMoTL70PqTpPI= X-Received: by 2002:a17:907:28d6:b0:72b:7497:76b with SMTP id en22-20020a17090728d600b0072b7497076bmr19322425ejc.365.1659526372574; Wed, 03 Aug 2022 04:32:52 -0700 (PDT) MIME-Version: 1.0 References: <20220803054728.1541104-1-colin.foster@in-advantage.com> <20220803054728.1541104-5-colin.foster@in-advantage.com> In-Reply-To: <20220803054728.1541104-5-colin.foster@in-advantage.com> From: Andy Shevchenko Date: Wed, 3 Aug 2022 13:32:15 +0200 Message-ID: Subject: Re: [PATCH v15 mfd 4/9] pinctrl: ocelot: add ability to be used in a non-mmio configuration 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:47 AM Colin Foster wrote: > > There are a few Ocelot chips that contain pinctrl logic, but can be > controlled externally. Specifically the VSC7511, 7512, 7513 and 7514. In > the externally controlled configurations these registers are not > memory-mapped. > > Add support for these non-memory-mapped configurations. FWIW, Reviewed-by: Andy Shevchenko > Signed-off-by: Colin Foster > Reviewed-by: Vladimir Oltean > Acked-by: Linus Walleij > --- > > (No changes since v14) > > v14 > * Add Reviewed and Acked tags > > --- > drivers/pinctrl/pinctrl-ocelot.c | 16 +++++----------- > 1 file changed, 5 insertions(+), 11 deletions(-) > > diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c > index d18047d2306d..80a3bba520cb 100644 > --- a/drivers/pinctrl/pinctrl-ocelot.c > +++ b/drivers/pinctrl/pinctrl-ocelot.c > @@ -10,6 +10,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -1918,7 +1919,6 @@ static int ocelot_pinctrl_probe(struct platform_device *pdev) > struct ocelot_pinctrl *info; > struct reset_control *reset; > struct regmap *pincfg; > - void __iomem *base; > int ret; > struct regmap_config regmap_config = { > .reg_bits = 32, > @@ -1938,20 +1938,14 @@ static int ocelot_pinctrl_probe(struct platform_device *pdev) > "Failed to get reset\n"); > reset_control_reset(reset); > > - base = devm_ioremap_resource(dev, > - platform_get_resource(pdev, IORESOURCE_MEM, 0)); > - if (IS_ERR(base)) > - return PTR_ERR(base); > - > info->stride = 1 + (info->desc->npins - 1) / 32; > > regmap_config.max_register = OCELOT_GPIO_SD_MAP * info->stride + 15 * 4; > > - info->map = devm_regmap_init_mmio(dev, base, ®map_config); > - if (IS_ERR(info->map)) { > - dev_err(dev, "Failed to create regmap\n"); > - return PTR_ERR(info->map); > - } > + info->map = ocelot_regmap_from_resource(pdev, 0, ®map_config); > + if (IS_ERR(info->map)) > + return dev_err_probe(dev, PTR_ERR(info->map), > + "Failed to create regmap\n"); > dev_set_drvdata(dev, info->map); > info->dev = dev; > > -- > 2.25.1 > -- With Best Regards, Andy Shevchenko