Commit eaa399eb authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

media: atomisp: do lots of other coding style cleanups



Use some auto-reformat tools to make the atomisp style
a little better. There are still lots of weird things there,
but this will hopefully reduce the number of pure coding
style patches submitted upstream.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent bdfe0beb
Loading
Loading
Loading
Loading
+131 −128
Original line number Diff line number Diff line
@@ -388,7 +388,8 @@ static int gc0310_get_intg_factor(struct i2c_client *client,
		return ret;
	sh_delay = reg_val;
	buf->line_length_pck = buf->output_width + hori_blanking + sh_delay + 4;
	pr_info("hori_blanking=%d sh_delay=%d line_length_pck=%d\n", hori_blanking, sh_delay, buf->line_length_pck);
	pr_info("hori_blanking=%d sh_delay=%d line_length_pck=%d\n", hori_blanking,
		sh_delay, buf->line_length_pck);

	/* Getting frame_length_lines */
	ret = gc0310_read_reg(client, GC0310_8BIT,
@@ -402,7 +403,8 @@ static int gc0310_get_intg_factor(struct i2c_client *client,
		return ret;
	vert_blanking = val | (reg_val & 0xFF);
	buf->frame_length_lines = buf->output_height + vert_blanking;
	pr_info("vert_blanking=%d frame_length_lines=%d\n", vert_blanking, buf->frame_length_lines);
	pr_info("vert_blanking=%d frame_length_lines=%d\n", vert_blanking,
		buf->frame_length_lines);

	buf->binning_factor_x = res->bin_factor_x ?
				res->bin_factor_x : 1;
@@ -1085,7 +1087,8 @@ static int gc0310_detect(struct i2c_client *client)
	pr_info("sensor ID = 0x%x\n", id);

	if (id != GC0310_ID) {
		dev_err(&client->dev, "sensor ID error, read id = 0x%x, target id = 0x%x\n", id, GC0310_ID);
		dev_err(&client->dev, "sensor ID error, read id = 0x%x, target id = 0x%x\n", id,
			GC0310_ID);
		return -ENODEV;
	}

+134 −132
Original line number Diff line number Diff line
@@ -251,7 +251,8 @@ static int ov2680_write_reg_array(struct i2c_client *client,
			 * If next address is not consecutive, data needs to be
			 * flushed before proceed.
			 */
			 dev_dbg(&client->dev,  "+++ov2680_write_reg_array reg=%x->%x\n", next->reg, next->val);
			dev_dbg(&client->dev,  "+++ov2680_write_reg_array reg=%x->%x\n", next->reg,
				next->val);
			if (!__ov2680_write_reg_is_consecutive(client, &ctrl,
							       next)) {
				err = __ov2680_flush_reg_array(client, &ctrl);
@@ -619,7 +620,8 @@ static int ov2680_v_flip(struct v4l2_subdev *sd, s32 value)
			       OV2680_FLIP_REG, val);
	if (ret)
		return ret;
	index = (v_flag > 0 ? OV2680_FLIP_BIT : 0) | (h_flag > 0 ? OV2680_MIRROR_BIT : 0);
	index = (v_flag > 0 ? OV2680_FLIP_BIT : 0) | (h_flag > 0 ? OV2680_MIRROR_BIT :
		0);
	ov2680_info = v4l2_get_subdev_hostdata(sd);
	if (ov2680_info) {
		ov2680_info->raw_bayer_order = ov2680_bayer_order_mapping[index];
@@ -652,7 +654,8 @@ static int ov2680_h_flip(struct v4l2_subdev *sd, s32 value)
			       OV2680_MIRROR_REG, val);
	if (ret)
		return ret;
	index = (v_flag > 0 ? OV2680_FLIP_BIT : 0) | (h_flag > 0 ? OV2680_MIRROR_BIT : 0);
	index = (v_flag > 0 ? OV2680_FLIP_BIT : 0) | (h_flag > 0 ? OV2680_MIRROR_BIT :
		0);
	ov2680_info = v4l2_get_subdev_hostdata(sd);
	if (ov2680_info) {
		ov2680_info->raw_bayer_order = ov2680_bayer_order_mapping[index];
@@ -1435,8 +1438,7 @@ static int ov2680_probe(struct i2c_client *client)
	dev->sd.ctrl_handler = &dev->ctrl_handler;

	ret = media_entity_pads_init(&dev->sd.entity, 1, &dev->pad);
	if (ret)
	{
	if (ret) {
		ov2680_remove(client);
		dev_dbg(&client->dev, "+++ remove ov2680\n");
	}
+176 −171
Original line number Diff line number Diff line
@@ -53,7 +53,8 @@
 */
static uint up_delay = 30;
module_param(up_delay, uint, 0644);
MODULE_PARM_DESC(up_delay, "Delay prior to the first CCI transaction for ov5693");
MODULE_PARM_DESC(up_delay,
		 "Delay prior to the first CCI transaction for ov5693");

static int vcm_ad_i2c_wr8(struct i2c_client *client, u8 reg, u8 val)
{
@@ -740,7 +741,8 @@ static int __ov5693_otp_read(struct v4l2_subdev *sd, u8 *buf)
	dev->otp_size = 0;
	for (i = 1; i < OV5693_OTP_BANK_MAX; i++) {
		/*set bank NO and OTP read mode. */
		ret = ov5693_write_reg(client, OV5693_8BIT, OV5693_OTP_BANK_REG, (i | 0xc0));	//[7:6] 2'b11 [5:0] bank no
		ret = ov5693_write_reg(client, OV5693_8BIT, OV5693_OTP_BANK_REG,
				       (i | 0xc0));	//[7:6] 2'b11 [5:0] bank no
		if (ret) {
			dev_err(&client->dev, "failed to prepare OTP page\n");
			return ret;
@@ -748,7 +750,8 @@ static int __ov5693_otp_read(struct v4l2_subdev *sd, u8 *buf)
		//pr_debug("write 0x%x->0x%x\n",OV5693_OTP_BANK_REG,(i|0xc0));

		/*enable read */
		ret = ov5693_write_reg(client, OV5693_8BIT, OV5693_OTP_READ_REG, OV5693_OTP_MODE_READ);	// enable :1
		ret = ov5693_write_reg(client, OV5693_8BIT, OV5693_OTP_READ_REG,
				       OV5693_OTP_MODE_READ);	// enable :1
		if (ret) {
			dev_err(&client->dev,
				"failed to set OTP reading mode page");
@@ -776,7 +779,8 @@ static int __ov5693_otp_read(struct v4l2_subdev *sd, u8 *buf)
				b = buf;
				continue;
			}
		} else if (i == 24) {		//if the first 320bytes data doesn't not exist, try to read the next 32bytes data.
		} else if (i ==
			   24) {		//if the first 320bytes data doesn't not exist, try to read the next 32bytes data.
			if ((*b) == 0) {
				dev->otp_size = 32;
				break;
@@ -784,7 +788,8 @@ static int __ov5693_otp_read(struct v4l2_subdev *sd, u8 *buf)
				b = buf;
				continue;
			}
		} else if (i == 27) {		//if the prvious 32bytes data doesn't exist, try to read the next 32bytes data again.
		} else if (i ==
			   27) {		//if the prvious 32bytes data doesn't exist, try to read the next 32bytes data again.
			if ((*b) == 0) {
				dev->otp_size = 32;
				break;
+2 −1
Original line number Diff line number Diff line
@@ -407,7 +407,8 @@ struct atomisp_zoom_point {
 * This specifies the region
 */
struct atomisp_zoom_region {
	struct atomisp_zoom_point origin; /* Starting point coordinates for the region */
	struct atomisp_zoom_point
		origin; /* Starting point coordinates for the region */
	struct atomisp_resolution resolution; /* Region resolution */
};

+19 −18
Original line number Diff line number Diff line
@@ -383,7 +383,8 @@ int atomisp_acc_map(struct atomisp_sub_device *asd, struct atomisp_acc_map *map)
	return 0;
}

int atomisp_acc_unmap(struct atomisp_sub_device *asd, struct atomisp_acc_map *map)
int atomisp_acc_unmap(struct atomisp_sub_device *asd,
		      struct atomisp_acc_map *map)
{
	struct atomisp_map *atomisp_map;

Loading