Commit f34bd465 authored by Tomi Valkeinen's avatar Tomi Valkeinen

OMAP: DSS2: DSI: use ISR for BTA in framedone

Remove bta_callback from the interrupt handler, and use ISR support
instead.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent f36a06e7
...@@ -249,8 +249,6 @@ static struct ...@@ -249,8 +249,6 @@ static struct
unsigned pll_locked; unsigned pll_locked;
void (*bta_callback)(void);
spinlock_t irq_lock; spinlock_t irq_lock;
struct dsi_isr_tables isr_tables; struct dsi_isr_tables isr_tables;
/* space for a copy used by the interrupt handler */ /* space for a copy used by the interrupt handler */
...@@ -640,16 +638,6 @@ static irqreturn_t omap_dsi_irq_handler(int irq, void *arg) ...@@ -640,16 +638,6 @@ static irqreturn_t omap_dsi_irq_handler(int irq, void *arg)
del_timer(&dsi.te_timer); del_timer(&dsi.te_timer);
#endif #endif
for (i = 0; i < 4; ++i) {
if (vcstatus[i] == 0)
continue;
if (vcstatus[i] & DSI_VC_IRQ_BTA) {
if (dsi.bta_callback)
dsi.bta_callback();
}
}
/* make a copy and unlock, so that isrs can unregister /* make a copy and unlock, so that isrs can unregister
* themselves */ * themselves */
memcpy(&dsi.isr_tables_copy, &dsi.isr_tables, sizeof(dsi.isr_tables)); memcpy(&dsi.isr_tables_copy, &dsi.isr_tables, sizeof(dsi.isr_tables));
...@@ -923,26 +911,6 @@ static u32 dsi_get_errors(void) ...@@ -923,26 +911,6 @@ static u32 dsi_get_errors(void)
return e; return e;
} }
static void dsi_vc_enable_bta_irq(int channel)
{
u32 l;
dsi_write_reg(DSI_VC_IRQSTATUS(channel), DSI_VC_IRQ_BTA);
l = dsi_read_reg(DSI_VC_IRQENABLE(channel));
l |= DSI_VC_IRQ_BTA;
dsi_write_reg(DSI_VC_IRQENABLE(channel), l);
}
static void dsi_vc_disable_bta_irq(int channel)
{
u32 l;
l = dsi_read_reg(DSI_VC_IRQENABLE(channel));
l &= ~DSI_VC_IRQ_BTA;
dsi_write_reg(DSI_VC_IRQENABLE(channel), l);
}
/* DSI func clock. this could also be dsi_pll_hsdiv_dsi_clk */ /* DSI func clock. this could also be dsi_pll_hsdiv_dsi_clk */
static inline void enable_clocks(bool enable) static inline void enable_clocks(bool enable)
{ {
...@@ -3109,19 +3077,20 @@ static void dsi_te_timeout(unsigned long arg) ...@@ -3109,19 +3077,20 @@ static void dsi_te_timeout(unsigned long arg)
} }
#endif #endif
static void dsi_framedone_bta_callback(void *data, u32 mask);
static void dsi_handle_framedone(int error) static void dsi_handle_framedone(int error)
{ {
const int channel = dsi.update_channel; const int channel = dsi.update_channel;
cancel_delayed_work(&dsi.framedone_timeout_work); dsi_unregister_isr_vc(channel, dsi_framedone_bta_callback,
NULL, DSI_VC_IRQ_BTA);
dsi_vc_disable_bta_irq(channel); cancel_delayed_work(&dsi.framedone_timeout_work);
/* SIDLEMODE back to smart-idle */ /* SIDLEMODE back to smart-idle */
dispc_enable_sidle(); dispc_enable_sidle();
dsi.bta_callback = NULL;
if (dsi.te_enabled) { if (dsi.te_enabled) {
/* enable LP_RX_TO again after the TE */ /* enable LP_RX_TO again after the TE */
REG_FLD_MOD(DSI_TIMING2, 1, 15, 15); /* LP_RX_TO */ REG_FLD_MOD(DSI_TIMING2, 1, 15, 15); /* LP_RX_TO */
...@@ -3155,7 +3124,7 @@ static void dsi_framedone_timeout_work_callback(struct work_struct *work) ...@@ -3155,7 +3124,7 @@ static void dsi_framedone_timeout_work_callback(struct work_struct *work)
dsi_handle_framedone(-ETIMEDOUT); dsi_handle_framedone(-ETIMEDOUT);
} }
static void dsi_framedone_bta_callback(void) static void dsi_framedone_bta_callback(void *data, u32 mask)
{ {
dsi_handle_framedone(0); dsi_handle_framedone(0);
...@@ -3195,15 +3164,19 @@ static void dsi_framedone_irq_callback(void *data, u32 mask) ...@@ -3195,15 +3164,19 @@ static void dsi_framedone_irq_callback(void *data, u32 mask)
* asynchronously. * asynchronously.
* */ * */
dsi.bta_callback = dsi_framedone_bta_callback; r = dsi_register_isr_vc(channel, dsi_framedone_bta_callback,
NULL, DSI_VC_IRQ_BTA);
barrier(); if (r) {
DSSERR("Failed to register BTA ISR\n");
dsi_vc_enable_bta_irq(channel); dsi_handle_framedone(-EIO);
return;
}
r = dsi_vc_send_bta(channel); r = dsi_vc_send_bta(channel);
if (r) { if (r) {
DSSERR("BTA after framedone failed\n"); DSSERR("BTA after framedone failed\n");
dsi_unregister_isr_vc(channel, dsi_framedone_bta_callback,
NULL, DSI_VC_IRQ_BTA);
dsi_handle_framedone(-EIO); dsi_handle_framedone(-EIO);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment