AD5629 Internal Reference via ad5064.c Linux driver device tree

Hello,

I have been struggling to get the internal reference to activate on the AD5629 using the latest AD5064 driver:

  • Omitting the vref-supply parameter resulted in a warning  supply vref not found, using dummy regulator, but the internal reference was not activated. I thought I had read that omitting vref-supply from the device definition was the method to activate the internal reference.
  • However, by making an invalid vref-supply in the device tree (one that would intentionally generate an error by omitting a required parameter), created an error that then resulted in the the driver activating the internal reference. 

I am very new to all of this (and it took an embarrassingly long amount of time to get to this point...), but I think what might be happening in the ad5064.c driver is that when the dummy regulator is applied (due to omitting the vref-supply parameter). the regulator_get (via devm_regulator_bulk_get) function call in ad5064.c does not return an error, so the internal regulator is actually never applied.

The dts with the intentionally invalid regulator is pasted below, which is the only way I could find to get the internal reference to work. 

I guess my question is:

  • What is the proper way to activate the internal reference in this case? 

Thank you very much for your time.

Jordan

/dts-v1/;
/plugin/;

/ {

       compatible = "brcm,bcm2708";
        fragment@0 {
                target-path = "/";
                __overlay__ {
                        adc_vref: fixedregulator@0 {
                                /*compatible = "regulator-fixed";*/
                                regulator-name = "fixed-supply";
                                regulator-min-microvolt = <5000000>;
                                regulator-max-microvolt = <5000000>;
                        };
                };
        };

        fragment@1 {
                target = <&i2c_arm>;
                __overlay__ {
                        #address-cells = <1>;
                        #size-cells = <0>;

                    ad5629-2@56 {
                        compatible = "adi,ad5629-2";
                        reg = <0x56>;
                        status = "okay";
                        vref-supply = <&adc_vref>;
                    };
                };
        };
};

Parents Reply Children
No Data