diff options
author | Archit Taneja <archit@ti.com> | 2011-05-12 07:56:28 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-05-12 12:30:26 -0400 |
commit | 2e868dbe1d24a908fcb4dee0733500fd0aab0bce (patch) | |
tree | 229488d1c07a65651b65d9026758e7571b2aea86 /drivers | |
parent | f1da39d9ce8490c5652768180454a816eb043b48 (diff) |
OMAP: DSS2: DSI: Pass pointer to struct to packet_sent_handler isrs
dsi_packet_sent_handler_vp() and dsi_packet_sent_handler_l4() currently
receive the completion parameter as their argument. This is not sufficient
information to differentiate between DSI1 and DSI2 platform devices.
Pass the struct "dsi_packet_sent_handler_data" to the packet_sent_handler
isrs, these contain the platform_device pointer of the DSI device and the
pointer to the completion struct.
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/omap2/dss/dsi.c | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 61ee3dbd5486..762b0fe1dc19 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 | ||
333 | struct dsi_packet_sent_handler_data { | ||
334 | struct platform_device *dsidev; | ||
335 | struct completion *completion; | ||
336 | }; | ||
337 | |||
333 | static struct platform_device *dsi_pdev_map[MAX_NUM_DSI]; | 338 | static 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 | ||
2395 | static void dsi_packet_sent_handler_vp(void *data, u32 mask) | 2400 | static 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 | ||
2406 | static int dsi_sync_vc_vp(struct platform_device *dsidev, int channel) | 2412 | static 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; |
2435 | err1: | 2441 | err1: |
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); |
2438 | err0: | 2444 | err0: |
2439 | return r; | 2445 | return r; |
2440 | } | 2446 | } |
2441 | 2447 | ||
2442 | static void dsi_packet_sent_handler_l4(void *data, u32 mask) | 2448 | static 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 | ||
2452 | static int dsi_sync_vc_l4(struct platform_device *dsidev, int channel) | 2459 | static 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; |
2477 | err1: | 2484 | err1: |
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); |
2480 | err0: | 2487 | err0: |
2481 | return r; | 2488 | return r; |
2482 | } | 2489 | } |