summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/magnetometer/ak8975.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2011-12-22 18:46:42 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-09 10:03:51 -0800
commit54461c3067b2dce5947c9e4f88a8d905dca2c0c9 (patch)
tree1a385829d1106c190b59d18d59f70d4e9ff577cc /drivers/staging/iio/magnetometer/ak8975.c
parent4ee195241a3d9384ad222da7c593f7565a7cf518 (diff)
staging:iio: ak8975: add of_match table for device-tree probing
Just like isl29018; trivial addition. Using both asahi-kasei,ak8975 and the non-prefixed version (I couldn't figure out if Asahi Kasei had a stock symbol to use, I only found numerical indexes for their stock info). Signed-off-by: Olof Johansson <olof@lixom.net> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/iio/magnetometer/ak8975.c')
-rw-r--r--drivers/staging/iio/magnetometer/ak8975.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/staging/iio/magnetometer/ak8975.c b/drivers/staging/iio/magnetometer/ak8975.c
index 3158f12cb051..d5ddac3d8831 100644
--- a/drivers/staging/iio/magnetometer/ak8975.c
+++ b/drivers/staging/iio/magnetometer/ak8975.c
@@ -564,9 +564,17 @@ static const struct i2c_device_id ak8975_id[] = {
MODULE_DEVICE_TABLE(i2c, ak8975_id);
+static const struct of_device_id ak8975_of_match[] = {
+ { .compatible = "asahi-kasei,ak8975", },
+ { .compatible = "ak8975", },
+ { }
+};
+MODULE_DEVICE_TABLE(of, ak8975_of_match);
+
static struct i2c_driver ak8975_driver = {
.driver = {
.name = "ak8975",
+ .of_match_table = ak8975_of_match,
},
.probe = ak8975_probe,
.remove = __devexit_p(ak8975_remove),