13 Aug
2015
13 Aug
'15
4:57 p.m.
On 08/13/2015 03:55 PM, Ricard Wanderlof wrote:
+#define ICS43432_RATE_MIN 7190 /* Hz, from data sheet */ +#define ICS43432_RATE_MAX 52800 /* Hz, from data sheet */
If the part can work with continuous rates between those two values set rate_min and rate_max in the DAI struct and set the rates field of the same struct to SNDRV_PCM_RATE_CONTINUOUS.
+static int ics43432_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params, struct snd_soc_dai *dai)
+{
- unsigned int rate = params_rate(params);
- if (rate < ICS43432_RATE_MIN || rate > ICS43432_RATE_MAX)
return -EINVAL;
And then drop all of this. The ALSA core will take care of enforcing the constraints.
- return 0;
+}