From: NeilBrown <neilb@suse.de>
To: Jonathan Cameron <jic23@cam.ac.uk>,
Grant Likely <grant.likely@linaro.org>,
Manuel Stahl <manuel.stahl@iis.fraunhofer.de>,
Mark Rutland <mark.rutland@arm.com>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org
Subject: [PATCH v2] itg3200: add dt support.
Date: Tue, 19 Nov 2013 11:30:13 +1100 [thread overview]
Message-ID: <20131119113013.39dae3cd@notabene.brown> (raw)
[-- Attachment #1: Type: text/plain, Size: 1570 bytes --]
No new configuration, just a 'compatible' string and documentation.
Signed-off-by: NeilBrown <neilb@suse.de>
diff --git a/Documentation/devicetree/bindings/iio/gyro/itg3200.txt
b/Documentation/devicetree/bindings/iio/gyro/itg3200.txt new file mode 100644
index 000000000000..4581620632df
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/gyro/itg3200.txt
@@ -0,0 +1,20 @@
+* InvenSense ITG3200 3-axis gyroscope
+
+Required properties:
+
+ - compatible : "invensense,itg3200"
+ - reg : I2C address, typically 0x68
+
+Optional properties:
+
+ - interrupt-parent : should be the phandle for the interrupt controller
+ - interrupts : interrupt mapping for IRQ
+
+Example:
+
+itg3200@68 {
+ compatible = "invensense,itg3200";
+ reg = <0x68>;
+ interrupt-parent = <&gpio2>;
+ interrupts = <24 IRQ_TYPE_EDGE_RISING>;
+};
diff --git a/drivers/iio/gyro/itg3200_core.c b/drivers/iio/gyro/itg3200_core.c
index 4d3f3b92b361..1ed3003ef41a 100644
--- a/drivers/iio/gyro/itg3200_core.c
+++ b/drivers/iio/gyro/itg3200_core.c
@@ -374,10 +374,17 @@ static const struct i2c_device_id itg3200_id[] = {
};
MODULE_DEVICE_TABLE(i2c, itg3200_id);
+static const struct of_device_id itg3200_of_match[] = {
+ { .compatible = "invensense,itg3200", },
+ {}
+};
+MODULE_DEVICE_TABLE(of, itg3200_of_match);
+
static struct i2c_driver itg3200_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "itg3200",
+ .of_match_table = of_match_ptr(itg3200_of_match),
},
.id_table = itg3200_id,
.probe = itg3200_probe,
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: NeilBrown <neilb-l3A5Bk7waGM@public.gmane.org>
To: Jonathan Cameron <jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>,
Grant Likely
<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Manuel Stahl
<manuel.stahl-GeUHRtUQU7nSyEMIgutvibNAH6kLmebB@public.gmane.org>,
Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH v2] itg3200: add dt support.
Date: Tue, 19 Nov 2013 11:30:13 +1100 [thread overview]
Message-ID: <20131119113013.39dae3cd@notabene.brown> (raw)
[-- Attachment #1: Type: text/plain, Size: 1591 bytes --]
No new configuration, just a 'compatible' string and documentation.
Signed-off-by: NeilBrown <neilb-l3A5Bk7waGM@public.gmane.org>
diff --git a/Documentation/devicetree/bindings/iio/gyro/itg3200.txt
b/Documentation/devicetree/bindings/iio/gyro/itg3200.txt new file mode 100644
index 000000000000..4581620632df
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/gyro/itg3200.txt
@@ -0,0 +1,20 @@
+* InvenSense ITG3200 3-axis gyroscope
+
+Required properties:
+
+ - compatible : "invensense,itg3200"
+ - reg : I2C address, typically 0x68
+
+Optional properties:
+
+ - interrupt-parent : should be the phandle for the interrupt controller
+ - interrupts : interrupt mapping for IRQ
+
+Example:
+
+itg3200@68 {
+ compatible = "invensense,itg3200";
+ reg = <0x68>;
+ interrupt-parent = <&gpio2>;
+ interrupts = <24 IRQ_TYPE_EDGE_RISING>;
+};
diff --git a/drivers/iio/gyro/itg3200_core.c b/drivers/iio/gyro/itg3200_core.c
index 4d3f3b92b361..1ed3003ef41a 100644
--- a/drivers/iio/gyro/itg3200_core.c
+++ b/drivers/iio/gyro/itg3200_core.c
@@ -374,10 +374,17 @@ static const struct i2c_device_id itg3200_id[] = {
};
MODULE_DEVICE_TABLE(i2c, itg3200_id);
+static const struct of_device_id itg3200_of_match[] = {
+ { .compatible = "invensense,itg3200", },
+ {}
+};
+MODULE_DEVICE_TABLE(of, itg3200_of_match);
+
static struct i2c_driver itg3200_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "itg3200",
+ .of_match_table = of_match_ptr(itg3200_of_match),
},
.id_table = itg3200_id,
.probe = itg3200_probe,
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next reply other threads:[~2013-11-19 0:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-19 0:30 NeilBrown [this message]
2013-11-19 0:30 ` [PATCH v2] itg3200: add dt support NeilBrown
2013-11-19 1:49 ` Sebastian Reichel
2013-11-19 1:49 ` Sebastian Reichel
2013-11-19 5:48 ` NeilBrown
2013-11-19 5:48 ` NeilBrown
2013-11-24 21:04 ` Jonathan Cameron
2013-11-24 21:04 ` Jonathan Cameron
2013-11-19 9:59 ` Mark Rutland
2013-11-19 9:59 ` Mark Rutland
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=20131119113013.39dae3cd@notabene.brown \
--to=neilb@suse.de \
--cc=devicetree@vger.kernel.org \
--cc=grant.likely@linaro.org \
--cc=jic23@cam.ac.uk \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manuel.stahl@iis.fraunhofer.de \
--cc=mark.rutland@arm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.