summaryrefslogtreecommitdiffstats
path: root/sound/x86
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-02-07 01:55:27 -0500
committerTakashi Iwai <tiwai@suse.de>2017-02-07 03:43:01 -0500
commit075a1d46bed386138eb51f92a6a3130c82fdefec (patch)
tree52008e09afda38f3f8c7d5cf6aede137b9173d9d /sound/x86
parent3e21a76ca32f535a7640b0657f8d56660527ddab (diff)
ALSA: x86: Rename had_enable_audio_int() to had_ack_irqs()
had_enable_audio_int() came from the LPE audio shell set_caps callback with ENABLE_INT and DISABLE_INT caps. I interpreted as these correspond to enabling / disabling the audio interface, but the actual implementation is only to clear (send ACK) to both BUFFER_DONE and BUFFER_UNDERRUN interrupts unconditionally. And, there is no counterpart, DISABLE_INT, code at all. For avoiding the further misunderstanding, rename the function to the more fitting one, had_ack_irqs(), and drop the calls with enable=false in allover places. There is no functional changes at all. After this patch, there is only one caller at the PCM trigger start. Then it's doubtful whether this call is still really needed or not; I bet it not, but let's stay in the safer side for now and keep it as was. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/x86')
-rw-r--r--sound/x86/intel_hdmi_audio.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
index 11ee4dddc5dd..8506a3dc0298 100644
--- a/sound/x86/intel_hdmi_audio.c
+++ b/sound/x86/intel_hdmi_audio.c
@@ -238,17 +238,15 @@ static void had_enable_audio(struct snd_pcm_substream *substream,
238 had_write_register(intelhaddata, AUD_CONFIG, val); 238 had_write_register(intelhaddata, AUD_CONFIG, val);
239} 239}
240 240
241/* enable / disable the audio interface */ 241/* forcibly ACKs to both BUFFER_DONE and BUFFER_UNDERRUN interrupts */
242static void had_enable_audio_int(struct snd_intelhad *ctx, bool enable) 242static void had_ack_irqs(struct snd_intelhad *ctx)
243{ 243{
244 u32 status_reg; 244 u32 status_reg;
245 245
246 if (enable) { 246 had_read_register(ctx, AUD_HDMI_STATUS, &status_reg);
247 had_read_register(ctx, AUD_HDMI_STATUS, &status_reg); 247 status_reg |= HDMI_AUDIO_BUFFER_DONE | HDMI_AUDIO_UNDERRUN;
248 status_reg |= HDMI_AUDIO_BUFFER_DONE | HDMI_AUDIO_UNDERRUN; 248 had_write_register(ctx, AUD_HDMI_STATUS, status_reg);
249 had_write_register(ctx, AUD_HDMI_STATUS, status_reg); 249 had_read_register(ctx, AUD_HDMI_STATUS, &status_reg);
250 had_read_register(ctx, AUD_HDMI_STATUS, &status_reg);
251 }
252} 250}
253 251
254/* Reset buffer pointers */ 252/* Reset buffer pointers */
@@ -1169,7 +1167,7 @@ static int had_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
1169 intelhaddata->stream_info.running = true; 1167 intelhaddata->stream_info.running = true;
1170 1168
1171 /* Enable Audio */ 1169 /* Enable Audio */
1172 had_enable_audio_int(intelhaddata, true); 1170 had_ack_irqs(intelhaddata); /* FIXME: do we need this? */
1173 had_enable_audio(substream, intelhaddata, true); 1171 had_enable_audio(substream, intelhaddata, true);
1174 break; 1172 break;
1175 1173
@@ -1183,11 +1181,9 @@ static int had_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
1183 intelhaddata->stream_info.running = false; 1181 intelhaddata->stream_info.running = false;
1184 spin_unlock(&intelhaddata->had_spinlock); 1182 spin_unlock(&intelhaddata->had_spinlock);
1185 /* Disable Audio */ 1183 /* Disable Audio */
1186 had_enable_audio_int(intelhaddata, false);
1187 had_enable_audio(substream, intelhaddata, false); 1184 had_enable_audio(substream, intelhaddata, false);
1188 /* Reset buffer pointers */ 1185 /* Reset buffer pointers */
1189 had_reset_audio(intelhaddata); 1186 had_reset_audio(intelhaddata);
1190 had_enable_audio_int(intelhaddata, false);
1191 break; 1187 break;
1192 1188
1193 default: 1189 default:
@@ -1392,7 +1388,6 @@ static void had_process_hot_unplug(struct snd_intelhad *intelhaddata)
1392 } 1388 }
1393 1389
1394 /* Disable Audio */ 1390 /* Disable Audio */
1395 had_enable_audio_int(intelhaddata, false);
1396 had_enable_audio(substream, intelhaddata, false); 1391 had_enable_audio(substream, intelhaddata, false);
1397 1392
1398 intelhaddata->connected = false; 1393 intelhaddata->connected = false;
@@ -1802,8 +1797,6 @@ static int hdmi_lpe_audio_remove(struct platform_device *pdev)
1802{ 1797{
1803 struct snd_intelhad *ctx = platform_get_drvdata(pdev); 1798 struct snd_intelhad *ctx = platform_get_drvdata(pdev);
1804 1799
1805 if (ctx->connected)
1806 had_enable_audio_int(ctx, false);
1807 snd_card_free(ctx->card); 1800 snd_card_free(ctx->card);
1808 return 0; 1801 return 0;
1809} 1802}