Revert "[COMMON] fimc-is2: add & fixed a 2x5 3dhdr stat"
authorWooyeon Kim <wooy88.kim@samsung.com>
Sat, 13 Jul 2019 05:35:50 +0000 (14:35 +0900)
committerKim Gunho <gunho.kim@samsung.com>
Wed, 7 Aug 2019 13:00:34 +0000 (22:00 +0900)
This reverts commit 5163d533c949d86848ce7db975bf4a090bffe7ba.

Change-Id: Iff98b7dd427df8ca2c8ff45e2f8ca5f7f36462f8
Signed-off-by: Wooyeon Kim <wooy88.kim@samsung.com>
drivers/media/platform/exynos/fimc-is2/sensor/module_framework/cis/fimc-is-cis-2x5sp.c
drivers/media/platform/exynos/fimc-is2/sensor/module_framework/fimc-is-interface-sensor.h

index 4bca438cf9107c7358e6d73f89aafbd4904d7abb..fb3396a70505a5cbfc02e34e9abef26c855623b2 100644 (file)
@@ -1979,7 +1979,6 @@ int sensor_2x5sp_cis_set_3hdr_roi(struct v4l2_subdev *subdev, struct roi_setting
        struct fimc_is_cis *cis;
        struct i2c_client *client;
        u16 roi_val[4];
-       int i;
 #ifdef DEBUG_SENSOR_TIME
        struct timeval st, end;
 
@@ -2026,12 +2025,9 @@ int sensor_2x5sp_cis_set_3hdr_roi(struct v4l2_subdev *subdev, struct roi_setting
        roi_val[2] = roi_control.roi_end_x; /* 0x20004B2A: bot_right_x */
        roi_val[3] = roi_control.roi_end_y; /* 0x20004B2C: bot_right_y */
 
-       ret = fimc_is_sensor_write16(client, 0x602A, 0x4B26);
-       for (i = 0; i < 4; i++) {
-               ret = fimc_is_sensor_write16(client, 0x6F12, roi_val[i]);
-               if (ret < 0)
-                       goto p_err;
-       }
+       ret = fimc_is_sensor_write16_array(client, 0x4B26, roi_val, 4);
+       if (ret < 0)
+               goto p_err;
 
        /* t_isp_rgby_hist_grid_grid & thstat_grid_area */
        roi_val[0] = roi_control.roi_end_x - roi_control.roi_start_x; /* 0x20004BEE & 0x20004E44: width */
@@ -2039,19 +2035,13 @@ int sensor_2x5sp_cis_set_3hdr_roi(struct v4l2_subdev *subdev, struct roi_setting
        roi_val[2] = (roi_control.roi_start_x + roi_control.roi_end_x) / 2; /* center_x */
        roi_val[3] = (roi_control.roi_start_y + roi_control.roi_end_y) / 2; /* center_y */
 
-       ret = fimc_is_sensor_write16(client, 0x602A, 0x4BEE);
-       for (i = 0; i < 4; i++) {
-               ret = fimc_is_sensor_write16(client, 0x6F12, roi_val[i]);
-               if (ret < 0)
-                       goto p_err;
-       }
+       ret = fimc_is_sensor_write16_array(client, 0x4BEE, roi_val, 4);
+       if (ret < 0)
+               goto p_err;
 
-       ret = fimc_is_sensor_write16(client, 0x602A, 0x4E44);
-       for (i = 0; i < 2; i++) {
-               ret = fimc_is_sensor_write16(client, 0x6F12, roi_val[i]);
-               if (ret < 0)
-                       goto p_err;
-       }
+       ret = fimc_is_sensor_write16_array(client, 0x4E44, roi_val, 2);
+       if (ret < 0)
+               goto p_err;
 
        /* restore 0x4000_XXXX */
        ret = fimc_is_sensor_write16(client, 0x6028, 0x4000);
@@ -2079,7 +2069,6 @@ int sensor_2x5sp_cis_set_3hdr_stat(struct v4l2_subdev *subdev, bool streaming, v
 {
        int ret = 0;
        int hold = 0;
-       int i;
        struct fimc_is_cis *cis;
        struct i2c_client *client;
        u16 weight[3];
@@ -2142,146 +2131,67 @@ int sensor_2x5sp_cis_set_3hdr_stat(struct v4l2_subdev *subdev, bool streaming, v
                goto p_err;
 
        /* t_isp_rgby_hist_short_exp_weight */
-       ret = fimc_is_sensor_write16(client, 0x602A, 0x4BBC);
-       for (i = 0; i < 3; i++) {
-               ret = fimc_is_sensor_write16(client, 0x6F12, weight[i]);
-               if (ret < 0)
-                       goto p_err;
-       }
+       ret = fimc_is_sensor_write16_array(client, 0x4BBC, weight, 3);
+       if (ret < 0)
+               goto p_err;
 
        /* t_isp_rgby_hist_long_exp_weight */
-       ret = fimc_is_sensor_write16(client, 0x602A, 0x4BCA);
-       for (i = 0; i < 3; i++) {
-               ret = fimc_is_sensor_write16(client, 0x6F12, weight[i]);
-               if (ret < 0)
-                       goto p_err;
-       }
+       ret = fimc_is_sensor_write16_array(client, 0x4BCA, weight, 3);
+       if (ret < 0)
+               goto p_err;
 
        /* t_isp_rgby_hist_medium_exp_weight */
-       ret = fimc_is_sensor_write16(client, 0x602A, 0x4BD8);
-       for (i = 0; i < 3; i++) {
-               ret = fimc_is_sensor_write16(client, 0x6F12, weight[i]);
-               if (ret < 0)
-                       goto p_err;
-       }
+       ret = fimc_is_sensor_write16_array(client, 0x4BD8, weight, 3);
+       if (ret < 0)
+               goto p_err;
 
        /* t_isp_rgby_hist_mixed_exp_weight */
-       ret = fimc_is_sensor_write16(client, 0x602A, 0x4BE6);
-       for (i = 0; i < 3; i++) {
-               ret = fimc_is_sensor_write16(client, 0x6F12, weight[i]);
-               if (ret < 0)
-                       goto p_err;
-       }
+       ret = fimc_is_sensor_write16_array(client, 0x4BE6, weight, 3);
+       if (ret < 0)
+               goto p_err;
 
        /* t_isp_drc_thstat_rgb_weights */
-       ret = fimc_is_sensor_write16(client, 0x602A, 0x4E2C);
-       for (i = 0; i < 3; i++) {
-               ret = fimc_is_sensor_write16(client, 0x6F12, weight[i]);
-               if (ret < 0)
-                       goto p_err;
-       }
+       ret = fimc_is_sensor_write16_array(client, 0x4E2C, weight, 3);
+       if (ret < 0)
+               goto p_err;
 
        if (!streaming) {
                /* t_isp_drc_thstat_u_low_tresh_red */
-               ret = fimc_is_sensor_write16(client, 0x602A, 0x4E1A);
-               ret = fimc_is_sensor_write16(client, 0x6F12, low_gate_thr);
+               ret = fimc_is_sensor_write16(client, 0x4E1A, low_gate_thr);
                if (ret < 0)
                        goto p_err;
                /* t_isp_drc_thstat_u_high_tresh_red */
-               ret = fimc_is_sensor_write16(client, 0x6F12, high_gate_thr);
+               ret = fimc_is_sensor_write16(client, 0x4E1C, high_gate_thr);
                if (ret < 0)
                        goto p_err;
 
                /* t_isp_drc_thstat_u_low_tresh_green */
-               ret = fimc_is_sensor_write16(client, 0x6F12, low_gate_thr);
+               ret = fimc_is_sensor_write16(client, 0x4E1E, low_gate_thr);
                if (ret < 0)
                        goto p_err;
 
                /* t_isp_drc_thstat_u_high_tresh_green */
-               ret = fimc_is_sensor_write16(client, 0x6F12, high_gate_thr);
+               ret = fimc_is_sensor_write16(client, 0x4E20, high_gate_thr);
                if (ret < 0)
                        goto p_err;
 
                /* t_isp_drc_thstat_u_low_tresh_blue */
-               ret = fimc_is_sensor_write16(client, 0x6F12, low_gate_thr);
+               ret = fimc_is_sensor_write16(client, 0x4E22, low_gate_thr);
                if (ret < 0)
                        goto p_err;
 
                /* t_isp_drc_thstat_u_high_tresh_blue */
-               ret = fimc_is_sensor_write16(client, 0x6F12, high_gate_thr);
+               ret = fimc_is_sensor_write16(client, 0x4E24, high_gate_thr);
                if (ret < 0)
                        goto p_err;
 
                /* t_isp_y_sum_top_left_x */
-               ret = fimc_is_sensor_write16(client, 0x602A, 0x4E04);
-               ret = fimc_is_sensor_write16(client, 0x6F12, y_sum_roi.roi_start_x);
+               ret = fimc_is_sensor_write16(client, 0x4E04, y_sum_roi.roi_start_x);
                if (ret < 0)
                        goto p_err;
-               ret = fimc_is_sensor_write16(client, 0x6F12, y_sum_roi.roi_start_y);
+               ret = fimc_is_sensor_write16(client, 0x4E06, y_sum_roi.roi_start_y);
                if (ret < 0)
                        goto p_err;
-       } else {
-               /* update 3hdr motion stat */
-               ret = fimc_is_sensor_write16(client, 0x6028, 0x2001);
-               if (ret < 0)
-                       goto p_err;
-
-               ret |= fimc_is_sensor_write16(client, 0x602A, 0x29D8);
-               ret |= fimc_is_sensor_write16(client, 0x6F12,
-                               (u16)per_frame_stat.motion_indication);
-
-               ret |= fimc_is_sensor_write16(client, 0x602A, 0x2A52);
-               ret |= fimc_is_sensor_write16(client, 0x6F12,
-                               (u16)per_frame_stat.motion_high_end_ty2ty1);
-               ret |= fimc_is_sensor_write16(client, 0x6F12,
-                               (u16)per_frame_stat.motion_high_end_ty3ty2);
-               ret |= fimc_is_sensor_write16(client, 0x6F12,
-                               (u16)per_frame_stat.motion_high_start_ty2ty1);
-               ret |= fimc_is_sensor_write16(client, 0x6F12,
-                               (u16)per_frame_stat.motion_high_start_ty3ty2);
-               ret |= fimc_is_sensor_write16(client, 0x6F12,
-                               (u16)per_frame_stat.motion_low_end_ty2ty1);
-               ret |= fimc_is_sensor_write16(client, 0x6F12,
-                               (u16)per_frame_stat.motion_low_end_ty3ty2);
-               ret |= fimc_is_sensor_write16(client, 0x6F12,
-                               (u16)per_frame_stat.motion_low_start_ty2ty1);
-               ret |= fimc_is_sensor_write16(client, 0x6F12,
-                               (u16)per_frame_stat.motion_low_start_ty3ty2);
-
-               dbg_sensor(2, "[%s] motion idc(%d) high21(e:%d, s:%d), low21(e:%d, s:%d)\n",
-                               __func__,
-                               (u16)per_frame_stat.motion_indication,
-                               (u16)per_frame_stat.motion_high_end_ty2ty1,
-                               (u16)per_frame_stat.motion_high_start_ty2ty1,
-                               (u16)per_frame_stat.motion_low_end_ty2ty1,
-                               (u16)per_frame_stat.motion_low_start_ty2ty1);
-               dbg_sensor(2, "[%s] motion high32(e:%d, s:%d), low32(e:%d, s:%d)\n",
-                               __func__,
-                               (u16)per_frame_stat.motion_high_end_ty3ty2,
-                               (u16)per_frame_stat.motion_high_start_ty3ty2,
-                               (u16)per_frame_stat.motion_low_end_ty3ty2,
-                               (u16)per_frame_stat.motion_low_start_ty3ty2);
-
-               ret |= fimc_is_sensor_write16(client, 0x602A, 0x2A68);
-               ret |= fimc_is_sensor_write16(client, 0x6F12,
-                               (u16)per_frame_stat.decision_thresh_override);
-               ret |= fimc_is_sensor_write16(client, 0x6F12,
-                               (u16)per_frame_stat.motion_abs_high_ty3ty2);
-               ret |= fimc_is_sensor_write16(client, 0x6F12,
-                               (u16)per_frame_stat.motion_abs_low_ty3ty2);
-               ret |= fimc_is_sensor_write16(client, 0x6F12,
-                               (u16)per_frame_stat.motion_abs_high_ty2ty1);
-               ret |= fimc_is_sensor_write16(client, 0x6F12,
-                               (u16)per_frame_stat.motion_abs_low_ty2ty1);
-
-               dbg_sensor(2, "[%s] motion DTO(%d), abs(h32:%d, l32:%d), abs(h21:%d, l21:%d)\n",
-                               __func__,
-                               (u16)per_frame_stat.decision_thresh_override,
-                               (u16)per_frame_stat.motion_abs_high_ty3ty2,
-                               (u16)per_frame_stat.motion_abs_low_ty3ty2,
-                               (u16)per_frame_stat.motion_abs_high_ty2ty1,
-                               (u16)per_frame_stat.motion_abs_low_ty2ty1);
-
        }
 
        /* restore 0x4000_XXXX */
index 7f9a4170649ed451b46f8a258a49bfeb44c69cd3..be278cee8016c2fd8afce09b4a3d4dc2eab72a5a 100755 (executable)
@@ -248,22 +248,6 @@ struct sensor_lsi_3hdr_stat_control_per_frame {
        int r_weight;
        int b_weight;
        int g_weight;
-
-       /* stat for 3dhdr motion */
-       u32 motion_indication;
-       u32 motion_high_end_ty2ty1;
-       u32 motion_high_start_ty2ty1;
-       u32 motion_low_end_ty2ty1;
-       u32 motion_low_start_ty2ty1;
-       u32 motion_high_end_ty3ty2;
-       u32 motion_high_start_ty3ty2;
-       u32 motion_low_end_ty3ty2;
-       u32 motion_low_start_ty3ty2;
-       u32 decision_thresh_override;
-       u32 motion_abs_high_ty3ty2;
-       u32 motion_abs_low_ty3ty2;
-       u32 motion_abs_high_ty2ty1;
-       u32 motion_abs_low_ty2ty1;
 };
 
 typedef struct {