提交 71ff069c 编写于 作者: S Shawn Guo 提交者: Dmitry Torokhov

Input: mma8450 - add device tree probe support

It adds device tree probe support for mma8450 driver.
Signed-off-by: NShawn Guo <shawn.guo@linaro.org>
Acked-by: NEric Miao <eric.miao@linaro.org>
Acked-by: NGrant Likely <grant.likely@secretlab.ca>
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 1f4bb066
* Freescale MMA8450 3-Axis Accelerometer
Required properties:
- compatible : "fsl,mma8450".
Example:
accelerometer: mma8450@1c {
compatible = "fsl,mma8450";
reg = <0x1c>;
};
......@@ -24,6 +24,7 @@
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/input-polldev.h>
#include <linux/of_device.h>
#define MMA8450_DRV_NAME "mma8450"
......@@ -229,10 +230,17 @@ static const struct i2c_device_id mma8450_id[] = {
};
MODULE_DEVICE_TABLE(i2c, mma8450_id);
static const struct of_device_id mma8450_dt_ids[] = {
{ .compatible = "fsl,mma8450", },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(i2c, mma8450_dt_ids);
static struct i2c_driver mma8450_driver = {
.driver = {
.name = MMA8450_DRV_NAME,
.owner = THIS_MODULE,
.of_match_table = mma8450_dt_ids,
},
.probe = mma8450_probe,
.remove = __devexit_p(mma8450_remove),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册