1*c66ec88fSEmmanuel VadotBindings for ADC envelope detector using a DAC and a comparator 2*c66ec88fSEmmanuel Vadot 3*c66ec88fSEmmanuel VadotThe DAC is used to find the peak level of an alternating voltage input 4*c66ec88fSEmmanuel Vadotsignal by a binary search using the output of a comparator wired to 5*c66ec88fSEmmanuel Vadotan interrupt pin. Like so: 6*c66ec88fSEmmanuel Vadot _ 7*c66ec88fSEmmanuel Vadot | \ 8*c66ec88fSEmmanuel Vadot input +------>-------|+ \ 9*c66ec88fSEmmanuel Vadot | \ 10*c66ec88fSEmmanuel Vadot .-------. | }---. 11*c66ec88fSEmmanuel Vadot | | | / | 12*c66ec88fSEmmanuel Vadot | dac|-->--|- / | 13*c66ec88fSEmmanuel Vadot | | |_/ | 14*c66ec88fSEmmanuel Vadot | | | 15*c66ec88fSEmmanuel Vadot | | | 16*c66ec88fSEmmanuel Vadot | irq|------<-------' 17*c66ec88fSEmmanuel Vadot | | 18*c66ec88fSEmmanuel Vadot '-------' 19*c66ec88fSEmmanuel Vadot 20*c66ec88fSEmmanuel VadotRequired properties: 21*c66ec88fSEmmanuel Vadot- compatible: Should be "axentia,tse850-envelope-detector" 22*c66ec88fSEmmanuel Vadot- io-channels: Channel node of the dac to be used for comparator input. 23*c66ec88fSEmmanuel Vadot- io-channel-names: Should be "dac". 24*c66ec88fSEmmanuel Vadot- interrupt specification for one client interrupt, 25*c66ec88fSEmmanuel Vadot see ../../interrupt-controller/interrupts.txt for details. 26*c66ec88fSEmmanuel Vadot- interrupt-names: Should be "comp". 27*c66ec88fSEmmanuel Vadot 28*c66ec88fSEmmanuel VadotExample: 29*c66ec88fSEmmanuel Vadot 30*c66ec88fSEmmanuel Vadot &i2c { 31*c66ec88fSEmmanuel Vadot dpot: mcp4651-104@28 { 32*c66ec88fSEmmanuel Vadot compatible = "microchip,mcp4651-104"; 33*c66ec88fSEmmanuel Vadot reg = <0x28>; 34*c66ec88fSEmmanuel Vadot #io-channel-cells = <1>; 35*c66ec88fSEmmanuel Vadot }; 36*c66ec88fSEmmanuel Vadot }; 37*c66ec88fSEmmanuel Vadot 38*c66ec88fSEmmanuel Vadot dac: dac { 39*c66ec88fSEmmanuel Vadot compatible = "dpot-dac"; 40*c66ec88fSEmmanuel Vadot vref-supply = <®_3v3>; 41*c66ec88fSEmmanuel Vadot io-channels = <&dpot 0>; 42*c66ec88fSEmmanuel Vadot io-channel-names = "dpot"; 43*c66ec88fSEmmanuel Vadot #io-channel-cells = <1>; 44*c66ec88fSEmmanuel Vadot }; 45*c66ec88fSEmmanuel Vadot 46*c66ec88fSEmmanuel Vadot envelope-detector { 47*c66ec88fSEmmanuel Vadot compatible = "axentia,tse850-envelope-detector"; 48*c66ec88fSEmmanuel Vadot io-channels = <&dac 0>; 49*c66ec88fSEmmanuel Vadot io-channel-names = "dac"; 50*c66ec88fSEmmanuel Vadot 51*c66ec88fSEmmanuel Vadot interrupt-parent = <&gpio>; 52*c66ec88fSEmmanuel Vadot interrupts = <3 IRQ_TYPE_EDGE_FALLING>; 53*c66ec88fSEmmanuel Vadot interrupt-names = "comp"; 54*c66ec88fSEmmanuel Vadot }; 55