video: tegra: Support for post power-on actions
Chao Jiang [Wed, 8 Dec 2010 09:57:20 +0000 (18:57 +0900)]
Add support for extra actions that have to be done after power on the
panel.

fixes bug 767252

Original-Change-Id: I68b0c4d03818c2722149fcba38b6eb222157d209
Reviewed-on: http://git-master/r/15766
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

Rebase-Id: R83157a78978ae41d265f8250a862a0158266c72b

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

index bd9afa5..75ce437 100644 (file)
@@ -91,6 +91,7 @@ struct tegra_dc_out {
        unsigned                n_out_pins;
 
        int     (*enable)(void);
+       int     (*postpoweron)(void);
        int     (*disable)(void);
 };
 
index 4f14482..457cac1 100644 (file)
@@ -742,7 +742,6 @@ void tegra_dc_setup_clk(struct tegra_dc *dc, struct clk *clk)
 
        pclk = tegra_dc_pclk_round_rate(dc, dc->mode.pclk);
        tegra_dvfs_set_rate(clk, pclk);
-
 }
 
 static int tegra_dc_program_mode(struct tegra_dc *dc, struct tegra_dc_mode *mode)
@@ -1135,6 +1134,9 @@ static bool _tegra_dc_enable(struct tegra_dc *dc)
        if (dc->mode.pclk == 0)
                return false;
 
+       if (!dc->out)
+               return false;
+
        tegra_dc_io_start(dc);
 
        if (dc->out && dc->out->enable)
@@ -1157,6 +1159,9 @@ static bool _tegra_dc_enable(struct tegra_dc *dc)
                tegra_dc_set_out_pin_polars(dc, dc->out->out_pins,
                                            dc->out->n_out_pins);
 
+       if (dc->out->postpoweron)
+               dc->out->postpoweron();
+
        /* force a full blending update */
        dc->blend.z[0] = -1;