diff options
-rw-r--r-- | sound/soc/codecs/wm8994.c | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 9b9c15ffb7d2..0dc14115f109 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
@@ -102,8 +102,6 @@ struct wm8994_priv { | |||
102 | 102 | ||
103 | wm8958_micdet_cb jack_cb; | 103 | wm8958_micdet_cb jack_cb; |
104 | void *jack_cb_data; | 104 | void *jack_cb_data; |
105 | bool jack_is_mic; | ||
106 | bool jack_is_video; | ||
107 | int micdet_irq; | 105 | int micdet_irq; |
108 | 106 | ||
109 | int revision; | 107 | int revision; |
@@ -2972,46 +2970,18 @@ static void wm8958_default_micdet(u16 status, void *data) | |||
2972 | int report = 0; | 2970 | int report = 0; |
2973 | 2971 | ||
2974 | /* If nothing present then clear our statuses */ | 2972 | /* If nothing present then clear our statuses */ |
2975 | if (!(status & WM8958_MICD_STS)) { | 2973 | if (!(status & WM8958_MICD_STS)) |
2976 | wm8994->jack_is_video = false; | ||
2977 | wm8994->jack_is_mic = false; | ||
2978 | goto done; | 2974 | goto done; |
2979 | } | ||
2980 | |||
2981 | /* Assume anything over 475 ohms is a microphone and remember | ||
2982 | * that we've seen one (since buttons override it) */ | ||
2983 | if (status & 0x600) | ||
2984 | wm8994->jack_is_mic = true; | ||
2985 | if (wm8994->jack_is_mic) | ||
2986 | report |= SND_JACK_MICROPHONE; | ||
2987 | 2975 | ||
2988 | /* Video has an impedence of approximately 75 ohms; assume | 2976 | report = SND_JACK_MICROPHONE; |
2989 | * this isn't used as a button and remember it since buttons | ||
2990 | * override it. */ | ||
2991 | if (status & 0x40) | ||
2992 | wm8994->jack_is_video = true; | ||
2993 | if (wm8994->jack_is_video) | ||
2994 | report |= SND_JACK_VIDEOOUT; | ||
2995 | 2977 | ||
2996 | /* Everything else is buttons; just assign slots */ | 2978 | /* Everything else is buttons; just assign slots */ |
2997 | if (status & 0x4) | 2979 | if (status & 0x1c0) |
2998 | report |= SND_JACK_BTN_0; | 2980 | report |= SND_JACK_BTN_0; |
2999 | if (status & 0x8) | ||
3000 | report |= SND_JACK_BTN_1; | ||
3001 | if (status & 0x10) | ||
3002 | report |= SND_JACK_BTN_2; | ||
3003 | if (status & 0x20) | ||
3004 | report |= SND_JACK_BTN_3; | ||
3005 | if (status & 0x80) | ||
3006 | report |= SND_JACK_BTN_4; | ||
3007 | if (status & 0x100) | ||
3008 | report |= SND_JACK_BTN_5; | ||
3009 | 2981 | ||
3010 | done: | 2982 | done: |
3011 | snd_soc_jack_report(wm8994->micdet[0].jack, report, | 2983 | snd_soc_jack_report(wm8994->micdet[0].jack, report, |
3012 | SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2 | | 2984 | SND_JACK_BTN_0 | SND_JACK_MICROPHONE); |
3013 | SND_JACK_BTN_3 | SND_JACK_BTN_4 | SND_JACK_BTN_5 | | ||
3014 | SND_JACK_MICROPHONE | SND_JACK_VIDEOOUT); | ||
3015 | } | 2985 | } |
3016 | 2986 | ||
3017 | /** | 2987 | /** |