diff options
-rw-r--r-- | include/sound/asound.h | 6 | ||||
-rw-r--r-- | sound/core/pcm_native.c | 4 | ||||
-rw-r--r-- | sound/core/timer.c | 12 |
3 files changed, 16 insertions, 6 deletions
diff --git a/include/sound/asound.h b/include/sound/asound.h index 9974f83cca44..694b6e66efcb 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
@@ -560,7 +560,7 @@ enum { | |||
560 | * Timer section - /dev/snd/timer | 560 | * Timer section - /dev/snd/timer |
561 | */ | 561 | */ |
562 | 562 | ||
563 | #define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 4) | 563 | #define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5) |
564 | 564 | ||
565 | enum sndrv_timer_class { | 565 | enum sndrv_timer_class { |
566 | SNDRV_TIMER_CLASS_NONE = -1, | 566 | SNDRV_TIMER_CLASS_NONE = -1, |
@@ -693,11 +693,15 @@ enum sndrv_timer_event { | |||
693 | SNDRV_TIMER_EVENT_CONTINUE, /* val = resolution in ns */ | 693 | SNDRV_TIMER_EVENT_CONTINUE, /* val = resolution in ns */ |
694 | SNDRV_TIMER_EVENT_PAUSE, /* val = 0 */ | 694 | SNDRV_TIMER_EVENT_PAUSE, /* val = 0 */ |
695 | SNDRV_TIMER_EVENT_EARLY, /* val = 0, early event */ | 695 | SNDRV_TIMER_EVENT_EARLY, /* val = 0, early event */ |
696 | SNDRV_TIMER_EVENT_SUSPEND, /* val = 0 */ | ||
697 | SNDRV_TIMER_EVENT_RESUME, /* val = 0 */ | ||
696 | /* master timer events for slave timer instances */ | 698 | /* master timer events for slave timer instances */ |
697 | SNDRV_TIMER_EVENT_MSTART = SNDRV_TIMER_EVENT_START + 10, | 699 | SNDRV_TIMER_EVENT_MSTART = SNDRV_TIMER_EVENT_START + 10, |
698 | SNDRV_TIMER_EVENT_MSTOP = SNDRV_TIMER_EVENT_STOP + 10, | 700 | SNDRV_TIMER_EVENT_MSTOP = SNDRV_TIMER_EVENT_STOP + 10, |
699 | SNDRV_TIMER_EVENT_MCONTINUE = SNDRV_TIMER_EVENT_CONTINUE + 10, | 701 | SNDRV_TIMER_EVENT_MCONTINUE = SNDRV_TIMER_EVENT_CONTINUE + 10, |
700 | SNDRV_TIMER_EVENT_MPAUSE = SNDRV_TIMER_EVENT_PAUSE + 10, | 702 | SNDRV_TIMER_EVENT_MPAUSE = SNDRV_TIMER_EVENT_PAUSE + 10, |
703 | SNDRV_TIMER_EVENT_MSUSPEND = SNDRV_TIMER_EVENT_SUSPEND + 10, | ||
704 | SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10, | ||
701 | }; | 705 | }; |
702 | 706 | ||
703 | struct sndrv_timer_tread { | 707 | struct sndrv_timer_tread { |
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 5041be25d75b..03c17159dd8e 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -1025,7 +1025,7 @@ static void snd_pcm_post_suspend(snd_pcm_substream_t *substream, int state) | |||
1025 | snd_pcm_runtime_t *runtime = substream->runtime; | 1025 | snd_pcm_runtime_t *runtime = substream->runtime; |
1026 | snd_pcm_trigger_tstamp(substream); | 1026 | snd_pcm_trigger_tstamp(substream); |
1027 | if (substream->timer) | 1027 | if (substream->timer) |
1028 | snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MPAUSE, &runtime->trigger_tstamp); | 1028 | snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MSUSPEND, &runtime->trigger_tstamp); |
1029 | runtime->status->suspended_state = runtime->status->state; | 1029 | runtime->status->suspended_state = runtime->status->state; |
1030 | runtime->status->state = SNDRV_PCM_STATE_SUSPENDED; | 1030 | runtime->status->state = SNDRV_PCM_STATE_SUSPENDED; |
1031 | snd_pcm_tick_set(substream, 0); | 1031 | snd_pcm_tick_set(substream, 0); |
@@ -1115,7 +1115,7 @@ static void snd_pcm_post_resume(snd_pcm_substream_t *substream, int state) | |||
1115 | snd_pcm_runtime_t *runtime = substream->runtime; | 1115 | snd_pcm_runtime_t *runtime = substream->runtime; |
1116 | snd_pcm_trigger_tstamp(substream); | 1116 | snd_pcm_trigger_tstamp(substream); |
1117 | if (substream->timer) | 1117 | if (substream->timer) |
1118 | snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MCONTINUE, &runtime->trigger_tstamp); | 1118 | snd_timer_notify(substream->timer, SNDRV_TIMER_EVENT_MRESUME, &runtime->trigger_tstamp); |
1119 | runtime->status->state = runtime->status->suspended_state; | 1119 | runtime->status->state = runtime->status->suspended_state; |
1120 | if (runtime->sleep_min) | 1120 | if (runtime->sleep_min) |
1121 | snd_pcm_tick_prepare(substream); | 1121 | snd_pcm_tick_prepare(substream); |
diff --git a/sound/core/timer.c b/sound/core/timer.c index c3997e047214..56bd383a06c2 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c | |||
@@ -880,9 +880,11 @@ void snd_timer_notify(snd_timer_t *timer, enum sndrv_timer_event event, struct t | |||
880 | struct list_head *p, *n; | 880 | struct list_head *p, *n; |
881 | 881 | ||
882 | snd_runtime_check(timer->hw.flags & SNDRV_TIMER_HW_SLAVE, return); | 882 | snd_runtime_check(timer->hw.flags & SNDRV_TIMER_HW_SLAVE, return); |
883 | snd_assert(event >= SNDRV_TIMER_EVENT_MSTART && event <= SNDRV_TIMER_EVENT_MPAUSE, return); | 883 | snd_assert(event >= SNDRV_TIMER_EVENT_MSTART && event <= SNDRV_TIMER_EVENT_MRESUME, return); |
884 | spin_lock_irqsave(&timer->lock, flags); | 884 | spin_lock_irqsave(&timer->lock, flags); |
885 | if (event == SNDRV_TIMER_EVENT_MSTART || event == SNDRV_TIMER_EVENT_MCONTINUE) { | 885 | if (event == SNDRV_TIMER_EVENT_MSTART || |
886 | event == SNDRV_TIMER_EVENT_MCONTINUE || | ||
887 | event == SNDRV_TIMER_EVENT_MRESUME) { | ||
886 | if (timer->hw.c_resolution) | 888 | if (timer->hw.c_resolution) |
887 | resolution = timer->hw.c_resolution(timer); | 889 | resolution = timer->hw.c_resolution(timer); |
888 | else | 890 | else |
@@ -1555,10 +1557,14 @@ static int snd_timer_user_params(struct file *file, snd_timer_params_t __user *_ | |||
1555 | (1<<SNDRV_TIMER_EVENT_STOP)| | 1557 | (1<<SNDRV_TIMER_EVENT_STOP)| |
1556 | (1<<SNDRV_TIMER_EVENT_CONTINUE)| | 1558 | (1<<SNDRV_TIMER_EVENT_CONTINUE)| |
1557 | (1<<SNDRV_TIMER_EVENT_PAUSE)| | 1559 | (1<<SNDRV_TIMER_EVENT_PAUSE)| |
1560 | (1<<SNDRV_TIMER_EVENT_SUSPEND)| | ||
1561 | (1<<SNDRV_TIMER_EVENT_RESUME)| | ||
1558 | (1<<SNDRV_TIMER_EVENT_MSTART)| | 1562 | (1<<SNDRV_TIMER_EVENT_MSTART)| |
1559 | (1<<SNDRV_TIMER_EVENT_MSTOP)| | 1563 | (1<<SNDRV_TIMER_EVENT_MSTOP)| |
1560 | (1<<SNDRV_TIMER_EVENT_MCONTINUE)| | 1564 | (1<<SNDRV_TIMER_EVENT_MCONTINUE)| |
1561 | (1<<SNDRV_TIMER_EVENT_MPAUSE))) { | 1565 | (1<<SNDRV_TIMER_EVENT_MPAUSE| |
1566 | (1<<SNDRV_TIMER_EVENT_MSUSPEND| | ||
1567 | (1<<SNDRV_TIMER_EVENT_MRESUME))) { | ||
1562 | err = -EINVAL; | 1568 | err = -EINVAL; |
1563 | goto _end; | 1569 | goto _end; |
1564 | } | 1570 | } |