aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/dsi.c43
1 files changed, 25 insertions, 18 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 61ee3dbd548..762b0fe1dc1 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -330,6 +330,11 @@ struct dsi_data {
330 unsigned scp_clk_refcount; 330 unsigned scp_clk_refcount;
331}; 331};
332 332
333struct dsi_packet_sent_handler_data {
334 struct platform_device *dsidev;
335 struct completion *completion;
336};
337
333static struct platform_device *dsi_pdev_map[MAX_NUM_DSI]; 338static struct platform_device *dsi_pdev_map[MAX_NUM_DSI];
334 339
335#ifdef DEBUG 340#ifdef DEBUG
@@ -2394,27 +2399,28 @@ static bool dsi_vc_is_enabled(struct platform_device *dsidev, int channel)
2394 2399
2395static void dsi_packet_sent_handler_vp(void *data, u32 mask) 2400static void dsi_packet_sent_handler_vp(void *data, u32 mask)
2396{ 2401{
2397 struct platform_device *dsidev = dsi_get_dsidev_from_id(0); 2402 struct dsi_packet_sent_handler_data *vp_data =
2398 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 2403 (struct dsi_packet_sent_handler_data *) data;
2404 struct dsi_data *dsi = dsi_get_dsidrv_data(vp_data->dsidev);
2399 const int channel = dsi->update_channel; 2405 const int channel = dsi->update_channel;
2400 u8 bit = dsi->te_enabled ? 30 : 31; 2406 u8 bit = dsi->te_enabled ? 30 : 31;
2401 2407
2402 if (REG_GET(dsidev, DSI_VC_TE(channel), bit, bit) == 0) 2408 if (REG_GET(vp_data->dsidev, DSI_VC_TE(channel), bit, bit) == 0)
2403 complete((struct completion *)data); 2409 complete(vp_data->completion);
2404} 2410}
2405 2411
2406static int dsi_sync_vc_vp(struct platform_device *dsidev, int channel) 2412static int dsi_sync_vc_vp(struct platform_device *dsidev, int channel)
2407{ 2413{
2408 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 2414 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
2415 DECLARE_COMPLETION_ONSTACK(completion);
2416 struct dsi_packet_sent_handler_data vp_data = { dsidev, &completion };
2409 int r = 0; 2417 int r = 0;
2410 u8 bit; 2418 u8 bit;
2411 2419
2412 DECLARE_COMPLETION_ONSTACK(completion);
2413
2414 bit = dsi->te_enabled ? 30 : 31; 2420 bit = dsi->te_enabled ? 30 : 31;
2415 2421
2416 r = dsi_register_isr_vc(dsidev, channel, dsi_packet_sent_handler_vp, 2422 r = dsi_register_isr_vc(dsidev, channel, dsi_packet_sent_handler_vp,
2417 &completion, DSI_VC_IRQ_PACKET_SENT); 2423 &vp_data, DSI_VC_IRQ_PACKET_SENT);
2418 if (r) 2424 if (r)
2419 goto err0; 2425 goto err0;
2420 2426
@@ -2429,34 +2435,35 @@ static int dsi_sync_vc_vp(struct platform_device *dsidev, int channel)
2429 } 2435 }
2430 2436
2431 dsi_unregister_isr_vc(dsidev, channel, dsi_packet_sent_handler_vp, 2437 dsi_unregister_isr_vc(dsidev, channel, dsi_packet_sent_handler_vp,
2432 &completion, DSI_VC_IRQ_PACKET_SENT); 2438 &vp_data, DSI_VC_IRQ_PACKET_SENT);
2433 2439
2434 return 0; 2440 return 0;
2435err1: 2441err1:
2436 dsi_unregister_isr_vc(dsidev, channel, dsi_packet_sent_handler_vp, 2442 dsi_unregister_isr_vc(dsidev, channel, dsi_packet_sent_handler_vp,
2437 &completion, DSI_VC_IRQ_PACKET_SENT); 2443 &vp_data, DSI_VC_IRQ_PACKET_SENT);
2438err0: 2444err0:
2439 return r; 2445 return r;
2440} 2446}
2441 2447
2442static void dsi_packet_sent_handler_l4(void *data, u32 mask) 2448static void dsi_packet_sent_handler_l4(void *data, u32 mask)
2443{ 2449{
2444 struct platform_device *dsidev = dsi_get_dsidev_from_id(0); 2450 struct dsi_packet_sent_handler_data *l4_data =
2445 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 2451 (struct dsi_packet_sent_handler_data *) data;
2452 struct dsi_data *dsi = dsi_get_dsidrv_data(l4_data->dsidev);
2446 const int channel = dsi->update_channel; 2453 const int channel = dsi->update_channel;
2447 2454
2448 if (REG_GET(dsidev, DSI_VC_CTRL(channel), 5, 5) == 0) 2455 if (REG_GET(l4_data->dsidev, DSI_VC_CTRL(channel), 5, 5) == 0)
2449 complete((struct completion *)data); 2456 complete(l4_data->completion);
2450} 2457}
2451 2458
2452static int dsi_sync_vc_l4(struct platform_device *dsidev, int channel) 2459static int dsi_sync_vc_l4(struct platform_device *dsidev, int channel)
2453{ 2460{
2454 int r = 0;
2455
2456 DECLARE_COMPLETION_ONSTACK(completion); 2461 DECLARE_COMPLETION_ONSTACK(completion);
2462 struct dsi_packet_sent_handler_data l4_data = { dsidev, &completion };
2463 int r = 0;
2457 2464
2458 r = dsi_register_isr_vc(dsidev, channel, dsi_packet_sent_handler_l4, 2465 r = dsi_register_isr_vc(dsidev, channel, dsi_packet_sent_handler_l4,
2459 &completion, DSI_VC_IRQ_PACKET_SENT); 2466 &l4_data, DSI_VC_IRQ_PACKET_SENT);
2460 if (r) 2467 if (r)
2461 goto err0; 2468 goto err0;
2462 2469
@@ -2471,12 +2478,12 @@ static int dsi_sync_vc_l4(struct platform_device *dsidev, int channel)
2471 } 2478 }
2472 2479
2473 dsi_unregister_isr_vc(dsidev, channel, dsi_packet_sent_handler_l4, 2480 dsi_unregister_isr_vc(dsidev, channel, dsi_packet_sent_handler_l4,
2474 &completion, DSI_VC_IRQ_PACKET_SENT); 2481 &l4_data, DSI_VC_IRQ_PACKET_SENT);
2475 2482
2476 return 0; 2483 return 0;
2477err1: 2484err1:
2478 dsi_unregister_isr_vc(dsidev, channel, dsi_packet_sent_handler_l4, 2485 dsi_unregister_isr_vc(dsidev, channel, dsi_packet_sent_handler_l4,
2479 &completion, DSI_VC_IRQ_PACKET_SENT); 2486 &l4_data, DSI_VC_IRQ_PACKET_SENT);
2480err0: 2487err0:
2481 return r; 2488 return r;
2482} 2489}