From: Chris Read <chrisrfq-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Alexandre Courbot
<gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Linus Walleij
<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Liam Girdwood <lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Markus Pargmann <mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Subject: Re: Userspace and Device-Tree
Date: Tue, 1 Sep 2015 15:19:44 -0700 [thread overview]
Message-ID: <CAPiN7iWq0EN+Pph82MHvNKn2pUNEh3Vs4ymjMpdB212x2fq0sQ@mail.gmail.com> (raw)
In-Reply-To: <20150901201755.GZ5313-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
On Tue, Sep 1, 2015 at 1:17 PM, Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
>> .......we have the application software act like drivers in
>> cases where high speed isn't required (such as GPIOs and switching
>> on/off power supplies).
>
> Yeah, so the power supplies bit is not something we want to encourage.
I agree with you (in almost all situations).
>> From what I see the standard kernel allows exposing GPIOs to userspace.
>> There are kernel calls to do so. It seems to be recognized as an important
>> feature. The standard kernel also has a regulator-consumer whose whole
>> purpose is to expose control of a regulator to userspace. So it looks like
>> such userspace control is intended.
>
> At least in the case of regulators those are specifically for use in
> board file cases, they should never have direct DT bindings.
My understanding, is that we're trying very hard to avoid having any board
files, and that DT use was intended to facilitate getting away from them.
Perhaps my interpretation of the need to avoid board files is extreme?
>> ..... I'd like
>> to have a way to use the same kernel for all our boards, and have a
>> configuration that can be provided that will expose the required ones.
>
> So one thing you could do here is have your connector have a driver that
> handles what it knows about for the cases where that's useful and just
> punts everything else to userspace. That way you don't need to actually
> write the kernel code for every last thing and can still punt to
> userspace but don't need to have a DT that represents the actual
> hardware.
>
> I don't know if other people think that makes sense though.
That's a very intriguing idea to me. Let me see if I understand your
suggestion fully.
It would involve creating a kernel module (not really a driver, since
it doesn't actually control hardware) as well as modifications to the DT.
In the DT we'd create a hardware description of a connector, which
indicates all the signals, etc. that come to it. Signals which are
connected to other devices and are thus fully described elsewhere
would simply be referenced. Nothing new would happen with those
signals via DT and kernel module.
However, signals that are not described elsewhere could be qualified
in the DT as appropriate for the hardware connector. For GPIO's that
could include direction, level, name, etc. Since those signals aren't
mated internally with any other hardware they would automatically be
exposed to userspace. The new kernel module would be responsible
for configuring the newly described hardware as well as doing the
exposing to userspace.
That sounds quite workable to me. It might get more complicated
than I'd prefer, especially if there are more things than GPIOs (such
as ADCs, DACs, etc.) that might come to the connector previously
unconfigured. But I think the idea is sound--and it keeps the DT in
the hardware rather than the userspace business, which is what we
want. It also sounds like it might be broadly applicable, and have
interest far beyond me.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-09-01 22:19 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <01e601d0e0f9$614450d0$23ccf270$@gmail.com>
2015-08-28 10:12 ` Userspace and Device-Tree Mark Rutland
[not found] ` <CAPiN7iV6LF6LtatzCQ5H6Nq=WivE+e4Z1OsA5cArkEZKqwPLBQ@mail.gmail.com>
[not found] ` <CAPiN7iV6LF6LtatzCQ5H6Nq=WivE+e4Z1OsA5cArkEZKqwPLBQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-08-28 17:55 ` Fwd: " Chris Read
2015-08-28 17:57 ` Mark Rutland
2015-08-28 18:33 ` Mark Brown
2015-08-28 18:05 ` Mark Brown
[not found] ` <20150828180544.GT12027-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-08-28 18:43 ` Chris Read
[not found] ` <CAPiN7iXep-rWN5DyU1+Toso9CT7ppuNyEXX6ySU3AnxwBro2_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-08-28 18:52 ` Mark Brown
[not found] ` <20150828185256.GW12027-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-08-28 19:32 ` Chris Read
[not found] ` <CAPiN7iUahed1uoMaFzVYHrdb-yRFUiej+c9S3GjZ0D2jw2+ygw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-08-29 9:30 ` Mark Brown
2015-08-29 12:09 ` Alexandre Courbot
[not found] ` <CAAVeFuJCSv74HLws7Adb1fnSbxf8rR5=NYX8GG59K1nLgFs+VA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-08-31 14:30 ` Chris Read
[not found] ` <CAPiN7iU+NzW1oYjXLsLgn7Sh=i6DPMC49WrDcpsa4XvmjpORcw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-08-31 14:55 ` Mark Brown
[not found] ` <20150831145500.GP12027-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-08-31 15:53 ` Chris Read
[not found] ` <CAPiN7iWFR2Sm8t9dUttNzwj-qZmUc-cdK69rGhG2RjD+s1gdSA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-08-31 18:01 ` Mark Brown
[not found] ` <20150831180140.GS12027-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-08-31 19:20 ` Chris Read
[not found] ` <CAPiN7iWWAxhg6YQ8BjYHh+Gu8bvQrntvT4QGV+oDe4KAnb1nvg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-01 20:17 ` Mark Brown
[not found] ` <20150901201755.GZ5313-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-09-01 22:19 ` Chris Read [this message]
[not found] ` <CAPiN7iWq0EN+Pph82MHvNKn2pUNEh3Vs4ymjMpdB212x2fq0sQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-02 9:17 ` Mark Brown
2015-09-21 23:51 ` Linus Walleij
[not found] ` <CACRpkdaUZ93t7BdAMhiS0m3wSGP_VaBQdU05ZK_AaHmHyCCKRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-22 13:37 ` Chris Read
2015-09-02 12:29 ` Alexandre Courbot
[not found] ` <CAAVeFuJsM_gDNHNqSRi2iHNAzMHAiw0-y5V1pRce4SD8OgY11Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-02 13:35 ` Chris Read
[not found] ` <CAPiN7iUvDgifPYxhtVf3oOJLV1q1ZA6MZ-2tL2JbpgE0oUM6AA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-21 23:55 ` Linus Walleij
[not found] ` <CACRpkda=2qnxnnRBga-6U9mCDUD61=1+62-awC8NVOV6Yt9mAA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-22 13:54 ` Chris Read
[not found] ` <CAPiN7iVZgvLS0HGifhDULVavCw2TdxZBC_+bcGjWKAAax=YFKQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-23 10:17 ` Alexandre Courbot
2015-09-24 16:54 ` Linus Walleij
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=CAPiN7iWq0EN+Pph82MHvNKn2pUNEh3Vs4ymjMpdB212x2fq0sQ@mail.gmail.com \
--to=chrisrfq-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
/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).