diff options
author | Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org> | 2016-03-10 16:33:37 +0530 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-25 16:03:49 -0700 |
commit | 47c036c7765d684d3793135ccbbd43b2bb53b87f (patch) | |
tree | ec6e8d86fe8306b350e0ac493e33c18f5f9d98d8 /sound/soc | |
parent | 2f750edecbecffd8760bd4968b49e791bae29981 (diff) |
ASoC: audio-ext-clk: Change gpio default value to -1
During stability test, gpio_direction_output is
invoked with msm gpio 0 which is leading to PC NOC error
as audio is not expected to access this gpio.
Hence initialise gpio to -1 and check if gpio
is valid before using.
CRs-Fixed: 973438
Change-Id: I32d779974f4eb497c62035f7f46c10739ebcfe5f
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Diffstat (limited to 'sound/soc')
-rwxr-xr-x | sound/soc/codecs/audio-ext-clk.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/soc/codecs/audio-ext-clk.c b/sound/soc/codecs/audio-ext-clk.c index 4f5f2d1fd169..045cdad73eee 100755 --- a/sound/soc/codecs/audio-ext-clk.c +++ b/sound/soc/codecs/audio-ext-clk.c @@ -66,7 +66,9 @@ static int audio_ext_clk_prepare(struct clk *clk) struct audio_ext_ap_clk *audio_clk = to_audio_ap_clk(clk); pr_debug("%s: gpio: %d\n", __func__, audio_clk->gpio); - return gpio_direction_output(audio_clk->gpio, 1); + if (gpio_is_valid(audio_clk->gpio)) + return gpio_direction_output(audio_clk->gpio, 1); + return 0; } static void audio_ext_clk_unprepare(struct clk *clk) @@ -74,7 +76,8 @@ static void audio_ext_clk_unprepare(struct clk *clk) struct audio_ext_ap_clk *audio_clk = to_audio_ap_clk(clk); pr_debug("%s: gpio: %d\n", __func__, audio_clk->gpio); - gpio_direction_output(audio_clk->gpio, 0); + if (gpio_is_valid(audio_clk->gpio)) + gpio_direction_output(audio_clk->gpio, 0); } static inline struct audio_ext_ap_clk2 *to_audio_ap_clk2(struct clk *clk) @@ -135,6 +138,7 @@ static struct clk_ops audio_ext_ap_clk2_ops = { }; static struct audio_ext_pmi_clk audio_pmi_clk = { + .gpio = -EINVAL, .c = { .dbg_name = "audio_ext_pmi_clk", .ops = &clk_ops_dummy, @@ -143,6 +147,7 @@ static struct audio_ext_pmi_clk audio_pmi_clk = { }; static struct audio_ext_ap_clk audio_ap_clk = { + .gpio = -EINVAL, .c = { .dbg_name = "audio_ext_ap_clk", .ops = &audio_ext_ap_clk_ops, |