[PATCH v8 0/9] io: accel: mma8452: Allow open drain interrupt pin configuration
From: Esben Haabendal
Date: Mon Sep 07 2026 - 10:52:49 EST
Extend the mma8452 driver with support for configuration of the
interrupt line in open-drain mode, which is needed for hardware designs
where the interrupt line is shared with other chips.
Adding drive-open-drain property to mma8452 device-tree node for such
designs to enable switching pin configuration to open-drain mode.
Signed-off-by: Esben Haabendal <esben@xxxxxxxxxx>
---
Changes in v8:
- Move patch 7 (with Fixes: ...) to go before the non-fixes patches.
- Rebased from v7.3-rc1 to current iio/togreg branch.
- Drop patch 8 (identical patch from Sanjay Chitroda already in togreg
branch).
- Add new patch fixing a strangely extra indentation of a comment block.
- Add new patch adding documentation for struct mma8452_data.
- Move patch 4 to last in series, and rework the synchronization between
suspend/resume and interrupt handler.
- Link to v7: https://patch.msgid.link/20260831-mma8452-open-drain-v7-0-22946812c928@xxxxxxxxxx
Changes in v7:
- Use dev pointer directly in mma8452_runtime_suspend() also.
- Move struct i2c_client *client definition to patch 4.
- Drop patch 7 (Drop unneeded lock acquire on read).
- Link to v6: https://patch.msgid.link/20260825-mma8452-open-drain-v6-0-9b252804ee80@xxxxxxxxxx
Changes in v6:
- Prevent interrupt storm if runtime suspend fails to set the device in
standby mode by not setting suspended flag to true when failing to
activate standby mode and by ensuring PM counter is not leaked in
mma8452_interrupt().
- Don't acquire data->lock in mma8452_read_raw().
- Add fix for use-after-free in mma8452_probe() error path when CONFIG_PM
is enabled.
- Fix (brown paper bug) build error introduced in v5.
- Renamed label in mma8452_interrupt().
- Add patch to return -ENODATA when missing device model information.
- Link to v5: https://patch.msgid.link/20260819-mma8452-open-drain-v5-0-d8aa590d7c36@xxxxxxxxxx
Changes in v5:
- Squashed dev_err_probe() call to one line.
- Fixed typo in patch 2 title.
- Added synchronization between runtime suspend and interrupt handler.
- Link to v4: https://patch.msgid.link/20260812-mma8452-open-drain-v4-0-bfca15d02b59@xxxxxxxxxx
Changes in v4:
- Fixed interrupt handler to check runtime PM status before trying to
access the chip.
- Split open-drain support and interrupt sharing into separate patches.
- Added new patch to reuse existing struct device * through mma8452_probe()
function.
- Print warning message when irq type is not set by firmware.
- Link to v3: https://patch.msgid.link/20260805-mma8452-open-drain-v3-0-6149f406a409@xxxxxxxxxx
Changes in v3:
- Reordered patches, swapping #2 and #3.
- Always add IRQF_SHARED flag.
- New patch to change it so IQRF_TRIGGER_LOW flag is only added when no
trigger type is set by firmware.
- Link to v2: https://patch.msgid.link/20260715-mma8452-open-drain-v2-0-95be9f5f4795@xxxxxxxxxx
Changes in v2:
- Commit message of patch 2 updated.
- Operator precedence bug fixed in flags argument to
request_threaded_irq().
- Always check return value of mma8452_set_interrupt_pin_mode(), and just
check for non-zero value.
- Added new patch with optimization of struct mma8452_data ordering.
- Link to v1: https://patch.msgid.link/20260715-mma8452-open-drain-v1-0-b1dd2a440c60@xxxxxxxxxx
To: Jonathan Cameron <jic23@xxxxxxxxxx>
To: Lars-Peter Clausen <lars@xxxxxxxxxx>
To: Rob Herring <robh@xxxxxxxxxx>
To: Krzysztof Kozlowski <krzk+dt@xxxxxxxxxx>
To: Conor Dooley <conor+dt@xxxxxxxxxx>
To: Martin Kepplinger <martink@xxxxxxxxx>
To: Sean Nyekjaer <sean@xxxxxxxxxx>
To: David Lechner <dlechner@xxxxxxxxxxxx>
To: Nuno Sá <nuno.sa@xxxxxxxxxx>
To: Andy Shevchenko <andy@xxxxxxxxxx>
To: Martin Kepplinger <martin.kepplinger@xxxxxxxxxxxxxxxxxxxxx>
To: Christoph Muellner <christoph.muellner@xxxxxxxxxxxxxxxxxxxxx>
Cc: linux-iio@xxxxxxxxxxxxxxx
Cc: devicetree@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
---
Esben Haabendal (9):
dt-bindings: iio: accel: mma8452: Add drive-open-drain
iio: accel: mma8452: Fix use-after-free bug in error error path
iio: accel: mma8452: Optimize struct mma8452_data member orders
iio: accel: mma8452: Only apply trigger type when not set by firmware
iio: accel: mma8452: Fix unintended comment indent
iio: accel: mma8452: Add comment block for struct mma8452_data
iio: accel: mma8452: Allow open drain interrupt pin configuration
iio: accel: mma8452: Use proper error code when missing device model
iio: accel: mma8452: Support interrupt sharing
.../devicetree/bindings/iio/accel/fsl,mma8452.yaml | 6 +
drivers/iio/accel/mma8452.c | 165 +++++++++++++++++----
2 files changed, 141 insertions(+), 30 deletions(-)
---
base-commit: 309bd01041636b587bcb424b243640b448bd62f7
change-id: 20250401-mma8452-open-drain-81577c41375c
Best regards,
--
Esben Haabendal <esben@xxxxxxxxxx>