Received: by 10.192.165.148 with SMTP id m20csp1012751imm; Wed, 25 Apr 2018 11:07:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/SAU56uCMVRkmRTBlp1/X7Wpw+Zx0/iyPuZFFnWbTQeS+T1jr5gZsQg8PocIkwBhiWnjKi X-Received: by 10.98.71.76 with SMTP id u73mr28771514pfa.4.1524679638990; Wed, 25 Apr 2018 11:07:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524679638; cv=none; d=google.com; s=arc-20160816; b=fYYF+Mbkor/01LsZSRPK+26D7xWmcUTU5b9YoUAgVI1Xg6FGAxays3uwZeXdNNjMnX LLUg3Z96JvZ9eUu4fW2oKnAATx93sJ//589b/tP8lYMrq9IuTfyZ0To2PI6hrc25dvrv 7udNbE1zUI2W/KB3OFxbJ5lhL+5mcEhRjidbV5lpP2FehqKtNVs1g0C0r61p2Hr95jH8 xd5UNOa3f8iN4FIviNcHO/t3cr4FAZUo4r7nf/Y1O70AZbkJV2WvzcreCxn44mRAirfh kOuQ5Qwm3n1Y+3NuLx82oK3nb45/mUfW6/mLHUoXf3lYbxoX7/rkCUeRy+0XruDvyhay a/7w== 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=OZqQIQdVtj5DjeDJXVuX3zJYh5+CqV1xCyP5HzwfwQQ=; b=Rn/6YEttN351B8YeCJz/wRZF8d6fb7Ut7mQAah03C400kVGR9ghGr9pLNrTId6Rr49 olJFqaVqeDD/r3ucOa7Bctqn2bChN4dBUJ37+XM7kzLcFYcMkhRV1rpVqbKsoJnkc12r mQKdATKCW0fvcgR+36ML4JKKjWfIfzRwIg2B2m1JyBKpV5qBbGODODLAGH25Z4/w15cZ jR3JlAvJHa1LfjmRH8zCWSHH7oyIcdKNn4AuGT9Ox8mHt3FEiwBg2tHgOit6shRJLtXm qBppop7umx9h/dePbETweGhJdEflJXRmXNYIoUVGslATZUaUDN06TsxFsnz2Xj8yuhHa Za8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@goldelico.com header.s=strato-dkim-0002 header.b=ePy6/dfQ; 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 x17si16018189pfm.330.2018.04.25.11.07.03; Wed, 25 Apr 2018 11:07:18 -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=ePy6/dfQ; 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 S1755712AbeDYSF5 (ORCPT + 99 others); Wed, 25 Apr 2018 14:05:57 -0400 Received: from mo4-p01-ob.smtp.rzone.de ([81.169.146.167]:21724 "EHLO mo4-p01-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751084AbeDYSFx (ORCPT ); Wed, 25 Apr 2018 14:05:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1524679549; 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=OZqQIQdVtj5DjeDJXVuX3zJYh5+CqV1xCyP5HzwfwQQ=; b=ePy6/dfQDj72arKw4tR9Cm+zYyWAUa+HnY+YPIySG+6Wi0JcizD72LGmV/1ZN/2T4c upJk+arF8N5TsmZ5wuBJeA/luLmfsBfPopdEOSh6JlgFnV4mRmGS2+59nB1+fxXkgc00 5jJ6KUXpeQucrY/cUDAwIJj2NLwccQ77aN3xinM3BKOOmIePe8dKRxdbwaDLAYIuJp7c ZgkBD37VC9TeR310YRek0IlzpPaHU4eo5F3cpXkqOfUeiFRKB0nAwQsaRPGojroVSJqN 6XMpAwkRXqXrS7m1U8J8kVXvK8GBbo8qsLkGna+CheOv9c1zr4xiY+R4YG7LhGnL8B8l HFfw== X-RZG-AUTH: :JGIXVUS7cutRB/49FwqZ7WcJeFKiMgPgp8VKxflSZ1P34KBj4Qpw87Wiv9N1EzmY X-RZG-CLASS-ID: mo00 Received: from [192.168.2.121] by smtp.strato.de (RZmta 43.5 DYNA|AUTH) with ESMTPSA id z0512cu3PI5Z0hN (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, 25 Apr 2018 20:05:35 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [Letux-kernel] [PATCH v3 2/4] gpio: pca953x: add register definitions for pcal6524 and fix address calculation From: "H. Nikolaus Schaller" In-Reply-To: Date: Wed, 25 Apr 2018 20:05:36 +0200 Cc: Mark Rutland , Alexandre Courbot , Pawel Moll , Ian Campbell , Linus Walleij , kernel@pyra-handheld.com, Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , devicetree , Rob Herring , Kumar Gala , Discussions about the Letux Kernel Content-Transfer-Encoding: quoted-printable Message-Id: <65085C47-CDA8-4F8C-8307-C145F21F7D19@goldelico.com> 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 11.04.2018 um 07:00 schrieb H. Nikolaus Schaller = : >=20 > Hi Andy, >=20 >> 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. >=20 > Ok. Queued for v4. >=20 >>=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. Any news on this? I am waiting for your advice before submitting v4 (with pending updates = for the other patches). > No problem. I'll wait with v4. >=20 > 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. >=20 > BR and thanks, > Nikolaus BR and thanks, Nikolaus