aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-03-02 07:52:48 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-03-15 04:54:19 -0400
commitf34bd465cae57bcce11fb7f953cfcbb18222b99e (patch)
tree5fea976d577ffd654bad71ec3bc3d05f798ee43b
parentf36a06e702ef804a99ce3a286514d84610a74db5 (diff)
OMAP: DSS2: DSI: use ISR for BTA in framedone
Remove bta_callback from the interrupt handler, and use ISR support instead. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/omap2/dss/dsi.c57
1 files changed, 15 insertions, 42 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 18b72521ee7e..cd872e9d7989 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -249,8 +249,6 @@ static struct
249 249
250 unsigned pll_locked; 250 unsigned pll_locked;
251 251
252 void (*bta_callback)(void);
253
254 spinlock_t irq_lock; 252 spinlock_t irq_lock;
255 struct dsi_isr_tables isr_tables; 253 struct dsi_isr_tables isr_tables;
256 /* space for a copy used by the interrupt handler */ 254 /* 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 del_timer(&dsi.te_timer); 638 del_timer(&dsi.te_timer);
641#endif 639#endif
642 640
643 for (i = 0; i < 4; ++i) {
644 if (vcstatus[i] == 0)
645 continue;
646
647 if (vcstatus[i] & DSI_VC_IRQ_BTA) {
648 if (dsi.bta_callback)
649 dsi.bta_callback();
650 }
651 }
652
653 /* make a copy and unlock, so that isrs can unregister 641 /* make a copy and unlock, so that isrs can unregister
654 * themselves */ 642 * themselves */
655 memcpy(&dsi.isr_tables_copy, &dsi.isr_tables, sizeof(dsi.isr_tables)); 643 memcpy(&dsi.isr_tables_copy, &dsi.isr_tables, sizeof(dsi.isr_tables));
@@ -923,26 +911,6 @@ static u32 dsi_get_errors(void)
923 return e; 911 return e;
924} 912}
925 913
926static void dsi_vc_enable_bta_irq(int channel)
927{
928 u32 l;
929
930 dsi_write_reg(DSI_VC_IRQSTATUS(channel), DSI_VC_IRQ_BTA);
931
932 l = dsi_read_reg(DSI_VC_IRQENABLE(channel));
933 l |= DSI_VC_IRQ_BTA;
934 dsi_write_reg(DSI_VC_IRQENABLE(channel), l);
935}
936
937static void dsi_vc_disable_bta_irq(int channel)
938{
939 u32 l;
940
941 l = dsi_read_reg(DSI_VC_IRQENABLE(channel));
942 l &= ~DSI_VC_IRQ_BTA;
943 dsi_write_reg(DSI_VC_IRQENABLE(channel), l);
944}
945
946/* DSI func clock. this could also be dsi_pll_hsdiv_dsi_clk */ 914/* DSI func clock. this could also be dsi_pll_hsdiv_dsi_clk */
947static inline void enable_clocks(bool enable) 915static inline void enable_clocks(bool enable)
948{ 916{
@@ -3109,19 +3077,20 @@ static void dsi_te_timeout(unsigned long arg)
3109} 3077}
3110#endif 3078#endif
3111 3079
3080static void dsi_framedone_bta_callback(void *data, u32 mask);
3081
3112static void dsi_handle_framedone(int error) 3082static void dsi_handle_framedone(int error)
3113{ 3083{
3114 const int channel = dsi.update_channel; 3084 const int channel = dsi.update_channel;
3115 3085
3116 cancel_delayed_work(&dsi.framedone_timeout_work); 3086 dsi_unregister_isr_vc(channel, dsi_framedone_bta_callback,
3087 NULL, DSI_VC_IRQ_BTA);
3117 3088
3118 dsi_vc_disable_bta_irq(channel); 3089 cancel_delayed_work(&dsi.framedone_timeout_work);
3119 3090
3120 /* SIDLEMODE back to smart-idle */ 3091 /* SIDLEMODE back to smart-idle */
3121 dispc_enable_sidle(); 3092 dispc_enable_sidle();
3122 3093
3123 dsi.bta_callback = NULL;
3124
3125 if (dsi.te_enabled) { 3094 if (dsi.te_enabled) {
3126 /* enable LP_RX_TO again after the TE */ 3095 /* enable LP_RX_TO again after the TE */
3127 REG_FLD_MOD(DSI_TIMING2, 1, 15, 15); /* LP_RX_TO */ 3096 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 dsi_handle_framedone(-ETIMEDOUT); 3124 dsi_handle_framedone(-ETIMEDOUT);
3156} 3125}
3157 3126
3158static void dsi_framedone_bta_callback(void) 3127static void dsi_framedone_bta_callback(void *data, u32 mask)
3159{ 3128{
3160 dsi_handle_framedone(0); 3129 dsi_handle_framedone(0);
3161 3130
@@ -3195,15 +3164,19 @@ static void dsi_framedone_irq_callback(void *data, u32 mask)
3195 * asynchronously. 3164 * asynchronously.
3196 * */ 3165 * */
3197 3166
3198 dsi.bta_callback = dsi_framedone_bta_callback; 3167 r = dsi_register_isr_vc(channel, dsi_framedone_bta_callback,
3199 3168 NULL, DSI_VC_IRQ_BTA);
3200 barrier(); 3169 if (r) {
3201 3170 DSSERR("Failed to register BTA ISR\n");
3202 dsi_vc_enable_bta_irq(channel); 3171 dsi_handle_framedone(-EIO);
3172 return;
3173 }
3203 3174
3204 r = dsi_vc_send_bta(channel); 3175 r = dsi_vc_send_bta(channel);
3205 if (r) { 3176 if (r) {
3206 DSSERR("BTA after framedone failed\n"); 3177 DSSERR("BTA after framedone failed\n");
3178 dsi_unregister_isr_vc(channel, dsi_framedone_bta_callback,
3179 NULL, DSI_VC_IRQ_BTA);
3207 dsi_handle_framedone(-EIO); 3180 dsi_handle_framedone(-EIO);
3208 } 3181 }
3209} 3182}