15def4c47SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 25def4c47SEmmanuel Vadot%YAML 1.2 35def4c47SEmmanuel Vadot--- 45def4c47SEmmanuel Vadot$id: http://devicetree.org/schemas/iio/afe/voltage-divider.yaml# 55def4c47SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 65def4c47SEmmanuel Vadot 75def4c47SEmmanuel Vadottitle: Voltage divider 85def4c47SEmmanuel Vadot 95def4c47SEmmanuel Vadotmaintainers: 105def4c47SEmmanuel Vadot - Peter Rosin <peda@axentia.se> 115def4c47SEmmanuel Vadot 125def4c47SEmmanuel Vadotdescription: | 135def4c47SEmmanuel Vadot When an io-channel measures the midpoint of a voltage divider, the 145def4c47SEmmanuel Vadot interesting voltage is often the voltage over the full resistance 155def4c47SEmmanuel Vadot of the divider. This binding describes the voltage divider in such 16*f126890aSEmmanuel Vadot a circuit. 175def4c47SEmmanuel Vadot 185def4c47SEmmanuel Vadot Vin ----. 195def4c47SEmmanuel Vadot | 205def4c47SEmmanuel Vadot .-----. 215def4c47SEmmanuel Vadot | R | 225def4c47SEmmanuel Vadot '-----' 235def4c47SEmmanuel Vadot | 245def4c47SEmmanuel Vadot +---- Vout 255def4c47SEmmanuel Vadot | 265def4c47SEmmanuel Vadot .-----. 275def4c47SEmmanuel Vadot | Rout| 285def4c47SEmmanuel Vadot '-----' 295def4c47SEmmanuel Vadot | 305def4c47SEmmanuel Vadot GND 315def4c47SEmmanuel Vadot 325def4c47SEmmanuel Vadot 335def4c47SEmmanuel Vadotproperties: 345def4c47SEmmanuel Vadot compatible: 355def4c47SEmmanuel Vadot const: voltage-divider 365def4c47SEmmanuel Vadot 375def4c47SEmmanuel Vadot io-channels: 385def4c47SEmmanuel Vadot maxItems: 1 395def4c47SEmmanuel Vadot description: | 405def4c47SEmmanuel Vadot Channel node of a voltage io-channel. 415def4c47SEmmanuel Vadot 425def4c47SEmmanuel Vadot output-ohms: 435def4c47SEmmanuel Vadot description: 445def4c47SEmmanuel Vadot Resistance Rout over which the output voltage is measured. See full-ohms. 455def4c47SEmmanuel Vadot 465def4c47SEmmanuel Vadot full-ohms: 475def4c47SEmmanuel Vadot description: 485def4c47SEmmanuel Vadot Resistance R + Rout for the full divider. The io-channel is scaled by 495def4c47SEmmanuel Vadot the Rout / (R + Rout) quotient. 505def4c47SEmmanuel Vadot 515def4c47SEmmanuel Vadotrequired: 525def4c47SEmmanuel Vadot - compatible 535def4c47SEmmanuel Vadot - io-channels 545def4c47SEmmanuel Vadot - output-ohms 555def4c47SEmmanuel Vadot - full-ohms 565def4c47SEmmanuel Vadot 575def4c47SEmmanuel VadotadditionalProperties: false 585def4c47SEmmanuel Vadot 595def4c47SEmmanuel Vadotexamples: 605def4c47SEmmanuel Vadot - | 615def4c47SEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 625def4c47SEmmanuel Vadot /* 635def4c47SEmmanuel Vadot * The system voltage is circa 12V, but divided down with a 22/222 645def4c47SEmmanuel Vadot * voltage divider (R = 200 Ohms, Rout = 22 Ohms) and fed to an ADC. 655def4c47SEmmanuel Vadot */ 665def4c47SEmmanuel Vadot spi { 675def4c47SEmmanuel Vadot #address-cells = <1>; 685def4c47SEmmanuel Vadot #size-cells = <0>; 695def4c47SEmmanuel Vadot maxadc: adc@0 { 705def4c47SEmmanuel Vadot compatible = "maxim,max1027"; 715def4c47SEmmanuel Vadot reg = <0>; 725def4c47SEmmanuel Vadot #io-channel-cells = <1>; 735def4c47SEmmanuel Vadot interrupt-parent = <&gpio5>; 745def4c47SEmmanuel Vadot interrupts = <15 IRQ_TYPE_EDGE_RISING>; 755def4c47SEmmanuel Vadot spi-max-frequency = <1000000>; 765def4c47SEmmanuel Vadot }; 775def4c47SEmmanuel Vadot }; 785def4c47SEmmanuel Vadot sysv { 795def4c47SEmmanuel Vadot compatible = "voltage-divider"; 805def4c47SEmmanuel Vadot io-channels = <&maxadc 1>; 815def4c47SEmmanuel Vadot 825def4c47SEmmanuel Vadot /* Scale the system voltage by 22/222 to fit the ADC range. */ 835def4c47SEmmanuel Vadot output-ohms = <22>; 845def4c47SEmmanuel Vadot full-ohms = <222>; /* 200 + 22 */ 855def4c47SEmmanuel Vadot }; 865def4c47SEmmanuel Vadot... 87