summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-07-22 12:11:34 +0200
committerTakashi Iwai <tiwai@suse.de>2014-07-22 12:11:34 +0200
commitc1ab70c10b17ce816367efdd8adb1464456242f0 (patch)
tree560464b6136ec398d22733eecce090cf4dd23762
parent2d9772ef653ccf2d5213603e371bbdfe7573df93 (diff)
parente58c295c041d17aa4298c1c8f618752f05d5c6ee (diff)
downloadop-kernel-dev-c1ab70c10b17ce816367efdd8adb1464456242f0.zip
op-kernel-dev-c1ab70c10b17ce816367efdd8adb1464456242f0.tar.gz
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 a7e062f..32168f7 100644
--- a/include/uapi/sound/asound.h
+++ b/include/uapi/sound/asound.h
@@ -391,8 +391,8 @@ struct snd_pcm_sw_params {
snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */
snd_pcm_uframes_t silence_size; /* silence block size */
snd_pcm_uframes_t boundary; /* pointers wrap point */
- unsigned int tstamp_type; /* timestamp type */
- int pads; /* alignment, reserved */
+ unsigned int proto; /* protocol version */
+ unsigned int tstamp_type; /* timestamp type (req. proto >= 2.0.12) */
unsigned char reserved[56]; /* reserved for future */
};
diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c
index af49721..102e8fd 100644
--- a/sound/core/pcm_compat.c
+++ b/sound/core/pcm_compat.c
@@ -101,7 +101,9 @@ struct snd_pcm_sw_params32 {
u32 silence_threshold;
u32 silence_size;
u32 boundary;
- unsigned char reserved[64];
+ u32 proto;
+ u32 tstamp_type;
+ unsigned char reserved[56];
};
/* recalcuate the boundary within 32bit */
@@ -133,7 +135,9 @@ static int snd_pcm_ioctl_sw_params_compat(struct snd_pcm_substream *substream,
get_user(params.start_threshold, &src->start_threshold) ||
get_user(params.stop_threshold, &src->stop_threshold) ||
get_user(params.silence_threshold, &src->silence_threshold) ||
- get_user(params.silence_size, &src->silence_size))
+ get_user(params.silence_size, &src->silence_size) ||
+ get_user(params.tstamp_type, &src->tstamp_type) ||
+ get_user(params.proto, &src->proto))
return -EFAULT;
/*
* Check silent_size parameter. Since we have 64bit boundary,
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 81dedc3..8cd2f93 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,
if (params->tstamp_mode > SNDRV_PCM_TSTAMP_LAST)
return -EINVAL;
- if (params->tstamp_type > SNDRV_PCM_TSTAMP_TYPE_LAST)
+ if (params->proto >= SNDRV_PROTOCOL_VERSION(2, 0, 12) &&
+ params->tstamp_type > SNDRV_PCM_TSTAMP_TYPE_LAST)
return -EINVAL;
if (params->avail_min == 0)
return -EINVAL;
@@ -559,7 +560,8 @@ static int snd_pcm_sw_params(struct snd_pcm_substream *substream,
err = 0;
snd_pcm_stream_lock_irq(substream);
runtime->tstamp_mode = params->tstamp_mode;
- runtime->tstamp_type = params->tstamp_type;
+ if (params->proto >= SNDRV_PROTOCOL_VERSION(2, 0, 12))
+ runtime->tstamp_type = params->tstamp_type;
runtime->period_step = params->period_step;
runtime->control->avail_min = params->avail_min;
runtime->start_threshold = params->start_threshold;
OpenPOWER on IntegriCloud