Re: "Generic" MMIO ADC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 6 Jul 2017 23:37:04 +0200
Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:

> On Mon, Jul 3, 2017 at 2:37 PM, Mike Looijmans <mike.looijmans@xxxxxxxx> 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@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux