From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965189AbcJZNyK (ORCPT ); Wed, 26 Oct 2016 09:54:10 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:37491 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754332AbcJZNyI (ORCPT ); Wed, 26 Oct 2016 09:54:08 -0400 Date: Wed, 26 Oct 2016 14:56:31 +0100 From: Lee Jones To: Milo Kim Cc: bcousson@baylibre.com, Tony Lindgren , linux-omap@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 7/7] mfd: tps65217: Fix mismatched interrupt number Message-ID: <20161026135631.GC13127@dell> References: <20161021140106.21531-1-woogyom.kim@gmail.com> <20161021140106.21531-8-woogyom.kim@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20161021140106.21531-8-woogyom.kim@gmail.com> User-Agent: Mutt/1.6.2 (2016-07-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 21 Oct 2016, Milo Kim wrote: > Enum value of 'tps65217_irq_type' is not matched with DT parsed hwirq > number[*]. > > The MFD driver gets the IRQ data by referencing hwirq, but the value is > different. So, irq_to_tps65217_irq() returns mismatched IRQ data. > Eventually, the power button driver enables not PB but USB interrupt > when it is probed. > > According to the TPS65217 register map[**], USB interrupt is the LSB. > This patch synchronizes TPS65217 IRQ index. > > [*] include/dt-bindings/mfd/tps65217.h > [**] http://www.ti.com/lit/ds/symlink/tps65217.pdf > > Signed-off-by: Milo Kim > --- > include/linux/mfd/tps65217.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h > index 4ccda89..75a3a5f 100644 > --- a/include/linux/mfd/tps65217.h > +++ b/include/linux/mfd/tps65217.h > @@ -235,9 +235,9 @@ struct tps65217_bl_pdata { > }; > > enum tps65217_irq_type { > - TPS65217_IRQ_PB, > - TPS65217_IRQ_AC, > TPS65217_IRQ_USB, > + TPS65217_IRQ_AC, > + TPS65217_IRQ_PB, > TPS65217_NUM_IRQ > }; This is why using enum for these types of assignments is sometimes dangerous. It's probably best to be explicit. -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Jones Subject: Re: [PATCH 7/7] mfd: tps65217: Fix mismatched interrupt number Date: Wed, 26 Oct 2016 14:56:31 +0100 Message-ID: <20161026135631.GC13127@dell> References: <20161021140106.21531-1-woogyom.kim@gmail.com> <20161021140106.21531-8-woogyom.kim@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Content-Disposition: inline In-Reply-To: <20161021140106.21531-8-woogyom.kim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Milo Kim Cc: bcousson-rdvid1DuHRBWk0Htik3J/w@public.gmane.org, Tony Lindgren , linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: devicetree@vger.kernel.org On Fri, 21 Oct 2016, Milo Kim wrote: > Enum value of 'tps65217_irq_type' is not matched with DT parsed hwirq > number[*]. > > The MFD driver gets the IRQ data by referencing hwirq, but the value is > different. So, irq_to_tps65217_irq() returns mismatched IRQ data. > Eventually, the power button driver enables not PB but USB interrupt > when it is probed. > > According to the TPS65217 register map[**], USB interrupt is the LSB. > This patch synchronizes TPS65217 IRQ index. > > [*] include/dt-bindings/mfd/tps65217.h > [**] http://www.ti.com/lit/ds/symlink/tps65217.pdf > > Signed-off-by: Milo Kim > --- > include/linux/mfd/tps65217.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h > index 4ccda89..75a3a5f 100644 > --- a/include/linux/mfd/tps65217.h > +++ b/include/linux/mfd/tps65217.h > @@ -235,9 +235,9 @@ struct tps65217_bl_pdata { > }; > > enum tps65217_irq_type { > - TPS65217_IRQ_PB, > - TPS65217_IRQ_AC, > TPS65217_IRQ_USB, > + TPS65217_IRQ_AC, > + TPS65217_IRQ_PB, > TPS65217_NUM_IRQ > }; This is why using enum for these types of assignments is sometimes dangerous. It's probably best to be explicit. -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: lee.jones@linaro.org (Lee Jones) Date: Wed, 26 Oct 2016 14:56:31 +0100 Subject: [PATCH 7/7] mfd: tps65217: Fix mismatched interrupt number In-Reply-To: <20161021140106.21531-8-woogyom.kim@gmail.com> References: <20161021140106.21531-1-woogyom.kim@gmail.com> <20161021140106.21531-8-woogyom.kim@gmail.com> Message-ID: <20161026135631.GC13127@dell> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Fri, 21 Oct 2016, Milo Kim wrote: > Enum value of 'tps65217_irq_type' is not matched with DT parsed hwirq > number[*]. > > The MFD driver gets the IRQ data by referencing hwirq, but the value is > different. So, irq_to_tps65217_irq() returns mismatched IRQ data. > Eventually, the power button driver enables not PB but USB interrupt > when it is probed. > > According to the TPS65217 register map[**], USB interrupt is the LSB. > This patch synchronizes TPS65217 IRQ index. > > [*] include/dt-bindings/mfd/tps65217.h > [**] http://www.ti.com/lit/ds/symlink/tps65217.pdf > > Signed-off-by: Milo Kim > --- > include/linux/mfd/tps65217.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h > index 4ccda89..75a3a5f 100644 > --- a/include/linux/mfd/tps65217.h > +++ b/include/linux/mfd/tps65217.h > @@ -235,9 +235,9 @@ struct tps65217_bl_pdata { > }; > > enum tps65217_irq_type { > - TPS65217_IRQ_PB, > - TPS65217_IRQ_AC, > TPS65217_IRQ_USB, > + TPS65217_IRQ_AC, > + TPS65217_IRQ_PB, > TPS65217_NUM_IRQ > }; This is why using enum for these types of assignments is sometimes dangerous. It's probably best to be explicit. -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog