Commit 2b5b9af8 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab

media: ccs: Wrap long lines, unwrap short ones

Over the years (and renaming) some lines that may well be wrapped ended up
being over 80 characters, likewise there are shorter lines that can be
merged. Do that.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent fd5cfde3
...@@ -657,8 +657,7 @@ static int ccs_set_ctrl(struct v4l2_ctrl *ctrl) ...@@ -657,8 +657,7 @@ static int ccs_set_ctrl(struct v4l2_ctrl *ctrl)
break; break;
case V4L2_CID_HBLANK: case V4L2_CID_HBLANK:
rval = ccs_write(sensor, LINE_LENGTH_PCK, rval = ccs_write(sensor, LINE_LENGTH_PCK,
sensor->pixel_array->crop[ sensor->pixel_array->crop[CCS_PA_PAD_SRC].width
CCS_PA_PAD_SRC].width
+ ctrl->val); + ctrl->val);
break; break;
...@@ -989,15 +988,13 @@ static void ccs_update_blanking(struct ccs_sensor *sensor) ...@@ -989,15 +988,13 @@ static void ccs_update_blanking(struct ccs_sensor *sensor)
min = max_t(int, min = max_t(int,
CCS_LIM(sensor, MIN_FRAME_BLANKING_LINES), CCS_LIM(sensor, MIN_FRAME_BLANKING_LINES),
min_fll - min_fll - sensor->pixel_array->crop[CCS_PA_PAD_SRC].height);
sensor->pixel_array->crop[CCS_PA_PAD_SRC].height);
max = max_fll - sensor->pixel_array->crop[CCS_PA_PAD_SRC].height; max = max_fll - sensor->pixel_array->crop[CCS_PA_PAD_SRC].height;
__v4l2_ctrl_modify_range(vblank, min, max, vblank->step, min); __v4l2_ctrl_modify_range(vblank, min, max, vblank->step, min);
min = max_t(int, min = max_t(int,
min_llp - min_llp - sensor->pixel_array->crop[CCS_PA_PAD_SRC].width,
sensor->pixel_array->crop[CCS_PA_PAD_SRC].width,
min_lbp); min_lbp);
max = max_llp - sensor->pixel_array->crop[CCS_PA_PAD_SRC].width; max = max_llp - sensor->pixel_array->crop[CCS_PA_PAD_SRC].width;
...@@ -1784,7 +1781,8 @@ static void ccs_get_crop_compose(struct v4l2_subdev *subdev, ...@@ -1784,7 +1781,8 @@ static void ccs_get_crop_compose(struct v4l2_subdev *subdev,
} else { } else {
if (crops) { if (crops) {
for (i = 0; i < subdev->entity.num_pads; i++) for (i = 0; i < subdev->entity.num_pads; i++)
crops[i] = v4l2_subdev_get_try_crop(subdev, cfg, i); crops[i] = v4l2_subdev_get_try_crop(subdev,
cfg, i);
} }
if (comps) if (comps)
*comps = v4l2_subdev_get_try_compose(subdev, cfg, *comps = v4l2_subdev_get_try_compose(subdev, cfg,
...@@ -1809,8 +1807,7 @@ static void ccs_propagate(struct v4l2_subdev *subdev, ...@@ -1809,8 +1807,7 @@ static void ccs_propagate(struct v4l2_subdev *subdev,
comp->height = crops[CCS_PAD_SINK]->height; comp->height = crops[CCS_PAD_SINK]->height;
if (which == V4L2_SUBDEV_FORMAT_ACTIVE) { if (which == V4L2_SUBDEV_FORMAT_ACTIVE) {
if (ssd == sensor->scaler) { if (ssd == sensor->scaler) {
sensor->scale_m = sensor->scale_m = CCS_LIM(sensor, SCALER_N_MIN);
CCS_LIM(sensor, SCALER_N_MIN);
sensor->scaling_mode = sensor->scaling_mode =
CCS_SCALING_MODE_NO_SCALING; CCS_SCALING_MODE_NO_SCALING;
} else if (ssd == sensor->binner) { } else if (ssd == sensor->binner) {
...@@ -2236,9 +2233,11 @@ static int ccs_set_crop(struct v4l2_subdev *subdev, ...@@ -2236,9 +2233,11 @@ static int ccs_set_crop(struct v4l2_subdev *subdev,
if (sel->pad == ssd->sink_pad) { if (sel->pad == ssd->sink_pad) {
_r.left = 0; _r.left = 0;
_r.top = 0; _r.top = 0;
_r.width = v4l2_subdev_get_try_format(subdev, cfg, sel->pad) _r.width = v4l2_subdev_get_try_format(subdev, cfg,
sel->pad)
->width; ->width;
_r.height = v4l2_subdev_get_try_format(subdev, cfg, sel->pad) _r.height = v4l2_subdev_get_try_format(subdev, cfg,
sel->pad)
->height; ->height;
src_size = &_r; src_size = &_r;
} else { } else {
...@@ -2356,11 +2355,9 @@ static int ccs_set_selection(struct v4l2_subdev *subdev, ...@@ -2356,11 +2355,9 @@ static int ccs_set_selection(struct v4l2_subdev *subdev,
sel->r.width = CCS_ALIGN_DIM(sel->r.width, sel->flags); sel->r.width = CCS_ALIGN_DIM(sel->r.width, sel->flags);
sel->r.height = CCS_ALIGN_DIM(sel->r.height, sel->flags); sel->r.height = CCS_ALIGN_DIM(sel->r.height, sel->flags);
sel->r.width = max_t(unsigned int, sel->r.width = max_t(unsigned int, CCS_LIM(sensor, MIN_X_OUTPUT_SIZE),
CCS_LIM(sensor, MIN_X_OUTPUT_SIZE),
sel->r.width); sel->r.width);
sel->r.height = max_t(unsigned int, sel->r.height = max_t(unsigned int, CCS_LIM(sensor, MIN_Y_OUTPUT_SIZE),
CCS_LIM(sensor, MIN_Y_OUTPUT_SIZE),
sel->r.height); sel->r.height);
switch (sel->target) { switch (sel->target) {
...@@ -2613,8 +2610,7 @@ static int ccs_identify_module(struct ccs_sensor *sensor) ...@@ -2613,8 +2610,7 @@ static int ccs_identify_module(struct ccs_sensor *sensor)
dev_warn(&client->dev, dev_warn(&client->dev,
"no quirks for this module; let's hope it's fully compliant\n"); "no quirks for this module; let's hope it's fully compliant\n");
dev_dbg(&client->dev, "the sensor is called %s\n", dev_dbg(&client->dev, "the sensor is called %s\n", minfo->name);
minfo->name);
return 0; return 0;
} }
...@@ -2634,19 +2630,15 @@ static int ccs_register_subdev(struct ccs_sensor *sensor, ...@@ -2634,19 +2630,15 @@ static int ccs_register_subdev(struct ccs_sensor *sensor,
if (!sink_ssd) if (!sink_ssd)
return 0; return 0;
rval = media_entity_pads_init(&ssd->sd.entity, rval = media_entity_pads_init(&ssd->sd.entity, ssd->npads, ssd->pads);
ssd->npads, ssd->pads);
if (rval) { if (rval) {
dev_err(&client->dev, dev_err(&client->dev, "media_entity_pads_init failed\n");
"media_entity_pads_init failed\n");
return rval; return rval;
} }
rval = v4l2_device_register_subdev(sensor->src->sd.v4l2_dev, rval = v4l2_device_register_subdev(sensor->src->sd.v4l2_dev, &ssd->sd);
&ssd->sd);
if (rval) { if (rval) {
dev_err(&client->dev, dev_err(&client->dev, "v4l2_device_register_subdev failed\n");
"v4l2_device_register_subdev failed\n");
return rval; return rval;
} }
...@@ -2654,8 +2646,7 @@ static int ccs_register_subdev(struct ccs_sensor *sensor, ...@@ -2654,8 +2646,7 @@ static int ccs_register_subdev(struct ccs_sensor *sensor,
&sink_ssd->sd.entity, sink_pad, &sink_ssd->sd.entity, sink_pad,
link_flags); link_flags);
if (rval) { if (rval) {
dev_err(&client->dev, dev_err(&client->dev, "media_create_pad_link failed\n");
"media_create_pad_link failed\n");
v4l2_device_unregister_subdev(&ssd->sd); v4l2_device_unregister_subdev(&ssd->sd);
return rval; return rval;
} }
......
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