diff options
Diffstat (limited to 'sound/soc/codecs/wm8994.c')
-rw-r--r-- | sound/soc/codecs/wm8994.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index bb62f4b3d563..6c9eeca85b95 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -2649,7 +2649,7 @@ static int wm8994_hw_params(struct snd_pcm_substream *substream, | |||
2649 | return -EINVAL; | 2649 | return -EINVAL; |
2650 | } | 2650 | } |
2651 | 2651 | ||
2652 | bclk_rate = params_rate(params) * 2; | 2652 | bclk_rate = params_rate(params) * 4; |
2653 | switch (params_format(params)) { | 2653 | switch (params_format(params)) { |
2654 | case SNDRV_PCM_FORMAT_S16_LE: | 2654 | case SNDRV_PCM_FORMAT_S16_LE: |
2655 | bclk_rate *= 16; | 2655 | bclk_rate *= 16; |
@@ -3253,10 +3253,13 @@ static void wm8994_mic_work(struct work_struct *work) | |||
3253 | int ret; | 3253 | int ret; |
3254 | int report; | 3254 | int report; |
3255 | 3255 | ||
3256 | pm_runtime_get_sync(dev); | ||
3257 | |||
3256 | ret = regmap_read(regmap, WM8994_INTERRUPT_RAW_STATUS_2, ®); | 3258 | ret = regmap_read(regmap, WM8994_INTERRUPT_RAW_STATUS_2, ®); |
3257 | if (ret < 0) { | 3259 | if (ret < 0) { |
3258 | dev_err(dev, "Failed to read microphone status: %d\n", | 3260 | dev_err(dev, "Failed to read microphone status: %d\n", |
3259 | ret); | 3261 | ret); |
3262 | pm_runtime_put(dev); | ||
3260 | return; | 3263 | return; |
3261 | } | 3264 | } |
3262 | 3265 | ||
@@ -3299,6 +3302,8 @@ static void wm8994_mic_work(struct work_struct *work) | |||
3299 | 3302 | ||
3300 | snd_soc_jack_report(priv->micdet[1].jack, report, | 3303 | snd_soc_jack_report(priv->micdet[1].jack, report, |
3301 | SND_JACK_HEADSET | SND_JACK_BTN_0); | 3304 | SND_JACK_HEADSET | SND_JACK_BTN_0); |
3305 | |||
3306 | pm_runtime_put(dev); | ||
3302 | } | 3307 | } |
3303 | 3308 | ||
3304 | static irqreturn_t wm8994_mic_irq(int irq, void *data) | 3309 | static irqreturn_t wm8994_mic_irq(int irq, void *data) |
@@ -3421,12 +3426,15 @@ static irqreturn_t wm1811_jackdet_irq(int irq, void *data) | |||
3421 | int reg; | 3426 | int reg; |
3422 | bool present; | 3427 | bool present; |
3423 | 3428 | ||
3429 | pm_runtime_get_sync(codec->dev); | ||
3430 | |||
3424 | mutex_lock(&wm8994->accdet_lock); | 3431 | mutex_lock(&wm8994->accdet_lock); |
3425 | 3432 | ||
3426 | reg = snd_soc_read(codec, WM1811_JACKDET_CTRL); | 3433 | reg = snd_soc_read(codec, WM1811_JACKDET_CTRL); |
3427 | if (reg < 0) { | 3434 | if (reg < 0) { |
3428 | dev_err(codec->dev, "Failed to read jack status: %d\n", reg); | 3435 | dev_err(codec->dev, "Failed to read jack status: %d\n", reg); |
3429 | mutex_unlock(&wm8994->accdet_lock); | 3436 | mutex_unlock(&wm8994->accdet_lock); |
3437 | pm_runtime_put(codec->dev); | ||
3430 | return IRQ_NONE; | 3438 | return IRQ_NONE; |
3431 | } | 3439 | } |
3432 | 3440 | ||
@@ -3491,6 +3499,7 @@ static irqreturn_t wm1811_jackdet_irq(int irq, void *data) | |||
3491 | SND_JACK_MECHANICAL | SND_JACK_HEADSET | | 3499 | SND_JACK_MECHANICAL | SND_JACK_HEADSET | |
3492 | wm8994->btn_mask); | 3500 | wm8994->btn_mask); |
3493 | 3501 | ||
3502 | pm_runtime_put(codec->dev); | ||
3494 | return IRQ_HANDLED; | 3503 | return IRQ_HANDLED; |
3495 | } | 3504 | } |
3496 | 3505 | ||
@@ -3602,6 +3611,8 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data) | |||
3602 | if (!(snd_soc_read(codec, WM8958_MIC_DETECT_1) & WM8958_MICD_ENA)) | 3611 | if (!(snd_soc_read(codec, WM8958_MIC_DETECT_1) & WM8958_MICD_ENA)) |
3603 | return IRQ_HANDLED; | 3612 | return IRQ_HANDLED; |
3604 | 3613 | ||
3614 | pm_runtime_get_sync(codec->dev); | ||
3615 | |||
3605 | /* We may occasionally read a detection without an impedence | 3616 | /* We may occasionally read a detection without an impedence |
3606 | * range being provided - if that happens loop again. | 3617 | * range being provided - if that happens loop again. |
3607 | */ | 3618 | */ |
@@ -3612,6 +3623,7 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data) | |||
3612 | dev_err(codec->dev, | 3623 | dev_err(codec->dev, |
3613 | "Failed to read mic detect status: %d\n", | 3624 | "Failed to read mic detect status: %d\n", |
3614 | reg); | 3625 | reg); |
3626 | pm_runtime_put(codec->dev); | ||
3615 | return IRQ_NONE; | 3627 | return IRQ_NONE; |
3616 | } | 3628 | } |
3617 | 3629 | ||
@@ -3639,6 +3651,7 @@ static irqreturn_t wm8958_mic_irq(int irq, void *data) | |||
3639 | dev_warn(codec->dev, "Accessory detection with no callback\n"); | 3651 | dev_warn(codec->dev, "Accessory detection with no callback\n"); |
3640 | 3652 | ||
3641 | out: | 3653 | out: |
3654 | pm_runtime_put(codec->dev); | ||
3642 | return IRQ_HANDLED; | 3655 | return IRQ_HANDLED; |
3643 | } | 3656 | } |
3644 | 3657 | ||
@@ -4025,6 +4038,8 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec) | |||
4025 | break; | 4038 | break; |
4026 | case WM8958: | 4039 | case WM8958: |
4027 | if (wm8994->revision < 1) { | 4040 | if (wm8994->revision < 1) { |
4041 | snd_soc_dapm_add_routes(dapm, wm8994_intercon, | ||
4042 | ARRAY_SIZE(wm8994_intercon)); | ||
4028 | snd_soc_dapm_add_routes(dapm, wm8994_revd_intercon, | 4043 | snd_soc_dapm_add_routes(dapm, wm8994_revd_intercon, |
4029 | ARRAY_SIZE(wm8994_revd_intercon)); | 4044 | ARRAY_SIZE(wm8994_revd_intercon)); |
4030 | snd_soc_dapm_add_routes(dapm, wm8994_lateclk_revd_intercon, | 4045 | snd_soc_dapm_add_routes(dapm, wm8994_lateclk_revd_intercon, |