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

Input: mma8450 - add device tree probe support

It adds device tree probe support for mma8450 driver.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Eric Miao <eric.miao@linaro.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

authored by

Shawn Guo and committed by
Dmitry Torokhov
71ff069c 1f4bb066

+19
+11
Documentation/devicetree/bindings/input/fsl-mma8450.txt
··· 1 + * Freescale MMA8450 3-Axis Accelerometer 2 + 3 + Required properties: 4 + - compatible : "fsl,mma8450". 5 + 6 + Example: 7 + 8 + accelerometer: mma8450@1c { 9 + compatible = "fsl,mma8450"; 10 + reg = <0x1c>; 11 + };
+8
drivers/input/misc/mma8450.c
··· 24 24 #include <linux/delay.h> 25 25 #include <linux/i2c.h> 26 26 #include <linux/input-polldev.h> 27 + #include <linux/of_device.h> 27 28 28 29 #define MMA8450_DRV_NAME "mma8450" 29 30 ··· 230 229 }; 231 230 MODULE_DEVICE_TABLE(i2c, mma8450_id); 232 231 232 + static const struct of_device_id mma8450_dt_ids[] = { 233 + { .compatible = "fsl,mma8450", }, 234 + { /* sentinel */ } 235 + }; 236 + MODULE_DEVICE_TABLE(i2c, mma8450_dt_ids); 237 + 233 238 static struct i2c_driver mma8450_driver = { 234 239 .driver = { 235 240 .name = MMA8450_DRV_NAME, 236 241 .owner = THIS_MODULE, 242 + .of_match_table = mma8450_dt_ids, 237 243 }, 238 244 .probe = mma8450_probe, 239 245 .remove = __devexit_p(mma8450_remove),