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

Commit 1fe7ae1a authored by Rohit Kumar's avatar Rohit Kumar Committed by Gerrit - the friendly Code Review server
Browse files

mfd: wcd9xxx: Add support for gpio controlled buck VSEL pin



This adds support to control VSEL pin of WCD buck connected
via GPIO.

Change-Id: I790bcff561143fafe1c90863b489c68afba304be
Signed-off-by: default avatarRohit Kumar <rohitkr@codeaurora.org>
parent 05e7d36b
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -12,7 +12,6 @@ Required properties:
 - qcom,wcd-rst-gpio-node: Phandle reference to the DT node having codec reset gpio
                        configuration. If this property is not defined, it is
                        expected to atleast define "qcom,cdc-reset-gpio" property.

 - cdc-vdd-buck-supply: phandle of buck supply's regulator device tree node.
 - qcom,cdc-vdd-buck-voltage: buck supply's voltage level min and max in mV.
 - qcom,cdc-vdd-buck-current: buck supply's max current in mA.
@@ -142,6 +141,11 @@ Optional properties:
 - clock-names : clock name defined for external clock.
 - clocks : external clock defined for codec clock.

 - qcom,has-buck-vsel-gpio:  Boolean property to select if WCD_BUCK has VSEL
			controlled by GPIO.
 - qcom,buck-vsel-gpio-node: Phandle reference to the DT node having wcd buck
			VSEL gpio configuration.

Example:

taiko_codec {
+4 −0
Original line number Diff line number Diff line
@@ -1280,6 +1280,10 @@ static int wcd9xxx_slim_probe(struct slim_device *slim)
		ret = -EINVAL;
		goto err_codec;
	}

	if (pdata->has_buck_vsel_gpio)
		msm_cdc_pinctrl_select_active_state(pdata->buck_vsel_ctl_np);

	device_id = slim_get_device_id(slim);
	if (!device_id) {
		dev_err(&slim->dev, "%s: Error, no device id\n", __func__);
+13 −0
Original line number Diff line number Diff line
@@ -342,6 +342,19 @@ struct wcd9xxx_pdata *wcd9xxx_populate_dt_data(struct device *dev)
		goto err_parse_dt_prop;
	}

	pdata->has_buck_vsel_gpio = of_property_read_bool(dev->of_node,
						"qcom,has-buck-vsel-gpio");
	if (pdata->has_buck_vsel_gpio) {
		pdata->buck_vsel_ctl_np = of_parse_phandle(dev->of_node,
				"qcom,buck-vsel-gpio-node", 0);
		if (!pdata->buck_vsel_ctl_np) {
			dev_err(dev, "%s No entry for %s property in node %s\n",
				__func__, "qcom,buck-vsel-gpio-node",
				dev->of_node->full_name);
			goto err_parse_dt_prop;
		}
	}

	if (!(wcd9xxx_read_of_property_u32(dev, "qcom,cdc-mclk-clk-rate",
					   &prop_val)))
		pdata->mclk_rate = prop_val;
+2 −0
Original line number Diff line number Diff line
@@ -179,6 +179,8 @@ struct wcd9xxx_pdata {
	int irq_base;
	int num_irqs;
	int reset_gpio;
	bool has_buck_vsel_gpio;
	struct device_node *buck_vsel_ctl_np;
	struct device_node *wcd_rst_np;
	struct wcd9xxx_amic amic_settings;
	struct slim_device slimbus_slave_device;