Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp1082287pxa; Fri, 28 Aug 2020 03:12:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4CluTIvRvlOKLGAJWfuKmxhwUrBSu1c5gdEy/66xK2ASsgLFNvzrAWG8H4InHAMsngz+p X-Received: by 2002:a17:907:20ae:: with SMTP id pw14mr981745ejb.153.1598609578781; Fri, 28 Aug 2020 03:12:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598609578; cv=none; d=google.com; s=arc-20160816; b=pI3qM+7ofFTeh0zznockywJS2NDC7R2zyEZRvaYTM8nB/f3uA7zP0zEJ0ruJwu3uUD 2q3hkb6xBJ5K/9Cq5LnMgA7w2LjpanqSurYLZe/hKLc3C/17HJJXk8dktOlta0mKJnFt aiSuRcFdW+72WGPVPRuWhhK4XJ2IMDYv5X8oOI6m1Bib6oVe5Gpknu35XeEFJgHWC827 JuXibeH8TngsGH7ZggwyxmLGPb4VfVFUERrv0h4NNGHm+xVjLeCvJAuyuYb5GeHKovyt +OYipyT1v4cQsZ7RmfbuEjA1n4+9hzOOu2zgVegSBtK5t0VnwgCTbgvMBORxMn7mpgQ0 /ESQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ZHzBTEqiDK4axPBETGabpIdpXz6s1djywLVqOpLrIug=; b=S5xBQ3Fd9feE45av1/2+YvW/6BYVg+fIKY4bGHqTGA2MyrQH7fM0CQ6SyluheaYSlj 3pPU6t7fa4O9bbZ2bcy+KF/LPmeaIGkAf0TsYDBqsnOq+4RKjHdd6224sZ7WCzAcGaKJ IfkOz6gTGt75/EDi3vVfJDvNPjP6bY84YDqRfRTutSLLDn/bHscwzoRk6HfWwDsZ0E9N n2IkqRXMsAPJGlV6HhdnhzSpJpo/7NgpuQKceBd3q/+gC0ONe43jieCBV4Sosv/kUv5w xhAH7G3Xrxa2F038GA3Frpl/+bFEcxX83yjobRd99DwrzCTeX06nPZ03fLlm0aSJIGxp ZIaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=T9enyjml; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w26si330960ejv.328.2020.08.28.03.12.36; Fri, 28 Aug 2020 03:12:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=T9enyjml; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1729093AbgH1KJY (ORCPT + 99 others); Fri, 28 Aug 2020 06:09:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729079AbgH1KJU (ORCPT ); Fri, 28 Aug 2020 06:09:20 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB7E1C061264; Fri, 28 Aug 2020 03:09:20 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id k15so403320pfc.12; Fri, 28 Aug 2020 03:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ZHzBTEqiDK4axPBETGabpIdpXz6s1djywLVqOpLrIug=; b=T9enyjmlwfTWxjknmDmppmvnYxe4xHyWpqkIas/0XLDkgVDcR6B+5tCZiMAzy6KRaZ zu+vgGSFu88poO4Av7eyhr27kv71owDOS//MDGrL5Zob8OaRq3iJzjc3p1EiGLEk1Ta1 ISnnM/GcLf5v/csuFhteu7s82Mi5WiR6PSd1nDdoKB0vBj32qgvYJad7lTa18+xhNL1Z L1wKIPBmJa+z3i/NyWwmQuWnAUL7rL+WkmrSwBSN/hCXMnnWSl+0sSeBh33M18smlAMb N3sdKpsgOH+8K2GoVawj36iWMRlieqZdNBEYRjDbeee0qYjdXN2wjVvKmzuBJ0weWJlu NoRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ZHzBTEqiDK4axPBETGabpIdpXz6s1djywLVqOpLrIug=; b=cbMyB2ME1JtvoN3sgePr46ICgAxOCNfon5PPjB21LSs5smCfGMm50/DyiNlpahMdKC i4lptKuWWMg62wxvwZ/5Z8d16JXGSgcAOTHife5Md1gJ8SQk4y+X5NiHxSt2IucWzlbD WlAB9tFQl0cA6RYjrcpy+viLiQxgGe3sbEuHBtf8awBtX5vwa/lHByxLKaQBqkHNKW0C x7Qy4pywO7/eX8haglRsxv4IxaXac6C5gId+AT6aOtqwVVc5kgHeGP8xEdVXgCCDb1PD BBsOmK6wWzBrXeNDEvw6IIyHdfRvLTFEVKy3Q7d3lcvQU1wDf659qGPjO7TZREq1tD+4 tS4g== X-Gm-Message-State: AOAM533SFpu0O9f+MHsmdFp4xkZAN6OtpeO+BnsFt9yTBOMOfl/ctb7S noQyQfzuGyGOY/jC/zvBIDmSuIULn40n8jKVAU4= X-Received: by 2002:aa7:95b8:: with SMTP id a24mr621160pfk.219.1598609360115; Fri, 28 Aug 2020 03:09:20 -0700 (PDT) MIME-Version: 1.0 References: <20200814100357.209340-1-thomas.preston@codethink.co.uk> <20200814100357.209340-2-thomas.preston@codethink.co.uk> In-Reply-To: <20200814100357.209340-2-thomas.preston@codethink.co.uk> From: Andy Shevchenko Date: Fri, 28 Aug 2020 13:09:03 +0300 Message-ID: Subject: Re: [PATCH 1/3] pinctrl: mcp23s08: Fixup mcp23x17 regmap_config To: Thomas Preston Cc: Linus Walleij , Rob Herring , "open list:GPIO SUBSYSTEM" , devicetree , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 14, 2020 at 1:35 PM Thomas Preston wrote: > > - Fix a typo where mcp23x17 configs are referred to as mcp23x16. I'm not sure it's correct. MPC23016 is an existing I=C2=B2C IO expander. > - Fix precious range to include INTCAP{A,B}, which clear on read. > - Fix precious range to include GPIOB, which clears on read. > - Fix volatile range to include GPIOB, to fix debugfs registers > reporting different values than `gpioget gpiochip2 {0..15}`. I'm wondering if you read all the datasheets before doing these changes. MPC2308 MPC23016 MPC23017 ... > -static const struct regmap_range mcp23x16_volatile_range =3D { > +static const struct regmap_range mcp23x17_volatile_range =3D { > .range_min =3D MCP_INTF << 1, > - .range_max =3D MCP_GPIO << 1, > + .range_max =3D (MCP_GPIO << 1) + 1, This looks weird. Usually we do a mask or a bit based mask, like (1 << x) -= 1. > }; ... > +static const struct regmap_range mcp23x17_precious_range =3D { > + .range_min =3D MCP_INTCAP << 1, > + .range_max =3D (MCP_GPIO << 1) + 1, Ditto. > }; --=20 With Best Regards, Andy Shevchenko