diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2011-09-11 16:59:04 -0400 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-03-12 17:40:45 -0400 |
commit | 9a2985e7f943678154f5761dad753f1987c2fdd0 (patch) | |
tree | d0c767e82624c283526d35b5dd786149cf5bdc7e /drivers/video/sh_mobile_lcdcfb.c | |
parent | 732bbcc46c31dea5bb6dd27de331d8767e9e8530 (diff) |
fbdev: sh_mobile_lcdc: Handle HDMI/MIPI transmitter device directly
Pass a pointer to the transmitter device through platform data, retrieve
the corresponding sh_mobile_lcdc_entity structure in the probe method
and call the transmitter display_on/off methods directly.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers/video/sh_mobile_lcdcfb.c')
-rw-r--r-- | drivers/video/sh_mobile_lcdcfb.c | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index bd725a421921..a2e0903466b3 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c | |||
@@ -339,6 +339,11 @@ static void sh_mobile_lcdc_display_on(struct sh_mobile_lcdc_chan *ch) | |||
339 | { | 339 | { |
340 | struct sh_mobile_lcdc_board_cfg *board_cfg = &ch->cfg.board_cfg; | 340 | struct sh_mobile_lcdc_board_cfg *board_cfg = &ch->cfg.board_cfg; |
341 | 341 | ||
342 | if (ch->tx_dev) { | ||
343 | if (ch->tx_dev->ops->display_on(ch->tx_dev, ch->info) < 0) | ||
344 | return; | ||
345 | } | ||
346 | |||
342 | /* HDMI must be enabled before LCDC configuration */ | 347 | /* HDMI must be enabled before LCDC configuration */ |
343 | if (board_cfg->display_on && try_module_get(board_cfg->owner)) { | 348 | if (board_cfg->display_on && try_module_get(board_cfg->owner)) { |
344 | board_cfg->display_on(board_cfg->board_data, ch->info); | 349 | board_cfg->display_on(board_cfg->board_data, ch->info); |
@@ -354,6 +359,9 @@ static void sh_mobile_lcdc_display_off(struct sh_mobile_lcdc_chan *ch) | |||
354 | board_cfg->display_off(board_cfg->board_data); | 359 | board_cfg->display_off(board_cfg->board_data); |
355 | module_put(board_cfg->owner); | 360 | module_put(board_cfg->owner); |
356 | } | 361 | } |
362 | |||
363 | if (ch->tx_dev) | ||
364 | ch->tx_dev->ops->display_off(ch->tx_dev); | ||
357 | } | 365 | } |
358 | 366 | ||
359 | /* ----------------------------------------------------------------------------- | 367 | /* ----------------------------------------------------------------------------- |
@@ -1490,18 +1498,21 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev) | |||
1490 | sh_mobile_lcdc_stop(priv); | 1498 | sh_mobile_lcdc_stop(priv); |
1491 | 1499 | ||
1492 | for (i = 0; i < ARRAY_SIZE(priv->ch); i++) { | 1500 | for (i = 0; i < ARRAY_SIZE(priv->ch); i++) { |
1493 | info = priv->ch[i].info; | 1501 | struct sh_mobile_lcdc_chan *ch = &priv->ch[i]; |
1494 | 1502 | ||
1503 | info = ch->info; | ||
1495 | if (!info || !info->device) | 1504 | if (!info || !info->device) |
1496 | continue; | 1505 | continue; |
1497 | 1506 | ||
1498 | if (priv->ch[i].sglist) | 1507 | if (ch->tx_dev) |
1499 | vfree(priv->ch[i].sglist); | 1508 | module_put(ch->cfg.tx_dev->dev.driver->owner); |
1509 | |||
1510 | if (ch->sglist) | ||
1511 | vfree(ch->sglist); | ||
1500 | 1512 | ||
1501 | if (info->screen_base) | 1513 | if (info->screen_base) |
1502 | dma_free_coherent(&pdev->dev, info->fix.smem_len, | 1514 | dma_free_coherent(&pdev->dev, info->fix.smem_len, |
1503 | info->screen_base, | 1515 | info->screen_base, ch->dma_handle); |
1504 | priv->ch[i].dma_handle); | ||
1505 | fb_dealloc_cmap(&info->cmap); | 1516 | fb_dealloc_cmap(&info->cmap); |
1506 | framebuffer_release(info); | 1517 | framebuffer_release(info); |
1507 | } | 1518 | } |
@@ -1595,6 +1606,16 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv, | |||
1595 | info->pseudo_palette = &ch->pseudo_palette; | 1606 | info->pseudo_palette = &ch->pseudo_palette; |
1596 | info->flags = FBINFO_FLAG_DEFAULT; | 1607 | info->flags = FBINFO_FLAG_DEFAULT; |
1597 | 1608 | ||
1609 | if (cfg->tx_dev) { | ||
1610 | if (!cfg->tx_dev->dev.driver || | ||
1611 | !try_module_get(cfg->tx_dev->dev.driver->owner)) { | ||
1612 | dev_warn(priv->dev, | ||
1613 | "unable to get transmitter device\n"); | ||
1614 | return -EINVAL; | ||
1615 | } | ||
1616 | ch->tx_dev = platform_get_drvdata(cfg->tx_dev); | ||
1617 | } | ||
1618 | |||
1598 | /* Iterate through the modes to validate them and find the highest | 1619 | /* Iterate through the modes to validate them and find the highest |
1599 | * resolution. | 1620 | * resolution. |
1600 | */ | 1621 | */ |