[PATCH] ARM: dts: imx6q-bx50v3: configure unused pca953x pins

Akshay Bhat
2016-08-22T14:18:42Z

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
>