Re: [PATCH 1/2] iio: imu: st_lsm6dsx: support open drain mode
From: Linus Walleij <hidden>
Date: 2017-06-29 11:46:32
Also in:
linux-iio
On Sun, Jun 25, 2017 at 11:34 AM, Lorenzo Bianconi [off-list ref] wrote:
quoted
In common with the mpu3050 which was the first driver in IIO to do open drain,
I think I implemented it on the ST sensors first actually.
quoted
I think you need to think about precedence as we allow for IRQF_RISING and IRQF_FALLING already. Open drain only allows for shared interrupts if IRQF_FALLING (I think)quoted
err = devm_request_threaded_irq(hw->dev, hw->irq, st_lsm6dsx_handler_irq, st_lsm6dsx_handler_thread,I have not got the difference between IRQF_RISING and IRQF_FALLING when the irq line is marked as shared (when open drain is enabled). Looking at the code, mpu3050 gyro sensor does not support shared interrupts with IRQF_RISING and IRQF_TRIGGER_HIGH. Is it a hw limitation?
It seems like I have inverted the logic in the MPU3050 driver. I'll send a patch.
Speaking with digital designer, lsm6dsx series allows open drain mode even if the requested irq line is IRQF_TRIGGER_HIGH or IRQF_RISING, we need to add a pull-down resistor. Moreover ST framework already supports open drain if the requested interrupt is IRQF_RISING.
This seems correct. Yours, Linus Walleij