Lines Matching full:pair
26 dev_err(&asrc->pdev->dev, "Pair %c: " fmt, 'A' + index, ##__VA_ARGS__)
29 dev_dbg(&asrc->pdev->dev, "Pair %c: " fmt, 'A' + index, ##__VA_ARGS__)
32 dev_warn(&asrc->pdev->dev, "Pair %c: " fmt, 'A' + index, ##__VA_ARGS__)
206 * fsl_asrc_request_pair - Request ASRC pair
208 * @pair: pointer to pair
210 * It assigns pair by the order of A->C->B because allocation of pair B,
211 * within range [ANCA, ANCA+ANCB-1], depends on the channels of pair A
212 * while pair A and pair C are comparatively independent.
214 static int fsl_asrc_request_pair(int channels, struct fsl_asrc_pair *pair) in fsl_asrc_request_pair() argument
217 struct fsl_asrc *asrc = pair->asrc; in fsl_asrc_request_pair()
225 if (asrc->pair[i] != NULL) in fsl_asrc_request_pair()
242 asrc->pair[index] = pair; in fsl_asrc_request_pair()
243 pair->channels = channels; in fsl_asrc_request_pair()
244 pair->index = index; in fsl_asrc_request_pair()
253 * fsl_asrc_release_pair - Release ASRC pair
254 * @pair: pair to release
258 static void fsl_asrc_release_pair(struct fsl_asrc_pair *pair) in fsl_asrc_release_pair() argument
260 struct fsl_asrc *asrc = pair->asrc; in fsl_asrc_release_pair()
261 enum asrc_pair_index index = pair->index; in fsl_asrc_release_pair()
264 /* Make sure the pair is disabled */ in fsl_asrc_release_pair()
270 asrc->channel_avail += pair->channels; in fsl_asrc_release_pair()
271 asrc->pair[index] = NULL; in fsl_asrc_release_pair()
272 pair->error = 0; in fsl_asrc_release_pair()
279 * @pair: pointer to pair
283 static void fsl_asrc_set_watermarks(struct fsl_asrc_pair *pair, u32 in, u32 out) in fsl_asrc_set_watermarks() argument
285 struct fsl_asrc *asrc = pair->asrc; in fsl_asrc_set_watermarks()
286 enum asrc_pair_index index = pair->index; in fsl_asrc_set_watermarks()
299 * @pair: pointer to pair
304 static u32 fsl_asrc_cal_asrck_divisor(struct fsl_asrc_pair *pair, u32 div) in fsl_asrc_cal_asrck_divisor() argument
317 * @pair: pointer to pair
323 static int fsl_asrc_set_ideal_ratio(struct fsl_asrc_pair *pair, in fsl_asrc_set_ideal_ratio() argument
326 struct fsl_asrc *asrc = pair->asrc; in fsl_asrc_set_ideal_ratio()
327 enum asrc_pair_index index = pair->index; in fsl_asrc_set_ideal_ratio()
362 * fsl_asrc_config_pair - Configure the assigned ASRC pair
363 * @pair: pointer to pair
377 static int fsl_asrc_config_pair(struct fsl_asrc_pair *pair, bool use_ideal_rate) in fsl_asrc_config_pair() argument
379 struct fsl_asrc_pair_priv *pair_priv = pair->private; in fsl_asrc_config_pair()
381 struct fsl_asrc *asrc = pair->asrc; in fsl_asrc_config_pair()
383 enum asrc_pair_index index = pair->index; in fsl_asrc_config_pair()
395 pair_err("invalid pair config\n"); in fsl_asrc_config_pair()
511 /* Update channels for current pair */ in fsl_asrc_config_pair()
529 indiv = fsl_asrc_cal_asrck_divisor(pair, div[IN]); in fsl_asrc_config_pair()
530 outdiv = fsl_asrc_cal_asrck_divisor(pair, div[OUT]); in fsl_asrc_config_pair()
549 fsl_asrc_set_watermarks(pair, ASRC_INPUTFIFO_THRESHOLD, in fsl_asrc_config_pair()
573 return fsl_asrc_set_ideal_ratio(pair, inrate, outrate); in fsl_asrc_config_pair()
577 * fsl_asrc_start_pair - Start the assigned ASRC pair
578 * @pair: pointer to pair
580 * It enables the assigned pair and makes it stopped at the stall level.
582 static void fsl_asrc_start_pair(struct fsl_asrc_pair *pair) in fsl_asrc_start_pair() argument
584 struct fsl_asrc *asrc = pair->asrc; in fsl_asrc_start_pair()
585 enum asrc_pair_index index = pair->index; in fsl_asrc_start_pair()
588 /* Enable the current pair */ in fsl_asrc_start_pair()
605 for (i = 0; i < pair->channels * 4; i++) in fsl_asrc_start_pair()
613 * fsl_asrc_stop_pair - Stop the assigned ASRC pair
614 * @pair: pointer to pair
616 static void fsl_asrc_stop_pair(struct fsl_asrc_pair *pair) in fsl_asrc_stop_pair() argument
618 struct fsl_asrc *asrc = pair->asrc; in fsl_asrc_stop_pair()
619 enum asrc_pair_index index = pair->index; in fsl_asrc_stop_pair()
621 /* Stop the current pair */ in fsl_asrc_stop_pair()
627 * fsl_asrc_get_dma_channel- Get DMA channel according to the pair and direction.
628 * @pair: pointer to pair
631 static struct dma_chan *fsl_asrc_get_dma_channel(struct fsl_asrc_pair *pair, in fsl_asrc_get_dma_channel() argument
634 struct fsl_asrc *asrc = pair->asrc; in fsl_asrc_get_dma_channel()
635 enum asrc_pair_index index = pair->index; in fsl_asrc_get_dma_channel()
661 struct fsl_asrc_pair *pair, in fsl_asrc_select_clk() argument
665 struct fsl_asrc_pair_priv *pair_priv = pair->private; in fsl_asrc_select_clk()
704 struct fsl_asrc_pair *pair = runtime->private_data; in fsl_asrc_dai_hw_params() local
705 struct fsl_asrc_pair_priv *pair_priv = pair->private; in fsl_asrc_dai_hw_params()
711 ret = fsl_asrc_request_pair(channels, pair); in fsl_asrc_dai_hw_params()
713 dev_err(dai->dev, "fail to request asrc pair\n"); in fsl_asrc_dai_hw_params()
719 config.pair = pair->index; in fsl_asrc_dai_hw_params()
734 fsl_asrc_select_clk(asrc_priv, pair, in fsl_asrc_dai_hw_params()
738 ret = fsl_asrc_config_pair(pair, false); in fsl_asrc_dai_hw_params()
740 dev_err(dai->dev, "fail to config asrc pair\n"); in fsl_asrc_dai_hw_params()
751 struct fsl_asrc_pair *pair = runtime->private_data; in fsl_asrc_dai_hw_free() local
753 if (pair) in fsl_asrc_dai_hw_free()
754 fsl_asrc_release_pair(pair); in fsl_asrc_dai_hw_free()
763 struct fsl_asrc_pair *pair = runtime->private_data; in fsl_asrc_dai_trigger() local
769 fsl_asrc_start_pair(pair); in fsl_asrc_dai_trigger()
774 fsl_asrc_stop_pair(pair); in fsl_asrc_dai_trigger()
979 /* Halt ASRC internal FP when input FIFO needs data for pair A, B, C */ in fsl_asrc_init()
1029 if (!asrc->pair[index]) in fsl_asrc_isr()
1033 asrc->pair[index]->error |= ASRC_TASK_Q_OVERLOAD; in fsl_asrc_isr()
1038 asrc->pair[index]->error |= ASRC_OUTPUT_TASK_OVERLOAD; in fsl_asrc_isr()
1043 asrc->pair[index]->error |= ASRC_INPUT_TASK_OVERLOAD; in fsl_asrc_isr()
1048 asrc->pair[index]->error |= ASRC_OUTPUT_BUFFER_OVERFLOW; in fsl_asrc_isr()
1053 asrc->pair[index]->error |= ASRC_INPUT_BUFFER_UNDERRUN; in fsl_asrc_isr()
1319 dev_warn(dev, "Pair %c initialization isn't finished\n", 'A' + i); in fsl_asrc_runtime_resume()