}
}
+static int atomisp_get_sensor_bin_factor(struct atomisp_device *isp)
+{
+ struct v4l2_control ctrl;
+ int hbin, vbin;
+ int ret;
+
+ memset(&ctrl, 0, sizeof(ctrl));
+
+ ctrl.id = V4L2_CID_BIN_FACTOR_HORZ;
+ ret = v4l2_subdev_call(isp->inputs[isp->input_curr].camera, core,
+ g_ctrl, &ctrl);
+ hbin = ctrl.value;
+ ctrl.id = V4L2_CID_BIN_FACTOR_VERT;
+ ret |= v4l2_subdev_call(isp->inputs[isp->input_curr].camera, core,
+ g_ctrl, &ctrl);
+ vbin = ctrl.value;
+
+ /*
+ * ISP needs to know binning factor from sensor.
+ * In case horizontal and vertical sensor's binning factors
+ * are different or sensor does not support binning factor CID,
+ * ISP will apply default 0 value.
+ */
+ if (ret || (hbin != vbin))
+ hbin = 0;
+
+ return hbin;
+}
+
static int atomisp_set_fmt_to_snr(struct atomisp_device *isp,
struct v4l2_format *f, unsigned int pixelformat,
unsigned int padding_w, unsigned int padding_h,
isp->input_format->out.height < ATOM_ISP_STEP_HEIGHT)
return -EINVAL;
+ sh_css_input_set_binning_factor(atomisp_get_sensor_bin_factor(isp));
+
return 0;
}
void atomisp_get_yuv_ds_status(struct atomisp_device *isp,