Commit a17ac45a5da76f851faf0b6502f66c1205159469

Authored by Krzysztof Helt
Committed by Takashi Iwai
1 parent aa9c293ae4

ALSA: ad1816a: enable hardware timer

Enable hardware timer with 10 usec resolution.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

Showing 3 changed files with 9 additions and 5 deletions Side-by-side Diff

include/sound/ad1816a.h
... ... @@ -169,6 +169,8 @@
169 169  
170 170 extern int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device, struct snd_pcm **rpcm);
171 171 extern int snd_ad1816a_mixer(struct snd_ad1816a *chip);
  172 +extern int snd_ad1816a_timer(struct snd_ad1816a *chip, int device,
  173 + struct snd_timer **rtimer);
172 174  
173 175 #endif /* __SOUND_AD1816A_H */
sound/isa/ad1816a/ad1816a.c
... ... @@ -156,6 +156,7 @@
156 156 struct snd_card_ad1816a *acard;
157 157 struct snd_ad1816a *chip;
158 158 struct snd_opl3 *opl3;
  159 + struct snd_timer *timer;
159 160  
160 161 if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE,
161 162 sizeof(struct snd_card_ad1816a))) == NULL)
... ... @@ -190,6 +191,12 @@
190 191 }
191 192  
192 193 if ((error = snd_ad1816a_mixer(chip)) < 0) {
  194 + snd_card_free(card);
  195 + return error;
  196 + }
  197 +
  198 + error = snd_ad1816a_timer(chip, 0, &timer);
  199 + if (error < 0) {
193 200 snd_card_free(card);
194 201 return error;
195 202 }
sound/isa/ad1816a/ad1816a_lib.c
... ... @@ -377,7 +377,6 @@
377 377 .fifo_size = 0,
378 378 };
379 379  
380   -#if 0 /* not used now */
381 380 static int snd_ad1816a_timer_close(struct snd_timer *timer)
382 381 {
383 382 struct snd_ad1816a *chip = snd_timer_chip(timer);
384 383  
... ... @@ -442,9 +441,7 @@
442 441 .start = snd_ad1816a_timer_start,
443 442 .stop = snd_ad1816a_timer_stop,
444 443 };
445   -#endif /* not used now */
446 444  
447   -
448 445 static int snd_ad1816a_playback_open(struct snd_pcm_substream *substream)
449 446 {
450 447 struct snd_ad1816a *chip = snd_pcm_substream_chip(substream);
... ... @@ -687,7 +684,6 @@
687 684 return 0;
688 685 }
689 686  
690   -#if 0 /* not used now */
691 687 int __devinit snd_ad1816a_timer(struct snd_ad1816a *chip, int device, struct snd_timer **rtimer)
692 688 {
693 689 struct snd_timer *timer;
... ... @@ -709,7 +705,6 @@
709 705 *rtimer = timer;
710 706 return 0;
711 707 }
712   -#endif /* not used now */
713 708  
714 709 /*
715 710 *