예제 #1
0
static irqreturn_t asrc_isr(int irq, void *dev_id)
{
	enum asrc_pair_index index;
	u32 status;

	regmap_read(asrc->regmap, REG_ASRSTR, &status);

	for (index = ASRC_PAIR_A; index < ASRC_PAIR_MAX_NUM; index++) {
		if (asrc->asrc_pair[index].active == 0)
			continue;
		if (status & ASRSTR_ATQOL)
			SET_OVERLOAD_ERR(index, ASRC_TASK_Q_OVERLOAD,
					"Task Queue FIFO overload");
		if (status & ASRSTR_AOOL(index))
			SET_OVERLOAD_ERR(index, ASRC_OUTPUT_TASK_OVERLOAD,
					"Output Task Overload");
		if (status & ASRSTR_AIOL(index))
			SET_OVERLOAD_ERR(index, ASRC_INPUT_TASK_OVERLOAD,
					"Input Task Overload");
		if (status & ASRSTR_AODO(index))
			SET_OVERLOAD_ERR(index, ASRC_OUTPUT_BUFFER_OVERFLOW,
					"Output Data Buffer has overflowed");
		if (status & ASRSTR_AIDU(index))
			SET_OVERLOAD_ERR(index, ASRC_INPUT_BUFFER_UNDERRUN,
					"Input Data Buffer has underflowed");
	}

	/* Clean overload error  */
	regmap_write(asrc->regmap, REG_ASRSTR, ASRSTR_AOLE);

	return IRQ_HANDLED;
}
예제 #2
0
/**
 * Interrupt handler for ASRC
 */
static irqreturn_t fsl_asrc_isr(int irq, void *dev_id)
{
	struct fsl_asrc *asrc_priv = (struct fsl_asrc *)dev_id;
	struct device *dev = &asrc_priv->pdev->dev;
	enum asrc_pair_index index;
	u32 status;

	regmap_read(asrc_priv->regmap, REG_ASRSTR, &status);

	/* Clean overload error */
	regmap_write(asrc_priv->regmap, REG_ASRSTR, ASRSTR_AOLE);

	/*
	 * We here use dev_dbg() for all exceptions because ASRC itself does
	 * not care if FIFO overflowed or underrun while a warning in the
	 * interrupt would result a ridged conversion.
	 */
	for (index = ASRC_PAIR_A; index < ASRC_PAIR_MAX_NUM; index++) {
		if (!asrc_priv->pair[index])
			continue;

		if (status & ASRSTR_ATQOL) {
			asrc_priv->pair[index]->error |= ASRC_TASK_Q_OVERLOAD;
			dev_dbg(dev, "ASRC Task Queue FIFO overload\n");
		}

		if (status & ASRSTR_AOOL(index)) {
			asrc_priv->pair[index]->error |= ASRC_OUTPUT_TASK_OVERLOAD;
			pair_dbg("Output Task Overload\n");
		}

		if (status & ASRSTR_AIOL(index)) {
			asrc_priv->pair[index]->error |= ASRC_INPUT_TASK_OVERLOAD;
			pair_dbg("Input Task Overload\n");
		}

		if (status & ASRSTR_AODO(index)) {
			asrc_priv->pair[index]->error |= ASRC_OUTPUT_BUFFER_OVERFLOW;
			pair_dbg("Output Data Buffer has overflowed\n");
		}

		if (status & ASRSTR_AIDU(index)) {
			asrc_priv->pair[index]->error |= ASRC_INPUT_BUFFER_UNDERRUN;
			pair_dbg("Input Data Buffer has underflowed\n");
		}
	}

	return IRQ_HANDLED;
}