@@ -1084,7 +1084,7 @@ static int vc4_hdmi_audio_startup(struct snd_pcm_substream *substream,
VC4_HDMI_RAM_PACKET_ENABLE))
return -ENODEV;
- ret = snd_pcm_hw_constraint_eld(substream->runtime, connector->eld);
+ ret = snd_pcm_hw_constraint_eld(substream, connector->eld);
if (ret)
return ret;
@@ -404,7 +404,7 @@ int snd_ac97_pcm_assign(struct snd_ac97_bus *ac97,
int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,
enum ac97_pcm_cfg cfg, unsigned short slots);
int snd_ac97_pcm_close(struct ac97_pcm *pcm);
-int snd_ac97_pcm_double_rate_rules(struct snd_pcm_runtime *runtime);
+int snd_ac97_pcm_double_rate_rules(struct snd_pcm_substream *substream);
/* ad hoc AC97 device driver access */
extern struct bus_type ac97_bus_type;
@@ -984,36 +984,36 @@ int snd_pcm_hw_constraint_mask64(struct snd_pcm_runtime *runtime, snd_pcm_hw_par
int snd_pcm_hw_constraint_minmax(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
unsigned int min, unsigned int max);
int snd_pcm_hw_constraint_integer(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var);
-int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime,
+int snd_pcm_hw_constraint_list(struct snd_pcm_substream *substream,
unsigned int cond,
snd_pcm_hw_param_t var,
const struct snd_pcm_hw_constraint_list *l);
-int snd_pcm_hw_constraint_ranges(struct snd_pcm_runtime *runtime,
+int snd_pcm_hw_constraint_ranges(struct snd_pcm_substream *substream,
unsigned int cond,
snd_pcm_hw_param_t var,
const struct snd_pcm_hw_constraint_ranges *r);
-int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime,
+int snd_pcm_hw_constraint_ratnums(struct snd_pcm_substream *substream,
unsigned int cond,
snd_pcm_hw_param_t var,
const struct snd_pcm_hw_constraint_ratnums *r);
-int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime,
+int snd_pcm_hw_constraint_ratdens(struct snd_pcm_substream *substream,
unsigned int cond,
snd_pcm_hw_param_t var,
const struct snd_pcm_hw_constraint_ratdens *r);
-int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime,
+int snd_pcm_hw_constraint_msbits(struct snd_pcm_substream *substream,
unsigned int cond,
unsigned int width,
unsigned int msbits);
-int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime,
+int snd_pcm_hw_constraint_step(struct snd_pcm_substream *substream,
unsigned int cond,
snd_pcm_hw_param_t var,
unsigned long step);
-int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime,
+int snd_pcm_hw_constraint_pow2(struct snd_pcm_substream *substream,
unsigned int cond,
snd_pcm_hw_param_t var);
-int snd_pcm_hw_rule_noresample(struct snd_pcm_runtime *runtime,
+int snd_pcm_hw_rule_noresample(struct snd_pcm_substream *substream,
unsigned int base_rate);
-int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime,
+int snd_pcm_hw_rule_add(struct snd_pcm_substream *substream,
unsigned int cond,
int var,
snd_pcm_hw_rule_func_t func, void *private,
@@ -2,6 +2,6 @@
#ifndef __SOUND_PCM_DRM_ELD_H
#define __SOUND_PCM_DRM_ELD_H
-int snd_pcm_hw_constraint_eld(struct snd_pcm_runtime *runtime, void *eld);
+int snd_pcm_hw_constraint_eld(struct snd_pcm_substream *substream, void *eld);
#endif
@@ -419,7 +419,7 @@ static int aaci_pcm_open(struct snd_pcm_substream *substream)
runtime->hw.channels_max = 6;
/* Add rule describing channel dependency. */
- ret = snd_pcm_hw_rule_add(substream->runtime, 0,
+ ret = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
aaci_rule_channels, aaci,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
@@ -427,7 +427,7 @@ static int aaci_pcm_open(struct snd_pcm_substream *substream)
return ret;
if (aacirun->pcm->r[1].slots)
- snd_ac97_pcm_double_rate_rules(runtime);
+ snd_ac97_pcm_double_rate_rules(substream);
}
/*
@@ -104,12 +104,12 @@ int pxa2xx_pcm_open(struct snd_pcm_substream *substream)
* playback samples are lost if the DMA count is not a multiple
* of the DMA burst size. Let's add a rule to enforce that.
*/
- ret = snd_pcm_hw_constraint_step(runtime, 0,
+ ret = snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 32);
if (ret)
return ret;
- ret = snd_pcm_hw_constraint_step(runtime, 0,
+ ret = snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 32);
if (ret)
return ret;
@@ -77,17 +77,17 @@ static int eld_limit_channels(struct snd_pcm_hw_params *params,
return snd_interval_refine(c, &t);
}
-int snd_pcm_hw_constraint_eld(struct snd_pcm_runtime *runtime, void *eld)
+int snd_pcm_hw_constraint_eld(struct snd_pcm_substream *substream, void *eld)
{
int ret;
- ret = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ ret = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
eld_limit_rates, eld,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
if (ret < 0)
return ret;
- ret = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ ret = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
eld_limit_channels, eld,
SNDRV_PCM_HW_PARAM_RATE, -1);
@@ -1107,7 +1107,7 @@ static int snd_interval_step(struct snd_interval *i, unsigned int step)
/**
* snd_pcm_hw_rule_add - add the hw-constraint rule
- * @runtime: the pcm runtime instance
+ * @substream: the pcm substream
* @cond: condition bits
* @var: the variable to evaluate
* @func: the evaluation function
@@ -1116,15 +1116,17 @@ static int snd_interval_step(struct snd_interval *i, unsigned int step)
*
* Return: Zero if successful, or a negative error code on failure.
*/
-int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, unsigned int cond,
+int snd_pcm_hw_rule_add(struct snd_pcm_substream *substream, unsigned int cond,
int var,
snd_pcm_hw_rule_func_t func, void *private,
int dep, ...)
{
- struct snd_pcm_hw_constraints *constrs = &runtime->hw_constraints;
+ struct snd_pcm_hw_constraints *constrs =
+ &substream->runtime->hw_constraints;
struct snd_pcm_hw_rule *c;
unsigned int k;
va_list args;
+
va_start(args, dep);
if (constrs->rules_num >= constrs->rules_all) {
struct snd_pcm_hw_rule *new;
@@ -1258,21 +1260,21 @@ static int snd_pcm_hw_rule_list(struct snd_pcm_hw_params *params,
/**
* snd_pcm_hw_constraint_list - apply a list of constraints to a parameter
- * @runtime: PCM runtime instance
+ * @substream: the pcm substream
* @cond: condition bits
* @var: hw_params variable to apply the list constraint
* @l: list
- *
+ *
* Apply the list of constraints to an interval parameter.
*
* Return: Zero if successful, or a negative error code on failure.
*/
-int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime,
+int snd_pcm_hw_constraint_list(struct snd_pcm_substream *substream,
unsigned int cond,
snd_pcm_hw_param_t var,
const struct snd_pcm_hw_constraint_list *l)
{
- return snd_pcm_hw_rule_add(runtime, cond, var,
+ return snd_pcm_hw_rule_add(substream, cond, var,
snd_pcm_hw_rule_list, (void *)l,
var, -1);
}
@@ -1289,7 +1291,7 @@ static int snd_pcm_hw_rule_ranges(struct snd_pcm_hw_params *params,
/**
* snd_pcm_hw_constraint_ranges - apply list of range constraints to a parameter
- * @runtime: PCM runtime instance
+ * @substream: the pcm substream
* @cond: condition bits
* @var: hw_params variable to apply the list of range constraints
* @r: ranges
@@ -1298,12 +1300,12 @@ static int snd_pcm_hw_rule_ranges(struct snd_pcm_hw_params *params,
*
* Return: Zero if successful, or a negative error code on failure.
*/
-int snd_pcm_hw_constraint_ranges(struct snd_pcm_runtime *runtime,
+int snd_pcm_hw_constraint_ranges(struct snd_pcm_substream *substream,
unsigned int cond,
snd_pcm_hw_param_t var,
const struct snd_pcm_hw_constraint_ranges *r)
{
- return snd_pcm_hw_rule_add(runtime, cond, var,
+ return snd_pcm_hw_rule_add(substream, cond, var,
snd_pcm_hw_rule_ranges, (void *)r,
var, -1);
}
@@ -1326,19 +1328,19 @@ static int snd_pcm_hw_rule_ratnums(struct snd_pcm_hw_params *params,
/**
* snd_pcm_hw_constraint_ratnums - apply ratnums constraint to a parameter
- * @runtime: PCM runtime instance
+ * @substream: the pcm substream
* @cond: condition bits
* @var: hw_params variable to apply the ratnums constraint
* @r: struct snd_ratnums constriants
*
* Return: Zero if successful, or a negative error code on failure.
*/
-int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime,
+int snd_pcm_hw_constraint_ratnums(struct snd_pcm_substream *substream,
unsigned int cond,
snd_pcm_hw_param_t var,
const struct snd_pcm_hw_constraint_ratnums *r)
{
- return snd_pcm_hw_rule_add(runtime, cond, var,
+ return snd_pcm_hw_rule_add(substream, cond, var,
snd_pcm_hw_rule_ratnums, (void *)r,
var, -1);
}
@@ -1360,19 +1362,19 @@ static int snd_pcm_hw_rule_ratdens(struct snd_pcm_hw_params *params,
/**
* snd_pcm_hw_constraint_ratdens - apply ratdens constraint to a parameter
- * @runtime: PCM runtime instance
+ * @substream: the pcm substream
* @cond: condition bits
* @var: hw_params variable to apply the ratdens constraint
* @r: struct snd_ratdens constriants
*
* Return: Zero if successful, or a negative error code on failure.
*/
-int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime,
+int snd_pcm_hw_constraint_ratdens(struct snd_pcm_substream *substream,
unsigned int cond,
snd_pcm_hw_param_t var,
const struct snd_pcm_hw_constraint_ratdens *r)
{
- return snd_pcm_hw_rule_add(runtime, cond, var,
+ return snd_pcm_hw_rule_add(substream, cond, var,
snd_pcm_hw_rule_ratdens, (void *)r,
var, -1);
}
@@ -1399,7 +1401,7 @@ static int snd_pcm_hw_rule_msbits(struct snd_pcm_hw_params *params,
/**
* snd_pcm_hw_constraint_msbits - add a hw constraint msbits rule
- * @runtime: PCM runtime instance
+ * @substream: the pcm substream
* @cond: condition bits
* @width: sample bits width
* @msbits: msbits width
@@ -1411,13 +1413,13 @@ static int snd_pcm_hw_rule_msbits(struct snd_pcm_hw_params *params,
*
* Return: Zero if successful, or a negative error code on failure.
*/
-int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime,
+int snd_pcm_hw_constraint_msbits(struct snd_pcm_substream *substream,
unsigned int cond,
unsigned int width,
unsigned int msbits)
{
unsigned long l = (msbits << 16) | width;
- return snd_pcm_hw_rule_add(runtime, cond, -1,
+ return snd_pcm_hw_rule_add(substream, cond, -1,
snd_pcm_hw_rule_msbits,
(void*) l,
SNDRV_PCM_HW_PARAM_SAMPLE_BITS, -1);
@@ -1433,19 +1435,19 @@ static int snd_pcm_hw_rule_step(struct snd_pcm_hw_params *params,
/**
* snd_pcm_hw_constraint_step - add a hw constraint step rule
- * @runtime: PCM runtime instance
+ * @substream: the pcm substream
* @cond: condition bits
* @var: hw_params variable to apply the step constraint
* @step: step size
*
* Return: Zero if successful, or a negative error code on failure.
*/
-int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime,
+int snd_pcm_hw_constraint_step(struct snd_pcm_substream *substream,
unsigned int cond,
snd_pcm_hw_param_t var,
unsigned long step)
{
- return snd_pcm_hw_rule_add(runtime, cond, var,
+ return snd_pcm_hw_rule_add(substream, cond, var,
snd_pcm_hw_rule_step, (void *) step,
var, -1);
}
@@ -1465,17 +1467,17 @@ static int snd_pcm_hw_rule_pow2(struct snd_pcm_hw_params *params, struct snd_pcm
/**
* snd_pcm_hw_constraint_pow2 - add a hw constraint power-of-2 rule
- * @runtime: PCM runtime instance
+ * @substream: the pcm substream
* @cond: condition bits
* @var: hw_params variable to apply the power-of-2 constraint
*
* Return: Zero if successful, or a negative error code on failure.
*/
-int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime,
+int snd_pcm_hw_constraint_pow2(struct snd_pcm_substream *substream,
unsigned int cond,
snd_pcm_hw_param_t var)
{
- return snd_pcm_hw_rule_add(runtime, cond, var,
+ return snd_pcm_hw_rule_add(substream, cond, var,
snd_pcm_hw_rule_pow2, NULL,
var, -1);
}
@@ -1493,15 +1495,15 @@ static int snd_pcm_hw_rule_noresample_func(struct snd_pcm_hw_params *params,
/**
* snd_pcm_hw_rule_noresample - add a rule to allow disabling hw resampling
- * @runtime: PCM runtime instance
+ * @substream: the pcm substream
* @base_rate: the rate at which the hardware does not resample
*
* Return: Zero if successful, or a negative error code on failure.
*/
-int snd_pcm_hw_rule_noresample(struct snd_pcm_runtime *runtime,
+int snd_pcm_hw_rule_noresample(struct snd_pcm_substream *substream,
unsigned int base_rate)
{
- return snd_pcm_hw_rule_add(runtime, SNDRV_PCM_HW_PARAMS_NORESAMPLE,
+ return snd_pcm_hw_rule_add(substream, SNDRV_PCM_HW_PARAMS_NORESAMPLE,
SNDRV_PCM_HW_PARAM_RATE,
snd_pcm_hw_rule_noresample_func,
(void *)(uintptr_t)base_rate,
@@ -2420,103 +2420,103 @@ static int snd_pcm_hw_constraints_init(struct snd_pcm_substream *substream)
snd_interval_setinteger(constrs_interval(constrs, SNDRV_PCM_HW_PARAM_SAMPLE_BITS));
snd_interval_setinteger(constrs_interval(constrs, SNDRV_PCM_HW_PARAM_FRAME_BITS));
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FORMAT,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_FORMAT,
snd_pcm_hw_rule_format, NULL,
SNDRV_PCM_HW_PARAM_SAMPLE_BITS, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
snd_pcm_hw_rule_sample_bits, NULL,
- SNDRV_PCM_HW_PARAM_FORMAT,
+ SNDRV_PCM_HW_PARAM_FORMAT,
SNDRV_PCM_HW_PARAM_SAMPLE_BITS, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
snd_pcm_hw_rule_div, NULL,
SNDRV_PCM_HW_PARAM_FRAME_BITS, SNDRV_PCM_HW_PARAM_CHANNELS, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FRAME_BITS,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_FRAME_BITS,
snd_pcm_hw_rule_mul, NULL,
SNDRV_PCM_HW_PARAM_SAMPLE_BITS, SNDRV_PCM_HW_PARAM_CHANNELS, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FRAME_BITS,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_FRAME_BITS,
snd_pcm_hw_rule_mulkdiv, (void*) 8,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FRAME_BITS,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_FRAME_BITS,
snd_pcm_hw_rule_mulkdiv, (void*) 8,
SNDRV_PCM_HW_PARAM_BUFFER_BYTES, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
snd_pcm_hw_rule_div, NULL,
SNDRV_PCM_HW_PARAM_FRAME_BITS, SNDRV_PCM_HW_PARAM_SAMPLE_BITS, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
snd_pcm_hw_rule_mulkdiv, (void*) 1000000,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE, SNDRV_PCM_HW_PARAM_PERIOD_TIME, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
snd_pcm_hw_rule_mulkdiv, (void*) 1000000,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE, SNDRV_PCM_HW_PARAM_BUFFER_TIME, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIODS,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_PERIODS,
snd_pcm_hw_rule_div, NULL,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
snd_pcm_hw_rule_div, NULL,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE, SNDRV_PCM_HW_PARAM_PERIODS, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
snd_pcm_hw_rule_mulkdiv, (void*) 8,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES, SNDRV_PCM_HW_PARAM_FRAME_BITS, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
snd_pcm_hw_rule_muldivk, (void*) 1000000,
SNDRV_PCM_HW_PARAM_PERIOD_TIME, SNDRV_PCM_HW_PARAM_RATE, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
snd_pcm_hw_rule_mul, NULL,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE, SNDRV_PCM_HW_PARAM_PERIODS, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
snd_pcm_hw_rule_mulkdiv, (void*) 8,
SNDRV_PCM_HW_PARAM_BUFFER_BYTES, SNDRV_PCM_HW_PARAM_FRAME_BITS, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
snd_pcm_hw_rule_muldivk, (void*) 1000000,
SNDRV_PCM_HW_PARAM_BUFFER_TIME, SNDRV_PCM_HW_PARAM_RATE, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
snd_pcm_hw_rule_muldivk, (void*) 8,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE, SNDRV_PCM_HW_PARAM_FRAME_BITS, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
snd_pcm_hw_rule_muldivk, (void*) 8,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE, SNDRV_PCM_HW_PARAM_FRAME_BITS, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_TIME,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_TIME,
snd_pcm_hw_rule_mulkdiv, (void*) 1000000,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE, SNDRV_PCM_HW_PARAM_RATE, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_TIME,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_BUFFER_TIME,
snd_pcm_hw_rule_mulkdiv, (void*) 1000000,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE, SNDRV_PCM_HW_PARAM_RATE, -1);
if (err < 0)
@@ -2581,7 +2581,7 @@ static int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream)
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
snd_pcm_hw_rule_buffer_bytes_max, substream,
SNDRV_PCM_HW_PARAM_BUFFER_BYTES, -1);
if (err < 0)
@@ -2595,7 +2595,7 @@ static int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream)
}
if (!(hw->rates & (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))) {
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
snd_pcm_hw_rule_rate, hw,
SNDRV_PCM_HW_PARAM_RATE, -1);
if (err < 0)
@@ -1226,19 +1226,19 @@ static int loopback_open(struct snd_pcm_substream *substream)
/* use dynamic rules based on actual runtime->hw values */
/* note that the default rules created in the PCM midlevel code */
/* are cached -> they do not reflect the actual state */
- err = snd_pcm_hw_rule_add(runtime, 0,
+ err = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_FORMAT,
rule_format, dpcm,
SNDRV_PCM_HW_PARAM_FORMAT, -1);
if (err < 0)
goto unlock;
- err = snd_pcm_hw_rule_add(runtime, 0,
+ err = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
rule_rate, dpcm,
SNDRV_PCM_HW_PARAM_RATE, -1);
if (err < 0)
goto unlock;
- err = snd_pcm_hw_rule_add(runtime, 0,
+ err = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
rule_channels, dpcm,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
@@ -1250,7 +1250,7 @@ static int loopback_open(struct snd_pcm_substream *substream)
* This rule only takes effect if a sound timer was chosen
*/
if (cable->snd_timer.instance) {
- err = snd_pcm_hw_rule_add(runtime, 0,
+ err = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
rule_period_bytes, dpcm,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES, -1);
@@ -541,8 +541,8 @@ static int vx_pcm_playback_open(struct snd_pcm_substream *subs)
runtime->private_data = pipe;
/* align to 4 bytes (otherwise will be problematic when 24bit is used) */
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 4);
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4);
+ snd_pcm_hw_constraint_step(subs, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 4);
+ snd_pcm_hw_constraint_step(subs, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4);
return 0;
}
@@ -924,8 +924,8 @@ static int vx_pcm_capture_open(struct snd_pcm_substream *subs)
runtime->private_data = pipe;
/* align to 4 bytes (otherwise will be problematic when 24bit is used) */
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 4);
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4);
+ snd_pcm_hw_constraint_step(subs, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 4);
+ snd_pcm_hw_constraint_step(subs, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4);
return 0;
}
@@ -224,20 +224,20 @@ static void write_pcm_silence(struct amdtp_stream *s,
/**
* amdtp_am824_add_pcm_hw_constraints - add hw constraints for PCM substream
* @s: the AMDTP stream for AM824 data block, must be initialized.
- * @runtime: the PCM substream runtime
+ * @pcm: the PCM substream
*
*/
int amdtp_am824_add_pcm_hw_constraints(struct amdtp_stream *s,
- struct snd_pcm_runtime *runtime)
+ struct snd_pcm_substream *pcm)
{
int err;
- err = amdtp_stream_add_pcm_hw_constraints(s, runtime);
+ err = amdtp_stream_add_pcm_hw_constraints(s, pcm);
if (err < 0)
return err;
/* AM824 in IEC 61883-6 can deliver 24bit data. */
- return snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
+ return snd_pcm_hw_constraint_msbits(pcm, 0, 32, 24);
}
EXPORT_SYMBOL_GPL(amdtp_am824_add_pcm_hw_constraints);
@@ -39,7 +39,7 @@ void amdtp_am824_set_midi_position(struct amdtp_stream *s,
unsigned int position);
int amdtp_am824_add_pcm_hw_constraints(struct amdtp_stream *s,
- struct snd_pcm_runtime *runtime);
+ struct snd_pcm_substream *pcm);
void amdtp_am824_midi_trigger(struct amdtp_stream *s, unsigned int port,
struct snd_rawmidi_substream *midi);
@@ -173,12 +173,12 @@ static int apply_constraint_to_size(struct snd_pcm_hw_params *params,
/**
* amdtp_stream_add_pcm_hw_constraints - add hw constraints for PCM substream
* @s: the AMDTP stream, which must be initialized.
- * @runtime: the PCM substream runtime
+ * @pcm: the PCM substream
*/
int amdtp_stream_add_pcm_hw_constraints(struct amdtp_stream *s,
- struct snd_pcm_runtime *runtime)
+ struct snd_pcm_substream *pcm)
{
- struct snd_pcm_hardware *hw = &runtime->hw;
+ struct snd_pcm_hardware *hw = &pcm->runtime->hw;
unsigned int ctx_header_size;
unsigned int maximum_usec_per_period;
int err;
@@ -228,7 +228,7 @@ int amdtp_stream_add_pcm_hw_constraints(struct amdtp_stream *s,
// Due to the above protocol design, the minimum PCM frames per
// interrupt should be double of the value of syt interval, thus it is
// 250 usec.
- err = snd_pcm_hw_constraint_minmax(runtime,
+ err = snd_pcm_hw_constraint_minmax(pcm->runtime,
SNDRV_PCM_HW_PARAM_PERIOD_TIME,
250, maximum_usec_per_period);
if (err < 0)
@@ -244,13 +244,13 @@ int amdtp_stream_add_pcm_hw_constraints(struct amdtp_stream *s,
* depending on its sampling rate. For accurate period interrupt, it's
* preferrable to align period/buffer sizes to current SYT_INTERVAL.
*/
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
+ err = snd_pcm_hw_rule_add(pcm, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
apply_constraint_to_size, NULL,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
SNDRV_PCM_HW_PARAM_RATE, -1);
if (err < 0)
goto end;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
+ err = snd_pcm_hw_rule_add(pcm, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
apply_constraint_to_size, NULL,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
SNDRV_PCM_HW_PARAM_RATE, -1);
@@ -197,7 +197,7 @@ unsigned int amdtp_stream_get_max_payload(struct amdtp_stream *s);
void amdtp_stream_update(struct amdtp_stream *s);
int amdtp_stream_add_pcm_hw_constraints(struct amdtp_stream *s,
- struct snd_pcm_runtime *runtime);
+ struct snd_pcm_substream *pcm);
void amdtp_stream_pcm_prepare(struct amdtp_stream *s);
void amdtp_stream_pcm_abort(struct amdtp_stream *s);
@@ -112,19 +112,19 @@ pcm_init_hw_params(struct snd_bebob *bebob,
limit_channels_and_rates(&runtime->hw, formations);
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
hw_rule_channels, formations,
SNDRV_PCM_HW_PARAM_RATE, -1);
if (err < 0)
goto end;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
hw_rule_rate, formations,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
if (err < 0)
goto end;
- err = amdtp_am824_add_pcm_hw_constraints(s, runtime);
+ err = amdtp_am824_add_pcm_hw_constraints(s, substream);
end:
return err;
}
@@ -147,18 +147,18 @@ static int init_hw_info(struct snd_dice *dice,
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
dice_rate_constraint, substream,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
dice_channels_constraint, substream,
SNDRV_PCM_HW_PARAM_RATE, -1);
if (err < 0)
return err;
- return amdtp_am824_add_pcm_hw_constraints(stream, runtime);
+ return amdtp_am824_add_pcm_hw_constraints(stream, substream);
}
static int pcm_open(struct snd_pcm_substream *substream)
@@ -320,16 +320,16 @@ static void read_midi_messages(struct amdtp_stream *s, __be32 *buffer,
}
int amdtp_dot_add_pcm_hw_constraints(struct amdtp_stream *s,
- struct snd_pcm_runtime *runtime)
+ struct snd_pcm_substream *pcm)
{
int err;
/* This protocol delivers 24 bit data in 32bit data channel. */
- err = snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
+ err = snd_pcm_hw_constraint_msbits(pcm, 0, 32, 24);
if (err < 0)
return err;
- return amdtp_stream_add_pcm_hw_constraints(s, runtime);
+ return amdtp_stream_add_pcm_hw_constraints(s, pcm);
}
void amdtp_dot_midi_trigger(struct amdtp_stream *s, unsigned int port,
@@ -80,21 +80,21 @@ static int pcm_init_hw_params(struct snd_dg00x *dg00x,
SNDRV_PCM_RATE_96000;
snd_pcm_limit_hw_rates(runtime);
- err = snd_pcm_hw_rule_add(substream->runtime, 0,
+ err = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
hw_rule_channels, NULL,
SNDRV_PCM_HW_PARAM_RATE, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(substream->runtime, 0,
+ err = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
hw_rule_rate, NULL,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
if (err < 0)
return err;
- return amdtp_dot_add_pcm_hw_constraints(s, substream->runtime);
+ return amdtp_dot_add_pcm_hw_constraints(s, substream);
}
static int pcm_open(struct snd_pcm_substream *substream)
@@ -121,7 +121,7 @@ int amdtp_dot_set_parameters(struct amdtp_stream *s, unsigned int rate,
unsigned int pcm_channels);
void amdtp_dot_reset(struct amdtp_stream *s);
int amdtp_dot_add_pcm_hw_constraints(struct amdtp_stream *s,
- struct snd_pcm_runtime *runtime);
+ struct snd_pcm_substream *pcm);
void amdtp_dot_midi_trigger(struct amdtp_stream *s, unsigned int port,
struct snd_rawmidi_substream *midi);
@@ -101,15 +101,15 @@ static void write_pcm_silence(struct amdtp_stream *s,
}
int amdtp_ff_add_pcm_hw_constraints(struct amdtp_stream *s,
- struct snd_pcm_runtime *runtime)
+ struct snd_pcm_substream *pcm)
{
int err;
- err = snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
+ err = snd_pcm_hw_constraint_msbits(pcm, 0, 32, 24);
if (err < 0)
return err;
- return amdtp_stream_add_pcm_hw_constraints(s, runtime);
+ return amdtp_stream_add_pcm_hw_constraints(s, pcm);
}
static unsigned int process_it_ctx_payloads(struct amdtp_stream *s,
@@ -121,19 +121,19 @@ static int pcm_init_hw_params(struct snd_ff *ff,
limit_channels_and_rates(&runtime->hw, pcm_channels);
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
hw_rule_channels, (void *)pcm_channels,
SNDRV_PCM_HW_PARAM_RATE, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
hw_rule_rate, (void *)pcm_channels,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
if (err < 0)
return err;
- return amdtp_ff_add_pcm_hw_constraints(s, runtime);
+ return amdtp_ff_add_pcm_hw_constraints(s, substream);
}
static int pcm_open(struct snd_pcm_substream *substream)
@@ -138,7 +138,7 @@ void snd_ff_transaction_unregister(struct snd_ff *ff);
int amdtp_ff_set_parameters(struct amdtp_stream *s, unsigned int rate,
unsigned int pcm_channels);
int amdtp_ff_add_pcm_hw_constraints(struct amdtp_stream *s,
- struct snd_pcm_runtime *runtime);
+ struct snd_pcm_substream *substream);
int amdtp_ff_init(struct amdtp_stream *s, struct fw_unit *unit,
enum amdtp_stream_direction dir);
@@ -153,19 +153,19 @@ pcm_init_hw_params(struct snd_efw *efw,
limit_channels(&runtime->hw, pcm_channels);
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
hw_rule_channels, pcm_channels,
SNDRV_PCM_HW_PARAM_RATE, -1);
if (err < 0)
goto end;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
hw_rule_rate, pcm_channels,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
if (err < 0)
goto end;
- err = amdtp_am824_add_pcm_hw_constraints(s, runtime);
+ err = amdtp_am824_add_pcm_hw_constraints(s, substream);
end:
return err;
}
@@ -210,16 +210,16 @@ static void write_pcm_silence(struct amdtp_stream *s, __be32 *buffer,
}
int amdtp_motu_add_pcm_hw_constraints(struct amdtp_stream *s,
- struct snd_pcm_runtime *runtime)
+ struct snd_pcm_substream *pcm)
{
int err;
/* TODO: how to set an constraint for exactly 24bit PCM sample? */
- err = snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
+ err = snd_pcm_hw_constraint_msbits(pcm, 0, 32, 24);
if (err < 0)
return err;
- return amdtp_stream_add_pcm_hw_constraints(s, runtime);
+ return amdtp_stream_add_pcm_hw_constraints(s, pcm);
}
void amdtp_motu_midi_trigger(struct amdtp_stream *s, unsigned int port,
@@ -113,18 +113,18 @@ static int init_hw_info(struct snd_motu *motu,
limit_channels_and_rates(motu, runtime, formats);
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
motu_rate_constraint, formats,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
motu_channels_constraint, formats,
SNDRV_PCM_HW_PARAM_RATE, -1);
if (err < 0)
return err;
- return amdtp_motu_add_pcm_hw_constraints(stream, runtime);
+ return amdtp_motu_add_pcm_hw_constraints(stream, substream);
}
static int pcm_open(struct snd_pcm_substream *substream)
@@ -129,7 +129,7 @@ int amdtp_motu_set_parameters(struct amdtp_stream *s, unsigned int rate,
unsigned int midi_ports,
struct snd_motu_packet_format *formats);
int amdtp_motu_add_pcm_hw_constraints(struct amdtp_stream *s,
- struct snd_pcm_runtime *runtime);
+ struct snd_pcm_substream *pcm);
void amdtp_motu_midi_trigger(struct amdtp_stream *s, unsigned int port,
struct snd_rawmidi_substream *midi);
@@ -126,19 +126,19 @@ static int init_hw_params(struct snd_oxfw *oxfw,
limit_channels_and_rates(&runtime->hw, formats);
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
hw_rule_channels, formats,
SNDRV_PCM_HW_PARAM_RATE, -1);
if (err < 0)
goto end;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
hw_rule_rate, formats,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
if (err < 0)
goto end;
- err = amdtp_am824_add_pcm_hw_constraints(stream, runtime);
+ err = amdtp_am824_add_pcm_hw_constraints(stream, substream);
end:
return err;
}
@@ -111,7 +111,7 @@ static void write_pcm_silence(struct amdtp_stream *s, __be32 *buffer,
}
int amdtp_tscm_add_pcm_hw_constraints(struct amdtp_stream *s,
- struct snd_pcm_runtime *runtime)
+ struct snd_pcm_substream *pcm)
{
int err;
@@ -119,11 +119,11 @@ int amdtp_tscm_add_pcm_hw_constraints(struct amdtp_stream *s,
* Our implementation allows this protocol to deliver 24 bit sample in
* 32bit data channel.
*/
- err = snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
+ err = snd_pcm_hw_constraint_msbits(pcm, 0, 32, 24);
if (err < 0)
return err;
- return amdtp_stream_add_pcm_hw_constraints(s, runtime);
+ return amdtp_stream_add_pcm_hw_constraints(s, pcm);
}
static void read_status_messages(struct amdtp_stream *s,
@@ -37,7 +37,7 @@ static int pcm_init_hw_params(struct snd_tscm *tscm,
SNDRV_PCM_RATE_96000;
snd_pcm_limit_hw_rates(runtime);
- return amdtp_tscm_add_pcm_hw_constraints(stream, runtime);
+ return amdtp_tscm_add_pcm_hw_constraints(stream, substream);
}
static int pcm_open(struct snd_pcm_substream *substream)
@@ -160,7 +160,7 @@ int amdtp_tscm_init(struct amdtp_stream *s, struct fw_unit *unit,
enum amdtp_stream_direction dir, unsigned int pcm_channels);
int amdtp_tscm_set_parameters(struct amdtp_stream *s, unsigned int rate);
int amdtp_tscm_add_pcm_hw_constraints(struct amdtp_stream *s,
- struct snd_pcm_runtime *runtime);
+ struct snd_pcm_substream *pcm);
int snd_tscm_stream_get_rate(struct snd_tscm *tscm, unsigned int *rate);
int snd_tscm_stream_get_clock(struct snd_tscm *tscm,
@@ -712,23 +712,23 @@ static int double_rate_hw_constraint_channels(struct snd_pcm_hw_params *params,
/**
* snd_ac97_pcm_double_rate_rules - set double rate constraints
- * @runtime: the runtime of the ac97 front playback pcm
+ * @substream: the substream of the ac97 front playback pcm
*
* Installs the hardware constraint rules to prevent using double rates and
* more than two channels at the same time.
*
* Return: Zero if successful, or a negative error code on failure.
*/
-int snd_ac97_pcm_double_rate_rules(struct snd_pcm_runtime *runtime)
+int snd_ac97_pcm_double_rate_rules(struct snd_pcm_substream *substream)
{
int err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
double_rate_hw_constraint_rate, NULL,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
double_rate_hw_constraint_channels, NULL,
SNDRV_PCM_HW_PARAM_RATE, -1);
return err;
@@ -1569,7 +1569,7 @@ static int snd_ali_modem_open(struct snd_pcm_substream *substream, int rec,
if (err)
return err;
- return snd_pcm_hw_constraint_list(substream->runtime, 0,
+ return snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, &hw_constraint_rates);
}
@@ -1082,7 +1082,7 @@ static int snd_atiixp_playback_open(struct snd_pcm_substream *substream)
substream->runtime->hw.channels_max = chip->max_channels;
if (chip->max_channels > 2)
/* channels must be even */
- snd_pcm_hw_constraint_step(substream->runtime, 0,
+ snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS, 2);
return 0;
}
@@ -856,7 +856,7 @@ static int snd_atiixp_pcm_open(struct snd_pcm_substream *substream,
dma->substream = substream;
runtime->hw = snd_atiixp_pcm_hw;
dma->ac97_pcm_type = pcm_type;
- if ((err = snd_pcm_hw_constraint_list(runtime, 0,
+ if ((err = snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
&hw_constraints_rates)) < 0)
return err;
@@ -136,11 +136,11 @@ static int snd_vortex_pcm_open(struct snd_pcm_substream *substream)
return err;
/* Avoid PAGE_SIZE boundary to fall inside of a period. */
if ((err =
- snd_pcm_hw_constraint_pow2(runtime, 0,
+ snd_pcm_hw_constraint_pow2(substream, 0,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES)) < 0)
return err;
- snd_pcm_hw_constraint_step(runtime, 0,
+ snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 64);
if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) {
@@ -171,7 +171,7 @@ static int snd_vortex_pcm_open(struct snd_pcm_substream *substream)
VORTEX_IS_QUAD(vortex) &&
VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB) {
runtime->hw.channels_max = 4;
- snd_pcm_hw_constraint_list(runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
&hw_constraints_au8830_channels);
}
@@ -2024,7 +2024,7 @@ snd_azf3328_pcm_open(struct snd_pcm_substream *substream,
/* same parameters for all our codecs - at least we think so... */
runtime->hw = snd_azf3328_hardware;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&snd_azf3328_hw_constraints_rates);
runtime->private_data = codec;
return 0;
@@ -379,7 +379,7 @@ static int snd_bt87x_set_digital_hw(struct snd_bt87x *chip, struct snd_pcm_runti
return 0;
}
-static int snd_bt87x_set_analog_hw(struct snd_bt87x *chip, struct snd_pcm_runtime *runtime)
+static int snd_bt87x_set_analog_hw(struct snd_bt87x *chip, struct snd_pcm_substream *substream)
{
static const struct snd_ratnum analog_clock = {
.num = ANALOG_CLOCK,
@@ -393,8 +393,8 @@ static int snd_bt87x_set_analog_hw(struct snd_bt87x *chip, struct snd_pcm_runtim
};
chip->reg_control &= ~(CTL_DA_IOM_DA | CTL_A_PWRDN);
- runtime->hw = snd_bt87x_analog_hw;
- return snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ substream->runtime->hw = snd_bt87x_analog_hw;
+ return snd_pcm_hw_constraint_ratnums(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&constraint_rates);
}
@@ -410,7 +410,7 @@ static int snd_bt87x_pcm_open(struct snd_pcm_substream *substream)
if (substream->pcm->device == DEVICE_DIGITAL)
err = snd_bt87x_set_digital_hw(chip, runtime);
else
- err = snd_bt87x_set_analog_hw(chip, runtime);
+ err = snd_bt87x_set_analog_hw(chip, substream);
if (err < 0)
goto _error;
@@ -577,7 +577,7 @@ static int snd_ca0106_pcm_open_playback_channel(struct snd_pcm_substream *substr
channel->epcm = epcm;
if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
return err;
- if ((err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0)
+ if ((err = snd_pcm_hw_constraint_step(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0)
return err;
snd_pcm_set_sync(substream);
@@ -671,7 +671,7 @@ static int snd_ca0106_pcm_open_capture_channel(struct snd_pcm_substream *substre
if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
return err;
//snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hw_constraints_capture_period_sizes);
- if ((err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0)
+ if ((err = snd_pcm_hw_constraint_step(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0)
return err;
return 0;
}
@@ -1647,7 +1647,7 @@ static int snd_cmipci_playback_open(struct snd_pcm_substream *substream)
SNDRV_PCM_RATE_96000;
runtime->hw.rate_max = 96000;
} else if (cm->chip_version == 55) {
- err = snd_pcm_hw_constraint_list(runtime, 0,
+ err = snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates);
if (err < 0)
return err;
@@ -1672,7 +1672,7 @@ static int snd_cmipci_capture_open(struct snd_pcm_substream *substream)
runtime->hw.rate_min = 41000;
runtime->hw.rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000;
} else if (cm->chip_version == 55) {
- err = snd_pcm_hw_constraint_list(runtime, 0,
+ err = snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates);
if (err < 0)
return err;
@@ -1697,11 +1697,11 @@ static int snd_cmipci_playback2_open(struct snd_pcm_substream *substream)
if (cm->can_multi_ch) {
runtime->hw.channels_max = cm->max_channels;
if (cm->max_channels == 4)
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, &hw_constraints_channels_4);
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS, &hw_constraints_channels_4);
else if (cm->max_channels == 6)
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, &hw_constraints_channels_6);
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS, &hw_constraints_channels_6);
else if (cm->max_channels == 8)
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, &hw_constraints_channels_8);
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS, &hw_constraints_channels_8);
}
}
mutex_unlock(&cm->open_mutex);
@@ -1710,7 +1710,7 @@ static int snd_cmipci_playback2_open(struct snd_pcm_substream *substream)
SNDRV_PCM_RATE_96000;
runtime->hw.rate_max = 96000;
} else if (cm->chip_version == 55) {
- err = snd_pcm_hw_constraint_list(runtime, 0,
+ err = snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates);
if (err < 0)
return err;
@@ -1733,7 +1733,7 @@ static int snd_cmipci_playback_spdif_open(struct snd_pcm_substream *substream)
runtime->hw = snd_cmipci_playback_spdif;
if (cm->chip_version >= 37) {
runtime->hw.formats |= SNDRV_PCM_FMTBIT_S32_LE;
- snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
+ snd_pcm_hw_constraint_msbits(substream, 0, 32, 24);
}
if (cm->can_96k) {
runtime->hw.rates |= SNDRV_PCM_RATE_88200 |
@@ -884,7 +884,7 @@ static int snd_cs4281_playback_open(struct snd_pcm_substream *substream)
/* should be detected from the AC'97 layer, but it seems
that although CS4297A rev B reports 18-bit ADC resolution,
samples are 20-bit */
- snd_pcm_hw_constraint_msbits(runtime, 0, 32, 20);
+ snd_pcm_hw_constraint_msbits(substream, 0, 32, 20);
return 0;
}
@@ -903,7 +903,7 @@ static int snd_cs4281_capture_open(struct snd_pcm_substream *substream)
/* should be detected from the AC'97 layer, but it seems
that although CS4297A rev B reports 18-bit ADC resolution,
samples are 20-bit */
- snd_pcm_hw_constraint_msbits(runtime, 0, 32, 20);
+ snd_pcm_hw_constraint_msbits(substream, 0, 32, 20);
return 0;
}
@@ -1511,7 +1511,7 @@ static int _cs46xx_playback_open_channel (struct snd_pcm_substream *substream,in
cpcm->pcm_channel_id = pcm_channel_id;
- snd_pcm_hw_constraint_list(runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
&hw_constraints_period_sizes);
@@ -1594,7 +1594,7 @@ static int snd_cs46xx_capture_open(struct snd_pcm_substream *substream)
chip->active_ctrl(chip, 1);
#ifdef CONFIG_SND_CS46XX_NEW_DSP
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
&hw_constraints_period_sizes);
#endif
@@ -301,7 +301,7 @@ static int pcm_open(struct snd_pcm_substream *substream,
snd_pcm_set_sync(substream);
/* Only mono and any even number of channels are allowed */
- if ((err = snd_pcm_hw_constraint_list(runtime, 0,
+ if ((err = snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
&pipe->constr)) < 0)
return err;
@@ -314,16 +314,16 @@ static int pcm_open(struct snd_pcm_substream *substream,
/* The hw accesses memory in chunks 32 frames long and they should be
32-bytes-aligned. It's not a requirement, but it seems that IRQs are
generated with a resolution of 32 frames. Thus we need the following */
- if ((err = snd_pcm_hw_constraint_step(runtime, 0,
+ if ((err = snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
32)) < 0)
return err;
- if ((err = snd_pcm_hw_constraint_step(runtime, 0,
+ if ((err = snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
32)) < 0)
return err;
- if ((err = snd_pcm_hw_rule_add(substream->runtime, 0,
+ if ((err = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
hw_rule_sample_rate, chip,
SNDRV_PCM_HW_PARAM_RATE, -1)) < 0)
@@ -361,12 +361,12 @@ static int pcm_analog_in_open(struct snd_pcm_substream *substream)
if ((err = pcm_open(substream, num_analog_busses_in(chip) -
substream->number)) < 0)
return err;
- if ((err = snd_pcm_hw_rule_add(substream->runtime, 0,
+ if ((err = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
hw_rule_capture_channels_by_format, NULL,
SNDRV_PCM_HW_PARAM_FORMAT, -1)) < 0)
return err;
- if ((err = snd_pcm_hw_rule_add(substream->runtime, 0,
+ if ((err = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_FORMAT,
hw_rule_capture_format_by_channels, NULL,
SNDRV_PCM_HW_PARAM_CHANNELS, -1)) < 0)
@@ -389,13 +389,13 @@ static int pcm_analog_out_open(struct snd_pcm_substream *substream)
#endif
if ((err = pcm_open(substream, max_channels - substream->number)) < 0)
return err;
- if ((err = snd_pcm_hw_rule_add(substream->runtime, 0,
+ if ((err = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
hw_rule_playback_channels_by_format,
NULL,
SNDRV_PCM_HW_PARAM_FORMAT, -1)) < 0)
return err;
- if ((err = snd_pcm_hw_rule_add(substream->runtime, 0,
+ if ((err = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_FORMAT,
hw_rule_playback_format_by_channels,
NULL,
@@ -426,12 +426,12 @@ static int pcm_digital_in_open(struct snd_pcm_substream *substream)
if (err < 0)
goto din_exit;
- if ((err = snd_pcm_hw_rule_add(substream->runtime, 0,
+ if ((err = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
hw_rule_capture_channels_by_format, NULL,
SNDRV_PCM_HW_PARAM_FORMAT, -1)) < 0)
goto din_exit;
- if ((err = snd_pcm_hw_rule_add(substream->runtime, 0,
+ if ((err = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_FORMAT,
hw_rule_capture_format_by_channels, NULL,
SNDRV_PCM_HW_PARAM_CHANNELS, -1)) < 0)
@@ -463,13 +463,13 @@ static int pcm_digital_out_open(struct snd_pcm_substream *substream)
if (err < 0)
goto dout_exit;
- if ((err = snd_pcm_hw_rule_add(substream->runtime, 0,
+ if ((err = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
hw_rule_playback_channels_by_format,
NULL, SNDRV_PCM_HW_PARAM_FORMAT,
-1)) < 0)
goto dout_exit;
- if ((err = snd_pcm_hw_rule_add(substream->runtime, 0,
+ if ((err = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_FORMAT,
hw_rule_playback_format_by_channels,
NULL, SNDRV_PCM_HW_PARAM_CHANNELS,
@@ -374,7 +374,7 @@ static int snd_emu10k1x_playback_open(struct snd_pcm_substream *substream)
if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) {
return err;
}
- if ((err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0)
+ if ((err = snd_pcm_hw_constraint_step(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0)
return err;
epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
@@ -552,7 +552,7 @@ static int snd_emu10k1x_pcm_open_capture(struct snd_pcm_substream *substream)
if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
return err;
- if ((err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0)
+ if ((err = snd_pcm_hw_constraint_step(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0)
return err;
epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
@@ -1136,7 +1136,7 @@ static int snd_emu10k1_playback_open(struct snd_pcm_substream *substream)
sample_rate = 44100;
else
sample_rate = 48000;
- err = snd_pcm_hw_rule_noresample(runtime, sample_rate);
+ err = snd_pcm_hw_rule_noresample(substream, sample_rate);
if (err < 0) {
kfree(epcm);
return err;
@@ -1185,8 +1185,8 @@ static int snd_emu10k1_capture_open(struct snd_pcm_substream *substream)
runtime->hw = snd_emu10k1_capture;
emu->capture_interrupt = snd_emu10k1_pcm_ac97adc_interrupt;
emu->pcm_capture_substream = substream;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, &hw_constraints_capture_period_sizes);
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_capture_rates);
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, &hw_constraints_capture_period_sizes);
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_capture_rates);
return 0;
}
@@ -1224,7 +1224,7 @@ static int snd_emu10k1_capture_mic_open(struct snd_pcm_substream *substream)
runtime->hw.channels_min = 1;
emu->capture_mic_interrupt = snd_emu10k1_pcm_ac97mic_interrupt;
emu->pcm_capture_mic_substream = substream;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, &hw_constraints_capture_period_sizes);
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, &hw_constraints_capture_period_sizes);
return 0;
}
@@ -1332,7 +1332,7 @@ static int snd_emu10k1_capture_efx_open(struct snd_pcm_substream *substream)
spin_unlock_irq(&emu->reg_lock);
emu->capture_efx_interrupt = snd_emu10k1_pcm_efx_interrupt;
emu->pcm_capture_efx_substream = substream;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, &hw_constraints_capture_period_sizes);
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, &hw_constraints_capture_period_sizes);
return 0;
}
@@ -1105,10 +1105,10 @@ static int snd_ensoniq_playback1_open(struct snd_pcm_substream *substream)
ensoniq->spdif_stream = ensoniq->spdif_default;
spin_unlock_irq(&ensoniq->reg_lock);
#ifdef CHIP1370
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&snd_es1370_hw_constraints_rates);
#else
- snd_pcm_hw_constraint_ratdens(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_ratdens(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&snd_es1371_hw_constraints_dac_clock);
#endif
return 0;
@@ -1128,10 +1128,10 @@ static int snd_ensoniq_playback2_open(struct snd_pcm_substream *substream)
ensoniq->spdif_stream = ensoniq->spdif_default;
spin_unlock_irq(&ensoniq->reg_lock);
#ifdef CHIP1370
- snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_ratnums(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&snd_es1370_hw_constraints_clock);
#else
- snd_pcm_hw_constraint_ratdens(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_ratdens(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&snd_es1371_hw_constraints_dac_clock);
#endif
return 0;
@@ -1147,10 +1147,10 @@ static int snd_ensoniq_capture_open(struct snd_pcm_substream *substream)
runtime->hw = snd_ensoniq_capture;
snd_pcm_set_sync(substream);
#ifdef CHIP1370
- snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_ratnums(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&snd_es1370_hw_constraints_clock);
#else
- snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_ratnums(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&snd_es1371_hw_constraints_adc_clock);
#endif
return 0;
@@ -913,7 +913,7 @@ static int snd_es1938_capture_open(struct snd_pcm_substream *substream)
return -EAGAIN;
chip->capture_substream = substream;
runtime->hw = snd_es1938_capture;
- snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_ratnums(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&hw_constraints_clocks);
snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 0, 0xff00);
return 0;
@@ -938,7 +938,7 @@ static int snd_es1938_playback_open(struct snd_pcm_substream *substream)
return -EINVAL;
}
runtime->hw = snd_es1938_playback;
- snd_pcm_hw_constraint_ratnums(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_ratnums(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&hw_constraints_clocks);
snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 0, 0xff00);
return 0;
@@ -1612,7 +1612,7 @@ static int snd_es1968_capture_open(struct snd_pcm_substream *substream)
runtime->hw = snd_es1968_capture;
runtime->hw.buffer_bytes_max = runtime->hw.period_bytes_max =
calc_available_memory_size(chip) - 1024; /* keep MIXBUF size */
- snd_pcm_hw_constraint_pow2(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES);
+ snd_pcm_hw_constraint_pow2(substream, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES);
spin_lock_irq(&chip->substream_lock);
list_add(&es->list, &chip->substream_list);
@@ -651,11 +651,11 @@ static int snd_fm801_playback_open(struct snd_pcm_substream *substream)
chip->playback_substream = substream;
runtime->hw = snd_fm801_playback;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&hw_constraints_rates);
if (chip->multichannel) {
runtime->hw.channels_max = 6;
- snd_pcm_hw_constraint_list(runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
&hw_constraints_channels);
}
@@ -672,7 +672,7 @@ static int snd_fm801_capture_open(struct snd_pcm_substream *substream)
chip->capture_substream = substream;
runtime->hw = snd_fm801_capture;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&hw_constraints_rates);
if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
return err;
@@ -3735,7 +3735,7 @@ int snd_hda_multi_out_analog_open(struct hda_codec *codec,
}
mutex_unlock(&codec->spdif_mutex);
}
- return snd_pcm_hw_constraint_step(substream->runtime, 0,
+ return snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS, 2);
}
EXPORT_SYMBOL_GPL(snd_hda_multi_out_analog_open);
@@ -624,9 +624,9 @@ static int azx_pcm_open(struct snd_pcm_substream *substream)
option needs to be disabled */
buff_step = 4;
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
+ snd_pcm_hw_constraint_step(substream, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
buff_step);
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
+ snd_pcm_hw_constraint_step(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
buff_step);
snd_hda_power_up(apcm->codec);
if (hinfo->ops.open)
@@ -1202,7 +1202,7 @@ static int hdmi_pcm_open_no_pin(struct hda_pcm_stream *hinfo,
runtime->hw.formats = hinfo->formats;
runtime->hw.rates = hinfo->rates;
- snd_pcm_hw_constraint_step(substream->runtime, 0,
+ snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS, 2);
return 0;
}
@@ -1298,7 +1298,7 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
runtime->hw.formats = hinfo->formats;
runtime->hw.rates = hinfo->rates;
- snd_pcm_hw_constraint_step(substream->runtime, 0,
+ snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS, 2);
unlock:
mutex_unlock(&spec->pcm_lock);
@@ -3244,11 +3244,11 @@ static int simple_playback_pcm_open(struct hda_pcm_stream *hinfo,
}
if (hw_constraints_channels != NULL) {
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
hw_constraints_channels);
} else {
- snd_pcm_hw_constraint_step(substream->runtime, 0,
+ snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS, 2);
}
@@ -162,7 +162,7 @@ static int si3054_pcm_open(struct hda_pcm_stream *hinfo,
.mask = 0,
};
substream->runtime->hw.period_bytes_min = 80;
- return snd_pcm_hw_constraint_list(substream->runtime, 0,
+ return snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates);
}
@@ -1130,8 +1130,8 @@ static int snd_ice1712_playback_pro_open(struct snd_pcm_substream *substream)
ice->playback_pro_substream = substream;
runtime->hw = snd_ice1712_playback_pro;
snd_pcm_set_sync(substream);
- snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates);
+ snd_pcm_hw_constraint_msbits(substream, 0, 32, 24);
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates);
if (is_pro_rate_locked(ice)) {
runtime->hw.rate_min = PRO_RATE_DEFAULT;
runtime->hw.rate_max = PRO_RATE_DEFAULT;
@@ -1151,8 +1151,8 @@ static int snd_ice1712_capture_pro_open(struct snd_pcm_substream *substream)
ice->capture_pro_substream = substream;
runtime->hw = snd_ice1712_capture_pro;
snd_pcm_set_sync(substream);
- snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates);
+ snd_pcm_hw_constraint_msbits(substream, 0, 32, 24);
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates);
if (is_pro_rate_locked(ice)) {
runtime->hw.rate_min = PRO_RATE_DEFAULT;
runtime->hw.rate_max = PRO_RATE_DEFAULT;
@@ -972,7 +972,7 @@ static int set_rate_constraints(struct snd_ice1712 *ice,
runtime->hw.rate_min = ice->hw_rates->list[0];
runtime->hw.rate_max = ice->hw_rates->list[ice->hw_rates->count - 1];
runtime->hw.rates = SNDRV_PCM_RATE_KNOT;
- return snd_pcm_hw_constraint_list(runtime, 0,
+ return snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
ice->hw_rates);
}
@@ -1011,7 +1011,7 @@ static int snd_vt1724_playback_pro_open(struct snd_pcm_substream *substream)
ice->playback_pro_substream = substream;
runtime->hw = snd_vt1724_playback_pro;
snd_pcm_set_sync(substream);
- snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
+ snd_pcm_hw_constraint_msbits(substream, 0, 32, 24);
set_rate_constraints(ice, substream);
mutex_lock(&ice->open_mutex);
/* calculate the currently available channels */
@@ -1023,11 +1023,11 @@ static int snd_vt1724_playback_pro_open(struct snd_pcm_substream *substream)
chs = (chs + 1) * 2;
runtime->hw.channels_max = chs;
if (chs > 2) /* channels must be even */
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, 2);
+ snd_pcm_hw_constraint_step(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS, 2);
mutex_unlock(&ice->open_mutex);
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
+ snd_pcm_hw_constraint_step(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
VT1724_BUFFER_ALIGN);
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
+ snd_pcm_hw_constraint_step(substream, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
VT1724_BUFFER_ALIGN);
constrain_rate_if_locked(substream);
if (ice->pro_open)
@@ -1044,11 +1044,11 @@ static int snd_vt1724_capture_pro_open(struct snd_pcm_substream *substream)
ice->capture_pro_substream = substream;
runtime->hw = snd_vt1724_2ch_stereo;
snd_pcm_set_sync(substream);
- snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
+ snd_pcm_hw_constraint_msbits(substream, 0, 32, 24);
set_rate_constraints(ice, substream);
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
+ snd_pcm_hw_constraint_step(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
VT1724_BUFFER_ALIGN);
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
+ snd_pcm_hw_constraint_step(substream, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
VT1724_BUFFER_ALIGN);
constrain_rate_if_locked(substream);
if (ice->pro_open)
@@ -1192,10 +1192,10 @@ static int snd_vt1724_playback_spdif_open(struct snd_pcm_substream *substream)
} else
runtime->hw = snd_vt1724_spdif;
snd_pcm_set_sync(substream);
- snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
+ snd_pcm_hw_constraint_msbits(substream, 0, 32, 24);
+ snd_pcm_hw_constraint_step(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
VT1724_BUFFER_ALIGN);
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
+ snd_pcm_hw_constraint_step(substream, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
VT1724_BUFFER_ALIGN);
constrain_rate_if_locked(substream);
if (ice->spdif.ops.open)
@@ -1229,10 +1229,10 @@ static int snd_vt1724_capture_spdif_open(struct snd_pcm_substream *substream)
} else
runtime->hw = snd_vt1724_spdif;
snd_pcm_set_sync(substream);
- snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
+ snd_pcm_hw_constraint_msbits(substream, 0, 32, 24);
+ snd_pcm_hw_constraint_step(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
VT1724_BUFFER_ALIGN);
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
+ snd_pcm_hw_constraint_step(substream, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
VT1724_BUFFER_ALIGN);
constrain_rate_if_locked(substream);
if (ice->spdif.ops.open)
@@ -1378,7 +1378,7 @@ static int snd_vt1724_playback_indep_open(struct snd_pcm_substream *substream)
ice->playback_con_substream_ds[substream->number] = substream;
runtime->hw = snd_vt1724_2ch_stereo;
snd_pcm_set_sync(substream);
- snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
+ snd_pcm_hw_constraint_msbits(substream, 0, 32, 24);
set_rate_constraints(ice, substream);
return 0;
}
@@ -1116,24 +1116,24 @@ static int snd_intel8x0_playback_open(struct snd_pcm_substream *substream)
if (chip->multi8) {
runtime->hw.channels_max = 8;
- snd_pcm_hw_constraint_list(runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
&hw_constraints_channels8);
} else if (chip->multi6) {
runtime->hw.channels_max = 6;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
&hw_constraints_channels6);
} else if (chip->multi4) {
runtime->hw.channels_max = 4;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
&hw_constraints_channels4);
}
if (chip->dra) {
- snd_ac97_pcm_double_rate_rules(runtime);
+ snd_ac97_pcm_double_rate_rules(substream);
}
if (chip->smp20bit) {
runtime->hw.formats |= SNDRV_PCM_FMTBIT_S32_LE;
- snd_pcm_hw_constraint_msbits(runtime, 0, 32, 20);
+ snd_pcm_hw_constraint_msbits(substream, 0, 32, 20);
}
return 0;
}
@@ -605,7 +605,7 @@ static int snd_intel8x0m_pcm_open(struct snd_pcm_substream *substream, struct ic
ichdev->substream = substream;
runtime->hw = snd_intel8x0m_stream;
- err = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ err = snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&hw_constraints_rates);
if ( err < 0 )
return err;
@@ -235,9 +235,9 @@ static int lola_pcm_open(struct snd_pcm_substream *substream)
chip->ref_count_rate++;
snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
/* period size = multiple of chip->granularity (8, 16 or 32 frames)*/
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
+ snd_pcm_hw_constraint_step(substream, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
chip->granularity);
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
+ snd_pcm_hw_constraint_step(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
chip->granularity);
mutex_unlock(&chip->open_mutex);
return 0;
@@ -763,8 +763,8 @@ static int snd_mixart_playback_open(struct snd_pcm_substream *subs)
runtime->private_data = stream;
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 32);
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 64);
+ snd_pcm_hw_constraint_step(subs, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 32);
+ snd_pcm_hw_constraint_step(subs, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 64);
/* if a sample rate is already used, another stream cannot change */
if(mgr->ref_count_rate++) {
@@ -844,8 +844,8 @@ static int snd_mixart_capture_open(struct snd_pcm_substream *subs)
runtime->private_data = stream;
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 32);
- snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 64);
+ snd_pcm_hw_constraint_step(subs, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 32);
+ snd_pcm_hw_constraint_step(subs, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 64);
/* if a sample rate is already used, another stream cannot change */
if(mgr->ref_count_rate++) {
@@ -850,7 +850,7 @@ static void snd_nm256_setup_stream(struct nm256 *chip, struct nm256_stream *s,
runtime->private_data = s;
s->substream = substream;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&constraints_rates);
}
@@ -148,21 +148,21 @@ static int oxygen_open(struct snd_pcm_substream *substream,
}
if (chip->model.pcm_hardware_filter)
chip->model.pcm_hardware_filter(channel, &runtime->hw);
- err = snd_pcm_hw_constraint_step(runtime, 0,
+ err = snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 32);
if (err < 0)
return err;
- err = snd_pcm_hw_constraint_step(runtime, 0,
+ err = snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 32);
if (err < 0)
return err;
if (runtime->hw.formats & SNDRV_PCM_FMTBIT_S32_LE) {
- err = snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
+ err = snd_pcm_hw_constraint_msbits(substream, 0, 32, 24);
if (err < 0)
return err;
}
if (runtime->hw.channels_max > 2) {
- err = snd_pcm_hw_constraint_step(runtime, 0,
+ err = snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
2);
if (err < 0)
@@ -1056,9 +1056,9 @@ static int pcxhr_open(struct snd_pcm_substream *subs)
runtime->private_data = stream;
/* better get a divisor of granularity values (96 or 192) */
- snd_pcm_hw_constraint_step(runtime, 0,
+ snd_pcm_hw_constraint_step(subs, 0,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 32);
- snd_pcm_hw_constraint_step(runtime, 0,
+ snd_pcm_hw_constraint_step(subs, 0,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 32);
snd_pcm_set_sync(subs);
@@ -816,13 +816,13 @@ static const struct snd_pcm_hw_constraint_list hw_constraints_period_bytes = {
.mask = 0
};
-static void snd_rme32_set_buffer_constraint(struct rme32 *rme32, struct snd_pcm_runtime *runtime)
+static void snd_rme32_set_buffer_constraint(struct rme32 *rme32, struct snd_pcm_substream *substream)
{
if (! rme32->fullduplex_mode) {
- snd_pcm_hw_constraint_single(runtime,
+ snd_pcm_hw_constraint_single(substream->runtime,
SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
RME32_BUFFER_SIZE);
- snd_pcm_hw_constraint_list(runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
&hw_constraints_period_bytes);
}
@@ -862,7 +862,7 @@ static int snd_rme32_playback_spdif_open(struct snd_pcm_substream *substream)
runtime->hw.rate_max = rate;
}
- snd_rme32_set_buffer_constraint(rme32, runtime);
+ snd_rme32_set_buffer_constraint(rme32, substream);
rme32->wcreg_spdif_stream = rme32->wcreg_spdif;
rme32->spdif_ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
@@ -904,7 +904,7 @@ static int snd_rme32_capture_spdif_open(struct snd_pcm_substream *substream)
runtime->hw.rate_max = rate;
}
- snd_rme32_set_buffer_constraint(rme32, runtime);
+ snd_rme32_set_buffer_constraint(rme32, substream);
return 0;
}
@@ -940,7 +940,7 @@ snd_rme32_playback_adat_open(struct snd_pcm_substream *substream)
runtime->hw.rate_max = rate;
}
- snd_rme32_set_buffer_constraint(rme32, runtime);
+ snd_rme32_set_buffer_constraint(rme32, substream);
return 0;
}
@@ -974,7 +974,7 @@ snd_rme32_capture_adat_open(struct snd_pcm_substream *substream)
rme32->capture_substream = substream;
spin_unlock_irq(&rme32->lock);
- snd_rme32_set_buffer_constraint(rme32, runtime);
+ snd_rme32_set_buffer_constraint(rme32, substream);
return 0;
}
@@ -1154,19 +1154,20 @@ static const struct snd_pcm_hw_constraint_list hw_constraints_period_bytes = {
static void
rme96_set_buffer_size_constraint(struct rme96 *rme96,
- struct snd_pcm_runtime *runtime)
+ struct snd_pcm_substream *substream)
{
unsigned int size;
- snd_pcm_hw_constraint_single(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
+ snd_pcm_hw_constraint_single(substream->runtime,
+ SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
RME96_BUFFER_SIZE);
if ((size = rme96->playback_periodsize) != 0 ||
(size = rme96->capture_periodsize) != 0)
- snd_pcm_hw_constraint_single(runtime,
+ snd_pcm_hw_constraint_single(substream->runtime,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
size);
else
- snd_pcm_hw_constraint_list(runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
&hw_constraints_period_bytes);
}
@@ -1199,7 +1200,7 @@ snd_rme96_playback_spdif_open(struct snd_pcm_substream *substream)
runtime->hw.rate_min = rate;
runtime->hw.rate_max = rate;
}
- rme96_set_buffer_size_constraint(rme96, runtime);
+ rme96_set_buffer_size_constraint(rme96, substream);
rme96->wcreg_spdif_stream = rme96->wcreg_spdif;
rme96->spdif_ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
@@ -1236,7 +1237,7 @@ snd_rme96_capture_spdif_open(struct snd_pcm_substream *substream)
rme96->capture_substream = substream;
spin_unlock_irq(&rme96->lock);
- rme96_set_buffer_size_constraint(rme96, runtime);
+ rme96_set_buffer_size_constraint(rme96, substream);
return 0;
}
@@ -1268,7 +1269,7 @@ snd_rme96_playback_adat_open(struct snd_pcm_substream *substream)
runtime->hw.rate_min = rate;
runtime->hw.rate_max = rate;
}
- rme96_set_buffer_size_constraint(rme96, runtime);
+ rme96_set_buffer_size_constraint(rme96, substream);
return 0;
}
@@ -1303,7 +1304,7 @@ snd_rme96_capture_adat_open(struct snd_pcm_substream *substream)
rme96->capture_substream = substream;
spin_unlock_irq(&rme96->lock);
- rme96_set_buffer_size_constraint(rme96, runtime);
+ rme96_set_buffer_size_constraint(rme96, substream);
return 0;
}
@@ -4510,27 +4510,27 @@ static int snd_hdsp_playback_open(struct snd_pcm_substream *substream)
spin_unlock_irq(&hdsp->lock);
- snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hdsp_hw_constraints_period_sizes);
+ snd_pcm_hw_constraint_msbits(substream, 0, 32, 24);
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hdsp_hw_constraints_period_sizes);
if (hdsp->clock_source_locked) {
runtime->hw.rate_min = runtime->hw.rate_max = hdsp->system_sample_rate;
} else if (hdsp->io_type == H9632) {
runtime->hw.rate_max = 192000;
runtime->hw.rates = SNDRV_PCM_RATE_KNOT;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hdsp_hw_constraints_9632_sample_rates);
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE, &hdsp_hw_constraints_9632_sample_rates);
}
if (hdsp->io_type == H9632) {
runtime->hw.channels_min = hdsp->qs_out_channels;
runtime->hw.channels_max = hdsp->ss_out_channels;
}
- snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
snd_hdsp_hw_rule_out_channels, hdsp,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
- snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
snd_hdsp_hw_rule_out_channels_rate, hdsp,
SNDRV_PCM_HW_PARAM_RATE, -1);
- snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
snd_hdsp_hw_rule_rate_out_channels, hdsp,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
@@ -4587,22 +4587,22 @@ static int snd_hdsp_capture_open(struct snd_pcm_substream *substream)
spin_unlock_irq(&hdsp->lock);
- snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hdsp_hw_constraints_period_sizes);
+ snd_pcm_hw_constraint_msbits(substream, 0, 32, 24);
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hdsp_hw_constraints_period_sizes);
if (hdsp->io_type == H9632) {
runtime->hw.channels_min = hdsp->qs_in_channels;
runtime->hw.channels_max = hdsp->ss_in_channels;
runtime->hw.rate_max = 192000;
runtime->hw.rates = SNDRV_PCM_RATE_KNOT;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hdsp_hw_constraints_9632_sample_rates);
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE, &hdsp_hw_constraints_9632_sample_rates);
}
- snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
snd_hdsp_hw_rule_in_channels, hdsp,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
- snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
snd_hdsp_hw_rule_in_channels_rate, hdsp,
SNDRV_PCM_HW_PARAM_RATE, -1);
- snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
snd_hdsp_hw_rule_rate_in_channels, hdsp,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
return 0;
@@ -6071,8 +6071,8 @@ static int snd_hdspm_open(struct snd_pcm_substream *substream)
spin_unlock_irq(&hdspm->lock);
- snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
- snd_pcm_hw_constraint_pow2(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE);
+ snd_pcm_hw_constraint_msbits(substream, 0, 32, 24);
+ snd_pcm_hw_constraint_pow2(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE);
switch (hdspm->io_type) {
case AIO:
@@ -6097,22 +6097,22 @@ static int snd_hdspm_open(struct snd_pcm_substream *substream)
if (AES32 == hdspm->io_type) {
runtime->hw.rates |= SNDRV_PCM_RATE_KNOT;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&hdspm_hw_constraints_aes32_sample_rates);
} else {
- snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
(playback ?
snd_hdspm_hw_rule_rate_out_channels :
snd_hdspm_hw_rule_rate_in_channels), hdspm,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
}
- snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
(playback ? snd_hdspm_hw_rule_out_channels :
snd_hdspm_hw_rule_in_channels), hdspm,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
- snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
(playback ? snd_hdspm_hw_rule_out_channels_rate :
snd_hdspm_hw_rule_in_channels_rate), hdspm,
SNDRV_PCM_HW_PARAM_RATE, -1);
@@ -2287,15 +2287,15 @@ static int snd_rme9652_playback_open(struct snd_pcm_substream *substream)
spin_unlock_irq(&rme9652->lock);
- snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hw_constraints_period_sizes);
- snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_constraint_msbits(substream, 0, 32, 24);
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hw_constraints_period_sizes);
+ snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
snd_rme9652_hw_rule_channels, rme9652,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
- snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
snd_rme9652_hw_rule_channels_rate, rme9652,
SNDRV_PCM_HW_PARAM_RATE, -1);
- snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
snd_rme9652_hw_rule_rate_channels, rme9652,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
@@ -2347,15 +2347,15 @@ static int snd_rme9652_capture_open(struct snd_pcm_substream *substream)
spin_unlock_irq(&rme9652->lock);
- snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24);
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hw_constraints_period_sizes);
- snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_constraint_msbits(substream, 0, 32, 24);
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hw_constraints_period_sizes);
+ snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
snd_rme9652_hw_rule_channels, rme9652,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
- snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
snd_rme9652_hw_rule_channels_rate, rme9652,
SNDRV_PCM_HW_PARAM_RATE, -1);
- snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
snd_rme9652_hw_rule_rate_channels, rme9652,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
return 0;
@@ -796,7 +796,7 @@ static int snd_sonicvibes_playback_open(struct snd_pcm_substream *substream)
sonic->mode |= SV_MODE_PLAY;
sonic->playback_substream = substream;
runtime->hw = snd_sonicvibes_playback;
- snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_sonicvibes_hw_constraint_dac_rate, NULL, SNDRV_PCM_HW_PARAM_RATE, -1);
+ snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_RATE, snd_sonicvibes_hw_constraint_dac_rate, NULL, SNDRV_PCM_HW_PARAM_RATE, -1);
return 0;
}
@@ -808,7 +808,7 @@ static int snd_sonicvibes_capture_open(struct snd_pcm_substream *substream)
sonic->mode |= SV_MODE_CAPTURE;
sonic->capture_substream = substream;
runtime->hw = snd_sonicvibes_capture;
- snd_pcm_hw_constraint_ratdens(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_ratdens(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&snd_sonicvibes_hw_constraints_adc_clock);
return 0;
}
@@ -1201,7 +1201,7 @@ static int snd_via82xx_pcm_open(struct via82xx *chip, struct viadev *viadev,
return err;
if (use_src) {
- err = snd_pcm_hw_rule_noresample(runtime, 48000);
+ err = snd_pcm_hw_rule_noresample(substream, 48000);
if (err < 0)
return err;
}
@@ -1279,7 +1279,7 @@ static int snd_via8233_multi_open(struct snd_pcm_substream *substream)
return err;
substream->runtime->hw.channels_max = 6;
if (chip->revision == VIA_REV_8233A)
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
&hw_constraints_channels);
return 0;
@@ -738,7 +738,7 @@ static int snd_via82xx_modem_pcm_open(struct via82xx_modem *chip, struct viadev
runtime->hw = snd_via82xx_hw;
- if ((err = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ if ((err = snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&hw_constraints_rates)) < 0)
return err;
@@ -885,7 +885,7 @@ static int snd_ymfpci_playback_open_1(struct snd_pcm_substream *substream)
5334, UINT_MAX);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_noresample(runtime, 48000);
+ err = snd_pcm_hw_rule_noresample(substream, 48000);
if (err < 0)
return err;
@@ -1010,7 +1010,7 @@ static int snd_ymfpci_capture_open(struct snd_pcm_substream *substream,
5334, UINT_MAX);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_noresample(runtime, 48000);
+ err = snd_pcm_hw_rule_noresample(substream, 48000);
if (err < 0)
return err;
@@ -117,7 +117,7 @@ static int axi_i2s_startup(struct snd_pcm_substream *substream,
regmap_write(i2s->regmap, AXI_I2S_REG_RESET, mask);
- ret = snd_pcm_hw_constraint_ratnums(substream->runtime, 0,
+ ret = snd_pcm_hw_constraint_ratnums(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
&i2s->rate_constraints);
if (ret)
@@ -120,7 +120,7 @@ static int axi_spdif_startup(struct snd_pcm_substream *substream,
struct axi_spdif *spdif = snd_soc_dai_get_drvdata(dai);
int ret;
- ret = snd_pcm_hw_constraint_ratnums(substream->runtime, 0,
+ ret = snd_pcm_hw_constraint_ratnums(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
&spdif->rate_constraints);
if (ret)
@@ -255,9 +255,9 @@ static int cz_da7219_play_startup(struct snd_pcm_substream *substream)
*/
runtime->hw.channels_max = DUAL_CHANNEL;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
&constraints_channels);
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&constraints_rates);
machine->play_i2s_instance = I2S_SP_INSTANCE;
@@ -276,9 +276,9 @@ static int cz_da7219_cap_startup(struct snd_pcm_substream *substream)
*/
runtime->hw.channels_max = DUAL_CHANNEL;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
&constraints_channels);
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&constraints_rates);
machine->cap_i2s_instance = I2S_SP_INSTANCE;
@@ -298,9 +298,9 @@ static int cz_max_startup(struct snd_pcm_substream *substream)
*/
runtime->hw.channels_max = DUAL_CHANNEL;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
&constraints_channels);
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&constraints_rates);
machine->play_i2s_instance = I2S_BT_INSTANCE;
@@ -319,9 +319,9 @@ static int cz_dmic0_startup(struct snd_pcm_substream *substream)
*/
runtime->hw.channels_max = DUAL_CHANNEL;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
&constraints_channels);
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&constraints_rates);
machine->cap_i2s_instance = I2S_BT_INSTANCE;
@@ -340,9 +340,9 @@ static int cz_dmic1_startup(struct snd_pcm_substream *substream)
*/
runtime->hw.channels_max = DUAL_CHANNEL;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
&constraints_channels);
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&constraints_rates);
machine->cap_i2s_instance = I2S_SP_INSTANCE;
@@ -367,9 +367,9 @@ static int cz_rt5682_play_startup(struct snd_pcm_substream *substream)
*/
runtime->hw.channels_max = DUAL_CHANNEL;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
&constraints_channels);
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&constraints_rates);
machine->play_i2s_instance = I2S_SP_INSTANCE;
@@ -388,9 +388,9 @@ static int cz_rt5682_cap_startup(struct snd_pcm_substream *substream)
*/
runtime->hw.channels_max = DUAL_CHANNEL;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
&constraints_channels);
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&constraints_rates);
machine->cap_i2s_instance = I2S_SP_INSTANCE;
@@ -410,9 +410,9 @@ static int cz_rt5682_max_startup(struct snd_pcm_substream *substream)
*/
runtime->hw.channels_max = DUAL_CHANNEL;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
&constraints_channels);
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&constraints_rates);
machine->play_i2s_instance = I2S_BT_INSTANCE;
@@ -431,9 +431,9 @@ static int cz_rt5682_dmic0_startup(struct snd_pcm_substream *substream)
*/
runtime->hw.channels_max = DUAL_CHANNEL;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
&constraints_channels);
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&constraints_rates);
machine->cap_i2s_instance = I2S_BT_INSTANCE;
@@ -452,9 +452,9 @@ static int cz_rt5682_dmic1_startup(struct snd_pcm_substream *substream)
*/
runtime->hw.channels_max = DUAL_CHANNEL;
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
&constraints_channels);
- snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&constraints_rates);
machine->cap_i2s_instance = I2S_SP_INSTANCE;
@@ -295,7 +295,7 @@ static int atmel_ssc_startup(struct snd_pcm_substream *substream,
dir_mask = SSC_DIR_MASK_CAPTURE;
}
- ret = snd_pcm_hw_rule_add(substream->runtime, 0,
+ ret = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
atmel_ssc_hw_rule_rate,
ssc_p,
@@ -211,12 +211,12 @@ static int bcm63xx_pcm_open(struct snd_soc_component *component,
struct bcm63xx_runtime_data *prtd;
runtime->hw = bcm63xx_pcm_hardware;
- ret = snd_pcm_hw_constraint_step(runtime, 0,
+ ret = snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 32);
if (ret)
goto out;
- ret = snd_pcm_hw_constraint_step(runtime, 0,
+ ret = snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 32);
if (ret)
goto out;
@@ -582,7 +582,6 @@ static int cygnus_pcm_open(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
- struct snd_pcm_runtime *runtime = substream->runtime;
struct cygnus_aio_port *aio;
int ret;
@@ -594,12 +593,12 @@ static int cygnus_pcm_open(struct snd_soc_component *component,
snd_soc_set_runtime_hwparams(substream, &cygnus_pcm_hw);
- ret = snd_pcm_hw_constraint_step(runtime, 0,
+ ret = snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES, PERIOD_BYTES_MIN);
if (ret < 0)
return ret;
- ret = snd_pcm_hw_constraint_step(runtime, 0,
+ ret = snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_BUFFER_BYTES, PERIOD_BYTES_MIN);
if (ret < 0)
return ret;
@@ -754,7 +754,7 @@ static int cygnus_ssp_startup(struct snd_pcm_substream *substream,
substream->runtime->hw.rate_min = CYGNUS_RATE_MIN;
substream->runtime->hw.rate_max = CYGNUS_RATE_MAX;
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, &cygnus_rate_constraint);
return 0;
}
@@ -363,7 +363,7 @@ static int ad193x_hw_params(struct snd_pcm_substream *substream,
static int ad193x_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- return snd_pcm_hw_constraint_list(substream->runtime, 0,
+ return snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
&constr);
}
@@ -755,7 +755,7 @@ static int adau1372_startup(struct snd_pcm_substream *substream, struct snd_soc_
{
struct adau1372 *adau1372 = snd_soc_dai_get_drvdata(dai);
- snd_pcm_hw_constraint_list(substream->runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&adau1372->rate_constraints);
return 0;
@@ -555,7 +555,7 @@ static int ak4458_startup(struct snd_pcm_substream *substream,
{
int ret;
- ret = snd_pcm_hw_constraint_list(substream->runtime, 0,
+ ret = snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
&ak4458_rate_constraints);
@@ -255,7 +255,7 @@ static void ak4613_dai_shutdown(struct snd_pcm_substream *substream,
}
static void ak4613_hw_constraints(struct ak4613_priv *priv,
- struct snd_pcm_runtime *runtime)
+ struct snd_pcm_substream *substream)
{
static const unsigned int ak4613_rates[] = {
32000,
@@ -294,7 +294,7 @@ static void ak4613_hw_constraints(struct ak4613_priv *priv,
constraint->count = i + 1;
}
- snd_pcm_hw_constraint_list(runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, constraint);
}
@@ -306,7 +306,7 @@ static int ak4613_dai_startup(struct snd_pcm_substream *substream,
priv->cnt++;
- ak4613_hw_constraints(priv, substream->runtime);
+ ak4613_hw_constraints(priv, substream);
return 0;
}
@@ -242,7 +242,7 @@ static const struct snd_pcm_hw_constraint_list ak5558_rate_constraints = {
static int ak5558_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- return snd_pcm_hw_constraint_list(substream->runtime, 0,
+ return snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
&ak5558_rate_constraints);
}
@@ -520,7 +520,7 @@ static const struct snd_pcm_hw_constraint_list cs35l33_constraints = {
static int cs35l33_pcm_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
&cs35l33_constraints);
return 0;
@@ -577,7 +577,7 @@ static int cs35l34_pcm_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, &cs35l34_constraints);
return 0;
}
@@ -609,7 +609,7 @@ static int cs35l35_pcm_startup(struct snd_pcm_substream *substream,
if (!substream->runtime)
return 0;
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, &cs35l35_constraints);
regmap_update_bits(cs35l35->regmap, CS35L35_AMP_INP_DRV_CTL,
@@ -637,7 +637,7 @@ static int cs35l35_pdm_startup(struct snd_pcm_substream *substream,
if (!substream->runtime)
return 0;
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
&cs35l35_pdm_constraints);
@@ -963,7 +963,7 @@ static const struct snd_pcm_hw_constraint_list cs35l36_constraints = {
static int cs35l36_pcm_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, &cs35l36_constraints);
return 0;
@@ -505,7 +505,7 @@ static int cs4234_dai_startup(struct snd_pcm_substream *sub, struct snd_soc_dai
for (i = 0; i < cs4234->rate_constraint.nrats; i++)
cs4234->rate_dividers[i].num = cs4234->mclk_rate / CS4234_MCLK_SCALE;
- ret = snd_pcm_hw_constraint_ratnums(sub->runtime, 0,
+ ret = snd_pcm_hw_constraint_ratnums(sub, 0,
SNDRV_PCM_HW_PARAM_RATE,
&cs4234->rate_constraint);
if (ret < 0)
@@ -515,7 +515,7 @@ static int cs4234_dai_startup(struct snd_pcm_substream *sub, struct snd_soc_dai
* MCLK/rate may be a valid ratio but out-of-spec (e.g. 24576000/64000)
* so this rule limits the range of sample rate for given MCLK.
*/
- return snd_pcm_hw_rule_add(sub->runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ return snd_pcm_hw_rule_add(sub, 0, SNDRV_PCM_HW_PARAM_RATE,
cs4234_dai_rule_rate, cs4234, -1);
}
@@ -1144,7 +1144,7 @@ static const struct snd_pcm_hw_constraint_list constraints_12_24 = {
static int cs42l73_pcm_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
&constraints_12_24);
return 0;
@@ -1444,7 +1444,7 @@ static const struct snd_pcm_hw_constraint_list cs43130_asp_constraints = {
static int cs43130_pcm_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- return snd_pcm_hw_constraint_list(substream->runtime, 0,
+ return snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
&cs43130_asp_constraints);
}
@@ -1461,7 +1461,7 @@ static const struct snd_pcm_hw_constraint_list cs43130_dop_constraints = {
static int cs43130_dop_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- return snd_pcm_hw_constraint_list(substream->runtime, 0,
+ return snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
&cs43130_dop_constraints);
}
@@ -751,7 +751,7 @@ static const struct snd_pcm_hw_constraint_list src_constraints = {
static int cs53l30_pcm_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, &src_constraints);
return 0;
@@ -450,7 +450,7 @@ static int es8316_pcm_startup(struct snd_pcm_substream *substream,
struct es8316_priv *es8316 = snd_soc_component_get_drvdata(component);
if (es8316->sysclk_constraints.list)
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
&es8316->sysclk_constraints);
@@ -463,7 +463,7 @@ static int es8328_startup(struct snd_pcm_substream *substream,
struct es8328_priv *es8328 = snd_soc_component_get_drvdata(component);
if (es8328->master && es8328->sysclk_constraints)
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
es8328->sysclk_constraints);
@@ -411,7 +411,7 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream,
if (ret)
goto err;
- ret = snd_pcm_hw_constraint_eld(substream->runtime, hcp->eld);
+ ret = snd_pcm_hw_constraint_eld(substream, hcp->eld);
if (ret)
goto err;
@@ -1916,7 +1916,7 @@ static int max98090_dai_startup(struct snd_pcm_substream *substream,
/* Remove 24-bit format support if it is not in right justified mode. */
if ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) != SND_SOC_DAIFMT_RIGHT_J) {
substream->runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE;
- snd_pcm_hw_constraint_msbits(substream->runtime, 0, 16, 16);
+ snd_pcm_hw_constraint_msbits(substream, 0, 16, 16);
}
return 0;
}
@@ -314,7 +314,7 @@ static int max9867_startup(struct snd_pcm_substream *substream,
snd_soc_component_get_drvdata(dai->component);
if (max9867->constraints)
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, max9867->constraints);
return 0;
@@ -592,7 +592,7 @@ static int pcm512x_dai_startup_master(struct snd_pcm_substream *substream,
}
if (pcm512x->pll_out)
- return snd_pcm_hw_rule_add(substream->runtime, 0,
+ return snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
pcm512x_hw_rule_rate,
pcm512x,
@@ -613,7 +613,7 @@ static int pcm512x_dai_startup_master(struct snd_pcm_substream *substream,
rats_no_pll->den_max = 128;
rats_no_pll->den_step = 1;
- return snd_pcm_hw_constraint_ratnums(substream->runtime, 0,
+ return snd_pcm_hw_constraint_ratnums(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
constraints_no_pll);
}
@@ -639,7 +639,7 @@ static int pcm512x_dai_startup_slave(struct snd_pcm_substream *substream,
PCM512x_SREF, PCM512x_SREF_BCK);
}
- return snd_pcm_hw_constraint_list(substream->runtime, 0,
+ return snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
&constraints_slave);
}
@@ -804,7 +804,7 @@ int sigmadsp_restrict_params(struct sigmadsp *sigmadsp,
if (sigmadsp->rate_constraints.count == 0)
return 0;
- return snd_pcm_hw_constraint_list(substream->runtime, 0,
+ return snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, &sigmadsp->rate_constraints);
}
EXPORT_SYMBOL_GPL(sigmadsp_restrict_params);
@@ -330,7 +330,7 @@ static int ssm2602_startup(struct snd_pcm_substream *substream,
struct ssm2602_priv *ssm2602 = snd_soc_component_get_drvdata(component);
if (ssm2602->sysclk_constraints) {
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
ssm2602->sysclk_constraints);
}
@@ -103,7 +103,7 @@ static int uda1334_startup(struct snd_pcm_substream *substream,
return -EINVAL;
}
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
&uda1334->rate_constraint);
@@ -133,7 +133,7 @@ static int wm8523_startup(struct snd_pcm_substream *substream,
return -EINVAL;
}
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
&wm8523->rate_constraint);
@@ -71,7 +71,7 @@ static int wm8524_startup(struct snd_pcm_substream *substream,
return -EINVAL;
}
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
&wm8524->rate_constraint);
@@ -531,7 +531,7 @@ static int wm8731_startup(struct snd_pcm_substream *substream,
struct wm8731_priv *wm8731 = snd_soc_component_get_drvdata(dai->component);
if (wm8731->constraints)
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
wm8731->constraints);
@@ -179,7 +179,7 @@ static int wm8741_startup(struct snd_pcm_substream *substream,
struct wm8741_priv *wm8741 = snd_soc_component_get_drvdata(component);
if (wm8741->sysclk)
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
wm8741->sysclk_constraints);
@@ -592,11 +592,11 @@ static int fsl_asrc_dai_startup(struct snd_pcm_substream *substream,
/* Odd channel number is not valid for older ASRC (channel_bits==3) */
if (asrc_priv->soc->channel_bits == 3)
- snd_pcm_hw_constraint_step(substream->runtime, 0,
+ snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS, 2);
- return snd_pcm_hw_constraint_list(substream->runtime, 0,
+ return snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, &fsl_asrc_rate_constraints);
}
@@ -1400,7 +1400,7 @@ static const struct snd_pcm_hw_constraint_list easrc_rate_constraints = {
static int fsl_easrc_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- return snd_pcm_hw_constraint_list(substream->runtime, 0,
+ return snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
&easrc_rate_constraints);
}
@@ -684,12 +684,12 @@ static int fsl_sai_startup(struct snd_pcm_substream *substream,
* tx/rx maxburst
*/
if (sai->soc_data->use_edma)
- snd_pcm_hw_constraint_step(substream->runtime, 0,
+ snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
tx ? sai->dma_params_tx.maxburst :
sai->dma_params_rx.maxburst);
- ret = snd_pcm_hw_constraint_list(substream->runtime, 0,
+ ret = snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, &fsl_sai_rate_constraints);
return ret;
@@ -644,7 +644,7 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream,
* period. But SSI would still access fifo1 with an invalid data.
*/
if (ssi->use_dual_fifo)
- snd_pcm_hw_constraint_step(substream->runtime, 0,
+ snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 2);
return 0;
@@ -498,19 +498,18 @@ static int fsl_xcvr_prepare(struct snd_pcm_substream *substream,
return 0;
}
-static int fsl_xcvr_constr(const struct snd_pcm_substream *substream,
+static int fsl_xcvr_constr(struct snd_pcm_substream *substream,
const struct snd_pcm_hw_constraint_list *channels,
const struct snd_pcm_hw_constraint_list *rates)
{
- struct snd_pcm_runtime *rt = substream->runtime;
int ret;
- ret = snd_pcm_hw_constraint_list(rt, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
- channels);
+ ret = snd_pcm_hw_constraint_list(substream, 0,
+ SNDRV_PCM_HW_PARAM_CHANNELS, channels);
if (ret < 0)
return ret;
- ret = snd_pcm_hw_constraint_list(rt, 0, SNDRV_PCM_HW_PARAM_RATE,
+ ret = snd_pcm_hw_constraint_list(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
rates);
if (ret < 0)
return ret;
@@ -52,7 +52,7 @@ static int imx_audmix_fe_startup(struct snd_pcm_substream *substream)
int ret;
if (clk_rate % 24576000 == 0) {
- ret = snd_pcm_hw_constraint_list(runtime, 0,
+ ret = snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
&imx_audmix_rate_constraints);
if (ret < 0)
@@ -117,13 +117,13 @@ static int kirkwood_dma_open(struct snd_soc_component *component,
if (err < 0)
return err;
- err = snd_pcm_hw_constraint_step(runtime, 0,
+ err = snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
priv->burst);
if (err < 0)
return err;
- err = snd_pcm_hw_constraint_step(substream->runtime, 0,
+ err = snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
priv->burst);
if (err < 0)
@@ -47,7 +47,7 @@ int mtk_afe_fe_startup(struct snd_pcm_substream *substream,
memif->substream = substream;
- snd_pcm_hw_constraint_step(substream->runtime, 0,
+ snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 16);
/* enable agent */
mtk_regmap_update_bits(afe->regmap, memif->data->agent_disable_reg,
@@ -108,7 +108,7 @@ static int mt2701_cs42448_fe_ops_startup(struct snd_pcm_substream *substream)
{
int err;
- err = snd_pcm_hw_constraint_list(substream->runtime, 0,
+ err = snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
&mt2701_cs42448_constraints_rates);
if (err < 0) {
@@ -199,15 +199,15 @@ mt8183_da7219_max98357_startup(
struct snd_pcm_runtime *runtime = substream->runtime;
- snd_pcm_hw_constraint_list(runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, &constraints_rates);
runtime->hw.channels_max = 2;
- snd_pcm_hw_constraint_list(runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
&constraints_channels);
runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE;
- snd_pcm_hw_constraint_msbits(runtime, 0, 16, 16);
+ snd_pcm_hw_constraint_msbits(substream, 0, 16, 16);
return 0;
}
@@ -239,15 +239,15 @@ mt8183_da7219_max98357_bt_sco_startup(
struct snd_pcm_runtime *runtime = substream->runtime;
- snd_pcm_hw_constraint_list(runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, &constraints_rates);
runtime->hw.channels_max = 1;
- snd_pcm_hw_constraint_list(runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
&constraints_channels);
runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE;
- snd_pcm_hw_constraint_msbits(runtime, 0, 16, 16);
+ snd_pcm_hw_constraint_msbits(substream, 0, 16, 16);
return 0;
}
@@ -139,15 +139,15 @@ mt8183_mt6358_startup(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
- snd_pcm_hw_constraint_list(runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, &constraints_rates);
runtime->hw.channels_max = 2;
- snd_pcm_hw_constraint_list(runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
&constraints_channels);
runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE;
- snd_pcm_hw_constraint_msbits(runtime, 0, 16, 16);
+ snd_pcm_hw_constraint_msbits(substream, 0, 16, 16);
return 0;
}
@@ -179,15 +179,15 @@ mt8183_mt6358_ts3a227_max98357_bt_sco_startup(
struct snd_pcm_runtime *runtime = substream->runtime;
- snd_pcm_hw_constraint_list(runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, &constraints_rates);
runtime->hw.channels_max = 1;
- snd_pcm_hw_constraint_list(runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
&constraints_channels);
runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE;
- snd_pcm_hw_constraint_msbits(runtime, 0, 16, 16);
+ snd_pcm_hw_constraint_msbits(substream, 0, 16, 16);
return 0;
}
@@ -329,7 +329,7 @@ static int aiu_encoder_i2s_startup(struct snd_pcm_substream *substream,
int ret;
/* Make sure the encoder gets either 2 or 8 channels */
- ret = snd_pcm_hw_constraint_list(substream->runtime, 0,
+ ret = snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
&hw_channel_constraints);
if (ret) {
@@ -140,13 +140,13 @@ int aiu_fifo_startup(struct snd_pcm_substream *substream,
* Make sure the buffer and period size are multiple of the fifo burst
* size
*/
- ret = snd_pcm_hw_constraint_step(substream->runtime, 0,
+ ret = snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
fifo->fifo_block);
if (ret)
return ret;
- ret = snd_pcm_hw_constraint_step(substream->runtime, 0,
+ ret = snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
fifo->fifo_block);
if (ret)
@@ -229,13 +229,13 @@ int axg_fifo_pcm_open(struct snd_soc_component *component,
* Make sure the buffer and period size are multiple of the FIFO
* burst
*/
- ret = snd_pcm_hw_constraint_step(ss->runtime, 0,
+ ret = snd_pcm_hw_constraint_step(ss, 0,
SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
AXG_FIFO_BURST);
if (ret)
return ret;
- ret = snd_pcm_hw_constraint_step(ss->runtime, 0,
+ ret = snd_pcm_hw_constraint_step(ss, 0,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
AXG_FIFO_BURST);
if (ret)
@@ -992,7 +992,7 @@ static int rsnd_soc_dai_startup(struct snd_pcm_substream *substream,
snd_soc_set_runtime_hwparams(substream, &rsnd_pcm_hardware);
- snd_pcm_hw_constraint_list(runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS, constraint);
snd_pcm_hw_constraint_integer(runtime,
@@ -1005,11 +1005,11 @@ static int rsnd_soc_dai_startup(struct snd_pcm_substream *substream,
if (rsnd_rdai_is_clk_master(rdai)) {
int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
- snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
rsnd_soc_hw_rule_rate,
is_play ? &rdai->playback : &rdai->capture,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
- snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
rsnd_soc_hw_rule_channels,
is_play ? &rdai->playback : &rdai->capture,
SNDRV_PCM_HW_PARAM_RATE, -1);
@@ -436,7 +436,7 @@ static void soc_pcm_set_msb(struct snd_pcm_substream *substream, int bits)
if (!bits)
return;
- ret = snd_pcm_hw_constraint_msbits(substream->runtime, 0, 0, bits);
+ ret = snd_pcm_hw_constraint_msbits(substream, 0, 0, bits);
if (ret != 0)
dev_warn(rtd->dev, "ASoC: Failed to set MSB %d: %d\n",
bits, ret);
@@ -706,7 +706,7 @@ static int uni_player_startup(struct snd_pcm_substream *substream,
return 0;
/* refine hw constraint in tdm mode */
- ret = snd_pcm_hw_rule_add(substream->runtime, 0,
+ ret = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
sti_uniperiph_fix_tdm_chan,
player, SNDRV_PCM_HW_PARAM_CHANNELS,
@@ -714,7 +714,7 @@ static int uni_player_startup(struct snd_pcm_substream *substream,
if (ret < 0)
return ret;
- return snd_pcm_hw_rule_add(substream->runtime, 0,
+ return snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_FORMAT,
sti_uniperiph_fix_tdm_format,
player, SNDRV_PCM_HW_PARAM_FORMAT,
@@ -366,7 +366,7 @@ static int uni_reader_startup(struct snd_pcm_substream *substream,
return 0;
/* refine hw constraint in tdm mode */
- ret = snd_pcm_hw_rule_add(substream->runtime, 0,
+ ret = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
sti_uniperiph_fix_tdm_chan,
reader, SNDRV_PCM_HW_PARAM_CHANNELS,
@@ -374,7 +374,7 @@ static int uni_reader_startup(struct snd_pcm_substream *substream,
if (ret < 0)
return ret;
- return snd_pcm_hw_rule_add(substream->runtime, 0,
+ return snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_FORMAT,
sti_uniperiph_fix_tdm_format,
reader, SNDRV_PCM_HW_PARAM_FORMAT,
@@ -617,7 +617,7 @@ static int sun4i_codec_startup(struct snd_pcm_substream *substream,
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct sun4i_codec *scodec = snd_soc_card_get_drvdata(rtd->card);
- snd_pcm_hw_constraint_list(substream->runtime, 0,
+ snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, &sun4i_codec_constraints);
/*
@@ -429,7 +429,7 @@ static int sun8i_codec_startup(struct snd_pcm_substream *substream,
else
return -EINVAL;
- return snd_pcm_hw_constraint_list(substream->runtime, 0,
+ return snd_pcm_hw_constraint_list(substream, 0,
SNDRV_PCM_HW_PARAM_RATE, list);
}
@@ -85,7 +85,7 @@ int tegra_pcm_open(struct snd_soc_component *component,
snd_soc_set_runtime_hwparams(substream, &tegra_pcm_hardware);
/* Ensure period size is multiple of 8 */
- ret = snd_pcm_hw_constraint_step(substream->runtime, 0,
+ ret = snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 0x8);
if (ret) {
dev_err(rtd->dev, "failed to set constraint %d\n", ret);
@@ -1512,7 +1512,7 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
SNDRV_PCM_HW_PARAM_CHANNELS,
0, max_channels);
- snd_pcm_hw_constraint_list(substream->runtime,
+ snd_pcm_hw_constraint_list(substream,
0, SNDRV_PCM_HW_PARAM_CHANNELS,
&mcasp->chconstr[substream->stream]);
@@ -1521,7 +1521,7 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
* Only allow formats which require same amount of bits on the
* bus as the currently running stream
*/
- ret = snd_pcm_hw_rule_add(substream->runtime, 0,
+ ret = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_FORMAT,
davinci_mcasp_hw_rule_format_width,
ruledata,
@@ -1531,7 +1531,7 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
}
else if (mcasp->slot_width) {
/* Only allow formats require <= slot_width bits on the bus */
- ret = snd_pcm_hw_rule_add(substream->runtime, 0,
+ ret = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_FORMAT,
davinci_mcasp_hw_rule_slot_width,
ruledata,
@@ -1545,14 +1545,14 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
* set constraints based on what we can provide.
*/
if (mcasp->bclk_master && mcasp->bclk_div == 0 && mcasp->sysclk_freq) {
- ret = snd_pcm_hw_rule_add(substream->runtime, 0,
+ ret = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
davinci_mcasp_hw_rule_rate,
ruledata,
SNDRV_PCM_HW_PARAM_FORMAT, -1);
if (ret)
return ret;
- ret = snd_pcm_hw_rule_add(substream->runtime, 0,
+ ret = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_FORMAT,
davinci_mcasp_hw_rule_format,
ruledata,
@@ -1561,7 +1561,7 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
return ret;
}
- snd_pcm_hw_rule_add(substream->runtime, 0,
+ snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
davinci_mcasp_hw_rule_min_periodsize, NULL,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE, -1);
@@ -808,14 +808,14 @@ static int omap_mcbsp_dai_startup(struct snd_pcm_substream *substream,
* This applies only for the playback stream.
*/
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- snd_pcm_hw_rule_add(substream->runtime, 0,
+ snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
omap_mcbsp_hwrule_min_buffersize,
mcbsp,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
/* Make sure, that the period size is always even */
- snd_pcm_hw_constraint_step(substream->runtime, 0,
+ snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 2);
}
@@ -96,11 +96,9 @@ static irqreturn_t aiodma_irq(int irq, void *p)
static int uniphier_aiodma_open(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{
- struct snd_pcm_runtime *runtime = substream->runtime;
-
snd_soc_set_runtime_hwparams(substream, &uniphier_aiodma_hw);
- return snd_pcm_hw_constraint_step(runtime, 0,
+ return snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 256);
}
@@ -369,7 +369,7 @@ static int xlnx_formatter_pcm_open(struct snd_soc_component *component,
runtime->private_data = stream_data;
/* Resize the period size divisible by 64 */
- err = snd_pcm_hw_constraint_step(runtime, 0,
+ err = snd_pcm_hw_constraint_step(substream, 0,
SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64);
if (err) {
dev_err(component->dev,
@@ -374,7 +374,7 @@ static int hiface_pcm_open(struct snd_pcm_substream *alsa_sub)
alsa_rt->hw.rate_max = 384000;
/* explicit constraints needed as we added SNDRV_PCM_RATE_KNOT */
- ret = snd_pcm_hw_constraint_list(alsa_sub->runtime, 0,
+ ret = snd_pcm_hw_constraint_list(alsa_sub, 0,
SNDRV_PCM_HW_PARAM_RATE,
&constraints_extra_rates);
if (ret < 0) {
@@ -222,7 +222,7 @@ static int snd_line6_capture_open(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
- err = snd_pcm_hw_constraint_ratdens(runtime, 0,
+ err = snd_pcm_hw_constraint_ratdens(substream, 0,
SNDRV_PCM_HW_PARAM_RATE,
&line6pcm->properties->rates);
if (err < 0)
@@ -373,7 +373,7 @@ static int snd_line6_playback_open(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
- err = snd_pcm_hw_constraint_ratdens(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ err = snd_pcm_hw_constraint_ratdens(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
&line6pcm->properties->rates);
if (err < 0)
return err;
@@ -641,7 +641,7 @@ static int set_stream_hw(struct ua101 *ua, struct snd_pcm_substream *substream,
UINT_MAX);
if (err < 0)
return err;
- err = snd_pcm_hw_constraint_msbits(substream->runtime, 0, 32, 24);
+ err = snd_pcm_hw_constraint_msbits(substream, 0, 32, 24);
return err;
}
@@ -933,9 +933,10 @@ static int hw_rule_periods_implicit_fb(struct snd_pcm_hw_params *params,
* set up the runtime hardware information.
*/
-static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substream *subs)
+static int setup_hw_info(struct snd_pcm_substream *substream, struct snd_usb_substream *subs)
{
- const struct audioformat *fp;
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct audioformat *fp;
unsigned int pt, ptmin;
int param_period_time_if_needed = -1;
int err;
@@ -982,7 +983,7 @@ static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substre
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
hw_rule_rate, subs,
SNDRV_PCM_HW_PARAM_RATE,
SNDRV_PCM_HW_PARAM_FORMAT,
@@ -991,8 +992,7 @@ static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substre
-1);
if (err < 0)
return err;
-
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
hw_rule_channels, subs,
SNDRV_PCM_HW_PARAM_CHANNELS,
SNDRV_PCM_HW_PARAM_FORMAT,
@@ -1001,7 +1001,7 @@ static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substre
-1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FORMAT,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_FORMAT,
hw_rule_format, subs,
SNDRV_PCM_HW_PARAM_FORMAT,
SNDRV_PCM_HW_PARAM_RATE,
@@ -1011,7 +1011,7 @@ static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substre
if (err < 0)
return err;
if (param_period_time_if_needed >= 0) {
- err = snd_pcm_hw_rule_add(runtime, 0,
+ err = snd_pcm_hw_rule_add(substream, 0,
SNDRV_PCM_HW_PARAM_PERIOD_TIME,
hw_rule_period_time, subs,
SNDRV_PCM_HW_PARAM_FORMAT,
@@ -1023,22 +1023,22 @@ static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substre
}
/* additional hw constraints for implicit fb */
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FORMAT,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_FORMAT,
hw_rule_format_implicit_fb, subs,
SNDRV_PCM_HW_PARAM_FORMAT, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_RATE,
hw_rule_rate_implicit_fb, subs,
SNDRV_PCM_HW_PARAM_RATE, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
hw_rule_period_size_implicit_fb, subs,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE, -1);
if (err < 0)
return err;
- err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIODS,
+ err = snd_pcm_hw_rule_add(substream, 0, SNDRV_PCM_HW_PARAM_PERIODS,
hw_rule_periods_implicit_fb, subs,
SNDRV_PCM_HW_PARAM_PERIODS, -1);
if (err < 0)
@@ -1065,7 +1065,7 @@ static int snd_usb_pcm_open(struct snd_pcm_substream *substream)
subs->dsd_dop.channel = 0;
subs->dsd_dop.marker = 1;
- ret = setup_hw_info(runtime, subs);
+ ret = setup_hw_info(substream, subs);
if (ret < 0)
return ret;
ret = snd_usb_autoresume(subs->stream->chip);
Replace struct snd_pcm_runtime *runtime with struct snd_pcm_substream *substream in the header of snd_pcm_hw_rule_add(). This will allow us to use a different struct snd_pcm_hw_constraints later, for BEs. The drivers that call snd_pcm_hw_rule_add() and its wrappers are also updated. Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> --- drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- include/sound/ac97_codec.h | 2 +- include/sound/pcm.h | 18 +++--- include/sound/pcm_drm_eld.h | 2 +- sound/arm/aaci.c | 4 +- sound/arm/pxa2xx-pcm-lib.c | 4 +- sound/core/pcm_drm_eld.c | 6 +- sound/core/pcm_lib.c | 58 ++++++++++--------- sound/core/pcm_native.c | 46 +++++++-------- sound/drivers/aloop.c | 8 +-- sound/drivers/vx/vx_pcm.c | 8 +-- sound/firewire/amdtp-am824.c | 8 +-- sound/firewire/amdtp-am824.h | 2 +- sound/firewire/amdtp-stream.c | 12 ++-- sound/firewire/amdtp-stream.h | 2 +- sound/firewire/bebob/bebob_pcm.c | 6 +- sound/firewire/dice/dice-pcm.c | 6 +- sound/firewire/digi00x/amdtp-dot.c | 6 +- sound/firewire/digi00x/digi00x-pcm.c | 6 +- sound/firewire/digi00x/digi00x.h | 2 +- sound/firewire/fireface/amdtp-ff.c | 6 +- sound/firewire/fireface/ff-pcm.c | 6 +- sound/firewire/fireface/ff.h | 2 +- sound/firewire/fireworks/fireworks_pcm.c | 6 +- sound/firewire/motu/amdtp-motu.c | 6 +- sound/firewire/motu/motu-pcm.c | 6 +- sound/firewire/motu/motu.h | 2 +- sound/firewire/oxfw/oxfw-pcm.c | 6 +- sound/firewire/tascam/amdtp-tascam.c | 6 +- sound/firewire/tascam/tascam-pcm.c | 2 +- sound/firewire/tascam/tascam.h | 2 +- sound/pci/ac97/ac97_pcm.c | 8 +-- sound/pci/ali5451/ali5451.c | 2 +- sound/pci/atiixp.c | 2 +- sound/pci/atiixp_modem.c | 2 +- sound/pci/au88x0/au88x0_pcm.c | 6 +- sound/pci/azt3328.c | 2 +- sound/pci/bt87x.c | 8 +-- sound/pci/ca0106/ca0106_main.c | 4 +- sound/pci/cmipci.c | 14 ++--- sound/pci/cs4281.c | 4 +- sound/pci/cs46xx/cs46xx_lib.c | 4 +- sound/pci/echoaudio/echoaudio.c | 24 ++++---- sound/pci/emu10k1/emu10k1x.c | 4 +- sound/pci/emu10k1/emupcm.c | 10 ++-- sound/pci/ens1370.c | 12 ++-- sound/pci/es1938.c | 4 +- sound/pci/es1968.c | 2 +- sound/pci/fm801.c | 6 +- sound/pci/hda/hda_codec.c | 2 +- sound/pci/hda/hda_controller.c | 4 +- sound/pci/hda/patch_hdmi.c | 8 +-- sound/pci/hda/patch_si3054.c | 2 +- sound/pci/ice1712/ice1712.c | 8 +-- sound/pci/ice1712/ice1724.c | 30 +++++----- sound/pci/intel8x0.c | 10 ++-- sound/pci/intel8x0m.c | 2 +- sound/pci/lola/lola_pcm.c | 4 +- sound/pci/mixart/mixart.c | 8 +-- sound/pci/nm256/nm256.c | 2 +- sound/pci/oxygen/oxygen_pcm.c | 8 +-- sound/pci/pcxhr/pcxhr.c | 4 +- sound/pci/rme32.c | 14 ++--- sound/pci/rme96.c | 17 +++--- sound/pci/rme9652/hdsp.c | 24 ++++---- sound/pci/rme9652/hdspm.c | 12 ++-- sound/pci/rme9652/rme9652.c | 20 +++---- sound/pci/sonicvibes.c | 4 +- sound/pci/via82xx.c | 4 +- sound/pci/via82xx_modem.c | 2 +- sound/pci/ymfpci/ymfpci_main.c | 4 +- sound/soc/adi/axi-i2s.c | 2 +- sound/soc/adi/axi-spdif.c | 2 +- sound/soc/amd/acp-da7219-max98357a.c | 40 ++++++------- sound/soc/atmel/atmel_ssc_dai.c | 2 +- sound/soc/bcm/bcm63xx-pcm-whistler.c | 4 +- sound/soc/bcm/cygnus-pcm.c | 5 +- sound/soc/bcm/cygnus-ssp.c | 2 +- sound/soc/codecs/ad193x.c | 2 +- sound/soc/codecs/adau1372.c | 2 +- sound/soc/codecs/ak4458.c | 2 +- sound/soc/codecs/ak4613.c | 6 +- sound/soc/codecs/ak5558.c | 2 +- sound/soc/codecs/cs35l33.c | 2 +- sound/soc/codecs/cs35l34.c | 2 +- sound/soc/codecs/cs35l35.c | 4 +- sound/soc/codecs/cs35l36.c | 2 +- sound/soc/codecs/cs4234.c | 4 +- sound/soc/codecs/cs42l73.c | 2 +- sound/soc/codecs/cs43130.c | 4 +- sound/soc/codecs/cs53l30.c | 2 +- sound/soc/codecs/es8316.c | 2 +- sound/soc/codecs/es8328.c | 2 +- sound/soc/codecs/hdmi-codec.c | 2 +- sound/soc/codecs/max98090.c | 2 +- sound/soc/codecs/max9867.c | 2 +- sound/soc/codecs/pcm512x.c | 6 +- sound/soc/codecs/sigmadsp.c | 2 +- sound/soc/codecs/ssm2602.c | 2 +- sound/soc/codecs/uda1334.c | 2 +- sound/soc/codecs/wm8523.c | 2 +- sound/soc/codecs/wm8524.c | 2 +- sound/soc/codecs/wm8731.c | 2 +- sound/soc/codecs/wm8741.c | 2 +- sound/soc/fsl/fsl_asrc.c | 4 +- sound/soc/fsl/fsl_easrc.c | 2 +- sound/soc/fsl/fsl_sai.c | 4 +- sound/soc/fsl/fsl_ssi.c | 2 +- sound/soc/fsl/fsl_xcvr.c | 9 ++- sound/soc/fsl/imx-audmix.c | 2 +- sound/soc/kirkwood/kirkwood-dma.c | 4 +- sound/soc/mediatek/common/mtk-afe-fe-dai.c | 2 +- sound/soc/mediatek/mt2701/mt2701-cs42448.c | 2 +- .../mediatek/mt8183/mt8183-da7219-max98357.c | 12 ++-- .../mt8183/mt8183-mt6358-ts3a227-max98357.c | 12 ++-- sound/soc/meson/aiu-encoder-i2s.c | 2 +- sound/soc/meson/aiu-fifo.c | 4 +- sound/soc/meson/axg-fifo.c | 4 +- sound/soc/sh/rcar/core.c | 6 +- sound/soc/soc-pcm.c | 2 +- sound/soc/sti/uniperif_player.c | 4 +- sound/soc/sti/uniperif_reader.c | 4 +- sound/soc/sunxi/sun4i-codec.c | 2 +- sound/soc/sunxi/sun8i-codec.c | 2 +- sound/soc/tegra/tegra_pcm.c | 2 +- sound/soc/ti/davinci-mcasp.c | 12 ++-- sound/soc/ti/omap-mcbsp.c | 4 +- sound/soc/uniphier/aio-dma.c | 4 +- sound/soc/xilinx/xlnx_formatter_pcm.c | 2 +- sound/usb/hiface/pcm.c | 2 +- sound/usb/line6/capture.c | 2 +- sound/usb/line6/playback.c | 2 +- sound/usb/misc/ua101.c | 2 +- sound/usb/pcm.c | 24 ++++---- 134 files changed, 416 insertions(+), 417 deletions(-)