From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Walleij Subject: Re: [PATCH v7 3/3] gpio: pca953x: fix address calculation for pcal6524 Date: Wed, 23 May 2018 13:48:38 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: "H. Nikolaus Schaller" Cc: Kumar Gala , Andy Shevchenko , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Alexandre Courbot , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "open list:GPIO SUBSYSTEM" , "linux-kernel@vger.kernel.org" , Discussions about the Letux Kernel , kernel@pyra-handheld.com List-Id: devicetree@vger.kernel.org On Thu, May 17, 2018 at 6:59 AM, H. Nikolaus Schaller wrote: > The register constants are so far defined in a way that they fit > for the pcal9555a when shifted by the number of banks, i.e. are > multiplied by 2 in the accessor function. > > Now, the pcal6524 has 3 banks which means the relative offset > is multiplied by 4 for the standard registers. > > Simply applying the bit shift to the extended registers gives > a wrong result, since the base offset is already included in > the offset. > > Therefore, we have to add code to the 24 bit accessor functions > that adjusts the register number for these exended registers. > > The formula finally used was developed and proposed by > Andy Shevchenko . > > Suggested-by: Andy Shevchenko > Signed-off-by: H. Nikolaus Schaller Patch applied. Yours, Linus Walleij