Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 82a50195 authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Florian Tobias Schandinat
Browse files

video: exynos mipi dsi: Properly interpret the interrupt source flags



Rework the interrupt handler so the RX_DONE, FIFO_EMPTY interrupts are
properly detected. This prevents missing the interrupts when there are
other bits set in the INTSRC register than just RX_DONE and FIFO_EMPTY.

Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarDonghwa Lee <dh09.lee@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
parent b89e1399
Loading
Loading
Loading
Loading
+10 −18
Original line number Original line Diff line number Diff line
@@ -76,33 +76,25 @@ static unsigned int dpll_table[15] = {


irqreturn_t exynos_mipi_dsi_interrupt_handler(int irq, void *dev_id)
irqreturn_t exynos_mipi_dsi_interrupt_handler(int irq, void *dev_id)
{
{
	unsigned int intsrc = 0;
	struct mipi_dsim_device *dsim = dev_id;
	unsigned int intmsk = 0;
	unsigned int intsrc, intmsk;
	struct mipi_dsim_device *dsim = NULL;


	if (dsim == NULL) {
	dsim = dev_id;
		dev_err(dsim->dev, "%s: wrong parameter\n", __func__);
	if (!dsim) {
		return IRQ_NONE;
		dev_dbg(dsim->dev, KERN_ERR "%s:error: wrong parameter\n",
							__func__);
		return IRQ_HANDLED;
	}
	}


	intsrc = exynos_mipi_dsi_read_interrupt(dsim);
	intsrc = exynos_mipi_dsi_read_interrupt(dsim);
	intmsk = exynos_mipi_dsi_read_interrupt_mask(dsim);
	intmsk = exynos_mipi_dsi_read_interrupt_mask(dsim);
	intmsk = ~intmsk & intsrc;


	intmsk = ~(intmsk) & intsrc;
	if (intsrc & INTMSK_RX_DONE) {

	switch (intmsk) {
	case INTMSK_RX_DONE:
		complete(&dsim_rd_comp);
		complete(&dsim_rd_comp);
		dev_dbg(dsim->dev, "MIPI INTMSK_RX_DONE\n");
		dev_dbg(dsim->dev, "MIPI INTMSK_RX_DONE\n");
		break;
	}
	case INTMSK_FIFO_EMPTY:
	if (intsrc & INTMSK_FIFO_EMPTY) {
		complete(&dsim_wr_comp);
		complete(&dsim_wr_comp);
		dev_dbg(dsim->dev, "MIPI INTMSK_FIFO_EMPTY\n");
		dev_dbg(dsim->dev, "MIPI INTMSK_FIFO_EMPTY\n");
		break;
	default:
		break;
	}
	}


	exynos_mipi_dsi_clear_interrupt(dsim, intmsk);
	exynos_mipi_dsi_clear_interrupt(dsim, intmsk);