18c2ecf20Sopenharmony_ci* Renesas R-Car GyroADC device driver
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciThe GyroADC block is a reduced SPI block with up to 8 chipselect lines,
48c2ecf20Sopenharmony_ciwhich supports the SPI protocol of a selected few SPI ADCs. The SPI ADCs
58c2ecf20Sopenharmony_ciare sampled by the GyroADC block in a round-robin fashion and the result
68c2ecf20Sopenharmony_cipresented in the GyroADC registers.
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ciRequired properties:
98c2ecf20Sopenharmony_ci- compatible:	Should be "<soc-specific>", "renesas,rcar-gyroadc".
108c2ecf20Sopenharmony_ci                The <soc-specific> should be one of:
118c2ecf20Sopenharmony_ci		renesas,r8a7791-gyroadc - for the GyroADC block present
128c2ecf20Sopenharmony_ci					  in r8a7791 SoC
138c2ecf20Sopenharmony_ci		renesas,r8a7792-gyroadc - for the GyroADC with interrupt
148c2ecf20Sopenharmony_ci					  block present in r8a7792 SoC
158c2ecf20Sopenharmony_ci- reg:		Address and length of the register set for the device
168c2ecf20Sopenharmony_ci- clocks:	References to all the clocks specified in the clock-names
178c2ecf20Sopenharmony_ci		property as specified in
188c2ecf20Sopenharmony_ci		Documentation/devicetree/bindings/clock/clock-bindings.txt.
198c2ecf20Sopenharmony_ci- clock-names:	Shall contain "fck". The "fck" is the GyroADC block clock.
208c2ecf20Sopenharmony_ci- power-domains: Must contain a reference to the PM domain, if available.
218c2ecf20Sopenharmony_ci- #address-cells: Should be <1> (setting for the subnodes) for all ADCs
228c2ecf20Sopenharmony_ci		except for "fujitsu,mb88101a". Should be <0> (setting for
238c2ecf20Sopenharmony_ci		only subnode) for "fujitsu,mb88101a".
248c2ecf20Sopenharmony_ci- #size-cells:	Should be <0> (setting for the subnodes)
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ciSub-nodes:
278c2ecf20Sopenharmony_ciYou must define subnode(s) which select the connected ADC type and reference
288c2ecf20Sopenharmony_civoltage for the GyroADC channels.
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ciRequired properties for subnodes:
318c2ecf20Sopenharmony_ci- compatible:	Should be either of:
328c2ecf20Sopenharmony_ci		"fujitsu,mb88101a"
338c2ecf20Sopenharmony_ci			- Fujitsu MB88101A compatible mode,
348c2ecf20Sopenharmony_ci			  12bit sampling, up to 4 channels can be sampled in
358c2ecf20Sopenharmony_ci			  round-robin fashion. One Fujitsu chip supplies four
368c2ecf20Sopenharmony_ci			  GyroADC channels with data as it contains four ADCs
378c2ecf20Sopenharmony_ci			  on the chip and thus for 4-channel operation, single
388c2ecf20Sopenharmony_ci			  MB88101A is required. The Cx chipselect lines of the
398c2ecf20Sopenharmony_ci			  MB88101A connect directly to two CHS lines of the
408c2ecf20Sopenharmony_ci			  GyroADC, no demuxer is required. The data out line
418c2ecf20Sopenharmony_ci			  of each MB88101A connects to a shared input pin of
428c2ecf20Sopenharmony_ci			  the GyroADC.
438c2ecf20Sopenharmony_ci		"ti,adcs7476" or "ti,adc121" or "adi,ad7476"
448c2ecf20Sopenharmony_ci			- TI ADCS7476 / TI ADC121 / ADI AD7476 compatible mode,
458c2ecf20Sopenharmony_ci			  15bit sampling, up to 8 channels can be sampled in
468c2ecf20Sopenharmony_ci			  round-robin fashion. One TI/ADI chip supplies single
478c2ecf20Sopenharmony_ci			  ADC channel with data, thus for 8-channel operation,
488c2ecf20Sopenharmony_ci			  8 chips are required. A 3:8 chipselect demuxer is
498c2ecf20Sopenharmony_ci			  required to connect the nCS line of the TI/ADI chips
508c2ecf20Sopenharmony_ci			  to the GyroADC, while MISO line of each TI/ADI ADC
518c2ecf20Sopenharmony_ci			  connects to a shared input pin of the GyroADC.
528c2ecf20Sopenharmony_ci		"maxim,max1162" or "maxim,max11100"
538c2ecf20Sopenharmony_ci			- Maxim MAX1162 / Maxim MAX11100 compatible mode,
548c2ecf20Sopenharmony_ci			  16bit sampling, up to 8 channels can be sampled in
558c2ecf20Sopenharmony_ci			  round-robin fashion. One Maxim chip supplies single
568c2ecf20Sopenharmony_ci			  ADC channel with data, thus for 8-channel operation,
578c2ecf20Sopenharmony_ci			  8 chips are required. A 3:8 chipselect demuxer is
588c2ecf20Sopenharmony_ci			  required to connect the nCS line of the MAX chips
598c2ecf20Sopenharmony_ci			  to the GyroADC, while MISO line of each Maxim ADC
608c2ecf20Sopenharmony_ci			  connects to a shared input pin of the GyroADC.
618c2ecf20Sopenharmony_ci- reg:		Should be the number of the analog input. Should be present
628c2ecf20Sopenharmony_ci		for all ADCs except "fujitsu,mb88101a".
638c2ecf20Sopenharmony_ci- vref-supply:	Reference to the channel reference voltage regulator.
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ciExample:
668c2ecf20Sopenharmony_ci	vref_max1162: regulator-vref-max1162 {
678c2ecf20Sopenharmony_ci		compatible = "regulator-fixed";
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci		regulator-name = "MAX1162 Vref";
708c2ecf20Sopenharmony_ci		regulator-min-microvolt = <4096000>;
718c2ecf20Sopenharmony_ci		regulator-max-microvolt = <4096000>;
728c2ecf20Sopenharmony_ci	};
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci	adc@e6e54000 {
758c2ecf20Sopenharmony_ci		compatible = "renesas,r8a7791-gyroadc", "renesas,rcar-gyroadc";
768c2ecf20Sopenharmony_ci		reg = <0 0xe6e54000 0 64>;
778c2ecf20Sopenharmony_ci		clocks = <&mstp9_clks R8A7791_CLK_GYROADC>;
788c2ecf20Sopenharmony_ci		clock-names = "fck";
798c2ecf20Sopenharmony_ci		power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci		pinctrl-0 = <&adc_pins>;
828c2ecf20Sopenharmony_ci		pinctrl-names = "default";
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci		#address-cells = <1>;
858c2ecf20Sopenharmony_ci		#size-cells = <0>;
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci		adc@0 {
888c2ecf20Sopenharmony_ci			reg = <0>;
898c2ecf20Sopenharmony_ci			compatible = "maxim,max1162";
908c2ecf20Sopenharmony_ci			vref-supply = <&vref_max1162>;
918c2ecf20Sopenharmony_ci		};
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci		adc@1 {
948c2ecf20Sopenharmony_ci			reg = <1>;
958c2ecf20Sopenharmony_ci			compatible = "maxim,max1162";
968c2ecf20Sopenharmony_ci			vref-supply = <&vref_max1162>;
978c2ecf20Sopenharmony_ci		};
988c2ecf20Sopenharmony_ci	};
99