ASoC: wcd9xxx: Add gpio control for micbias-supply for SXR1120

SXR1120 has additional gpio for micbias supply to be
enabled. Add control for this gpio and enable it.

Change-Id: Ica4ea9765db9bd48a1f8eb010d82d2687c8abbb9
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
This commit is contained in:
Vatsal Bucha
2018-09-27 16:20:30 +05:30
parent 58ff6ed45b
commit 8148b998ed
3 changed files with 19 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -180,7 +180,9 @@ struct wcd9xxx_pdata {
int num_irqs;
int reset_gpio;
bool has_buck_vsel_gpio;
bool has_micb_supply_en_gpio;
struct device_node *buck_vsel_ctl_np;
struct device_node *micb_en_ctl;
struct device_node *wcd_rst_np;
struct wcd9xxx_amic amic_settings;
struct slim_device slimbus_slave_device;

View File

@@ -1289,6 +1289,9 @@ static int wcd9xxx_slim_probe(struct slim_device *slim)
if (pdata->has_buck_vsel_gpio)
msm_cdc_pinctrl_select_active_state(pdata->buck_vsel_ctl_np);
if (pdata->has_micb_supply_en_gpio)
msm_cdc_pinctrl_select_active_state(pdata->micb_en_ctl);
device_id = slim_get_device_id(slim);
if (!device_id) {
dev_err(&slim->dev, "%s: Error, no device id\n", __func__);

View File

@@ -365,6 +365,19 @@ struct wcd9xxx_pdata *wcd9xxx_populate_dt_data(struct device *dev)
}
}
pdata->has_micb_supply_en_gpio = of_property_read_bool(dev->of_node,
"qcom,has-micbias-supply-en-gpio");
if (pdata->has_micb_supply_en_gpio) {
pdata->micb_en_ctl = of_parse_phandle(dev->of_node,
"qcom,micbias-supply-en-gpio-node", 0);
if (!pdata->micb_en_ctl) {
dev_err(dev, "%s No entry for %s property in node %s\n",
__func__, "qcom,micbias-supply-en-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;