In preparation of suspend/resume support cache the chsel value when
written to the register so it can be restored on resume if needed.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
 
        vin_dbg(vin, "Set IFMD 0x%x\n", ifmd);
 
+       vin->chsel = chsel;
+
        /* Restore VNMC. */
        rvin_write(vin, vnmc, VNMC_REG);
 
 
  * @state:             keeps track of operation state
  *
  * @is_csi:            flag to mark the VIN as using a CSI-2 subdevice
+ * @chsel              Cached value of the current CSI-2 channel selection
  *
  * @mbus_code:         media bus format code
  * @format:            active V4L2 pixel format
        enum rvin_dma_state state;
 
        bool is_csi;
+       unsigned int chsel;
 
        u32 mbus_code;
        struct v4l2_pix_format format;