Re: [PATCH v2] itg3200: add dt support.
-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 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- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2] itg3200: add dt support.
-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 s...@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- -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2] itg3200: add dt support.
On Tue, Nov 19, 2013 at 12:30:13AM +, NeilBrown wrote: > > > No new configuration, just a 'compatible' string and documentation. > > Signed-off-by: NeilBrown > > diff --git a/Documentation/devicetree/bindings/iio/gyro/itg3200.txt > b/Documentation/devicetree/bindings/iio/gyro/itg3200.txt new file mode 100644 > index ..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 = <>; > + 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, -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2] itg3200: add dt support.
On Tue, Nov 19, 2013 at 12:30:13AM +, NeilBrown wrote: No new configuration, just a 'compatible' string and documentation. Signed-off-by: NeilBrown ne...@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 ..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, -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2] itg3200: add dt support.
On Tue, 19 Nov 2013 02:49:38 +0100 Sebastian Reichel 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 signature.asc Description: PGP signature
Re: [PATCH v2] itg3200: add dt support.
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 signature.asc Description: Digital signature
Re: [PATCH v2] itg3200: add dt support.
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 signature.asc Description: Digital signature
Re: [PATCH v2] itg3200: add dt support.
On Tue, 19 Nov 2013 02:49:38 +0100 Sebastian Reichel s...@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 signature.asc Description: PGP signature