#define TCLK_MISS      1
 #define TCLK_SETTLE    14
 
-static void cal_camerarx_config(struct cal_camerarx *phy, s64 external_rate,
-                               const struct cal_fmt *fmt)
+static void cal_camerarx_config(struct cal_camerarx *phy, s64 external_rate)
 {
        unsigned int reg0, reg1;
        unsigned int ths_term, ths_settle;
         * CSI-2 is DDR and we only count used lanes.
         *
         * csi2_ddrclk_khz = external_rate / 1000
-        *                 / (2 * num_lanes) * fmt->bpp;
+        *                 / (2 * num_lanes) * phy->fmtinfo->bpp;
         */
-       csi2_ddrclk_khz = div_s64(external_rate * fmt->bpp,
+       csi2_ddrclk_khz = div_s64(external_rate * phy->fmtinfo->bpp,
                                  2 * num_lanes * 1000);
 
        phy_dbg(1, phy, "csi2_ddrclk_khz: %d\n", csi2_ddrclk_khz);
                phy_err(phy, "Timeout waiting for stop state\n");
 }
 
-int cal_camerarx_start(struct cal_camerarx *phy, const struct cal_fmt *fmt)
+static int cal_camerarx_start(struct cal_camerarx *phy)
 {
        s64 external_rate;
        u32 sscounter;
        camerarx_read(phy, CAL_CSI2_PHY_REG0);
 
        /* Program the PHY timing parameters. */
-       cal_camerarx_config(phy, external_rate, fmt);
+       cal_camerarx_config(phy, external_rate);
 
        /*
         *    b. Assert the FORCERXMODE signal.
        return 0;
 }
 
-void cal_camerarx_stop(struct cal_camerarx *phy)
+static void cal_camerarx_stop(struct cal_camerarx *phy)
 {
        unsigned int i;
        int ret;
        struct cal_camerarx *phy = to_cal_camerarx(sd);
 
        if (enable)
-               return cal_camerarx_start(phy, NULL);
+               return cal_camerarx_start(phy);
 
        cal_camerarx_stop(phy);
        return 0;
 
 {
        struct cal_ctx *ctx = video_drvdata(file);
        struct vb2_queue *q = &ctx->vb_vidq;
+       struct v4l2_subdev_format sd_fmt = {
+               .which = V4L2_SUBDEV_FORMAT_ACTIVE,
+               .pad = CAL_CAMERARX_PAD_SINK,
+       };
        const struct cal_fmt *fmt;
-       struct v4l2_mbus_framefmt mbus_fmt;
        int ret;
 
        if (vb2_is_busy(q)) {
 
        fmt = find_format_by_pix(ctx, f->fmt.pix.pixelformat);
 
-       v4l2_fill_mbus_format(&mbus_fmt, &f->fmt.pix, fmt->code);
+       v4l2_fill_mbus_format(&sd_fmt.format, &f->fmt.pix, fmt->code);
 
-       ret = __subdev_set_format(ctx, &mbus_fmt);
+       ret = __subdev_set_format(ctx, &sd_fmt.format);
        if (ret)
                return ret;
 
        /* Just double check nothing has gone wrong */
-       if (mbus_fmt.code != fmt->code) {
+       if (sd_fmt.format.code != fmt->code) {
                ctx_dbg(3, ctx,
                        "%s subdev changed format on us, this should not happen\n",
                        __func__);
                return -EINVAL;
        }
 
-       v4l2_fill_pix_format(&ctx->v_fmt.fmt.pix, &mbus_fmt);
+       v4l2_fill_pix_format(&ctx->v_fmt.fmt.pix, &sd_fmt.format);
        ctx->v_fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        ctx->v_fmt.fmt.pix.pixelformat = fmt->fourcc;
-       ctx->v_fmt.fmt.pix.field = mbus_fmt.field;
+       ctx->v_fmt.fmt.pix.field = sd_fmt.format.field;
        cal_calc_format_size(ctx, fmt, &ctx->v_fmt);
+
+       v4l2_subdev_call(&ctx->phy->subdev, pad, set_fmt, NULL, &sd_fmt);
+
        ctx->fmt = fmt;
        *f = ctx->v_fmt;
 
                                              vb.vb2_buf);
        unsigned long size;
 
-       if (WARN_ON(!ctx->fmt))
-               return -EINVAL;
-
        size = ctx->v_fmt.fmt.pix.sizeimage;
        if (vb2_plane_size(vb, 0) < size) {
                ctx_err(ctx,
 
        cal_camerarx_enable_irqs(ctx->phy);
 
-       ret = cal_camerarx_start(ctx->phy, ctx->fmt);
+       ret = v4l2_subdev_call(&ctx->phy->subdev, video, s_stream, 1);
        if (ret)
                goto err;
 
                ctx_err(ctx, "failed to disable dma cleanly\n");
 
        cal_camerarx_disable_irqs(ctx->phy);
-       cal_camerarx_stop(ctx->phy);
+       v4l2_subdev_call(&ctx->phy->subdev, video, s_stream, 0);
 
        /* Release all active buffers */
        spin_lock_irqsave(&ctx->slock, flags);