From: "Paweł Chmiel" <pawel.mikolaj.chmiel@gmail.com>
To: dmitry.torokhov@gmail.com
Cc: robh+dt@kernel.org, mark.rutland@arm.com,
pawel.mikolaj.chmiel@gmail.com, xc-racer2@live.ca,
devicetree@vger.kernel.org, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] input: misc: bma150: Add support for device tree
Date: Fri, 25 Jan 2019 19:43:59 +0100 [thread overview]
Message-ID: <20190125184400.17669-3-pawel.mikolaj.chmiel@gmail.com> (raw)
In-Reply-To: <20190125184400.17669-1-pawel.mikolaj.chmiel@gmail.com>
From: Jonathan Bakker <xc-racer2@live.ca>
Add basic of_match table to enable bma150 to be probed via DT
Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
---
drivers/input/misc/bma150.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/input/misc/bma150.c b/drivers/input/misc/bma150.c
index d101bb0a33d6..c26a118d89fa 100644
--- a/drivers/input/misc/bma150.c
+++ b/drivers/input/misc/bma150.c
@@ -31,6 +31,7 @@
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/slab.h>
+#include <linux/of.h>
#include <linux/pm.h>
#include <linux/pm_runtime.h>
#include <linux/bma150.h>
@@ -628,6 +629,14 @@ static int bma150_resume(struct device *dev)
static UNIVERSAL_DEV_PM_OPS(bma150_pm, bma150_suspend, bma150_resume, NULL);
+#if IS_ENABLED(CONFIG_OF)
+static const struct of_device_id bma150_of_match[] = {
+ { .compatible = "bosch,bma150" },
+ { },
+};
+MODULE_DEVICE_TABLE(of, bma150_of_match);
+#endif
+
static const struct i2c_device_id bma150_id[] = {
{ "bma150", 0 },
{ "smb380", 0 },
@@ -640,6 +649,7 @@ MODULE_DEVICE_TABLE(i2c, bma150_id);
static struct i2c_driver bma150_driver = {
.driver = {
.name = BMA150_DRIVER,
+ .of_match_table = of_match_ptr(bma150_of_match),
.pm = &bma150_pm,
},
.class = I2C_CLASS_HWMON,
--
2.17.1
next prev parent reply other threads:[~2019-01-25 18:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-25 18:43 [PATCH 0/3] input: misc: bma150: Add support for device tree Paweł Chmiel
2019-01-25 18:43 ` [PATCH 1/3] input: misc: bma150: Use managed resources helpers Paweł Chmiel
2019-01-26 1:29 ` Dmitry Torokhov
2019-01-26 3:40 ` Jonathan Bakker
2019-01-25 18:43 ` Paweł Chmiel [this message]
2019-01-25 18:44 ` [PATCH 3/3] input: dt-bindings: Add binding for bma150 sensor Paweł Chmiel
2019-01-26 1:28 ` Dmitry Torokhov
2019-01-26 3:39 ` Jonathan Bakker
2019-01-28 19:31 ` Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190125184400.17669-3-pawel.mikolaj.chmiel@gmail.com \
--to=pawel.mikolaj.chmiel@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
--cc=xc-racer2@live.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).