diff mbox

ASoC: wm8994: register irq handler for mic1 detect

Message ID 1407843829-4908-1-git-send-email-nikesh@opensource.wolfsonmicro.com (mailing list archive)
State New, archived
Headers show

Commit Message

nikesh@opensource.wolfsonmicro.com Aug. 12, 2014, 11:43 a.m. UTC
Signed-off-by: Nikesh Oswal <nikesh@opensource.wolfsonmicro.com>
---
 sound/soc/codecs/wm8994.c |    9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Mark Brown Aug. 12, 2014, 11:48 a.m. UTC | #1
On Tue, Aug 12, 2014 at 12:43:49PM +0100, Nikesh Oswal wrote:

> --- a/sound/soc/codecs/wm8994.c
> +++ b/sound/soc/codecs/wm8994.c
> @@ -4099,6 +4099,15 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
>  				dev_warn(codec->dev,
>  					 "Failed to request Mic1 detect IRQ: %d\n",
>  					 ret);
> +		} else {
> +			ret = wm8994_request_irq(wm8994->wm8994,
> +					WM8994_IRQ_MIC1_DET,
> +					wm8994_mic_irq, "Mic 1 detect",
> +					wm8994);
> +			if (ret != 0)
> +				dev_warn(codec->dev,
> +				"Failed to request Mic1 detect IRQ: %d\n",
> +				ret);

This need a better changelog and possibly some editing of the code to
make it clearer.  According to the above diff we're in the else case for
an if statement where the true path also requests the same interrupt (or
at least something with the same text reported in the error message).
diff mbox

Patch

diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 247b390..24bcbe3 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -4099,6 +4099,15 @@  static int wm8994_codec_probe(struct snd_soc_codec *codec)
 				dev_warn(codec->dev,
 					 "Failed to request Mic1 detect IRQ: %d\n",
 					 ret);
+		} else {
+			ret = wm8994_request_irq(wm8994->wm8994,
+					WM8994_IRQ_MIC1_DET,
+					wm8994_mic_irq, "Mic 1 detect",
+					wm8994);
+			if (ret != 0)
+				dev_warn(codec->dev,
+				"Failed to request Mic1 detect IRQ: %d\n",
+				ret);
 		}
 
 		ret = wm8994_request_irq(wm8994->wm8994,