* [PATCH v2] itg3200: add dt support.
@ 2013-11-19 0:30 NeilBrown
2013-11-19 1:49 ` Sebastian Reichel
2013-11-19 9:59 ` Mark Rutland
0 siblings, 2 replies; 5+ messages in thread
From: NeilBrown @ 2013-11-19 0:30 UTC (permalink / raw)
To: Jonathan Cameron, Grant Likely, Manuel Stahl, Mark Rutland
Cc: devicetree, linux-kernel, linux-iio
[-- 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 --]
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] itg3200: add dt support.
2013-11-19 0:30 [PATCH v2] itg3200: add dt support NeilBrown
@ 2013-11-19 1:49 ` Sebastian Reichel
2013-11-19 5:48 ` NeilBrown
2013-11-19 9:59 ` Mark Rutland
1 sibling, 1 reply; 5+ messages in thread
From: Sebastian Reichel @ 2013-11-19 1:49 UTC (permalink / raw)
To: NeilBrown
Cc: Jonathan Cameron, Grant Likely, Manuel Stahl, Mark Rutland,
devicetree, linux-kernel, linux-iio
[-- Attachment #1: Type: text/plain, Size: 292 bytes --]
Hi,
On Tue, Nov 19, 2013 at 11:30:13AM +1100, NeilBrown wrote:
> No new configuration, just a 'compatible' string and
> documentation.
itg3200 looks like a candidate for the list of trivial i2c
devices [0] to me.
[0] Documentation/devicetree/bindings/i2c/trivial-devices.txt
-- Sebastian
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] itg3200: add dt support.
2013-11-19 1:49 ` Sebastian Reichel
@ 2013-11-19 5:48 ` NeilBrown
2013-11-24 21:04 ` Jonathan Cameron
0 siblings, 1 reply; 5+ messages in thread
From: NeilBrown @ 2013-11-19 5:48 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Jonathan Cameron, Grant Likely, Manuel Stahl, Mark Rutland,
devicetree, linux-kernel, linux-iio
[-- Attachment #1: Type: text/plain, Size: 1027 bytes --]
On Tue, 19 Nov 2013 02:49:38 +0100 Sebastian Reichel <sre@debian.org> wrote:
> Hi,
>
> On Tue, Nov 19, 2013 at 11:30:13AM +1100, NeilBrown wrote:
> > No new configuration, just a 'compatible' string and
> > documentation.
>
> itg3200 looks like a candidate for the list of trivial i2c
> devices [0] to me.
>
> [0] Documentation/devicetree/bindings/i2c/trivial-devices.txt
>
> -- Sebastian
Hmmm... a file that isn't referenced anywhere else in the kernel
documentation so is unlikely to be found except by people who know it is
there....
I can see that having lots of files for trivial devices is rather clumsy, but
there must be a better way.
I don't suppose we could just put the documentation in the device-driver file
in some format similar to kernel-doc and just extract it if it is wanted
separately? I think people read code a lot more than they read
documentation. I know I do.
But I can re-send with an update to trivial-devices.txt is that is what is
wanted.
Thanks,
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] itg3200: add dt support.
2013-11-19 0:30 [PATCH v2] itg3200: add dt support NeilBrown
2013-11-19 1:49 ` Sebastian Reichel
@ 2013-11-19 9:59 ` Mark Rutland
1 sibling, 0 replies; 5+ messages in thread
From: Mark Rutland @ 2013-11-19 9:59 UTC (permalink / raw)
To: NeilBrown
Cc: Jonathan Cameron, grant.likely@linaro.org, Manuel Stahl,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org
On Tue, Nov 19, 2013 at 12:30:13AM +0000, NeilBrown wrote:
>
>
> 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"
I couldn't see "invensense" in vendor-prefixes.txt. Assuming I haven't
missed a patch adding it, could you amend this patch to do so?
Otherwise this looks fine to me.
Cheers,
Mark.
> + - 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,
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] itg3200: add dt support.
2013-11-19 5:48 ` NeilBrown
@ 2013-11-24 21:04 ` Jonathan Cameron
0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2013-11-24 21:04 UTC (permalink / raw)
To: NeilBrown, Sebastian Reichel
Cc: Grant Likely, Manuel Stahl, Mark Rutland, devicetree,
linux-kernel, linux-iio
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 11/19/13 05:48, NeilBrown wrote:
> On Tue, 19 Nov 2013 02:49:38 +0100 Sebastian Reichel <sre@debian.org> wrote:
>
>> Hi,
>>
>> On Tue, Nov 19, 2013 at 11:30:13AM +1100, NeilBrown wrote:
>>> No new configuration, just a 'compatible' string and documentation.
>>
>> itg3200 looks like a candidate for the list of trivial i2c devices [0] to me.
>>
>> [0] Documentation/devicetree/bindings/i2c/trivial-devices.txt
>>
>> -- Sebastian
>
> Hmmm... a file that isn't referenced anywhere else in the kernel documentation so is unlikely to be found except by
> people who know it is there....
>
> I can see that having lots of files for trivial devices is rather clumsy, but there must be a better way. I don't
> suppose we could just put the documentation in the device-driver file in some format similar to kernel-doc and just
> extract it if it is wanted separately? I think people read code a lot more than they read documentation. I know I
> do.
>
> But I can re-send with an update to trivial-devices.txt is that is what is wanted.
Given that typically people will need to grep for the name of the actual
device they have to find the docs (not always obvious where in the documentation
their bindings will lie), it perhaps makes sense to put these simple devices
in trivial-devices.txt.
Anyhow, it is how it is currently done and we can always unwind it later to separate
files so, yes - please do move this and if missing add the invense entry as well
as Mark has requested.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJSkmnMAAoJEFSFNJnE9BaI2QQP/R9wloBWmMKiuF+2MFD4qPSM
GCgKVVptzk/qgV1TYvj7OsuYigGkCcVdTptRg3uDgrg2gL/1beYz8HqbeIRALcCp
G2rPKhFGF9R6LalHUU0eMVGvvTqUe7J2gXCnxoINp0QM+fAyFfkMk5FZJJur4drI
GnwroRToRcrIRloIFNstDc5m5/jphshCB++sEDh/uTZT64ZcH5VKlcsHmuzMGOEm
VO/gebr5kHogGA54HUB4C8psrMJncKm3XFt57yq9tkhHkDk/VijDdROuhbOMY/K0
6eLLl7oIUkYtQ0AOowg2pDG3B5mvBexfi2W5JWf9yxiK/GBE54OQwyPNXWSeR4Jo
yLFs+anAtoNVYJuX5O0hs5NXzAJCAhcsXVggzKAmBY5IQkUZ5HzyBxwpH7aB1c1N
xZY89s1gx4Fke3GNPxqQ7tTDnFy5qZvnZ1/RM0F1j6D6zVMVSM5rRtjZrn3jdpue
gvzoYSV7f6la+BVj6S2tR2bEFkEssiaUkPn844e+EPZ+iSt8rLVD7WRA0M7bVp4t
R5ruRioF7D3LGzSfJwhna5/SNCytKuUBKc98PL0VZRx1707GAa2Ucl/YAIp/Gnkh
ERq9T5GbeT+9zMAfQpeE7Jaz+CwrS8ib0ul+IZzA9q+CqOdZZo3/xjdkQjSw9D9C
IL28pFxuFOKYabdZ9kQC
=EsOI
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-11-24 21:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-19 0:30 [PATCH v2] itg3200: add dt support NeilBrown
2013-11-19 1:49 ` Sebastian Reichel
2013-11-19 5:48 ` NeilBrown
2013-11-24 21:04 ` Jonathan Cameron
2013-11-19 9:59 ` Mark Rutland
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).