From mboxrd@z Thu Jan 1 00:00:00 1970 From: akshay.bhat@timesys.com (Akshay Bhat) Date: Mon, 22 Aug 2016 10:18:42 -0400 Subject: [PATCH] ARM: dts: imx6q-bx50v3: configure unused pca953x pins In-Reply-To: <20160815072825.hffvzlxpzlph6bk7@pengutronix.de> References: <1471023911-2763-1-git-send-email-akshay.bhat@timesys.com> <20160815053033.ds27jg3c7vnx7ujw@pengutronix.de> <20160815072825.hffvzlxpzlph6bk7@pengutronix.de> Message-ID: <1384608f-8683-fb4b-aa8e-52c6dc512f6e@timesys.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Shawn, On 08/15/2016 03:28 AM, Uwe Kleine-K?nig wrote: > Hello, > > Cc += linux-gpio > > On Mon, Aug 15, 2016 at 06:18:07AM +0000, Ken.Lin wrote: >> 1. As you can see in the datasheet(that I attached to this email), at >> power on, P00 - P17 are configured as inputs (by chip default setting, >> datasheet P.3) and an interrupt is generated by any rising or falling >> edge of the port inputs in the input mode (datasheet P.10) > > ah, I see. All input pins generate an irq. The driver should handle this > just fine however. So I hope you don't see an oops or messages about > unhandled irqs, right? > >> 2. The unhandled interrupts ( return IRQ_NONE in pca953x_irq_handler) >> in GPIO expander driver (drivers/gpio/gpio-pca953x.c) could happen >> when unused GPIO pins in GPIO expander are not well configured. > > Hmm, maybe the driver should return IRQ_HANDLED in this case, too. After > all the irq reason is known and it was expected that an irq happend, > right? > >> 3. As a result, we tried to configure the unused (default floating >> inputs) pca953x GPIO pins as GPO low to avoid the unexpected >> interrupts (could be observed during the interference situation e.g. >> putting fingers on the unused pin to make the signal level change) > > So changing these to outputs might still make sense to prevent these > from floating or triggering unused irqs, but this should not make a > semantical difference for your machine. (It might have more load and a > bigger irq count, but apart from that everything should be the same.) > As Uwe mentioned above, independent of what the pca953x interrupt handler returns (IRQ_HANDLED or IRQ_NONE), I feel we should still change the pins to outputs to avoid trigger unused irqs. Is there any concern in accepting the patch? Thanks, Akshay > Best regards > Uwe >