diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2014-03-08 18:19:43 +0100 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2014-03-08 18:51:53 +0100 |
commit | b0940b1dd388a3d7b8d50da329b84e8f65717b9a (patch) | |
tree | 7c582e811c1216b7eab95f8500991ef836726066 | |
parent | 61d0583384b81de28498544ea3ec2e5c8eba42be (diff) |
imx233: add lcdif underflow irq support
Change-Id: Ie3fe223ff40abff38bb9b09f398eb5411fa0be4c
-rw-r--r-- | firmware/target/arm/imx233/lcdif-imx233.c | 21 | ||||
-rw-r--r-- | firmware/target/arm/imx233/lcdif-imx233.h | 2 |
2 files changed, 23 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/lcdif-imx233.c b/firmware/target/arm/imx233/lcdif-imx233.c index ea4fcf8a63..01c7ec71e4 100644 --- a/firmware/target/arm/imx233/lcdif-imx233.c +++ b/firmware/target/arm/imx233/lcdif-imx233.c @@ -25,6 +25,7 @@ #if IMX233_SUBTARGET >= 3700 static lcdif_irq_cb_t g_cur_frame_cb = NULL; static lcdif_irq_cb_t g_vsync_edge_cb = NULL; +static lcdif_irq_cb_t g_underflow_cb = NULL; #endif /* for some crazy reason, all "non-dma" interrupts are routed to the ERROR irq */ @@ -43,6 +44,12 @@ void INT_LCDIF_ERROR(void) g_vsync_edge_cb(); BF_CLR(LCDIF_CTRL1, VSYNC_EDGE_IRQ); } + if(BF_RD(LCDIF_CTRL1, UNDERFLOW_IRQ)) + { + if(g_underflow_cb) + g_underflow_cb(); + BF_CLR(LCDIF_CTRL1, UNDERFLOW_IRQ); + } } #endif @@ -341,6 +348,20 @@ void imx233_lcdif_set_vsync_edge_cb(lcdif_irq_cb_t cb) { g_vsync_edge_cb = cb; } + +void imx233_lcdif_enable_underflow_irq(bool en) +{ + if(en) + BF_SET(LCDIF_CTRL1, UNDERFLOW_IRQ_EN); + else + BF_CLR(LCDIF_CTRL1, UNDERFLOW_IRQ_EN); + BF_CLR(LCDIF_CTRL1, UNDERFLOW_IRQ); +} + +void imx233_lcdif_set_underflow_cb(lcdif_irq_cb_t cb) +{ + g_underflow_cb = cb; +} #endif #if IMX233_SUBTARGET >= 3780 diff --git a/firmware/target/arm/imx233/lcdif-imx233.h b/firmware/target/arm/imx233/lcdif-imx233.h index 3554c86e06..b45830f3d3 100644 --- a/firmware/target/arm/imx233/lcdif-imx233.h +++ b/firmware/target/arm/imx233/lcdif-imx233.h @@ -65,6 +65,8 @@ void imx233_lcdif_enable_frame_done_irq(bool en); void imx233_lcdif_set_frame_done_cb(lcdif_irq_cb_t cb); void imx233_lcdif_enable_vsync_edge_irq(bool en); void imx233_lcdif_set_vsync_edge_cb(lcdif_irq_cb_t cb); +void imx233_lcdif_enable_underflow_irq(bool en); +void imx233_lcdif_set_underflow_cb(lcdif_irq_cb_t cb); void imx233_lcdif_enable_sync_signals(bool en); #endif |