From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754727AbdC2IFg (ORCPT ); Wed, 29 Mar 2017 04:05:36 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:35198 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754440AbdC2IE2 (ORCPT ); Wed, 29 Mar 2017 04:04:28 -0400 Date: Wed, 29 Mar 2017 09:04:23 +0100 From: Lee Jones To: Sebastian Reichel Cc: Tony Lindgren , Dmitry Torokhov , Rob Herring , Mark Rutland , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv4] mfd: cpcap: implement irq sense helper Message-ID: <20170329080423.ijbl4seczla2s4nm@dell> References: <20170323142337.4c4d6lnhqtugbb2r@dell> <20170324084240.23251-1-sre@kernel.org> <20170328102716.gz7agm7kx3gz56jt@dell> <20170328145415.td4xeqxedem5yjen@earth> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170328145415.td4xeqxedem5yjen@earth> User-Agent: Mutt/1.6.2-neo (2016-08-21) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 28 Mar 2017, Sebastian Reichel wrote: > Hi Lee, > > On Tue, Mar 28, 2017 at 11:27:16AM +0100, Lee Jones wrote: > > > +int cpcap_sense_virq(struct regmap *regmap, int virq) > > > +{ > > > + struct regmap_irq_chip_data *d = irq_get_chip_data(virq); > > > + int base = regmap_irq_chip_get_base(d); > > > > What base is this? > > This function takes an Linux irq number. That number is a virtual > irq number, which has nothing to do with the hardware. For example > a platform could look like this: > > linux irq device base device irq > --------------------------------------------- > 0-63 SoC 0 0-63 > 64-127 SoC-GPIO 64 0-63 > 128-191 CPCAP 128 0-63 > > For the above example the function would map 128-191 to 0-63 as > used by the device. In which case may I suggest that you rename the variable, since 'base' is commonly used in the kernel to mean base of a particular IP's memory block. > > Could it be used to avoid some calculations in cpcap_sense_irq()? > > No. > > > > + return cpcap_sense_irq(regmap, virq - base); > > > +} > > > +EXPORT_SYMBOL_GPL(cpcap_sense_virq); > > -- Sebastian -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog