mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 23:24:22 -04:00
Merge "ASoC: wcd9xxx: Add gpio control for micbias-supply for SXR1120"
This commit is contained in:
commit
c4a3ea6151
3 changed files with 19 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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__);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue