Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: magnetometer: Add ACPI support for MMC35240

We assume that ACPI device tables use MMC35240 to
identify MEMSIC's 3 axis magnetic sensor.

Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

authored by

Daniel Baluta and committed by
Jonathan Cameron
d11715f0 553a776b

+8
+8
drivers/iio/magnetometer/mmc35240.c
··· 17 17 #include <linux/i2c.h> 18 18 #include <linux/delay.h> 19 19 #include <linux/regmap.h> 20 + #include <linux/acpi.h> 20 21 #include <linux/pm.h> 21 22 22 23 #include <linux/iio/iio.h> ··· 483 482 SET_SYSTEM_SLEEP_PM_OPS(mmc35240_suspend, mmc35240_resume) 484 483 }; 485 484 485 + static const struct acpi_device_id mmc35240_acpi_match[] = { 486 + {"MMC35240", 0}, 487 + { }, 488 + }; 489 + MODULE_DEVICE_TABLE(acpi, mmc35240_acpi_match); 490 + 486 491 static const struct i2c_device_id mmc35240_id[] = { 487 492 {"MMC35240", 0}, 488 493 {} ··· 499 492 .driver = { 500 493 .name = MMC35240_DRV_NAME, 501 494 .pm = &mmc35240_pm_ops, 495 + .acpi_match_table = ACPI_PTR(mmc35240_acpi_match), 502 496 }, 503 497 .probe = mmc35240_probe, 504 498 .id_table = mmc35240_id,