#include "vi.h"
 #include "video.h"
 
-#define MAX_CID_CONTROLS               1
+#define MAX_CID_CONTROLS               3
 
 /**
  * struct tegra_vi_graph_entity - Entity in the video graph
        case V4L2_CID_TEGRA_SYNCPT_TIMEOUT_RETRY:
                chan->syncpt_timeout_retry = ctrl->val;
                break;
+       case V4L2_CID_HFLIP:
+               chan->hflip = ctrl->val;
+               break;
+       case V4L2_CID_VFLIP:
+               chan->vflip = ctrl->val;
+               break;
        default:
                return -EINVAL;
        }
                v4l2_ctrl_handler_free(&chan->ctrl_handler);
                return ret;
        }
+
+       if (chan->vi->soc->has_h_v_flip) {
+               v4l2_ctrl_new_std(&chan->ctrl_handler, &vi_ctrl_ops, V4L2_CID_HFLIP, 0, 1, 1, 0);
+               v4l2_ctrl_new_std(&chan->ctrl_handler, &vi_ctrl_ops, V4L2_CID_VFLIP, 0, 1, 1, 0);
+       }
+
 #endif
 
        /* setup the controls */
 
  * @hw_revision: VI hw_revision
  * @vi_max_channels: supported max streaming channels
  * @vi_max_clk_hz: VI clock max frequency
+ * @has_h_v_flip: the chip can do H and V flip, and the driver implements it
  */
 struct tegra_vi_soc {
        const struct tegra_video_format *video_formats;
        u32 hw_revision;
        unsigned int vi_max_channels;
        unsigned int vi_max_clk_hz;
+       bool has_h_v_flip:1;
 };
 
 /**
  * @tpg_fmts_bitmap: a bitmap for supported TPG formats
  * @pg_mode: test pattern generator mode (disabled/direct/patch)
  * @notifier: V4L2 asynchronous subdevs notifier
+ *
+ * @hflip: Horizontal flip is enabled
+ * @vflip: Vertical flip is enabled
  */
 struct tegra_vi_channel {
        struct list_head list;
        enum tegra_vi_pg_mode pg_mode;
 
        struct v4l2_async_notifier notifier;
+
+       bool hflip:1;
+       bool vflip:1;
 };
 
 /**