| .. | .. |
|---|
| 2105 | 2105 | |
|---|
| 2106 | 2106 | dev_dbg(&client->dev, "%s: on: %d\n", __func__, on); |
|---|
| 2107 | 2107 | |
|---|
| 2108 | | - if (gc2145->bus_cfg.bus_type == V4L2_MBUS_CSI2) { |
|---|
| 2108 | + if (gc2145->bus_cfg.bus_type == V4L2_MBUS_CSI2_DPHY) { |
|---|
| 2109 | 2109 | val = on ? 0x94 : 0x84; |
|---|
| 2110 | 2110 | ret = gc2145_write(client, 0xfe, 0x03); |
|---|
| 2111 | 2111 | ret |= gc2145_write(client, 0x10, val); |
|---|
| .. | .. |
|---|
| 2458 | 2458 | } |
|---|
| 2459 | 2459 | #endif |
|---|
| 2460 | 2460 | |
|---|
| 2461 | | -static int gc2145_g_mbus_config(struct v4l2_subdev *sd, |
|---|
| 2461 | +static int gc2145_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad_id, |
|---|
| 2462 | 2462 | struct v4l2_mbus_config *config) |
|---|
| 2463 | 2463 | { |
|---|
| 2464 | 2464 | struct gc2145 *gc2145 = to_gc2145(sd); |
|---|
| 2465 | 2465 | |
|---|
| 2466 | | - if (gc2145->bus_cfg.bus_type == V4L2_MBUS_CSI2) { |
|---|
| 2467 | | - config->type = V4L2_MBUS_CSI2; |
|---|
| 2466 | + if (gc2145->bus_cfg.bus_type == V4L2_MBUS_CSI2_DPHY) { |
|---|
| 2467 | + config->type = V4L2_MBUS_CSI2_DPHY; |
|---|
| 2468 | 2468 | config->flags = V4L2_MBUS_CSI2_1_LANE | |
|---|
| 2469 | 2469 | V4L2_MBUS_CSI2_CHANNEL_0 | |
|---|
| 2470 | 2470 | V4L2_MBUS_CSI2_CONTINUOUS_CLOCK; |
|---|
| .. | .. |
|---|
| 2483 | 2483 | { |
|---|
| 2484 | 2484 | struct gc2145 *gc2145 = to_gc2145(sd); |
|---|
| 2485 | 2485 | |
|---|
| 2486 | | - mutex_lock(&gc2145->lock); |
|---|
| 2487 | 2486 | fi->interval = gc2145->frame_size->max_fps; |
|---|
| 2488 | | - mutex_unlock(&gc2145->lock); |
|---|
| 2489 | 2487 | |
|---|
| 2490 | 2488 | return 0; |
|---|
| 2491 | 2489 | } |
|---|
| .. | .. |
|---|
| 2628 | 2626 | |
|---|
| 2629 | 2627 | dev_info(&client->dev, "%s(%d)\n", __func__, __LINE__); |
|---|
| 2630 | 2628 | |
|---|
| 2631 | | - if (gc2145->bus_cfg.bus_type == V4L2_MBUS_CSI2) |
|---|
| 2629 | + if (gc2145->bus_cfg.bus_type == V4L2_MBUS_CSI2_DPHY) |
|---|
| 2632 | 2630 | ret = gc2145_write_array(client, gc2145_mipi_init_regs); |
|---|
| 2633 | 2631 | else |
|---|
| 2634 | 2632 | ret = gc2145_write_array(client, gc2145_dvp_init_regs); |
|---|
| .. | .. |
|---|
| 2672 | 2670 | if (fie->index >= gc2145->cfg_num) |
|---|
| 2673 | 2671 | return -EINVAL; |
|---|
| 2674 | 2672 | |
|---|
| 2675 | | - if (fie->code != MEDIA_BUS_FMT_UYVY8_2X8) |
|---|
| 2676 | | - return -EINVAL; |
|---|
| 2677 | | - |
|---|
| 2673 | + fie->code = MEDIA_BUS_FMT_UYVY8_2X8; |
|---|
| 2678 | 2674 | fie->width = gc2145->framesize_cfg[fie->index].width; |
|---|
| 2679 | 2675 | fie->height = gc2145->framesize_cfg[fie->index].height; |
|---|
| 2680 | 2676 | fie->interval = gc2145->framesize_cfg[fie->index].max_fps; |
|---|
| .. | .. |
|---|
| 2694 | 2690 | |
|---|
| 2695 | 2691 | static const struct v4l2_subdev_video_ops gc2145_subdev_video_ops = { |
|---|
| 2696 | 2692 | .s_stream = gc2145_s_stream, |
|---|
| 2697 | | - .g_mbus_config = gc2145_g_mbus_config, |
|---|
| 2698 | 2693 | .g_frame_interval = gc2145_g_frame_interval, |
|---|
| 2699 | 2694 | .s_frame_interval = gc2145_s_frame_interval, |
|---|
| 2700 | 2695 | }; |
|---|
| .. | .. |
|---|
| 2705 | 2700 | .enum_frame_interval = gc2145_enum_frame_interval, |
|---|
| 2706 | 2701 | .get_fmt = gc2145_get_fmt, |
|---|
| 2707 | 2702 | .set_fmt = gc2145_set_fmt, |
|---|
| 2703 | + .get_mbus_config = gc2145_g_mbus_config, |
|---|
| 2708 | 2704 | }; |
|---|
| 2709 | 2705 | |
|---|
| 2710 | 2706 | #ifdef CONFIG_VIDEO_V4L2_SUBDEV_API |
|---|
| .. | .. |
|---|
| 2856 | 2852 | of_node_put(endpoint); |
|---|
| 2857 | 2853 | return ret; |
|---|
| 2858 | 2854 | } |
|---|
| 2859 | | - if (gc2145->bus_cfg.bus_type == V4L2_MBUS_CSI2) { |
|---|
| 2855 | + if (gc2145->bus_cfg.bus_type == V4L2_MBUS_CSI2_DPHY) { |
|---|
| 2860 | 2856 | gc2145->framesize_cfg = gc2145_mipi_framesizes; |
|---|
| 2861 | 2857 | gc2145->cfg_num = ARRAY_SIZE(gc2145_mipi_framesizes); |
|---|
| 2862 | 2858 | } else { |
|---|