From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Likely Subject: Re: [PATCH] Input: mma8450: add device tree probe support Date: Sat, 30 Jul 2011 21:07:25 -0600 Message-ID: <20110731030725.GD24334@ponder.secretlab.ca> References: <1311265551-23233-1-git-send-email-shawn.guo@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1311265551-23233-1-git-send-email-shawn.guo@linaro.org> Sender: linux-input-owner@vger.kernel.org To: Shawn Guo Cc: linux-input@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, patches@linaro.org, Sammy He , Eric Miao , Dmitry Torokhov List-Id: devicetree@vger.kernel.org On Fri, Jul 22, 2011 at 12:25:51AM +0800, Shawn Guo wrote: > It adds device tree probe support for mma8450 driver. > > Signed-off-by: Shawn Guo > Cc: Grant Likely > Cc: Sammy He > Cc: Eric Miao > Cc: Dmitry Torokhov Acked-by: Grant Likely > --- > .../devicetree/bindings/input/fsl-mma8450.txt | 11 +++++++++++ > drivers/input/misc/mma8450.c | 8 ++++++++ > 2 files changed, 19 insertions(+), 0 deletions(-) > create mode 100644 Documentation/devicetree/bindings/input/fsl-mma8450.txt > > diff --git a/Documentation/devicetree/bindings/input/fsl-mma8450.txt b/Documentation/devicetree/bindings/input/fsl-mma8450.txt > new file mode 100644 > index 0000000..a00c94c > --- /dev/null > +++ b/Documentation/devicetree/bindings/input/fsl-mma8450.txt > @@ -0,0 +1,11 @@ > +* Freescale MMA8450 3-Axis Accelerometer > + > +Required properties: > +- compatible : "fsl,mma8450". > + > +Example: > + > +accelerometer: mma8450@1c { > + compatible = "fsl,mma8450"; > + reg = <0x1c>; > +}; > diff --git a/drivers/input/misc/mma8450.c b/drivers/input/misc/mma8450.c > index 20f8f92..6c76cf7 100644 > --- a/drivers/input/misc/mma8450.c > +++ b/drivers/input/misc/mma8450.c > @@ -24,6 +24,7 @@ > #include > #include > #include > +#include > > #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), > -- > 1.7.4.1 >