aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2011-09-11 12:27:50 -0400
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-03-12 17:40:46 -0400
commitd2c594a014563175b54115d1a73b607aaeb650ec (patch)
treebcb550373fe5265b522329027d106645cd8e0bad
parenta1022adbdff45c76dea27f89cdb3d77e76b75620 (diff)
fbdev: sh_mipi_dsi: Don't hook up into board_cfg display operations
The display_on/off operations are now accessed through the sh_mobile_lcdc_entity operations. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--drivers/video/sh_mipi_dsi.c56
1 files changed, 5 insertions, 51 deletions
diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
index 58744fee230e..ad09a05afd5f 100644
--- a/drivers/video/sh_mipi_dsi.c
+++ b/drivers/video/sh_mipi_dsi.c
@@ -58,10 +58,6 @@ struct sh_mipi {
58 void __iomem *linkbase; 58 void __iomem *linkbase;
59 struct clk *dsit_clk; 59 struct clk *dsit_clk;
60 struct platform_device *pdev; 60 struct platform_device *pdev;
61
62 void *next_board_data;
63 void (*next_display_on)(void *board_data, struct fb_info *info);
64 void (*next_display_off)(void *board_data);
65}; 61};
66 62
67#define to_sh_mipi(e) container_of(e, struct sh_mipi, entity) 63#define to_sh_mipi(e) container_of(e, struct sh_mipi, entity)
@@ -398,8 +394,8 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
398 return 0; 394 return 0;
399} 395}
400 396
401static int __mipi_display_on(struct sh_mobile_lcdc_entity *entity, 397static int mipi_display_on(struct sh_mobile_lcdc_entity *entity,
402 struct fb_info *info) 398 struct fb_info *info)
403{ 399{
404 struct sh_mipi *mipi = to_sh_mipi(entity); 400 struct sh_mipi *mipi = to_sh_mipi(entity);
405 struct sh_mipi_dsi_info *pdata = mipi->pdev->dev.platform_data; 401 struct sh_mipi_dsi_info *pdata = mipi->pdev->dev.platform_data;
@@ -427,21 +423,7 @@ mipi_display_on_fail2:
427 return ret; 423 return ret;
428} 424}
429 425
430static void mipi_display_on(void *arg, struct fb_info *info) 426static void mipi_display_off(struct sh_mobile_lcdc_entity *entity)
431{
432 struct sh_mobile_lcdc_entity *entity = arg;
433 struct sh_mipi *mipi = to_sh_mipi(entity);
434 int ret;
435
436 ret = __mipi_display_on(entity, info);
437 if (ret < 0)
438 return;
439
440 if (mipi->next_display_on)
441 mipi->next_display_on(mipi->next_board_data, info);
442}
443
444static void __mipi_display_off(struct sh_mobile_lcdc_entity *entity)
445{ 427{
446 struct sh_mipi *mipi = to_sh_mipi(entity); 428 struct sh_mipi *mipi = to_sh_mipi(entity);
447 struct sh_mipi_dsi_info *pdata = mipi->pdev->dev.platform_data; 429 struct sh_mipi_dsi_info *pdata = mipi->pdev->dev.platform_data;
@@ -453,20 +435,9 @@ static void __mipi_display_off(struct sh_mobile_lcdc_entity *entity)
453 pm_runtime_put_sync(&mipi->pdev->dev); 435 pm_runtime_put_sync(&mipi->pdev->dev);
454} 436}
455 437
456static void mipi_display_off(void *arg)
457{
458 struct sh_mobile_lcdc_entity *entity = arg;
459 struct sh_mipi *mipi = to_sh_mipi(entity);
460
461 if (mipi->next_display_off)
462 mipi->next_display_off(mipi->next_board_data);
463
464 __mipi_display_off(entity);
465}
466
467static const struct sh_mobile_lcdc_entity_ops mipi_ops = { 438static const struct sh_mobile_lcdc_entity_ops mipi_ops = {
468 .display_on = __mipi_display_on, 439 .display_on = mipi_display_on,
469 .display_off = __mipi_display_off, 440 .display_off = mipi_display_off,
470}; 441};
471 442
472static int __init sh_mipi_probe(struct platform_device *pdev) 443static int __init sh_mipi_probe(struct platform_device *pdev)
@@ -559,17 +530,6 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
559 mutex_unlock(&array_lock); 530 mutex_unlock(&array_lock);
560 platform_set_drvdata(pdev, &mipi->entity); 531 platform_set_drvdata(pdev, &mipi->entity);
561 532
562 /* Save original LCDC callbacks */
563 mipi->next_board_data = pdata->lcd_chan->board_cfg.board_data;
564 mipi->next_display_on = pdata->lcd_chan->board_cfg.display_on;
565 mipi->next_display_off = pdata->lcd_chan->board_cfg.display_off;
566
567 /* Set up LCDC callbacks */
568 pdata->lcd_chan->board_cfg.board_data = &mipi->entity;
569 pdata->lcd_chan->board_cfg.display_on = mipi_display_on;
570 pdata->lcd_chan->board_cfg.display_off = mipi_display_off;
571 pdata->lcd_chan->board_cfg.owner = THIS_MODULE;
572
573 return 0; 533 return 0;
574 534
575eclkton: 535eclkton:
@@ -594,7 +554,6 @@ efindslot:
594 554
595static int __exit sh_mipi_remove(struct platform_device *pdev) 555static int __exit sh_mipi_remove(struct platform_device *pdev)
596{ 556{
597 struct sh_mipi_dsi_info *pdata = pdev->dev.platform_data;
598 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 557 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
599 struct resource *res2 = platform_get_resource(pdev, IORESOURCE_MEM, 1); 558 struct resource *res2 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
600 struct sh_mipi *mipi = to_sh_mipi(platform_get_drvdata(pdev)); 559 struct sh_mipi *mipi = to_sh_mipi(platform_get_drvdata(pdev));
@@ -617,11 +576,6 @@ static int __exit sh_mipi_remove(struct platform_device *pdev)
617 if (ret < 0) 576 if (ret < 0)
618 return ret; 577 return ret;
619 578
620 pdata->lcd_chan->board_cfg.owner = NULL;
621 pdata->lcd_chan->board_cfg.display_on = NULL;
622 pdata->lcd_chan->board_cfg.display_off = NULL;
623 pdata->lcd_chan->board_cfg.board_data = NULL;
624
625 pm_runtime_disable(&pdev->dev); 579 pm_runtime_disable(&pdev->dev);
626 clk_disable(mipi->dsit_clk); 580 clk_disable(mipi->dsit_clk);
627 clk_put(mipi->dsit_clk); 581 clk_put(mipi->dsit_clk);