On Fri, Jun 30, 2017 at 3:53 PM, Jonathan Cameron <jic23@xxxxxxxxxxxxxxxxxxxxx> wrote: > On Fri, 30 Jun 2017 10:44:42 +0200 > Mike Looijmans <mike.looijmans@xxxxxxxx> wrote: > >> I'm writing an IIO driver for a custom IP, which is pretty simple: >> >> - Map the registers to memory and register IRQ routine >> - To start acquisition, write a value to the config register >> - On interrupt, read data register, push it into queue >> - To stop, write another value to config. >> >> Would it be useful to provide this as a generic driver in Linux, so that you >> can provide the config register and data register offsets and values in the >> devicetree? That would make it work on a lot of similar project without >> everyone coding the same thing. > > Hi Mike, > > I've brought in the devicetree bindings maintainers and list as well on this > discussion because in many ways it's more about the strategy on bindings > than the actual driver... Also Linus Walleij for any experience handing > the gpio-mmio driver which strikes me as fairly similar in aim. The gpio-mmio is for the simple case where we have one bit per GPIO, one bit reads/writes value, one bit sets direction etc. (I am happy we did not call it "gpio-simple" because these "simple" things are seldom simple in practice. So MMIO ADC is a good name.) I would ask the following architectural questions: - Is it really that simple, no clocks, regulator etc? - Is it advisible to have it as a child of a syscon, using "simple-mfd" to spawn the child device c.f. Documentation/devicetree/bindings/leds/register-bit-led.txt drivers/leds/leds-syscon.c - drivers/power/reset/syscon-* also use the syscon child approach 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