From: Javier Martinez Canillas <javierm@redhat.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Wolfram Sang <wsa@the-dreams.de>,
Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Michal Marek <michal.lkml@markovi.net>,
linux-kbuild <linux-kbuild@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>,
Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
Lee Jones <lee.jones@linaro.org>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH RFC] modpost: Support I2C Aliases from OF tables
Date: Tue, 6 Aug 2019 19:12:21 +0200 [thread overview]
Message-ID: <51451f89-9193-2be6-e724-e9ca44a25f52@redhat.com> (raw)
In-Reply-To: <CAMuHMdUA-hjVqSP_c0cB=76cfrucF6xxRi3ymVoEsJ2hbkfT=A@mail.gmail.com>
Hello Geert,
On 8/6/19 9:22 AM, Geert Uytterhoeven wrote:
> Hi Javier,
>
> On Tue, Aug 6, 2019 at 12:25 AM Javier Martinez Canillas
> <javierm@redhat.com> wrote:
>> On 7/31/19 9:44 PM, Wolfram Sang wrote:
>>> Hi Javier,
>>>> The other option is to remove i2c_of_match_device() and don't make OF match
>>>> to fallback to i2c_of_match_device_sysfs(). This is what happens in the ACPI
>>>> case, since i2c_device_match() just calls acpi_driver_match_device() directly
>>>> and doesn't have a wrapper function that fallbacks to sysfs matching.
>>>>
>>>> In this case an I2C device ID table would be required if the devices have to
>>>> be instantiated through sysfs. That way the I2C table would be used both for
>>>> auto-loading and also to match the device when it doesn't have an of_node.
>>>
>>> That would probably mean that only a minority of drivers will not add an I2C
>>> device ID table because it is easy to add an you get the sysfs feature?
>>>
>>
>> I believe so yes.
>
>> As Masahiro-san mentioned, this approach will still require to add a new macro
>> MODULE_DEVICE_TABLE(i2c_of, bar_of_match) so the OF device table is used twice.
>>
>> One to expose the "of:N*T*Cfoo,bar" and another one to expose it as "i2c:bar".
>>
>> I expect that many developers would miss adding this macro for new drivers that
>> are DT-only and so sysfs instantiation would not work there. So whatever is the
>> approach taken we should clearly document all this so drivers authors are aware.
>
> You could add a new I2C_MODULE_DEVICE_TABLE() that adds both, right?
> Makes it a little bit easier to check/enforce this.
>
Right, we could add a macro for that. Although it should probably be called
I2C_OF_MODULE_DEVICE_TABLE() or something like that since is specific to OF.
> Gr{oetje,eeting}s,
>
> Geert
>
Best regards,
--
Javier Martinez Canillas
Software Engineer - Desktop Hardware Enablement
Red Hat
next prev parent reply other threads:[~2019-08-06 17:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-10 19:39 [PATCH RFC] modpost: Support I2C Aliases from OF tables Kieran Bingham
2019-07-22 13:03 ` Javier Martinez Canillas
2019-07-31 19:44 ` Wolfram Sang
2019-08-01 2:17 ` Masahiro Yamada
2019-08-05 22:48 ` Javier Martinez Canillas
2019-08-06 7:30 ` Geert Uytterhoeven
2019-08-06 17:39 ` Javier Martinez Canillas
2019-08-05 22:25 ` Javier Martinez Canillas
2019-08-06 7:22 ` Geert Uytterhoeven
2019-08-06 17:12 ` Javier Martinez Canillas [this message]
2019-08-08 13:12 ` Enrico Weigelt, metux IT consult
2019-08-08 13:24 ` Andy Shevchenko
2019-08-08 14:00 ` Enrico Weigelt, metux IT consult
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=51451f89-9193-2be6-e724-e9ca44a25f52@redhat.com \
--to=javierm@redhat.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=broonie@kernel.org \
--cc=geert@linux-m68k.org \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=lee.jones@linaro.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--cc=wsa@the-dreams.de \
--cc=yamada.masahiro@socionext.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 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).