]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
drivers: media: camera: Hotplug fixes
authorBhanu Murthy V <bmurthyv@nvidia.com>
Wed, 13 Apr 2016 19:47:40 +0000 (12:47 -0700)
committerWenjia Zhou <wenjiaz@nvidia.com>
Wed, 27 Jul 2016 22:25:12 +0000 (15:25 -0700)
Add check to block immediate hotplug event being
processed before start of streaming.
Do sync point re-init to a clean state before
starting streaming.

Bug 200092604

Change-Id: I4be38edff61eb06e1bd52a63ba288610ca7bb52d
Signed-off-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Reviewed-on: http://git-master/r/1126327
(cherry picked from commit 1d76ef9f6822d88b2e486ecfb21429494e7abdff)
Reviewed-on: http://git-master/r/1161369
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jihoon Bang <jbang@nvidia.com>
drivers/media/platform/tegra/camera/channel.c

index bf57343bcda2c2dc99353c58462f413104c560d9..89aa7fea45b0f48e2d261680368de16e7d914ca9 100644 (file)
@@ -499,6 +499,10 @@ void tegra_channel_query_hdmiin_unplug(struct tegra_channel *chan,
                                dev_info(&chan->video.dev,
                                         "Got unplug event during capture!\n");
 
+                               /* required to block immediate unplug event */
+                               if (atomic_read(&chan->is_hdmiin_unplug))
+                                       return;
+
                                atomic_set(&chan->is_hdmiin_unplug, 1);
                                for (index = 0; index < valid_ports; index++) {
                                        nvhost_syncpt_cpu_incr_ext(
@@ -695,8 +699,13 @@ static int tegra_channel_start_streaming(struct vb2_queue *vq, u32 count)
        if (chan->bypass)
                return ret;
 
-       for (i = 0; i < chan->valid_ports; i++)
+       for (i = 0; i < chan->valid_ports; i++) {
                tegra_csi_start_streaming(chan->vi->csi, chan->port[i]);
+               /* ensure sync point state is clean */
+               nvhost_syncpt_set_min_eq_max_ext(chan->vi->ndev,
+                                                       chan->syncpt[i]);
+       }
+
        /* Note: Program VI registers after TPG, sensors and CSI streaming */
        ret = tegra_channel_capture_setup(chan);
        if (ret < 0)