video: tegra: add init/suspend/resume hooks to outputs
Erik Gilling [Thu, 12 Aug 2010 01:52:50 +0000 (18:52 -0700)]
Allows board specific code to handle panel init.

Signed-off-by: Erik Gilling <konkers@android.com>

arch/arm/mach-tegra/include/mach/dc.h
drivers/video/tegra/dc/dc.c

index b8a0e7a..ae610e5 100644 (file)
@@ -62,6 +62,10 @@ struct tegra_dc_out {
 
        struct tegra_dc_mode    *modes;
        int                     n_modes;
+
+       int     (*init)(void);
+       int     (*suspend)(pm_message_t state);
+       int     (*resume)(void);
 };
 
 #define TEGRA_DC_ALIGN_MSB             0
index 261bced..9c5caeb 100644 (file)
@@ -747,6 +747,8 @@ static int tegra_dc_probe(struct platform_device *pdev)
        }
 
        tegra_dc_init(dc);
+       if (dc->out && dc->out->init)
+               dc->out->init();
 
        tegra_dc_set_blending(dc, tegra_dc_blend_modes[0]);
 
@@ -812,6 +814,9 @@ static int tegra_dc_suspend(struct platform_device *pdev, pm_message_t state)
 
        dev_info(&pdev->dev, "suspend\n");
 
+       if (dc->out && dc->out->suspend)
+               dc->out->suspend(state);
+
        disable_irq(dc->irq);
        tegra_periph_reset_assert(dc->clk);
        clk_disable(dc->clk);
@@ -835,6 +840,8 @@ static int tegra_dc_resume(struct platform_device *pdev)
                wins[i] = &dc->windows[i];
 
        tegra_dc_init(dc);
+       if (dc->out && dc->out->resume)
+               dc->out->resume();
 
        tegra_dc_set_blending(dc, tegra_dc_blend_modes[0]);
        tegra_dc_update_windows(wins, dc->n_windows);