From: Jonathan Cameron <Jonathan.Cameron-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Mike Looijmans <mike.looijmans-Oq418RWZeHk@public.gmane.org>,
Jonathan Cameron
<jic23-tko9wxEg+fIOOJlXag/Snyp2UmYkHbXO@public.gmane.org>,
"linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: "Generic" MMIO ADC
Date: Fri, 7 Jul 2017 15:44:48 +0800 [thread overview]
Message-ID: <20170707154448.00006dec@huawei.com> (raw)
In-Reply-To: <CACRpkdaZ=qSbdVxgw4DH_tOeZb0pZBYhhJJOozFn2pn25F_Kag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Thu, 6 Jul 2017 23:37:04 +0200
Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> On Mon, Jul 3, 2017 at 2:37 PM, Mike Looijmans <mike.looijmans-Oq418RWZeHk@public.gmane.org> wrote:
>
> > I was thinking along these lines:
> >
> > ... {
> > compatible = "iio-adc-generic-mmio";
> > reg = <0x43210000 4096>;
> > interrupt = <&gic 42 0>;
> > iio,start-sequence = <0x0 0x3> <0x4 0xff>;
> > iio,stop-sequence = <0x0 0x0>;
>
> Nope. We are not going to invent scripting languages inside device tree.
> No sequences please. This is the start of what we call a jam table.
>
> We had this discussion a long time ago when starting to convert all the ARM
> platforms to device tree: sequences should be expressed in code, not in
> the device tree. Because next thing that happens is that you want to encode
> a for() loop or if() or while().
>
> The reason is that device tree is already part of open firmware, which already
> has a scripting language: FCode (based on forth). This is then used to create
> BIOS routines along the lines of what you're suggesting. So if you insist on
> writing a BIOS, by all means write a BIOS, but not inside DT, use FCode
> and figure out how to bridge that.
>
> But I think it's easier to just write a normal driver really.
>
> Compare to ACPI, which has AML, for the very same purpose, and DSDT
> for describing the hardware.
>
> Since ACPI is now starting to share parts of the DT bindings), things would
> get very weird if we did things like this. Should they also implement a
> compatible interpreter, rather than call their (very much in-use) AML
> snippets?
Ah that was matching up with my gut feeling on the matter. Thanks for the detailed
response Linus. Anyhow, doesn't mean the concept of such a driver is bad, merely that
the tables should form part of the driver code (much like any other driver that supports
a number of different parts) and be selected by the compatible string.
Jonathan
>
> Yours,
> Linus Walleij
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" 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:[~2017-07-07 7:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <b60def9a-45dc-bf97-e059-abbe105648b2@topic.nl>
[not found] ` <b60def9a-45dc-bf97-e059-abbe105648b2-Oq418RWZeHk@public.gmane.org>
2017-06-30 13:53 ` "Generic" MMIO ADC Jonathan Cameron
[not found] ` <20170630145319.20ec3696-tko9wxEg+fIOOJlXag/Snyp2UmYkHbXO@public.gmane.org>
2017-06-30 13:59 ` Linus Walleij
2017-06-30 15:33 ` Rob Herring
2017-07-03 12:37 ` Mike Looijmans
[not found] ` <b9dc2313-53da-1566-c0e8-ac18599f59da-Oq418RWZeHk@public.gmane.org>
2017-07-06 18:22 ` Jonathan Cameron
2017-07-06 21:37 ` Linus Walleij
[not found] ` <CACRpkdaZ=qSbdVxgw4DH_tOeZb0pZBYhhJJOozFn2pn25F_Kag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-07 7:44 ` Jonathan Cameron [this message]
[not found] ` <20170707154448.00006dec-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-07-09 4:11 ` 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=20170707154448.00006dec@huawei.com \
--to=jonathan.cameron-hv44wf8li93qt0dzr+alfa@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=jic23-tko9wxEg+fIOOJlXag/Snyp2UmYkHbXO@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=mike.looijmans-Oq418RWZeHk@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@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).