diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-16 15:50:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-16 15:50:53 -0500 |
commit | 73d75ba99e3bdd627275afd3fe48cc933723084b (patch) | |
tree | 8923aa413662c6eee1f36b473b211aab52474ec2 /sound/soc/fsl | |
parent | 71f777ed50e9109c235c14604d5e23d2f8e7453c (diff) | |
parent | abfe69dd2e313d0c8226ca4a12329e3d829cfd7c (diff) |
Merge tag 'sound-fix-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai:
"Two peaks in diffstat are for the audio EQ init of IDT codecs and the
EMU2004 usb mixer addition, both of which are pretty device-specific,
so safe to apply. The rest are a bunch of small fixes, most of them
are regression fixes"
* tag 'sound-fix-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (26 commits)
ALSA: hda - load EQ params into IDT codec on HP bNB13 systems
ASoC: cs42l52: Correct MIC CTL mask
ASoC: wm8962: Turn on regcache_cache_only before disabling regulator
ALSA: jack: Unregister input device at disconnection
ALSA: pcsp: Fix the order of input device unregistration
ASoC: fsl: imx-pcm-fiq: omit fiq counter to avoid harm in unbalanced situations
ASoC: blackfin: Fix missing break
ALSA: usb-audio: add front jack channel selector for EMU0204
ALSA: hda - Don't clear the power state at snd_hda_codec_reset()
ASoC: arizona: Fix typo in name of EQ coefficient controls
ALSA: hda - Control EAPD for Master volume on Lenovo N100
ALSA: hda - Don't turn off EAPD for headphone on Lenovo N100
ALSA: isa: not allocating enough space
ALSA: snd-aoa: two copy and paste bugs
ASoC: wm8997: Correct typo in ISRC mux routes
ALSA: hda - Check keep_eapd_on before inv_eapd
ALSA: hda - Fix Line Out automute on Realtek multifunction jacks
ALSA: msnd: Avoid duplicated driver name
ALSA: compress_core: don't return -EBADFD from poll if paused
ALSA: hda - hdmi: Fix wrong baseline length in ATI/AMD generated ELD
...
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r-- | sound/soc/fsl/imx-pcm-fiq.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c index 41740e488820..c75d43bb2e92 100644 --- a/sound/soc/fsl/imx-pcm-fiq.c +++ b/sound/soc/fsl/imx-pcm-fiq.c | |||
@@ -42,7 +42,8 @@ struct imx_pcm_runtime_data { | |||
42 | struct hrtimer hrt; | 42 | struct hrtimer hrt; |
43 | int poll_time_ns; | 43 | int poll_time_ns; |
44 | struct snd_pcm_substream *substream; | 44 | struct snd_pcm_substream *substream; |
45 | atomic_t running; | 45 | atomic_t playing; |
46 | atomic_t capturing; | ||
46 | }; | 47 | }; |
47 | 48 | ||
48 | static enum hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt) | 49 | static enum hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt) |
@@ -52,7 +53,7 @@ static enum hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt) | |||
52 | struct snd_pcm_substream *substream = iprtd->substream; | 53 | struct snd_pcm_substream *substream = iprtd->substream; |
53 | struct pt_regs regs; | 54 | struct pt_regs regs; |
54 | 55 | ||
55 | if (!atomic_read(&iprtd->running)) | 56 | if (!atomic_read(&iprtd->playing) && !atomic_read(&iprtd->capturing)) |
56 | return HRTIMER_NORESTART; | 57 | return HRTIMER_NORESTART; |
57 | 58 | ||
58 | get_fiq_regs(®s); | 59 | get_fiq_regs(®s); |
@@ -106,7 +107,6 @@ static int snd_imx_pcm_prepare(struct snd_pcm_substream *substream) | |||
106 | return 0; | 107 | return 0; |
107 | } | 108 | } |
108 | 109 | ||
109 | static int fiq_enable; | ||
110 | static int imx_pcm_fiq; | 110 | static int imx_pcm_fiq; |
111 | 111 | ||
112 | static int snd_imx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) | 112 | static int snd_imx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) |
@@ -118,23 +118,27 @@ static int snd_imx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) | |||
118 | case SNDRV_PCM_TRIGGER_START: | 118 | case SNDRV_PCM_TRIGGER_START: |
119 | case SNDRV_PCM_TRIGGER_RESUME: | 119 | case SNDRV_PCM_TRIGGER_RESUME: |
120 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | 120 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
121 | atomic_set(&iprtd->running, 1); | 121 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) |
122 | atomic_set(&iprtd->playing, 1); | ||
123 | else | ||
124 | atomic_set(&iprtd->capturing, 1); | ||
122 | hrtimer_start(&iprtd->hrt, ns_to_ktime(iprtd->poll_time_ns), | 125 | hrtimer_start(&iprtd->hrt, ns_to_ktime(iprtd->poll_time_ns), |
123 | HRTIMER_MODE_REL); | 126 | HRTIMER_MODE_REL); |
124 | if (++fiq_enable == 1) | 127 | enable_fiq(imx_pcm_fiq); |
125 | enable_fiq(imx_pcm_fiq); | ||
126 | |||
127 | break; | 128 | break; |
128 | 129 | ||
129 | case SNDRV_PCM_TRIGGER_STOP: | 130 | case SNDRV_PCM_TRIGGER_STOP: |
130 | case SNDRV_PCM_TRIGGER_SUSPEND: | 131 | case SNDRV_PCM_TRIGGER_SUSPEND: |
131 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | 132 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: |
132 | atomic_set(&iprtd->running, 0); | 133 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) |
133 | 134 | atomic_set(&iprtd->playing, 0); | |
134 | if (--fiq_enable == 0) | 135 | else |
136 | atomic_set(&iprtd->capturing, 0); | ||
137 | if (!atomic_read(&iprtd->playing) && | ||
138 | !atomic_read(&iprtd->capturing)) | ||
135 | disable_fiq(imx_pcm_fiq); | 139 | disable_fiq(imx_pcm_fiq); |
136 | |||
137 | break; | 140 | break; |
141 | |||
138 | default: | 142 | default: |
139 | return -EINVAL; | 143 | return -EINVAL; |
140 | } | 144 | } |
@@ -182,7 +186,8 @@ static int snd_imx_open(struct snd_pcm_substream *substream) | |||
182 | 186 | ||
183 | iprtd->substream = substream; | 187 | iprtd->substream = substream; |
184 | 188 | ||
185 | atomic_set(&iprtd->running, 0); | 189 | atomic_set(&iprtd->playing, 0); |
190 | atomic_set(&iprtd->capturing, 0); | ||
186 | hrtimer_init(&iprtd->hrt, CLOCK_MONOTONIC, HRTIMER_MODE_REL); | 191 | hrtimer_init(&iprtd->hrt, CLOCK_MONOTONIC, HRTIMER_MODE_REL); |
187 | iprtd->hrt.function = snd_hrtimer_callback; | 192 | iprtd->hrt.function = snd_hrtimer_callback; |
188 | 193 | ||