* [PATCH] Input: mpu3050: add of_match table for device-tree probing
@ 2011-12-23 2:39 Olof Johansson
[not found] ` <1324607992-2919-1-git-send-email-olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Olof Johansson @ 2011-12-23 2:39 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, devicetree-discuss, Olof Johansson
Adding invn,mpu3050 as the initial id.
Signed-off-by: Olof Johansson <olof@lixom.net>
---
drivers/input/misc/mpu3050.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/input/misc/mpu3050.c b/drivers/input/misc/mpu3050.c
index f71dc72..e9a57e3 100644
--- a/drivers/input/misc/mpu3050.c
+++ b/drivers/input/misc/mpu3050.c
@@ -348,11 +348,18 @@ static const struct i2c_device_id mpu3050_ids[] = {
};
MODULE_DEVICE_TABLE(i2c, mpu3050_ids);
+static const struct of_device_id mpu3050_of_match[] = {
+ { .compatible = "invn,mpu3050", },
+ { },
+};
+MODULE_DEVICE_TABLE(of, mpu3050_of_match);
+
static struct i2c_driver mpu3050_i2c_driver = {
.driver = {
.name = "mpu3050",
.owner = THIS_MODULE,
.pm = &mpu3050_pm,
+ .of_match_table = mpu3050_of_match,
},
.probe = mpu3050_probe,
.remove = __devexit_p(mpu3050_remove),
--
1.7.8.GIT
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] Input: mpu3050: add of_match table for device-tree probing
[not found] ` <1324607992-2919-1-git-send-email-olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>
@ 2011-12-23 9:22 ` Dmitry Torokhov
2011-12-23 15:58 ` Olof Johansson
0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Torokhov @ 2011-12-23 9:22 UTC (permalink / raw)
To: Olof Johansson
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-input-u79uwXL29TY76Z2rM5mHXA
Hi Olof,
On Thu, Dec 22, 2011 at 06:39:52PM -0800, Olof Johansson wrote:
> Adding invn,mpu3050 as the initial id.
>
I believe you also need to add this to
Documentation/devicetree/bindings/input/
Thanks!
> Signed-off-by: Olof Johansson <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>
> ---
> drivers/input/misc/mpu3050.c | 7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/input/misc/mpu3050.c b/drivers/input/misc/mpu3050.c
> index f71dc72..e9a57e3 100644
> --- a/drivers/input/misc/mpu3050.c
> +++ b/drivers/input/misc/mpu3050.c
> @@ -348,11 +348,18 @@ static const struct i2c_device_id mpu3050_ids[] = {
> };
> MODULE_DEVICE_TABLE(i2c, mpu3050_ids);
>
> +static const struct of_device_id mpu3050_of_match[] = {
> + { .compatible = "invn,mpu3050", },
> + { },
> +};
> +MODULE_DEVICE_TABLE(of, mpu3050_of_match);
> +
> static struct i2c_driver mpu3050_i2c_driver = {
> .driver = {
> .name = "mpu3050",
> .owner = THIS_MODULE,
> .pm = &mpu3050_pm,
> + .of_match_table = mpu3050_of_match,
> },
> .probe = mpu3050_probe,
> .remove = __devexit_p(mpu3050_remove),
> --
> 1.7.8.GIT
>
--
Dmitry
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Input: mpu3050: add of_match table for device-tree probing
2011-12-23 9:22 ` Dmitry Torokhov
@ 2011-12-23 15:58 ` Olof Johansson
2011-12-27 16:07 ` Rob Herring
0 siblings, 1 reply; 6+ messages in thread
From: Olof Johansson @ 2011-12-23 15:58 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, devicetree-discuss
Hi,
On Fri, Dec 23, 2011 at 1:22 AM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> Hi Olof,
>
> On Thu, Dec 22, 2011 at 06:39:52PM -0800, Olof Johansson wrote:
>> Adding invn,mpu3050 as the initial id.
>>
>
> I believe you also need to add this to
> Documentation/devicetree/bindings/input/
For simple i2c devices that only have a name, address and possibly an
interrupt, there's no need to document a binding (it hasn't been done
in the past for the vast majority of those devices).
-Olof
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Input: mpu3050: add of_match table for device-tree probing
2011-12-23 15:58 ` Olof Johansson
@ 2011-12-27 16:07 ` Rob Herring
2011-12-27 17:14 ` Olof Johansson
0 siblings, 1 reply; 6+ messages in thread
From: Rob Herring @ 2011-12-27 16:07 UTC (permalink / raw)
To: Olof Johansson; +Cc: Dmitry Torokhov, devicetree-discuss, linux-input
On 12/23/2011 09:58 AM, Olof Johansson wrote:
> Hi,
>
> On Fri, Dec 23, 2011 at 1:22 AM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
>> Hi Olof,
>>
>> On Thu, Dec 22, 2011 at 06:39:52PM -0800, Olof Johansson wrote:
>>> Adding invn,mpu3050 as the initial id.
>>>
>>
>> I believe you also need to add this to
>> Documentation/devicetree/bindings/input/
>
> For simple i2c devices that only have a name, address and possibly an
> interrupt, there's no need to document a binding (it hasn't been done
> in the past for the vast majority of those devices).
But then how do you find out if there is a existing binding for a device
without searching in the kernel source tree? The binding docs are
planned to be moved out as they are not Linux specific. There needs to
be 1 location to find binding information.
I do wonder if we should have a more structured registry or database of
bindings than free form text files...
Rob
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Input: mpu3050: add of_match table for device-tree probing
2011-12-27 16:07 ` Rob Herring
@ 2011-12-27 17:14 ` Olof Johansson
2012-01-02 8:42 ` Grant Likely
0 siblings, 1 reply; 6+ messages in thread
From: Olof Johansson @ 2011-12-27 17:14 UTC (permalink / raw)
To: Rob Herring; +Cc: Dmitry Torokhov, devicetree-discuss, linux-input
On Tue, Dec 27, 2011 at 8:07 AM, Rob Herring <robherring2@gmail.com> wrote:
> On 12/23/2011 09:58 AM, Olof Johansson wrote:
>> Hi,
>>
>> On Fri, Dec 23, 2011 at 1:22 AM, Dmitry Torokhov
>> <dmitry.torokhov@gmail.com> wrote:
>>> Hi Olof,
>>>
>>> On Thu, Dec 22, 2011 at 06:39:52PM -0800, Olof Johansson wrote:
>>>> Adding invn,mpu3050 as the initial id.
>>>>
>>>
>>> I believe you also need to add this to
>>> Documentation/devicetree/bindings/input/
>>
>> For simple i2c devices that only have a name, address and possibly an
>> interrupt, there's no need to document a binding (it hasn't been done
>> in the past for the vast majority of those devices).
>
> But then how do you find out if there is a existing binding for a device
> without searching in the kernel source tree?
That's a silly question, since today that is exactly what you do to
find out, since the Documentation/devicetree isn't the canonical
location for _all_ bindings anyway -- some are in ePAPR, some are in
the old IEEE1275 docs, and some are based on whatever the vendor that
first introduced the device chose (Apple, and some other vendors,
mostly PowerPC ones).
> The binding docs are
> planned to be moved out as they are not Linux specific. There needs to
> be 1 location to find binding information.
Sure. That has nothing to do with this i2c patch though. There has
been some talk in the past about creating one location, in part based
on what is now at devicetree.org.
> I do wonder if we should have a more structured registry or database of
> bindings than free form text files...
I don't think anyone considers the current text files to be a
permanent solution, and something more structured would be a good
idea.
As far as i2c devices go, for now a simple text table of trivial i2c
devices and their known names could be a good idea -- I'll go through
current drivers (including my three recently posted patches) and
create such a list for starter. But I'll do that separately from this
patch, Dmitry -- please apply it as it is.
-Olof
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Input: mpu3050: add of_match table for device-tree probing
2011-12-27 17:14 ` Olof Johansson
@ 2012-01-02 8:42 ` Grant Likely
0 siblings, 0 replies; 6+ messages in thread
From: Grant Likely @ 2012-01-02 8:42 UTC (permalink / raw)
To: Olof Johansson
Cc: Rob Herring, devicetree-discuss, Dmitry Torokhov, linux-input
On Tue, Dec 27, 2011 at 09:14:31AM -0800, Olof Johansson wrote:
> On Tue, Dec 27, 2011 at 8:07 AM, Rob Herring <robherring2@gmail.com> wrote:
> > On 12/23/2011 09:58 AM, Olof Johansson wrote:
> >> Hi,
> >>
> >> On Fri, Dec 23, 2011 at 1:22 AM, Dmitry Torokhov
> >> <dmitry.torokhov@gmail.com> wrote:
> >>> Hi Olof,
> >>>
> >>> On Thu, Dec 22, 2011 at 06:39:52PM -0800, Olof Johansson wrote:
> >>>> Adding invn,mpu3050 as the initial id.
> >>>>
> >>>
> >>> I believe you also need to add this to
> >>> Documentation/devicetree/bindings/input/
> >>
> >> For simple i2c devices that only have a name, address and possibly an
> >> interrupt, there's no need to document a binding (it hasn't been done
> >> in the past for the vast majority of those devices).
> >
> > But then how do you find out if there is a existing binding for a device
> > without searching in the kernel source tree?
>
> That's a silly question, since today that is exactly what you do to
> find out, since the Documentation/devicetree isn't the canonical
> location for _all_ bindings anyway -- some are in ePAPR, some are in
> the old IEEE1275 docs, and some are based on whatever the vendor that
> first introduced the device chose (Apple, and some other vendors,
> mostly PowerPC ones).
I would like to keep a list of new bindings though, but I agree with the
argument that a lot of bindings don't need a separate file with a whole
bunch of meaningless boilerplate.
g.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-01-02 8:42 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-23 2:39 [PATCH] Input: mpu3050: add of_match table for device-tree probing Olof Johansson
[not found] ` <1324607992-2919-1-git-send-email-olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>
2011-12-23 9:22 ` Dmitry Torokhov
2011-12-23 15:58 ` Olof Johansson
2011-12-27 16:07 ` Rob Herring
2011-12-27 17:14 ` Olof Johansson
2012-01-02 8:42 ` Grant Likely
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).