Hi Marek, Please CC linux-renesas-soc for drivers for (parts of) Renesas ARM SoCs. On Tue, Jan 10, 2017 at 10:33 PM, Marek Vasut <marek.vasut@xxxxxxxxx> wrote: > Add IIO driver for the Renesas RCar GyroADC block. This block is a > simple 4/8-channel ADC which samples 12/15/24 bits of data every > cycle from all channels. > > Signed-off-by: Marek Vasut <marek.vasut@xxxxxxxxx> > Cc: Geert Uytterhoeven <geert+renesas@xxxxxxxxx> > Cc: Simon Horman <horms+renesas@xxxxxxxxxxxx> > --- > V2: - Spelling fixes > - Rename the driver source file to rcar-gyroadc > - Rework the channel sample width handling > - Use iio_device_claim_mode_direct() > - Rename "renesas,rcar-gyroadc" to "renesas,r8a7791-gyroadc" and > rename "renesas,rcar-gyroadc-r8a7792" to "renesas,r8a7792-gyroadc" > to match the new naming scheme (WARNING: scif uses the old one!) > - Switch to using regulators for channel voltage reference, add new > properties renesas,gyroadc-vref-chN-supply for N in 0..7 > - Handle vref regulators as optional to, make channels without > vref regulator return EINVAL on read. > - Fix module license to GPL > - Drop interrupt.h include > - Rename clk to iclk > - Rename RCar to R-Car > - Rework the invalid mode handling > - Don't print error message on EPROBE_DEFER > - Drop fclk handling, use runtime PM for that instead > V3: - More R-Car spelling fixes > - Flip checks for V2H, since that's the only one that has > interrupt registers > - Replace if-else statement with switch statement in init_mode > - Use unsigned types where applicable > - Rework timing calculation slightly to drop if-else block > - Use DIV_ROUND_CLOSEST > V4: - Add renesas,rcar-gyroadc fallback compatible string into the bindings > - Rework the ADC bindings to use per-channel subdevs > - Support more compatible ADC chips > --- > .../bindings/iio/adc/renesas,gyroadc.txt | 70 +++ > MAINTAINERS | 6 + > drivers/iio/adc/Kconfig | 10 + > drivers/iio/adc/Makefile | 1 + > drivers/iio/adc/rcar-gyroadc.c | 531 +++++++++++++++++++++ > 5 files changed, 618 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt > create mode 100644 drivers/iio/adc/rcar-gyroadc.c > > diff --git a/Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt b/Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt > new file mode 100644 > index 000000000000..2dcea9c8895b > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt > @@ -0,0 +1,70 @@ > +* Renesas RCar GyroADC device driver > + > +Required properties: > +- compatible: Should be "renesas,<chip>-gyroadc", "renesas,rcar-gyroadc". > + Use "renesas,r8a7792-gyroadc" for a GyroADC with interrupt > + block found in R8A7792. > +- reg: Address and length of the register set for the device > +- clocks: References to all the clocks specified in the clock-names > + property as specified in > + Documentation/devicetree/bindings/clock/clock-bindings.txt. > +- clock-names: Shall contain "fck" and "if". The "fck" is the GyroADC block > + clock, the "if" is the interface clock. > +- power-domains: Must contain a reference to the PM domain, if available. > +- #address-cells: Should be <1> (setting for the subnodes) > +- #size-cells: Should be <0> (setting for the subnodes) > + > +Sub-nodes: > +Optionally you can define subnodes which define the reference voltage which defined the connected ADC type and the reference voltage > +for the analog inputs. "channels", to match the wording below? > + > +Required properties for subnodes: > +- compatible: Should be either of: > + "fujitsu,mb88101a" > + - Fujitsu MB88101A compatible mode, > + 12bit sampling, 4 channels For this one, we have to find a better representation in DT. Unlike the other two types, the MB88101A is a 4-channel ADC, and thus only a single instance is supported, providing 4 channels. Hence for MB88101A I suggest to just have a single node "adc", without a unit address or "reg" property. > + "ti,adcs7476" or "ti,adc121" or "adi,ad7476" > + - TI ADCS7476 / TI ADC121 / ADI AD7476 compatible mode, > + 15bit sampling, 8 channels ADCS7476 are single channel ADCs. "up to 8 channels can be connected"? > + "maxim,max1162" or "maxim,max11100" > + - Maxim MAX1162 / Maxim MAX11100 compatible mode, > + 16bit sampling, 8 channels MAX1162 and co are single channel ADCs. "up to 8 channels can be connected"? > +- reg: Should be the number of the analog input. > +- vref-supply: Reference to the channel reference voltage regulator. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds