1*c66ec88fSEmmanuel Vadot* Renesas R-Car GyroADC device driver 2*c66ec88fSEmmanuel Vadot 3*c66ec88fSEmmanuel VadotThe GyroADC block is a reduced SPI block with up to 8 chipselect lines, 4*c66ec88fSEmmanuel Vadotwhich supports the SPI protocol of a selected few SPI ADCs. The SPI ADCs 5*c66ec88fSEmmanuel Vadotare sampled by the GyroADC block in a round-robin fashion and the result 6*c66ec88fSEmmanuel Vadotpresented in the GyroADC registers. 7*c66ec88fSEmmanuel Vadot 8*c66ec88fSEmmanuel VadotRequired properties: 9*c66ec88fSEmmanuel Vadot- compatible: Should be "<soc-specific>", "renesas,rcar-gyroadc". 10*c66ec88fSEmmanuel Vadot The <soc-specific> should be one of: 11*c66ec88fSEmmanuel Vadot renesas,r8a7791-gyroadc - for the GyroADC block present 12*c66ec88fSEmmanuel Vadot in r8a7791 SoC 13*c66ec88fSEmmanuel Vadot renesas,r8a7792-gyroadc - for the GyroADC with interrupt 14*c66ec88fSEmmanuel Vadot block present in r8a7792 SoC 15*c66ec88fSEmmanuel Vadot- reg: Address and length of the register set for the device 16*c66ec88fSEmmanuel Vadot- clocks: References to all the clocks specified in the clock-names 17*c66ec88fSEmmanuel Vadot property as specified in 18*c66ec88fSEmmanuel Vadot Documentation/devicetree/bindings/clock/clock-bindings.txt. 19*c66ec88fSEmmanuel Vadot- clock-names: Shall contain "fck". The "fck" is the GyroADC block clock. 20*c66ec88fSEmmanuel Vadot- power-domains: Must contain a reference to the PM domain, if available. 21*c66ec88fSEmmanuel Vadot- #address-cells: Should be <1> (setting for the subnodes) for all ADCs 22*c66ec88fSEmmanuel Vadot except for "fujitsu,mb88101a". Should be <0> (setting for 23*c66ec88fSEmmanuel Vadot only subnode) for "fujitsu,mb88101a". 24*c66ec88fSEmmanuel Vadot- #size-cells: Should be <0> (setting for the subnodes) 25*c66ec88fSEmmanuel Vadot 26*c66ec88fSEmmanuel VadotSub-nodes: 27*c66ec88fSEmmanuel VadotYou must define subnode(s) which select the connected ADC type and reference 28*c66ec88fSEmmanuel Vadotvoltage for the GyroADC channels. 29*c66ec88fSEmmanuel Vadot 30*c66ec88fSEmmanuel VadotRequired properties for subnodes: 31*c66ec88fSEmmanuel Vadot- compatible: Should be either of: 32*c66ec88fSEmmanuel Vadot "fujitsu,mb88101a" 33*c66ec88fSEmmanuel Vadot - Fujitsu MB88101A compatible mode, 34*c66ec88fSEmmanuel Vadot 12bit sampling, up to 4 channels can be sampled in 35*c66ec88fSEmmanuel Vadot round-robin fashion. One Fujitsu chip supplies four 36*c66ec88fSEmmanuel Vadot GyroADC channels with data as it contains four ADCs 37*c66ec88fSEmmanuel Vadot on the chip and thus for 4-channel operation, single 38*c66ec88fSEmmanuel Vadot MB88101A is required. The Cx chipselect lines of the 39*c66ec88fSEmmanuel Vadot MB88101A connect directly to two CHS lines of the 40*c66ec88fSEmmanuel Vadot GyroADC, no demuxer is required. The data out line 41*c66ec88fSEmmanuel Vadot of each MB88101A connects to a shared input pin of 42*c66ec88fSEmmanuel Vadot the GyroADC. 43*c66ec88fSEmmanuel Vadot "ti,adcs7476" or "ti,adc121" or "adi,ad7476" 44*c66ec88fSEmmanuel Vadot - TI ADCS7476 / TI ADC121 / ADI AD7476 compatible mode, 45*c66ec88fSEmmanuel Vadot 15bit sampling, up to 8 channels can be sampled in 46*c66ec88fSEmmanuel Vadot round-robin fashion. One TI/ADI chip supplies single 47*c66ec88fSEmmanuel Vadot ADC channel with data, thus for 8-channel operation, 48*c66ec88fSEmmanuel Vadot 8 chips are required. A 3:8 chipselect demuxer is 49*c66ec88fSEmmanuel Vadot required to connect the nCS line of the TI/ADI chips 50*c66ec88fSEmmanuel Vadot to the GyroADC, while MISO line of each TI/ADI ADC 51*c66ec88fSEmmanuel Vadot connects to a shared input pin of the GyroADC. 52*c66ec88fSEmmanuel Vadot "maxim,max1162" or "maxim,max11100" 53*c66ec88fSEmmanuel Vadot - Maxim MAX1162 / Maxim MAX11100 compatible mode, 54*c66ec88fSEmmanuel Vadot 16bit sampling, up to 8 channels can be sampled in 55*c66ec88fSEmmanuel Vadot round-robin fashion. One Maxim chip supplies single 56*c66ec88fSEmmanuel Vadot ADC channel with data, thus for 8-channel operation, 57*c66ec88fSEmmanuel Vadot 8 chips are required. A 3:8 chipselect demuxer is 58*c66ec88fSEmmanuel Vadot required to connect the nCS line of the MAX chips 59*c66ec88fSEmmanuel Vadot to the GyroADC, while MISO line of each Maxim ADC 60*c66ec88fSEmmanuel Vadot connects to a shared input pin of the GyroADC. 61*c66ec88fSEmmanuel Vadot- reg: Should be the number of the analog input. Should be present 62*c66ec88fSEmmanuel Vadot for all ADCs except "fujitsu,mb88101a". 63*c66ec88fSEmmanuel Vadot- vref-supply: Reference to the channel reference voltage regulator. 64*c66ec88fSEmmanuel Vadot 65*c66ec88fSEmmanuel VadotExample: 66*c66ec88fSEmmanuel Vadot vref_max1162: regulator-vref-max1162 { 67*c66ec88fSEmmanuel Vadot compatible = "regulator-fixed"; 68*c66ec88fSEmmanuel Vadot 69*c66ec88fSEmmanuel Vadot regulator-name = "MAX1162 Vref"; 70*c66ec88fSEmmanuel Vadot regulator-min-microvolt = <4096000>; 71*c66ec88fSEmmanuel Vadot regulator-max-microvolt = <4096000>; 72*c66ec88fSEmmanuel Vadot }; 73*c66ec88fSEmmanuel Vadot 74*c66ec88fSEmmanuel Vadot adc@e6e54000 { 75*c66ec88fSEmmanuel Vadot compatible = "renesas,r8a7791-gyroadc", "renesas,rcar-gyroadc"; 76*c66ec88fSEmmanuel Vadot reg = <0 0xe6e54000 0 64>; 77*c66ec88fSEmmanuel Vadot clocks = <&mstp9_clks R8A7791_CLK_GYROADC>; 78*c66ec88fSEmmanuel Vadot clock-names = "fck"; 79*c66ec88fSEmmanuel Vadot power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 80*c66ec88fSEmmanuel Vadot 81*c66ec88fSEmmanuel Vadot pinctrl-0 = <&adc_pins>; 82*c66ec88fSEmmanuel Vadot pinctrl-names = "default"; 83*c66ec88fSEmmanuel Vadot 84*c66ec88fSEmmanuel Vadot #address-cells = <1>; 85*c66ec88fSEmmanuel Vadot #size-cells = <0>; 86*c66ec88fSEmmanuel Vadot 87*c66ec88fSEmmanuel Vadot adc@0 { 88*c66ec88fSEmmanuel Vadot reg = <0>; 89*c66ec88fSEmmanuel Vadot compatible = "maxim,max1162"; 90*c66ec88fSEmmanuel Vadot vref-supply = <&vref_max1162>; 91*c66ec88fSEmmanuel Vadot }; 92*c66ec88fSEmmanuel Vadot 93*c66ec88fSEmmanuel Vadot adc@1 { 94*c66ec88fSEmmanuel Vadot reg = <1>; 95*c66ec88fSEmmanuel Vadot compatible = "maxim,max1162"; 96*c66ec88fSEmmanuel Vadot vref-supply = <&vref_max1162>; 97*c66ec88fSEmmanuel Vadot }; 98*c66ec88fSEmmanuel Vadot }; 99