summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-08-18 12:04:43 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-08-18 12:04:43 -0700
commitd78a0bccb16f40b6d15a5c188e8af5cf7e9f0bda (patch)
tree81a62b4e35c2732093a5319fb90aaa4d6b2b9b72
parent96ff56bce9b0a621e3759ea2e22128e42f808df2 (diff)
parent669c51e0d9c2b40683d977fc685336087a0eb953 (diff)
Merge "ASoC: msm: add pinctrl support for wcd934x hifi hph switches"
-rw-r--r--sound/soc/msm/msmcobalt.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/sound/soc/msm/msmcobalt.c b/sound/soc/msm/msmcobalt.c
index f5fc3ffb7017..d0c6140d3a68 100644
--- a/sound/soc/msm/msmcobalt.c
+++ b/sound/soc/msm/msmcobalt.c
@@ -107,6 +107,8 @@ struct msm_asoc_mach_data {
int hph_en0_gpio;
int us_euro_gpio; /* used by gpio driver API */
struct device_node *us_euro_gpio_p; /* used by pinctrl API */
+ struct device_node *hph_en1_gpio_p; /* used by pinctrl API */
+ struct device_node *hph_en0_gpio_p; /* used by pinctrl API */
struct snd_info_entry *codec_root;
};
@@ -3968,17 +3970,24 @@ static int msm_asoc_machine_probe(struct platform_device *pdev)
pdata->hph_en1_gpio = of_get_named_gpio(pdev->dev.of_node,
"qcom,hph-en1-gpio", 0);
- if (pdata->hph_en1_gpio < 0) {
- dev_dbg(&pdev->dev, "%s: %s property not found %d\n",
- __func__, "qcom,hph-en1-gpio", pdata->hph_en1_gpio);
+ if (!gpio_is_valid(pdata->hph_en1_gpio))
+ pdata->hph_en1_gpio_p = of_parse_phandle(pdev->dev.of_node,
+ "qcom,hph-en1-gpio", 0);
+ if (!gpio_is_valid(pdata->hph_en1_gpio) && (!pdata->hph_en1_gpio_p)) {
+ dev_dbg(&pdev->dev, "property %s not detected in node %s",
+ "qcom,hph-en1-gpio", pdev->dev.of_node->full_name);
}
pdata->hph_en0_gpio = of_get_named_gpio(pdev->dev.of_node,
"qcom,hph-en0-gpio", 0);
- if (pdata->hph_en0_gpio < 0) {
- dev_dbg(&pdev->dev, "%s: %s property not found %d\n",
- __func__, "qcom,hph-en0-gpio", pdata->hph_en0_gpio);
+ if (!gpio_is_valid(pdata->hph_en0_gpio))
+ pdata->hph_en0_gpio_p = of_parse_phandle(pdev->dev.of_node,
+ "qcom,hph-en0-gpio", 0);
+ if (!gpio_is_valid(pdata->hph_en0_gpio) && (!pdata->hph_en0_gpio_p)) {
+ dev_dbg(&pdev->dev, "property %s not detected in node %s",
+ "qcom,hph-en0-gpio", pdev->dev.of_node->full_name);
}
+
ret = msm_prepare_hifi(card);
if (ret)
dev_dbg(&pdev->dev, "msm_prepare_hifi failed (%d)\n",
@@ -4020,11 +4029,11 @@ static int msm_asoc_machine_probe(struct platform_device *pdev)
*/
pdata->us_euro_gpio = of_get_named_gpio(pdev->dev.of_node,
"qcom,us-euro-gpios", 0);
- if (pdata->us_euro_gpio < 0)
+ if (!gpio_is_valid(pdata->us_euro_gpio))
pdata->us_euro_gpio_p = of_parse_phandle(pdev->dev.of_node,
"qcom,us-euro-gpios", 0);
- if ((pdata->us_euro_gpio < 0) && (!pdata->us_euro_gpio_p)) {
- dev_info(&pdev->dev, "property %s not detected in node %s",
+ if (!gpio_is_valid(pdata->us_euro_gpio) && (!pdata->us_euro_gpio_p)) {
+ dev_dbg(&pdev->dev, "property %s not detected in node %s",
"qcom,us-euro-gpios", pdev->dev.of_node->full_name);
} else {
dev_dbg(&pdev->dev, "%s detected",
@@ -4034,7 +4043,7 @@ static int msm_asoc_machine_probe(struct platform_device *pdev)
ret = msm_prepare_us_euro(card);
if (ret)
- dev_info(&pdev->dev, "msm_prepare_us_euro failed (%d)\n",
+ dev_dbg(&pdev->dev, "msm_prepare_us_euro failed (%d)\n",
ret);
return 0;
err: