video: tegra: dsi: Convert TE gpio to spio
Animesh Kishore [Fri, 23 Aug 2013 10:10:57 +0000 (15:10 +0530)]
- TE pin should always be spio
- Remove one-shot hacks

Bug 1232203

Change-Id: Ie19cb6ec4e1bd0768338b1e6fe24005fc4b24e50
Signed-off-by: Animesh Kishore <ankishore@nvidia.com>
Signed-off-by: Vineel Kumar Reddy Kovvuri <vineelkumarr@nvidia.com>
Reviewed-on: http://git-master/r/199456
(cherry picked from commit 7f2f7d7c20d8084cd39173efeeb6101f5f9ed68f)
Reviewed-on: http://git-master/r/265491
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit

drivers/video/tegra/dc/dsi.c

index bb909e3..0b430e4 100644 (file)
@@ -1819,6 +1819,20 @@ static void tegra_dsi_stop_dc_stream_at_frame_end(struct tegra_dc *dc,
        tegra_dsi_reset_underflow_overflow(dsi);
 }
 
+static void tegra_dc_gpio_to_spio(struct tegra_dc_dsi_data *dsi, unsigned gpio)
+{
+       int err;
+
+       /* convert to spio */
+       err = gpio_request(gpio, "temp_request");
+       if (err < 0) {
+               dev_err(&dsi->dc->ndev->dev,
+                       "dsi: %s: gpio request failed %d\n", __func__, err);
+               return;
+       }
+       gpio_free(gpio);
+}
+
 static void tegra_dsi_start_dc_stream(struct tegra_dc *dc,
                                        struct tegra_dc_dsi_data *dsi)
 {
@@ -1854,6 +1868,9 @@ static void tegra_dsi_start_dc_stream(struct tegra_dc *dc,
                tegra_dc_writel(dc, GENERAL_UPDATE, DC_CMD_STATE_CONTROL);
                tegra_dc_writel(dc, GENERAL_ACT_REQ | NC_HOST_TRIG,
                                                DC_CMD_STATE_CONTROL);
+
+               if (dsi->info.te_gpio)
+                       tegra_dc_gpio_to_spio(dsi, dsi->info.te_gpio);
        } else {
                /* set continuous mode */
                tegra_dc_writel(dc, DISP_CTRL_MODE_C_DISPLAY,