Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ad2d36b authored by Puja Gupta's avatar Puja Gupta Committed by Kyle Yan
Browse files

soc: qcom: pil: Make vdd_pll optional property for modem



Since 'qcom,vdd_pll' is optional property, change the flow so that pil
doesn't return if it is not present.

CRs-Fixed: 1025447
Change-Id: I530bbeb89f769afb188f28bcdc0230d32feed3dd
Signed-off-by: default avatarPuja Gupta <pujag@codeaurora.org>
parent 345bae17
Loading
Loading
Loading
Loading
+19 −23
Original line number Diff line number Diff line
@@ -558,7 +558,7 @@ struct q6v5_data *pil_q6v5_init(struct platform_device *pdev)
	struct resource *res;
	struct pil_desc *desc;
	struct property *prop;
	int ret;
	int ret, vdd_pll;

	drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL);
	if (!drv)
@@ -700,19 +700,15 @@ struct q6v5_data *pil_q6v5_init(struct platform_device *pdev)
		return ERR_CAST(prop);
	}

	ret = of_property_read_u32(pdev->dev.of_node, "qcom,vdd_pll",
		&vdd_pll);
	if (!ret) {
		drv->vreg_pll = devm_regulator_get(&pdev->dev, "vdd_pll");
		if (!IS_ERR_OR_NULL(drv->vreg_pll)) {
		int voltage;
		ret = of_property_read_u32(pdev->dev.of_node, "qcom,vdd_pll",
					   &voltage);
		if (ret) {
			dev_err(&pdev->dev, "Failed to find vdd_pll voltage.\n");
			return ERR_PTR(ret);
		}

		ret = regulator_set_voltage(drv->vreg_pll, voltage, voltage);
			ret = regulator_set_voltage(drv->vreg_pll, vdd_pll,
							vdd_pll);
			if (ret) {
			dev_err(&pdev->dev, "Failed to request vdd_pll voltage.\n");
				dev_err(&pdev->dev, "Failed to set vdd_pll voltage.\n");
				return ERR_PTR(ret);
			}

@@ -721,7 +717,7 @@ struct q6v5_data *pil_q6v5_init(struct platform_device *pdev)
				dev_err(&pdev->dev, "Failed to set vdd_pll mode.\n");
				return ERR_PTR(ret);
			}
	} else {
		} else
			drv->vreg_pll = NULL;
	}