summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsound/soc/codecs/audio-ext-clk.c9
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,