Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: staging: media: atomisp: code formatting changes atomisp_csi2.c

Several trivial code reformatting changes done according to the coding
style guidelines. These changes improves code organisation and readability
and also 4 address many chackpatch error, warning and check complaints.

Signed-off-by: Deepak R Varma <drv@mailo.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Deepak R Varma and committed by
Mauro Carvalho Chehab
1e153520 de27891f

+34 -36
+34 -36
drivers/staging/media/atomisp/pci/atomisp_csi2.c
··· 22 22 #include "atomisp_internal.h" 23 23 #include "atomisp-regs.h" 24 24 25 - static struct v4l2_mbus_framefmt *__csi2_get_format(struct 26 - atomisp_mipi_csi2_device 27 - * csi2, 28 - struct v4l2_subdev_state *sd_state, 29 - enum 30 - v4l2_subdev_format_whence 31 - which, unsigned int pad) 25 + static struct 26 + v4l2_mbus_framefmt *__csi2_get_format(struct atomisp_mipi_csi2_device *csi2, 27 + struct v4l2_subdev_state *sd_state, 28 + enum v4l2_subdev_format_whence which, 29 + unsigned int pad) 32 30 { 33 31 if (which == V4L2_SUBDEV_FORMAT_TRY) 34 32 return v4l2_subdev_get_try_format(&csi2->subdev, sd_state, ··· 41 43 * @fh : V4L2 subdev file handle 42 44 * @code : pointer to v4l2_subdev_pad_mbus_code_enum structure 43 45 * return -EINVAL or zero on success 44 - */ 46 + */ 45 47 static int csi2_enum_mbus_code(struct v4l2_subdev *sd, 46 48 struct v4l2_subdev_state *sd_state, 47 49 struct v4l2_subdev_mbus_code_enum *code) ··· 67 69 * @pad: pad num 68 70 * @fmt: pointer to v4l2 format structure 69 71 * return -EINVAL or zero on success 70 - */ 72 + */ 71 73 static int csi2_get_format(struct v4l2_subdev *sd, 72 74 struct v4l2_subdev_state *sd_state, 73 75 struct v4l2_subdev_format *fmt) ··· 102 104 else 103 105 actual_ffmt->code = atomisp_in_fmt_conv[0].code; 104 106 105 - actual_ffmt->width = clamp_t( 106 - u32, ffmt->width, ATOM_ISP_MIN_WIDTH, 107 - ATOM_ISP_MAX_WIDTH); 108 - actual_ffmt->height = clamp_t( 109 - u32, ffmt->height, ATOM_ISP_MIN_HEIGHT, 110 - ATOM_ISP_MAX_HEIGHT); 107 + actual_ffmt->width = clamp_t(u32, ffmt->width, 108 + ATOM_ISP_MIN_WIDTH, 109 + ATOM_ISP_MAX_WIDTH); 110 + actual_ffmt->height = clamp_t(u32, ffmt->height, 111 + ATOM_ISP_MIN_HEIGHT, 112 + ATOM_ISP_MAX_HEIGHT); 111 113 112 114 tmp_ffmt = *ffmt = *actual_ffmt; 113 115 ··· 130 132 * @pad: pad num 131 133 * @fmt: pointer to v4l2 format structure 132 134 * return -EINVAL or zero on success 133 - */ 135 + */ 134 136 static int csi2_set_format(struct v4l2_subdev *sd, 135 137 struct v4l2_subdev_state *sd_state, 136 138 struct v4l2_subdev_format *fmt) ··· 145 147 * @enable: Enable/disable stream (1/0) 146 148 * 147 149 * Return 0 on success or a negative error code otherwise. 148 - */ 150 + */ 149 151 static int csi2_set_stream(struct v4l2_subdev *sd, int enable) 150 152 { 151 153 return 0; ··· 182 184 * @remote : Pointer to remote pad array 183 185 * @flags : Link flags 184 186 * return -EINVAL or zero on success 185 - */ 187 + */ 186 188 static int csi2_link_setup(struct media_entity *entity, 187 189 const struct media_pad *local, 188 190 const struct media_pad *remote, u32 flags) ··· 220 222 }; 221 223 222 224 /* 223 - * ispcsi2_init_entities - Initialize subdev and media entity. 224 - * @csi2: Pointer to ispcsi2 structure. 225 - * return -ENOMEM or zero on success 226 - */ 225 + * ispcsi2_init_entities - Initialize subdev and media entity. 226 + * @csi2: Pointer to ispcsi2 structure. 227 + * return -ENOMEM or zero on success 228 + */ 227 229 static int mipi_csi2_init_entities(struct atomisp_mipi_csi2_device *csi2, 228 230 int port) 229 231 { ··· 247 249 if (ret < 0) 248 250 return ret; 249 251 250 - csi2->formats[CSI2_PAD_SINK].code = 251 - csi2->formats[CSI2_PAD_SOURCE].code = 252 - atomisp_in_fmt_conv[0].code; 252 + csi2->formats[CSI2_PAD_SINK].code = atomisp_in_fmt_conv[0].code; 253 + csi2->formats[CSI2_PAD_SOURCE].code = atomisp_in_fmt_conv[0].code; 253 254 254 255 return 0; 255 256 } ··· 376 379 (isp->inputs[asd->input_curr].camera->ctrl_handler, &ctrl) == 0) 377 380 mipi_freq = ctrl.value; 378 381 379 - clk_termen = atomisp_csi2_configure_calc(coeff_clk_termen, 380 - mipi_freq, TERMEN_DEFAULT); 381 - clk_settle = atomisp_csi2_configure_calc(coeff_clk_settle, 382 - mipi_freq, SETTLE_DEFAULT); 383 - dat_termen = atomisp_csi2_configure_calc(coeff_dat_termen, 384 - mipi_freq, TERMEN_DEFAULT); 385 - dat_settle = atomisp_csi2_configure_calc(coeff_dat_settle, 386 - mipi_freq, SETTLE_DEFAULT); 382 + clk_termen = atomisp_csi2_configure_calc(coeff_clk_termen, mipi_freq, 383 + TERMEN_DEFAULT); 384 + clk_settle = atomisp_csi2_configure_calc(coeff_clk_settle, mipi_freq, 385 + SETTLE_DEFAULT); 386 + dat_termen = atomisp_csi2_configure_calc(coeff_dat_termen, mipi_freq, 387 + TERMEN_DEFAULT); 388 + dat_settle = atomisp_csi2_configure_calc(coeff_dat_settle, mipi_freq, 389 + SETTLE_DEFAULT); 390 + 387 391 for (n = 0; n < csi2_port_lanes[port] + 1; n++) { 388 392 hrt_address base = csi2_port_base[port] + csi2_lane_base[n]; 389 393 390 394 atomisp_css2_hw_store_32(base + CSI2_REG_RX_CSI_DLY_CNT_TERMEN, 391 - n == 0 ? clk_termen : dat_termen); 395 + n == 0 ? clk_termen : dat_termen); 392 396 atomisp_css2_hw_store_32(base + CSI2_REG_RX_CSI_DLY_CNT_SETTLE, 393 - n == 0 ? clk_settle : dat_settle); 397 + n == 0 ? clk_settle : dat_settle); 394 398 } 395 399 } 396 400 ··· 403 405 404 406 /* 405 407 * atomisp_mipi_csi2_cleanup - Routine for module driver cleanup 406 - */ 408 + */ 407 409 void atomisp_mipi_csi2_cleanup(struct atomisp_device *isp) 408 410 { 409 411 }