From: veeenjoyer24 <danilsirin24@gmail.com>
To: "Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
veeenjoyer24 <danilsirin24@gmail.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] iio: accel: mma8452: add ACPI match table
Date: Fri, 7 Aug 2026 16:51:05 +0300 [thread overview]
Message-ID: <20260807135105.2175-1-danilsirin24@gmail.com> (raw)
The mma8452 driver supports obtaining chip-specific data through
i2c_get_match_data(), but only provides OF and I2C match tables.
On ACPI-based x86 systems, compatible devices such as the MMA8653 are
enumerated via ACPI. Without an ACPI match table, the driver never
binds to those devices.
Add an ACPI match table mapping the supported devices to the existing
chip information structures.
Tested on a Bay Trail tablet exposing an ACPI device with HID
"MMA8653". With this change the driver successfully probes, reads
the expected chip ID (0x5a), and registers an IIO device.
Signed-off-by: veeenjoyer24 <danilsirin24@gmail.com>
---
drivers/iio/accel/mma8452.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
index cefc7cf4b..8cb78e4cf 100644
--- a/drivers/iio/accel/mma8452.c
+++ b/drivers/iio/accel/mma8452.c
@@ -1822,6 +1822,17 @@ static const struct dev_pm_ops mma8452_pm_ops = {
mma8452_runtime_resume, NULL)
};
+static const struct acpi_device_id mma8452_acpi_id[] = {
+ { "FXLS8471", (kernel_ulong_t)&mma_chip_info_table[fxls8471] },
+ { "MMA8451", (kernel_ulong_t)&mma_chip_info_table[mma8451] },
+ { "MMA8452", (kernel_ulong_t)&mma_chip_info_table[mma8452] },
+ { "MMA8453", (kernel_ulong_t)&mma_chip_info_table[mma8453] },
+ { "MMA8652", (kernel_ulong_t)&mma_chip_info_table[mma8652] },
+ { "MMA8653", (kernel_ulong_t)&mma_chip_info_table[mma8653] },
+ { }
+};
+MODULE_DEVICE_TABLE(acpi, mma8452_acpi_id);
+
static const struct i2c_device_id mma8452_id[] = {
{ "fxls8471", (kernel_ulong_t)&mma_chip_info_table[fxls8471] },
{ "mma8451", (kernel_ulong_t)&mma_chip_info_table[mma8451] },
@@ -1837,6 +1848,7 @@ static struct i2c_driver mma8452_driver = {
.driver = {
.name = "mma8452",
.of_match_table = mma8452_dt_ids,
+ .acpi_match_table = mma8452_acpi_id,
.pm = &mma8452_pm_ops,
},
.probe = mma8452_probe,
--
2.55.0
next reply other threads:[~2026-08-07 13:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-07 13:51 veeenjoyer24 [this message]
2026-08-07 14:59 ` [PATCH] iio: accel: mma8452: add ACPI match table Joshua Crofts
2026-08-07 17:13 ` [PATCH v2] " Danil Sirin
2026-08-07 23:28 ` Jonathan Cameron
2026-08-08 20:33 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260807135105.2175-1-danilsirin24@gmail.com \
--to=danilsirin24@gmail.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.