Received: by 10.192.165.156 with SMTP id m28csp293986imm; Tue, 10 Apr 2018 22:06:00 -0700 (PDT) X-Google-Smtp-Source: AIpwx49QjqjQXupenXAgDmMjJsCyGTObPeoS64R4fUQjeMqU8T/icdeuMcURj8wq6keDH3u7zcD3 X-Received: by 2002:a17:902:4d45:: with SMTP id o5-v6mr3552691plh.84.1523423160333; Tue, 10 Apr 2018 22:06:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523423160; cv=none; d=google.com; s=arc-20160816; b=MHftSfB+2iguANPwbF0ODSg3Vj/x/YHotbfmKXnEPUfyl4XUyyHcLnaL5ubGXel4o5 jbF6nc3mOrACXhpEVxeWbsZfsRAdOVxda1iEraPsyx4Q0eASSMPg+daYHn3DsWbPuKMb hjZukfNfwqAYe7vADqNNWiY+aG4f2hx+nsPkBicDMigl5jYI8N5Exv79C5i0enR+afKi qlEING6BVu5GguSFC3DocJwUNCGjQdSEkFv7MaeQLOmPVrISyyo8ECP2r3yeas6ohIaH gQji9lRf9GDcdZkiOT59TQZktUTHhXMl1Xou+fChGRuU/5POrfQfythS9u78NkqIv0vV zTxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature:arc-authentication-results; bh=1OhNnWFuer6YbhJlGggtHsxIWRgHFV8wg+YeqeMou2s=; b=m0OYB8jqk265/0EUHx5hawzrcY5crXLyeekv6CQfOwr731qnP6N37b6UTJrHmYa4F4 jzuy+81FYaL6ovZWtRSpCb/TC5DUKbxeA3sk4U2C7lyfo2ogRGVL5evjt6STKS/tL1cu 3xJC+LLaQ4tMiqAVZXxMAhGBThDqTTSMXKX4uwUmZstOMq7xE/7FXEbazh/YaTy9XxwD VDT6tSMUOvDISUtxmRqIX63LEagjeh6qGN+6jviyB1xMHq052LC7iSBqZLkErpekatHq kZ7NNClhF/qaTf2F8H/Dz+elaZhPZp0Gr9PjwGOtKb7WkuKEHMlQ6CdubvAJJIq1a98C EvqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@goldelico.com header.s=strato-dkim-0002 header.b=bL+mu1su; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k3si225383pgc.441.2018.04.10.22.05.22; Tue, 10 Apr 2018 22:05:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@goldelico.com header.s=strato-dkim-0002 header.b=bL+mu1su; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752167AbeDKFA0 (ORCPT + 99 others); Wed, 11 Apr 2018 01:00:26 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([81.169.146.170]:15939 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750785AbeDKFAY (ORCPT ); Wed, 11 Apr 2018 01:00:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1523422822; s=strato-dkim-0002; d=goldelico.com; h=To:References:Message-Id:Content-Transfer-Encoding:Cc:Date: In-Reply-To:From:Subject:Content-Type:X-RZG-CLASS-ID:X-RZG-AUTH:From: Subject:Sender; bh=1OhNnWFuer6YbhJlGggtHsxIWRgHFV8wg+YeqeMou2s=; b=bL+mu1suXRkqgidWx61gh0zT/hpGbdasP4WItw6x70MmLdF/RyqEAe4LDjIrsIizsS Xp41kVQ2DBtwjhqEyXtc9qf6BWAvzMFkW998L8v7G7XCmsC6JV0cLYIMDzuBOgs93Qrd SgP+G07eDeaAUzVyF9n1ifywVdYJG7vpoVBbyTGquNrNqkQLU5kps5cm+vWDR36LWs5m StB01j3zny17zVwWVpcMqbDnQ1a1L7Q0mATtv1EF8Q8LiMQS5CJP5082vx4QbdJhAKAx gdHXED+RrMYqBerOgDJkmuEWy9xj8zy2gcfMnfFgn6ww0M2fXYpYiICJC1AT5Xyj4Q1o q7Hw== X-RZG-AUTH: :JGIXVUS7cutRB/49FwqZ7WcJeFKiMgPgp8VKxflSZ1P34KBj4Qpw87WisNN2Ez2Y X-RZG-CLASS-ID: mo00 Received: from [192.168.2.107] by smtp.strato.de (RZmta 43.2 DYNA|AUTH) with ESMTPSA id i04eeeu3B50B1i0 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Wed, 11 Apr 2018 07:00:11 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH v3 2/4] gpio: pca953x: add register definitions for pcal6524 and fix address calculation From: "H. Nikolaus Schaller" In-Reply-To: Date: Wed, 11 Apr 2018 07:00:04 +0200 Cc: Kumar Gala , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Linus Walleij , Alexandre Courbot , devicetree , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , Discussions about the Letux Kernel , kernel@pyra-handheld.com Content-Transfer-Encoding: quoted-printable Message-Id: References: <0e9bea79eae7504e61fabdb4a0311f8fdc2f6b25.1523376423.git.hns@goldelico.com> To: Andy Shevchenko X-Mailer: Apple Mail (2.3124) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andy, > Am 10.04.2018 um 20:06 schrieb Andy Shevchenko = : >=20 > On Tue, Apr 10, 2018 at 7:07 PM, H. Nikolaus Schaller = wrote: >> PCAL chips ("L" seems to stand for "latched") have additional >> registers starting at address 0x40 to control the latches, >> interrupt mask, pull-up and pull down etc. >>=20 >> The constants are so far defined in a way that they fit for >> the pcal9555a when shifted by the number of banks, i.e. multiplied >> by 2. >>=20 >> Now the pcal6524 has 3 banks which means the relative offset >> must be multiplied by 4 which gives a wrong result if not done >> carefully, since the base offset is already included in the offset. >>=20 >> For the basic registers shared with all pca93xx/tca64xx chips >> there is no such offset. >>=20 >> Therefore, we add code to adjust the register number for exended >> registers to the 24 bit accessor functions. >>=20 >> And we add additional register offset constants (not yet used by >> the driver code) which are specific to the pcal6524. >>=20 >=20 > First of all, as I said, please split this to two patches. Don't mix = the things. Ok. Queued for v4. >=20 >=20 >> + /* adjust register address for pcal6524 */ >> + if (reg >=3D PCAL953X_OUT_STRENGTH) >> + reg -=3D PCAL953X_OUT_STRENGTH >> 1; >> + >=20 > Give me some days to think about it. No problem. I'll wait with v4. The only alternative I would see is to add new accessor function pointers for the extended registers and have 0x00 based offsets, but that is IMHO more ugly. BR and thanks, Nikolaus