Fixed regulator without GPIO

Hi,

How are the fixed regulators get controlled (turn on/off) for the ones that has no GPIO binding in device-tree?

For example, the battery_reg:

hdr40_vdd_5v0: battery_reg: regulator@0 {
			compatible = "regulator-fixed";
			reg = <0>;
			regulator-name = "vdd-ac-bat";
			regulator-min-microvolt = <5000000>;
			regulator-max-microvolt = <5000000>;
			regulator-always-on;
		};

And p2822_vdd_fan:

p2822_vdd_fan: regulator@111 {
			compatible = "regulator-fixed";
			reg = <111>;
			regulator-name = "vdd-fan";
			regulator-min-microvolt = <5000000>;
			regulator-max-microvolt = <5000000>;
		};

The examples that I posted above has NO gpio = <XXX> binding. So, they cannot be turned on/off by GPIO. So, how are they get controlled? It would also be nice to understand it from devkit schematic as well.

Regards.

hello lunarking1028,

please check this topic for the definition in device tree to indicate the regulator names and its voltage.
you’re able to control it via kernel drivers.
thanks

Hi,

Thanks for your quick reply.
My question is about why it doesn’t have GPIO bindings in some of the fixed regulator.
Your link shows an example of how to use a GPIO binded fixed-regulator, which is NOT what I am looking for.

Also, the GPIO and fixed regulator in device-tree should match the hardware design.

Let me ask in a more specific way.
For example, the p2822_vdd_fan fixed regulator, it has NO GPIO for it:

p2822_vdd_fan: regulator@111 {
			compatible = "regulator-fixed";
			reg = <111>;
			regulator-name = "vdd-fan";
			regulator-min-microvolt = <5000000>;
			regulator-max-microvolt = <5000000>;
		};

And its consumer is the pwm-fan.

pwm-fan {
		vdd-fan-supply = <&p2822_vdd_fan>;
	}

When the fan is turned on/off, how its regulator get turned on/off? (fixed regulator, NO GPIO control) It seems it is a faked regulator?

Regards.

hello lunarking1028,

it’s an optional properties of GPIO to use for enable control,
please refer to kernel documentation,
for example, $L4T_Sources/r32.5.1/Linux_for_Tegra/source/public/kernel/kernel-4.9/Documentation/devicetree/bindings/regulator/fixed-regulator.txt
thanks

Hi,

As I said that “the GPIO and fixed regulator in device-tree should match the hardware design.” I cannot just pick any GPIO and put it there.

I checked devkit schematic, there is NO GPIO for enable/disable the power of fan. The fan’s power is VDD_5V which is enabled when carrier power is enabled.

So, again I still don’t see any need for that regulator there. Or It may be just a fake regulator to make the linux fan system happy.

Thanks.

Yes, it is just a fake one. It is for the driver because some drivers will check a regulator in their initialization.