[PATCH 12/12] iio: accel: kionix-kx022a: Fix IPOL macro name

From: Matti Vaittinen

Date: Mon Aug 10 2026 - 03:57:42 EST


From: Matti Vaittinen <mazziesaccount@xxxxxxxxx>

The "interrupt polarity high" -macro for KX022A variant is defined as:
However, the KX022A_MASK_IPOL1 is not defined anywhere, so actually
using the KX022A_IPOL_HIGH would produce a compile error.

Fix the define by using correct mask.

Signed-off-by: Matti Vaittinen <mazziesaccount@xxxxxxxxx>
Fixes: 7c1d1677b322 ("iio: accel: Support Kionix/ROHM KX022A accelerometer")

---
It appears the KX022A_IPOL_HIGH is unused as the IRQ is currently,
unconditionally set level low in kx022a_prepare_irq_pin(). The KX022A
hardware would support other configurations though. So, another
potential fix would be removing the define altogether. I decided to
leave the define there, as having it will allow users who need different
configuration to simply change the KX022A_IPOL_LOW to KX022A_IPOL_HIGH,
which is kind of a "easy to try" thing.

I don't have a strong preference here though.
---
drivers/iio/accel/kionix-kx022a.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/accel/kionix-kx022a.h b/drivers/iio/accel/kionix-kx022a.h
index 0ed54f584223..a2d122c1e234 100644
--- a/drivers/iio/accel/kionix-kx022a.h
+++ b/drivers/iio/accel/kionix-kx022a.h
@@ -65,7 +65,7 @@
#define KX022A_MASK_IEN BIT(5)
#define KX022A_MASK_IPOL BIT(4)
#define KX022A_IPOL_LOW 0
-#define KX022A_IPOL_HIGH KX022A_MASK_IPOL1
+#define KX022A_IPOL_HIGH KX022A_MASK_IPOL
#define KX022A_MASK_ITYP BIT(3)
#define KX022A_ITYP_PULSE KX022A_MASK_ITYP
#define KX022A_ITYP_LEVEL 0
--
2.55.0

Attachment: signature.asc
Description: PGP signature