pci: pcie_dw_rockchip: support fixed vcc3v3 regulator type
Subsystems (2)
cover pci: pcie_dw_rockchip: support fixed vcc3v3 regulator type
When trying to nvme boot rk3568 boards (tested with odroid-m1 and nanopi-r5s), it failes with error -19. This is because it is trying to set the voltage of a fixed-regulator to 3.3v.
John Clark (1):
pci: pcie_dw_rockchip: support fixed vcc3v3 regulator type
drivers/pci/pcie_dw_rockchip.c | 7 +++++++ 1 file changed, 7 insertions(+)
Signature · 1 line
2.39.2 (Apple Git-143)
PATCH 1/1 pci: pcie_dw_rockchip: support fixed vcc3v3 regulator type
If the regulator is fixed, the call to regulator_set_value will fail with -ENOSYS as fixed regulators do not support dm_regulator_ops->set_value.
see: regulator-uclass.c, regulator_set_value(), ops->set_value
This patch ignores -ENOSYS and enables the regulator via regulator_set_enable which should be suitable for all regulator types.
---
drivers/pci/pcie_dw_rockchip.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/pci/pcie_dw_rockchip.c +7 -0
@@ -289,6 +289,13 @@ static int rockchip_pcie_init_port(struct udevice *dev)/* Set power and maybe external ref clk input */ if (priv->vpcie3v3) { ret =regulator_set_value (priv->vpcie3v3,3300000 ); +if (ret && ret != -ENOSYS ) { +dev_err (priv->dw.dev, +"failed to set vpcie3v3 value (ret=%d)\n" , ret); +return ret; + } + + ret =regulator_set_enable (priv->vpcie3v3, true);if (ret) {dev_err (priv->dw.dev,"failed to enable vpcie3v3 (ret=%d)\n" , ret);
Signature · 1 line
2.39.2 (Apple Git-143)
Hi John,
Quoted 6 lines · John Clark
If the regulator is fixed, the call to
regulator_set_valuewill fail with-ENOSYSas fixed regulators do not supportdm_regulator_ops->set_value.see: regulator-uclass.c, regulator_set_value(), ops->set_valueThis patch ignores
-ENOSYSand enables the regulator viaregulator_set_enablewhich should be suitable for all regulator types.
Please see patch [1] in my series "rockchip: Fix PCIe and NVMe support on RK3568", that series fixes this and other issues to fully support PCIe and NVMe on RK3568.
[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
Regards,
Jonas
Quoted 26 lines
Signed-off-by John Clark <[email protected]>---
drivers/pci/pcie_dw_rockchip.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/pci/pcie_dw_rockchip.c +7
-0@@ -289,6 +289,13 @@ static int rockchip_pcie_init_port(struct udevice *dev)/* Set power and maybe external ref clk input */ if (priv->vpcie3v3) { ret =regulator_set_value (priv->vpcie3v3,3300000 ); +if (ret && ret != -ENOSYS ) { +dev_err (priv->dw.dev, +"failed to set vpcie3v3 value (ret=%d)\n" , ret); +return ret; + } + + ret =regulator_set_enable (priv->vpcie3v3, true);if (ret) {dev_err (priv->dw.dev,"failed to enable vpcie3v3 (ret=%d)\n" , ret);