18c2ecf20Sopenharmony_ciAnalog Devices AD5758 DAC device driver 28c2ecf20Sopenharmony_ci 38c2ecf20Sopenharmony_ciRequired properties for the AD5758: 48c2ecf20Sopenharmony_ci - compatible: Must be "adi,ad5758" 58c2ecf20Sopenharmony_ci - reg: SPI chip select number for the device 68c2ecf20Sopenharmony_ci - spi-max-frequency: Max SPI frequency to use (< 50000000) 78c2ecf20Sopenharmony_ci - spi-cpha: is the only mode that is supported 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ciRequired properties: 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci - adi,dc-dc-mode: Mode of operation of the dc-to-dc converter 128c2ecf20Sopenharmony_ci Dynamic Power Control (DPC) 138c2ecf20Sopenharmony_ci In this mode, the AD5758 circuitry senses the output 148c2ecf20Sopenharmony_ci voltage and dynamically regulates the supply voltage, 158c2ecf20Sopenharmony_ci VDPC+, to meet compliance requirements plus an optimized 168c2ecf20Sopenharmony_ci headroom voltage for the output buffer. 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci Programmable Power Control (PPC) 198c2ecf20Sopenharmony_ci In this mode, the VDPC+ voltage is user-programmable to 208c2ecf20Sopenharmony_ci a fixed level that needs to accommodate the maximum output 218c2ecf20Sopenharmony_ci load required. 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci The output of the DAC core is either converted to a 248c2ecf20Sopenharmony_ci current or voltage output at the VIOUT pin. Only one mode 258c2ecf20Sopenharmony_ci can be enabled at any one time. 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci The following values are currently supported: 288c2ecf20Sopenharmony_ci * 1: DPC current mode 298c2ecf20Sopenharmony_ci * 2: DPC voltage mode 308c2ecf20Sopenharmony_ci * 3: PPC current mode 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci Depending on the selected output mode (voltage or current) one of the 338c2ecf20Sopenharmony_ci two properties must 348c2ecf20Sopenharmony_ci be present: 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci - adi,range-microvolt: Voltage output range 378c2ecf20Sopenharmony_ci The array of voltage output ranges must contain two fields: 388c2ecf20Sopenharmony_ci * <0 5000000>: 0 V to 5 V voltage range 398c2ecf20Sopenharmony_ci * <0 10000000>: 0 V to 10 V voltage range 408c2ecf20Sopenharmony_ci * <(-5000000) 5000000>: ±5 V voltage range 418c2ecf20Sopenharmony_ci * <(-10000000) 10000000>: ±10 V voltage range 428c2ecf20Sopenharmony_ci - adi,range-microamp: Current output range 438c2ecf20Sopenharmony_ci The array of current output ranges must contain two fields: 448c2ecf20Sopenharmony_ci * <0 20000>: 0 mA to 20 mA current range 458c2ecf20Sopenharmony_ci * <0 24000>: 0 mA to 24 mA current range 468c2ecf20Sopenharmony_ci * <4 24000>: 4 mA to 20 mA current range 478c2ecf20Sopenharmony_ci * <(-20000) 20000>: ±20 mA current range 488c2ecf20Sopenharmony_ci * <(-24000) 24000>: ±24 mA current range 498c2ecf20Sopenharmony_ci * <(-1000) 22000>: −1 mA to +22 mA current range 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ciOptional properties: 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ci - reset-gpios : GPIO spec for the RESET pin. If specified, it will be 548c2ecf20Sopenharmony_ci asserted during driver probe. 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci - adi,dc-dc-ilim-microamp: The dc-to-dc converter current limit 578c2ecf20Sopenharmony_ci The following values are currently supported [uA]: 588c2ecf20Sopenharmony_ci * 150000 598c2ecf20Sopenharmony_ci * 200000 608c2ecf20Sopenharmony_ci * 250000 618c2ecf20Sopenharmony_ci * 300000 628c2ecf20Sopenharmony_ci * 350000 638c2ecf20Sopenharmony_ci * 400000 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ci - adi,slew-time-us: The time it takes for the output to reach the 668c2ecf20Sopenharmony_ci full scale [uS] 678c2ecf20Sopenharmony_ci The supported range is between 133us up to 1023984375us 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ciAD5758 Example: 708c2ecf20Sopenharmony_ci 718c2ecf20Sopenharmony_ci dac@0 { 728c2ecf20Sopenharmony_ci compatible = "adi,ad5758"; 738c2ecf20Sopenharmony_ci reg = <0>; 748c2ecf20Sopenharmony_ci spi-max-frequency = <1000000>; 758c2ecf20Sopenharmony_ci spi-cpha; 768c2ecf20Sopenharmony_ci 778c2ecf20Sopenharmony_ci reset-gpios = <&gpio 22 0>; 788c2ecf20Sopenharmony_ci 798c2ecf20Sopenharmony_ci adi,dc-dc-mode = <2>; 808c2ecf20Sopenharmony_ci adi,range-microvolt = <0 10000000>; 818c2ecf20Sopenharmony_ci adi,dc-dc-ilim-microamp = <200000>; 828c2ecf20Sopenharmony_ci adi,slew-time-us = <125000>; 838c2ecf20Sopenharmony_ci }; 84