.. | .. |
---|
155 | 155 | return -ENODEV; |
---|
156 | 156 | |
---|
157 | 157 | sensor = sd_to_sensor(dev, sensor_sd); |
---|
158 | | - ret = v4l2_subdev_call(sensor->sd, video, g_mbus_config, |
---|
159 | | - &sensor->mbus); |
---|
| 158 | + if (!sensor) |
---|
| 159 | + return -ENODEV; |
---|
| 160 | + |
---|
| 161 | + ret = v4l2_subdev_call(sensor->sd, pad, get_mbus_config, |
---|
| 162 | + 0, &sensor->mbus); |
---|
160 | 163 | if (ret && ret != -ENOIOCTLCMD) |
---|
161 | 164 | return ret; |
---|
| 165 | + |
---|
| 166 | + sensor->fmt.pad = 0; |
---|
162 | 167 | sensor->fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE; |
---|
163 | 168 | ret = v4l2_subdev_call(sensor->sd, pad, get_fmt, |
---|
164 | 169 | &sensor->cfg, &sensor->fmt); |
---|
.. | .. |
---|
327 | 332 | acq_prop = CIF_ISP_ACQ_PROP_DMA_RGB; |
---|
328 | 333 | } else if (in_fmt->fmt_type == FMT_YUV) { |
---|
329 | 334 | acq_mult = 2; |
---|
330 | | - if (sensor && sensor->mbus.type == V4L2_MBUS_CSI2) { |
---|
| 335 | + if (sensor && (sensor->mbus.type == V4L2_MBUS_CSI2_DPHY || |
---|
| 336 | + sensor->mbus.type == V4L2_MBUS_CCP2)) { |
---|
331 | 337 | isp_ctrl = CIF_ISP_CTRL_ISP_MODE_ITU601; |
---|
332 | 338 | } else { |
---|
333 | 339 | if (sensor && sensor->mbus.type == V4L2_MBUS_BT656) |
---|
.. | .. |
---|
595 | 601 | ret = rkisp1_config_dvp(dev); |
---|
596 | 602 | dpcl |= CIF_VI_DPCL_IF_SEL_PARALLEL; |
---|
597 | 603 | dev->isp_inp = INP_DVP; |
---|
598 | | - } else if (sensor && sensor->mbus.type == V4L2_MBUS_CSI2) { |
---|
| 604 | + } else if (sensor && sensor->mbus.type == V4L2_MBUS_CSI2_DPHY) { |
---|
599 | 605 | ret = rkisp1_config_mipi(dev); |
---|
600 | 606 | dpcl |= CIF_VI_DPCL_IF_SEL_MIPI; |
---|
601 | 607 | dev->isp_inp = INP_CSI; |
---|
.. | .. |
---|
822 | 828 | dev->stream[RKISP1_STREAM_MP].streaming); |
---|
823 | 829 | |
---|
824 | 830 | /* Activate MIPI */ |
---|
825 | | - if (sensor && sensor->mbus.type == V4L2_MBUS_CSI2) { |
---|
| 831 | + if (sensor && sensor->mbus.type == V4L2_MBUS_CSI2_DPHY) { |
---|
826 | 832 | #if RKISP1_RK3326_USE_OLDMIPI |
---|
827 | 833 | if (dev->isp_ver == ISP_V13) { |
---|
828 | 834 | #else |
---|
.. | .. |
---|
1250 | 1256 | const struct ispsd_in_fmt *in_fmt; |
---|
1251 | 1257 | |
---|
1252 | 1258 | in_fmt = find_in_fmt(mf->code); |
---|
| 1259 | + if (!in_fmt) |
---|
| 1260 | + goto err; |
---|
1253 | 1261 | isp_sd->in_fmt = *in_fmt; |
---|
1254 | 1262 | isp_sd->in_frm = *mf; |
---|
1255 | 1263 | } else if (fmt->pad == RKISP1_ISP_PAD_SOURCE_PATH) { |
---|
.. | .. |
---|
1257 | 1265 | |
---|
1258 | 1266 | /* Ignore width/height */ |
---|
1259 | 1267 | out_fmt = find_out_fmt(mf->code); |
---|
| 1268 | + if (!out_fmt) |
---|
| 1269 | + goto err; |
---|
1260 | 1270 | isp_sd->out_fmt = *out_fmt; |
---|
1261 | 1271 | /* |
---|
1262 | 1272 | * It is quantization for output, |
---|
.. | .. |
---|
1476 | 1486 | } |
---|
1477 | 1487 | } else { |
---|
1478 | 1488 | rkisp1_config_clk(isp_dev, on); |
---|
1479 | | - ret = pm_runtime_put(isp_dev->dev); |
---|
| 1489 | + ret = pm_runtime_put_sync(isp_dev->dev); |
---|
1480 | 1490 | if (ret < 0) |
---|
1481 | 1491 | return ret; |
---|
1482 | 1492 | } |
---|
.. | .. |
---|
1763 | 1773 | if (isp_mis & CIF_ISP_V_START) { |
---|
1764 | 1774 | if (dev->stream[RKISP1_STREAM_SP].interlaced) { |
---|
1765 | 1775 | /* 0 = ODD 1 = EVEN */ |
---|
1766 | | - if (dev->active_sensor->mbus.type == V4L2_MBUS_CSI2) { |
---|
| 1776 | + if (dev->active_sensor->mbus.type == V4L2_MBUS_CSI2_DPHY) { |
---|
1767 | 1777 | void __iomem *addr = NULL; |
---|
1768 | 1778 | |
---|
1769 | 1779 | if (dev->isp_ver == ISP_V10 || |
---|