aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-07-22 06:11:34 -0400
committerTakashi Iwai <tiwai@suse.de>2014-07-22 06:11:34 -0400
commitc1ab70c10b17ce816367efdd8adb1464456242f0 (patch)
tree560464b6136ec398d22733eecce090cf4dd23762
parent2d9772ef653ccf2d5213603e371bbdfe7573df93 (diff)
parente58c295c041d17aa4298c1c8f618752f05d5c6ee (diff)
Merge branch 'topic/monotonic' into for-next
-rw-r--r--include/uapi/sound/asound.h4
-rw-r--r--sound/core/pcm_compat.c8
-rw-r--r--sound/core/pcm_native.c6
3 files changed, 12 insertions, 6 deletions
diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h
index a7e062f91f39..32168f7ffce3 100644
--- a/include/uapi/sound/asound.h
+++ b/include/uapi/sound/asound.h
@@ -391,8 +391,8 @@ struct snd_pcm_sw_params {
391 snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */ 391 snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */
392 snd_pcm_uframes_t silence_size; /* silence block size */ 392 snd_pcm_uframes_t silence_size; /* silence block size */
393 snd_pcm_uframes_t boundary; /* pointers wrap point */ 393 snd_pcm_uframes_t boundary; /* pointers wrap point */
394 unsigned int tstamp_type; /* timestamp type */ 394 unsigned int proto; /* protocol version */
395 int pads; /* alignment, reserved */ 395 unsigned int tstamp_type; /* timestamp type (req. proto >= 2.0.12) */
396 unsigned char reserved[56]; /* reserved for future */ 396 unsigned char reserved[56]; /* reserved for future */
397}; 397};
398 398
diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c
index af49721ba0e3..102e8fd1d450 100644
--- a/sound/core/pcm_compat.c
+++ b/sound/core/pcm_compat.c
@@ -101,7 +101,9 @@ struct snd_pcm_sw_params32 {
101 u32 silence_threshold; 101 u32 silence_threshold;
102 u32 silence_size; 102 u32 silence_size;
103 u32 boundary; 103 u32 boundary;
104 unsigned char reserved[64]; 104 u32 proto;
105 u32 tstamp_type;
106 unsigned char reserved[56];
105}; 107};
106 108
107/* recalcuate the boundary within 32bit */ 109/* recalcuate the boundary within 32bit */
@@ -133,7 +135,9 @@ static int snd_pcm_ioctl_sw_params_compat(struct snd_pcm_substream *substream,
133 get_user(params.start_threshold, &src->start_threshold) || 135 get_user(params.start_threshold, &src->start_threshold) ||
134 get_user(params.stop_threshold, &src->stop_threshold) || 136 get_user(params.stop_threshold, &src->stop_threshold) ||
135 get_user(params.silence_threshold, &src->silence_threshold) || 137 get_user(params.silence_threshold, &src->silence_threshold) ||
136 get_user(params.silence_size, &src->silence_size)) 138 get_user(params.silence_size, &src->silence_size) ||
139 get_user(params.tstamp_type, &src->tstamp_type) ||
140 get_user(params.proto, &src->proto))
137 return -EFAULT; 141 return -EFAULT;
138 /* 142 /*
139 * Check silent_size parameter. Since we have 64bit boundary, 143 * Check silent_size parameter. Since we have 64bit boundary,
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 81dedc381efd..8cd2f930ad0b 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -543,7 +543,8 @@ static int snd_pcm_sw_params(struct snd_pcm_substream *substream,
543 543
544 if (params->tstamp_mode > SNDRV_PCM_TSTAMP_LAST) 544 if (params->tstamp_mode > SNDRV_PCM_TSTAMP_LAST)
545 return -EINVAL; 545 return -EINVAL;
546 if (params->tstamp_type > SNDRV_PCM_TSTAMP_TYPE_LAST) 546 if (params->proto >= SNDRV_PROTOCOL_VERSION(2, 0, 12) &&
547 params->tstamp_type > SNDRV_PCM_TSTAMP_TYPE_LAST)
547 return -EINVAL; 548 return -EINVAL;
548 if (params->avail_min == 0) 549 if (params->avail_min == 0)
549 return -EINVAL; 550 return -EINVAL;
@@ -559,7 +560,8 @@ static int snd_pcm_sw_params(struct snd_pcm_substream *substream,
559 err = 0; 560 err = 0;
560 snd_pcm_stream_lock_irq(substream); 561 snd_pcm_stream_lock_irq(substream);
561 runtime->tstamp_mode = params->tstamp_mode; 562 runtime->tstamp_mode = params->tstamp_mode;
562 runtime->tstamp_type = params->tstamp_type; 563 if (params->proto >= SNDRV_PROTOCOL_VERSION(2, 0, 12))
564 runtime->tstamp_type = params->tstamp_type;
563 runtime->period_step = params->period_step; 565 runtime->period_step = params->period_step;
564 runtime->control->avail_min = params->avail_min; 566 runtime->control->avail_min = params->avail_min;
565 runtime->start_threshold = params->start_threshold; 567 runtime->start_threshold = params->start_threshold;