Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54943789 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (12622): gspca_mr97310a: make the probing a bit less chatty



gspca_mr97310a: make the probing a bit less chatty

Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 5f5e26b1
Loading
Loading
Loading
Loading
+8 −14
Original line number Original line Diff line number Diff line
@@ -305,6 +305,7 @@ static int zero_the_pointer(struct gspca_dev *gspca_dev)
		if (err_code < 0)
		if (err_code < 0)
			return err_code;
			return err_code;
	}
	}
	if (status != 0x0a)
		PDEBUG(D_ERR, "status is %02x", status);
		PDEBUG(D_ERR, "status is %02x", status);


	tries = 0;
	tries = 0;
@@ -321,7 +322,6 @@ static int zero_the_pointer(struct gspca_dev *gspca_dev)
		if (err_code < 0)
		if (err_code < 0)
			return err_code;
			return err_code;
	}
	}
	PDEBUG(D_ERR, "Read 16 bytes from camera");


	data[0] = 0x19;
	data[0] = 0x19;
	err_code = mr_write(gspca_dev, 1);
	err_code = mr_write(gspca_dev, 1);
@@ -348,8 +348,7 @@ static u8 get_sensor_id(struct gspca_dev *gspca_dev)
	if (err_code < 0)
	if (err_code < 0)
		return err_code;
		return err_code;


	PDEBUG(D_ERR, "Read 16 bytes from camera");
	PDEBUG(D_PROBE, "Byte zero reported is %01x", gspca_dev->usb_buf[0]);
	PDEBUG(D_ERR, "Byte zero reported is %01x", gspca_dev->usb_buf[0]);


	return gspca_dev->usb_buf[0];
	return gspca_dev->usb_buf[0];
}
}
@@ -367,10 +366,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
	cam->cam_mode = vga_mode;
	cam->cam_mode = vga_mode;
	cam->nmodes = ARRAY_SIZE(vga_mode);
	cam->nmodes = ARRAY_SIZE(vga_mode);


	PDEBUG(D_PROBE,
		"MR97310A camera detected"
		" (vid/pid 0x%04X:0x%04X)", id->idVendor, id->idProduct);

	if (id->idProduct == 0x010e) {
	if (id->idProduct == 0x010e) {
		sd->cam_type = CAM_TYPE_CIF;
		sd->cam_type = CAM_TYPE_CIF;
		cam->nmodes--;
		cam->nmodes--;
@@ -401,13 +396,15 @@ static int sd_config(struct gspca_dev *gspca_dev,
		else
		else
			sd->sensor_type = 0;
			sd->sensor_type = 0;


		PDEBUG(D_ERR, "Sensor type is %01x", sd->sensor_type);
		PDEBUG(D_PROBE, "MR97310A CIF camera detected, sensor: %d",
		       sd->sensor_type);


		if (sd->sensor_type == 0)
		if (sd->sensor_type == 0)
			gspca_dev->ctrl_dis = (1 << BRIGHTNESS_IDX) |
			gspca_dev->ctrl_dis = (1 << BRIGHTNESS_IDX) |
					      (1 << EXPOSURE_IDX) | (1 << GAIN_IDX);
					      (1 << EXPOSURE_IDX) | (1 << GAIN_IDX);
	} else {
	} else {
		sd->cam_type = CAM_TYPE_VGA;
		sd->cam_type = CAM_TYPE_VGA;
		PDEBUG(D_PROBE, "MR97310A VGA camera detected");
		gspca_dev->ctrl_dis = (1 << BRIGHTNESS_IDX) |
		gspca_dev->ctrl_dis = (1 << BRIGHTNESS_IDX) |
				      (1 << EXPOSURE_IDX) | (1 << GAIN_IDX);
				      (1 << EXPOSURE_IDX) | (1 << GAIN_IDX);
	}
	}
@@ -568,8 +565,7 @@ static int start_vga_cam(struct gspca_dev *gspca_dev)
	if (err_code < 0)
	if (err_code < 0)
		return err_code;
		return err_code;


	PDEBUG(D_ERR, "Read 16 bytes from camera");
	PDEBUG(D_PROBE, "Byte reported is %02x", data[0]);
	PDEBUG(D_ERR, "Byte reported is %02x", data[0]);


	msleep(200);
	msleep(200);
	/*
	/*
@@ -604,7 +600,7 @@ static int start_vga_cam(struct gspca_dev *gspca_dev)
		data[0] = get_sensor_id(gspca_dev);
		data[0] = get_sensor_id(gspca_dev);
		if (data[0] == 0x7f) {
		if (data[0] == 0x7f) {
			sd->sensor_type = 1;
			sd->sensor_type = 1;
			PDEBUG(D_ERR, "sensor_type corrected to 1");
			PDEBUG(D_PROBE, "sensor_type corrected to 1");
		}
		}
		msleep(200);
		msleep(200);
	}
	}
@@ -715,10 +711,8 @@ static int sd_start(struct gspca_dev *gspca_dev)
	zero_the_pointer(gspca_dev);
	zero_the_pointer(gspca_dev);
	msleep(200);
	msleep(200);
	if (sd->cam_type == CAM_TYPE_CIF) {
	if (sd->cam_type == CAM_TYPE_CIF) {
		PDEBUG(D_ERR, "CIF camera");
		err_code = start_cif_cam(gspca_dev);
		err_code = start_cif_cam(gspca_dev);
	} else {
	} else {
		PDEBUG(D_ERR, "VGA camera");
		err_code = start_vga_cam(gspca_dev);
		err_code = start_vga_cam(gspca_dev);
	}
	}
	return err_code;
	return err_code;