mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
ASoC: tegra-alt: remove extra check for pinctrl
is_pinctrl variable check is redundant check which can be removed from the dmic and dspk drivers. Bug 200500656 Change-Id: I3dee030a198a3f398550de9c88a9f3b4f5d0f6fb Signed-off-by: Mohan Kumar <mkumard@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2084602 Reviewed-by: Sameer Pujar <spujar@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Sameer Pujar
parent
834b540cf9
commit
28684681fa
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* tegra186_dspk_alt.h - Definitions for Tegra186 DSPK driver
|
* tegra186_dspk_alt.h - Definitions for Tegra186 DSPK driver
|
||||||
*
|
*
|
||||||
* Copyright (c) 2015-2018 NVIDIA CORPORATION. All rights reserved.
|
* Copyright (c) 2015-2019 NVIDIA CORPORATION. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
@@ -182,7 +182,6 @@ struct tegra186_dspk {
|
|||||||
struct clk *clk_pll_a_out0;
|
struct clk *clk_pll_a_out0;
|
||||||
struct regmap *regmap;
|
struct regmap *regmap;
|
||||||
const struct tegra186_dspk_soc_data *soc_data;
|
const struct tegra186_dspk_soc_data *soc_data;
|
||||||
int is_pinctrl;
|
|
||||||
struct pinctrl *pinctrl;
|
struct pinctrl *pinctrl;
|
||||||
struct pinctrl_state *pin_active_state;
|
struct pinctrl_state *pin_active_state;
|
||||||
struct pinctrl_state *pin_idle_state;
|
struct pinctrl_state *pin_idle_state;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* tegra210_dmic_alt.h - Definitions for Tegra210 DMIC driver
|
* tegra210_dmic_alt.h - Definitions for Tegra210 DMIC driver
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2018 NVIDIA CORPORATION. All rights reserved.
|
* Copyright (c) 2014-2019 NVIDIA CORPORATION. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
@@ -125,7 +125,6 @@ struct tegra210_dmic {
|
|||||||
struct clk *clk_pll_a_out0;
|
struct clk *clk_pll_a_out0;
|
||||||
struct regmap *regmap;
|
struct regmap *regmap;
|
||||||
const struct tegra210_dmic_soc_data *soc_data;
|
const struct tegra210_dmic_soc_data *soc_data;
|
||||||
int is_pinctrl;
|
|
||||||
struct pinctrl *pinctrl;
|
struct pinctrl *pinctrl;
|
||||||
struct pinctrl_state *pin_active_state;
|
struct pinctrl_state *pin_active_state;
|
||||||
struct pinctrl_state *pin_idle_state;
|
struct pinctrl_state *pin_idle_state;
|
||||||
|
|||||||
@@ -205,12 +205,13 @@ static int tegra186_dspk_startup(struct snd_pcm_substream *substream,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) {
|
if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) {
|
||||||
if (!IS_ERR(dspk->pin_active_state) && dspk->is_pinctrl) {
|
if (!IS_ERR(dspk->pin_active_state)) {
|
||||||
ret = pinctrl_select_state(dspk->pinctrl,
|
ret = pinctrl_select_state(dspk->pinctrl,
|
||||||
dspk->pin_active_state);
|
dspk->pin_active_state);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(dev,
|
dev_err(dev,
|
||||||
"setting dap pinctrl active state failed\n");
|
"setting dspk pinctrl active state failed\n");
|
||||||
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -226,7 +227,7 @@ static void tegra186_dspk_shutdown(struct snd_pcm_substream *substream,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) {
|
if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) {
|
||||||
if (!IS_ERR(dspk->pin_idle_state) && dspk->is_pinctrl) {
|
if (!IS_ERR(dspk->pin_idle_state)) {
|
||||||
ret = pinctrl_select_state(
|
ret = pinctrl_select_state(
|
||||||
dspk->pinctrl, dspk->pin_idle_state);
|
dspk->pinctrl, dspk->pin_idle_state);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
@@ -597,36 +598,24 @@ static int tegra186_dspk_platform_probe(struct platform_device *pdev)
|
|||||||
dspk->prod_name);
|
dspk->prod_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (of_property_read_u32(np, "nvidia,is-pinctrl",
|
dspk->pinctrl = devm_pinctrl_get(&pdev->dev);
|
||||||
&dspk->is_pinctrl) < 0)
|
if (IS_ERR(dspk->pinctrl)) {
|
||||||
dspk->is_pinctrl = 0;
|
dev_warn(&pdev->dev, "Missing pinctrl device\n");
|
||||||
|
goto err_dap;
|
||||||
|
}
|
||||||
|
|
||||||
if (dspk->is_pinctrl) {
|
dspk->pin_active_state = pinctrl_lookup_state(dspk->pinctrl,
|
||||||
dspk->pinctrl = devm_pinctrl_get(&pdev->dev);
|
"dap_active");
|
||||||
if (IS_ERR(dspk->pinctrl)) {
|
if (IS_ERR(dspk->pin_active_state)) {
|
||||||
dev_warn(&pdev->dev, "Missing pinctrl device\n");
|
dev_dbg(&pdev->dev, "Missing dap-active state\n");
|
||||||
goto err_dap;
|
goto err_dap;
|
||||||
}
|
}
|
||||||
|
|
||||||
dspk->pin_active_state = pinctrl_lookup_state(dspk->pinctrl,
|
dspk->pin_idle_state = pinctrl_lookup_state(dspk->pinctrl,
|
||||||
"dap_active");
|
"dap_inactive");
|
||||||
if (IS_ERR(dspk->pin_active_state)) {
|
if (IS_ERR(dspk->pin_idle_state)) {
|
||||||
dev_dbg(&pdev->dev, "Missing dap-active state\n");
|
dev_dbg(&pdev->dev, "Missing dap-inactive state\n");
|
||||||
goto err_dap;
|
goto err_dap;
|
||||||
}
|
|
||||||
|
|
||||||
dspk->pin_idle_state = pinctrl_lookup_state(dspk->pinctrl,
|
|
||||||
"dap_inactive");
|
|
||||||
if (IS_ERR(dspk->pin_idle_state)) {
|
|
||||||
dev_dbg(&pdev->dev, "Missing dap-inactive state\n");
|
|
||||||
goto err_dap;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = pinctrl_select_state(dspk->pinctrl, dspk->pin_idle_state);
|
|
||||||
if (ret < 0) {
|
|
||||||
dev_err(&pdev->dev, "setting state failed\n");
|
|
||||||
goto err_dap;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
err_dap:
|
err_dap:
|
||||||
|
|||||||
@@ -241,12 +241,13 @@ static int tegra210_dmic_startup(struct snd_pcm_substream *substream,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) {
|
if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) {
|
||||||
if (!IS_ERR(dmic->pin_active_state) && dmic->is_pinctrl) {
|
if (!IS_ERR(dmic->pin_active_state)) {
|
||||||
ret = pinctrl_select_state(dmic->pinctrl,
|
ret = pinctrl_select_state(dmic->pinctrl,
|
||||||
dmic->pin_active_state);
|
dmic->pin_active_state);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(dev,
|
dev_err(dev,
|
||||||
"setting dap pinctrl active state failed\n");
|
"setting dmic pinctrl active state failed\n");
|
||||||
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -261,7 +262,7 @@ static void tegra210_dmic_shutdown(struct snd_pcm_substream *substream,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) {
|
if (!(tegra_platform_is_unit_fpga() || tegra_platform_is_fpga())) {
|
||||||
if (!IS_ERR(dmic->pin_idle_state) && dmic->is_pinctrl) {
|
if (!IS_ERR(dmic->pin_idle_state)) {
|
||||||
ret = pinctrl_select_state(
|
ret = pinctrl_select_state(
|
||||||
dmic->pinctrl, dmic->pin_idle_state);
|
dmic->pinctrl, dmic->pin_idle_state);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@@ -816,36 +817,24 @@ static int tegra210_dmic_platform_probe(struct platform_device *pdev)
|
|||||||
dmic->prod_name);
|
dmic->prod_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (of_property_read_u32(np, "nvidia,is-pinctrl",
|
dmic->pinctrl = devm_pinctrl_get(&pdev->dev);
|
||||||
&dmic->is_pinctrl) < 0)
|
if (IS_ERR(dmic->pinctrl)) {
|
||||||
dmic->is_pinctrl = 0;
|
dev_warn(&pdev->dev, "Missing pinctrl device\n");
|
||||||
|
goto err_dap;
|
||||||
|
}
|
||||||
|
|
||||||
if (dmic->is_pinctrl) {
|
dmic->pin_active_state = pinctrl_lookup_state(dmic->pinctrl,
|
||||||
dmic->pinctrl = devm_pinctrl_get(&pdev->dev);
|
"dap_active");
|
||||||
if (IS_ERR(dmic->pinctrl)) {
|
if (IS_ERR(dmic->pin_active_state)) {
|
||||||
dev_warn(&pdev->dev, "Missing pinctrl device\n");
|
dev_dbg(&pdev->dev, "Missing dap-active state\n");
|
||||||
goto err_dap;
|
goto err_dap;
|
||||||
}
|
}
|
||||||
|
|
||||||
dmic->pin_active_state = pinctrl_lookup_state(dmic->pinctrl,
|
dmic->pin_idle_state = pinctrl_lookup_state(dmic->pinctrl,
|
||||||
"dap_active");
|
"dap_inactive");
|
||||||
if (IS_ERR(dmic->pin_active_state)) {
|
if (IS_ERR(dmic->pin_idle_state)) {
|
||||||
dev_dbg(&pdev->dev, "Missing dap-active state\n");
|
dev_dbg(&pdev->dev, "Missing dap-inactive state\n");
|
||||||
goto err_dap;
|
goto err_dap;
|
||||||
}
|
|
||||||
|
|
||||||
dmic->pin_idle_state = pinctrl_lookup_state(dmic->pinctrl,
|
|
||||||
"dap_inactive");
|
|
||||||
if (IS_ERR(dmic->pin_idle_state)) {
|
|
||||||
dev_dbg(&pdev->dev, "Missing dap-inactive state\n");
|
|
||||||
goto err_dap;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = pinctrl_select_state(dmic->pinctrl, dmic->pin_idle_state);
|
|
||||||
if (ret < 0) {
|
|
||||||
dev_err(&pdev->dev, "setting state failed\n");
|
|
||||||
goto err_dap;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
err_dap:
|
err_dap:
|
||||||
|
|||||||
@@ -517,8 +517,11 @@ static int tegra210_i2s_startup(struct snd_pcm_substream *substream,
|
|||||||
if (!IS_ERR(i2s->pin_default_state)) {
|
if (!IS_ERR(i2s->pin_default_state)) {
|
||||||
ret = pinctrl_select_state(i2s->pinctrl,
|
ret = pinctrl_select_state(i2s->pinctrl,
|
||||||
i2s->pin_default_state);
|
i2s->pin_default_state);
|
||||||
if (ret < 0)
|
if (ret < 0) {
|
||||||
dev_err(dev, "setting dap pinctrl default state failed\n");
|
dev_err(dev,
|
||||||
|
"setting i2s pinctrl default state failed\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i2s->num_supplies > 0) {
|
if (i2s->num_supplies > 0) {
|
||||||
@@ -1241,11 +1244,6 @@ static int tegra210_i2s_platform_probe(struct platform_device *pdev)
|
|||||||
goto err_dap;
|
goto err_dap;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = pinctrl_select_state(i2s->pinctrl, i2s->pin_idle_state);
|
|
||||||
if (ret < 0) {
|
|
||||||
dev_err(&pdev->dev, "setting state failed\n");
|
|
||||||
goto err_dap;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
err_dap:
|
err_dap:
|
||||||
pm_runtime_enable(&pdev->dev);
|
pm_runtime_enable(&pdev->dev);
|
||||||
|
|||||||
Reference in New Issue
Block a user