[U-Boot] fsl_esdhc: GPIO regulator as VQMMC supply?

Sven Schwermer sven at svenschwermer.de
Fri May 31 13:17:23 UTC 2019


Hi,

I’m trying to implement the VQMMC supply for the an eMMC on my board using a GPIO regulator, i.e.

reg_sd_vsel: regulator-sd-vsel {
  pinctrl-names = "default";
  pinctrl-0 = <&pinctrl_sd_vsel>;
  compatible = "regulator-gpio";
  regulator-name = "sd-vsel";
  regulator-min-microvolt = <1800000>;
  regulator-max-microvolt = <3300000>;
  gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
  states = <1800000 1 3300000 0>;
  gpios-states = <0>; /* default: 3.3V */
};

&usdhc3 {
  vqmmc-supply = <&reg_sd_vsel>;
};

This is using an i.MX7D SoC, so my [eu]sdhc driver is fsl_esdhc. In fsl_esdhc_probe, regulator_set_enable is called for vqmmc-supply. This fails for GPIO regulators because they only have a set_value method and no set_enable method. How is this best resolved? Does it make sense to add a set_enable method to the GPIO regulator or should the esdhc driver handle the -ENOSYS return value gracefully? Or should I write my device tree differently?

Hints are much appreciated. Thanks!

Best regards,
Sven


More information about the U-Boot mailing list