| .. | .. |
|---|
| 117 | 117 | #define MIRROR_BIT_MASK BIT(2) |
|---|
| 118 | 118 | #define FLIP_BIT_MASK BIT(2) |
|---|
| 119 | 119 | |
|---|
| 120 | | -enum ov12d2q_max_pad { |
|---|
| 121 | | - PAD0, |
|---|
| 122 | | - PAD1, |
|---|
| 123 | | - PAD2, |
|---|
| 124 | | - PAD3, |
|---|
| 125 | | - PAD_MAX, |
|---|
| 126 | | -}; |
|---|
| 127 | | - |
|---|
| 128 | 120 | struct regval { |
|---|
| 129 | 121 | u16 addr; |
|---|
| 130 | 122 | u8 val; |
|---|
| .. | .. |
|---|
| 2224 | 2216 | struct ov12d2q *ov12d2q = to_ov12d2q(sd); |
|---|
| 2225 | 2217 | const struct ov12d2q_mode *mode = ov12d2q->cur_mode; |
|---|
| 2226 | 2218 | |
|---|
| 2227 | | - mutex_lock(&ov12d2q->mutex); |
|---|
| 2228 | 2219 | fi->interval = mode->max_fps; |
|---|
| 2229 | | - mutex_unlock(&ov12d2q->mutex); |
|---|
| 2230 | 2220 | |
|---|
| 2231 | 2221 | return 0; |
|---|
| 2232 | 2222 | } |
|---|
| 2233 | 2223 | |
|---|
| 2234 | | -static int ov12d2q_g_mbus_config(struct v4l2_subdev *sd, |
|---|
| 2224 | +static int ov12d2q_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad_id, |
|---|
| 2235 | 2225 | struct v4l2_mbus_config *config) |
|---|
| 2236 | 2226 | { |
|---|
| 2237 | 2227 | struct ov12d2q *ov12d2q = to_ov12d2q(sd); |
|---|
| .. | .. |
|---|
| 2248 | 2238 | V4L2_MBUS_CSI2_CONTINUOUS_CLOCK | |
|---|
| 2249 | 2239 | V4L2_MBUS_CSI2_CHANNEL_1; |
|---|
| 2250 | 2240 | |
|---|
| 2251 | | - config->type = V4L2_MBUS_CSI2; |
|---|
| 2241 | + config->type = V4L2_MBUS_CSI2_DPHY; |
|---|
| 2252 | 2242 | config->flags = val; |
|---|
| 2253 | 2243 | |
|---|
| 2254 | 2244 | return 0; |
|---|
| .. | .. |
|---|
| 2724 | 2714 | static const struct v4l2_subdev_video_ops ov12d2q_video_ops = { |
|---|
| 2725 | 2715 | .s_stream = ov12d2q_s_stream, |
|---|
| 2726 | 2716 | .g_frame_interval = ov12d2q_g_frame_interval, |
|---|
| 2727 | | - .g_mbus_config = ov12d2q_g_mbus_config, |
|---|
| 2728 | 2717 | }; |
|---|
| 2729 | 2718 | |
|---|
| 2730 | 2719 | static const struct v4l2_subdev_pad_ops ov12d2q_pad_ops = { |
|---|
| .. | .. |
|---|
| 2733 | 2722 | .enum_frame_interval = ov12d2q_enum_frame_interval, |
|---|
| 2734 | 2723 | .get_fmt = ov12d2q_get_fmt, |
|---|
| 2735 | 2724 | .set_fmt = ov12d2q_set_fmt, |
|---|
| 2725 | + .get_mbus_config = ov12d2q_g_mbus_config, |
|---|
| 2736 | 2726 | }; |
|---|
| 2737 | 2727 | |
|---|
| 2738 | 2728 | static const struct v4l2_subdev_ops ov12d2q_subdev_ops = { |
|---|
| .. | .. |
|---|
| 2769 | 2759 | switch (ctrl->id) { |
|---|
| 2770 | 2760 | case V4L2_CID_EXPOSURE: |
|---|
| 2771 | 2761 | if (ov12d2q->cur_mode->hdr_mode != NO_HDR) |
|---|
| 2772 | | - return 0; |
|---|
| 2762 | + goto ctrl_end; |
|---|
| 2773 | 2763 | ret = ov12d2q_write_reg(ov12d2q->client, |
|---|
| 2774 | 2764 | OV12D2Q_REG_EXP_L_H, |
|---|
| 2775 | 2765 | OV12D2Q_REG_VALUE_16BIT, |
|---|
| .. | .. |
|---|
| 2779 | 2769 | break; |
|---|
| 2780 | 2770 | case V4L2_CID_ANALOGUE_GAIN: |
|---|
| 2781 | 2771 | if (ov12d2q->cur_mode->hdr_mode != NO_HDR) |
|---|
| 2782 | | - return 0; |
|---|
| 2772 | + goto ctrl_end; |
|---|
| 2783 | 2773 | if (ctrl->val > 1984) {// >15.5x |
|---|
| 2784 | 2774 | dgain = ctrl->val * 10 / 155; |
|---|
| 2785 | 2775 | again = 1984; |
|---|
| .. | .. |
|---|
| 2896 | 2886 | break; |
|---|
| 2897 | 2887 | } |
|---|
| 2898 | 2888 | |
|---|
| 2889 | +ctrl_end: |
|---|
| 2899 | 2890 | pm_runtime_put(&client->dev); |
|---|
| 2900 | 2891 | |
|---|
| 2901 | 2892 | return ret; |
|---|