Commit b821cea5 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

media: atomisp-ov2680: Remove the ov2680_res and N_RES global variables

The ov2680_res and N_RES global variables are just hardcoded as aliases
for ov2680_res_preview and N_RES_PREVIEW, remove them.

Link: https://lore.kernel.org/linux-media/20211107171549.267583-5-hdegoede@redhat.comSigned-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent e9174a64
...@@ -653,15 +653,6 @@ static int ov2680_init_registers(struct v4l2_subdev *sd) ...@@ -653,15 +653,6 @@ static int ov2680_init_registers(struct v4l2_subdev *sd)
return ret; return ret;
} }
static int ov2680_init(struct v4l2_subdev *sd)
{
/* restore settings */
ov2680_res = ov2680_res_preview;
N_RES = N_RES_PREVIEW;
return ov2680_init_registers(sd);
}
static int power_ctrl(struct v4l2_subdev *sd, bool flag) static int power_ctrl(struct v4l2_subdev *sd, bool flag)
{ {
int ret = 0; int ret = 0;
...@@ -817,7 +808,7 @@ static int ov2680_s_power(struct v4l2_subdev *sd, int on) ...@@ -817,7 +808,7 @@ static int ov2680_s_power(struct v4l2_subdev *sd, int on)
} else { } else {
ret = power_up(sd); ret = power_up(sd);
if (!ret) if (!ret)
ret = ov2680_init(sd); ret = ov2680_init_registers(sd);
} }
mutex_unlock(&dev->input_lock); mutex_unlock(&dev->input_lock);
...@@ -857,7 +848,7 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd, ...@@ -857,7 +848,7 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd,
ARRAY_SIZE(ov2680_res_preview), width, ARRAY_SIZE(ov2680_res_preview), width,
height, fmt->width, fmt->height); height, fmt->width, fmt->height);
if (!res) if (!res)
res = &ov2680_res[N_RES - 1]; res = &ov2680_res_preview[N_RES_PREVIEW - 1];
fmt->width = res->width; fmt->width = res->width;
fmt->height = res->height; fmt->height = res->height;
...@@ -975,11 +966,6 @@ static int ov2680_s_stream(struct v4l2_subdev *sd, int enable) ...@@ -975,11 +966,6 @@ static int ov2680_s_stream(struct v4l2_subdev *sd, int enable)
ret = ov2680_write_reg(client, 1, OV2680_SW_STREAM, ret = ov2680_write_reg(client, 1, OV2680_SW_STREAM,
enable ? OV2680_START_STREAMING : enable ? OV2680_START_STREAMING :
OV2680_STOP_STREAMING); OV2680_STOP_STREAMING);
#if 0
/* restore settings */
ov2680_res = ov2680_res_preview;
N_RES = N_RES_PREVIEW;
#endif
//otp valid at stream on state //otp valid at stream on state
//if(!dev->otp_data) //if(!dev->otp_data)
...@@ -1069,13 +1055,13 @@ static int ov2680_enum_frame_size(struct v4l2_subdev *sd, ...@@ -1069,13 +1055,13 @@ static int ov2680_enum_frame_size(struct v4l2_subdev *sd,
{ {
int index = fse->index; int index = fse->index;
if (index >= N_RES) if (index >= N_RES_PREVIEW)
return -EINVAL; return -EINVAL;
fse->min_width = ov2680_res[index].width; fse->min_width = ov2680_res_preview[index].width;
fse->min_height = ov2680_res[index].height; fse->min_height = ov2680_res_preview[index].height;
fse->max_width = ov2680_res[index].width; fse->max_width = ov2680_res_preview[index].width;
fse->max_height = ov2680_res[index].height; fse->max_height = ov2680_res_preview[index].height;
return 0; return 0;
} }
......
...@@ -838,7 +838,4 @@ static struct ov2680_resolution ov2680_res_preview[] = { ...@@ -838,7 +838,4 @@ static struct ov2680_resolution ov2680_res_preview[] = {
#define N_RES_PREVIEW (ARRAY_SIZE(ov2680_res_preview)) #define N_RES_PREVIEW (ARRAY_SIZE(ov2680_res_preview))
static struct ov2680_resolution *ov2680_res = ov2680_res_preview;
static unsigned long N_RES = N_RES_PREVIEW;
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment