Commit 5d28d525 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (13645): soc-camera: fix multi-line comment coding style

parent 32536108
Loading
Loading
Loading
Loading
+24 −12
Original line number Diff line number Diff line
@@ -17,9 +17,11 @@
#include <media/v4l2-chip-ident.h>
#include <media/soc_camera.h>

/* mt9m001 i2c address 0x5d
/*
 * mt9m001 i2c address 0x5d
 * The platform has to define ctruct i2c_board_info objects and link to them
 * from struct soc_camera_link */
 * from struct soc_camera_link
 */

/* mt9m001 selected register addresses */
#define MT9M001_CHIP_VERSION		0x00
@@ -47,8 +49,10 @@
#define MT9M001_ROW_SKIP		12

static const struct soc_camera_data_format mt9m001_colour_formats[] = {
	/* Order important: first natively supported,
	 * second supported with a GPIO extender */
	/*
	 * Order important: first natively supported,
	 * second supported with a GPIO extender
	 */
	{
		.name		= "Bayer (sRGB) 10 bit",
		.depth		= 10,
@@ -230,8 +234,10 @@ static int mt9m001_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
	if (!ret)
		ret = reg_write(client, MT9M001_VERTICAL_BLANKING, vblank);

	/* The caller provides a supported format, as verified per
	 * call to icd->try_fmt() */
	/*
	 * The caller provides a supported format, as verified per
	 * call to icd->try_fmt()
	 */
	if (!ret)
		ret = reg_write(client, MT9M001_COLUMN_START, rect.left);
	if (!ret)
@@ -569,8 +575,10 @@ static int mt9m001_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
	return 0;
}

/* Interface active, can use i2c. If it fails, it can indeed mean, that
 * this wasn't our capture interface, so, we wait for the right one */
/*
 * Interface active, can use i2c. If it fails, it can indeed mean, that
 * this wasn't our capture interface, so, we wait for the right one
 */
static int mt9m001_video_probe(struct soc_camera_device *icd,
			       struct i2c_client *client)
{
@@ -580,8 +588,10 @@ static int mt9m001_video_probe(struct soc_camera_device *icd,
	unsigned long flags;
	int ret;

	/* We must have a parent by now. And it cannot be a wrong one.
	 * So this entire test is completely redundant. */
	/*
	 * We must have a parent by now. And it cannot be a wrong one.
	 * So this entire test is completely redundant.
	 */
	if (!icd->dev.parent ||
	    to_soc_camera_host(icd->dev.parent)->nr != icd->iface)
		return -ENODEV;
@@ -737,8 +747,10 @@ static int mt9m001_probe(struct i2c_client *client,
	mt9m001->rect.width	= MT9M001_MAX_WIDTH;
	mt9m001->rect.height	= MT9M001_MAX_HEIGHT;

	/* Simulated autoexposure. If enabled, we calculate shutter width
	 * ourselves in the driver based on vertical blanking and frame width */
	/*
	 * Simulated autoexposure. If enabled, we calculate shutter width
	 * ourselves in the driver based on vertical blanking and frame width
	 */
	mt9m001->autoexposure = 1;

	ret = mt9m001_video_probe(icd, client);
+16 −8
Original line number Diff line number Diff line
@@ -17,9 +17,11 @@
#include <media/v4l2-chip-ident.h>
#include <media/soc_camera.h>

/* mt9t031 i2c address 0x5d
/*
 * mt9t031 i2c address 0x5d
 * The platform has to define i2c_board_info and link to it from
 * struct soc_camera_link */
 * struct soc_camera_link
 */

/* mt9t031 selected register addresses */
#define MT9T031_CHIP_VERSION		0x00
@@ -292,8 +294,10 @@ static int mt9t031_set_params(struct soc_camera_device *icd,
	dev_dbg(&client->dev, "new physical left %u, top %u\n",
		rect->left, rect->top);

	/* The caller provides a supported format, as guaranteed by
	 * icd->try_fmt_cap(), soc_camera_s_crop() and soc_camera_cropcap() */
	/*
	 * The caller provides a supported format, as guaranteed by
	 * icd->try_fmt_cap(), soc_camera_s_crop() and soc_camera_cropcap()
	 */
	if (ret >= 0)
		ret = reg_write(client, MT9T031_COLUMN_START, rect->left);
	if (ret >= 0)
@@ -674,8 +678,10 @@ static int mt9t031_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
	return 0;
}

/* Interface active, can use i2c. If it fails, it can indeed mean, that
 * this wasn't our capture interface, so, we wait for the right one */
/*
 * Interface active, can use i2c. If it fails, it can indeed mean, that
 * this wasn't our capture interface, so, we wait for the right one
 */
static int mt9t031_video_probe(struct i2c_client *client)
{
	struct soc_camera_device *icd = client->dev.platform_data;
@@ -796,8 +802,10 @@ static int mt9t031_probe(struct i2c_client *client,
	mt9t031->rect.width	= MT9T031_MAX_WIDTH;
	mt9t031->rect.height	= MT9T031_MAX_HEIGHT;

	/* Simulated autoexposure. If enabled, we calculate shutter width
	 * ourselves in the driver based on vertical blanking and frame width */
	/*
	 * Simulated autoexposure. If enabled, we calculate shutter width
	 * ourselves in the driver based on vertical blanking and frame width
	 */
	mt9t031->autoexposure = 1;

	mt9t031->xskip = 1;
+32 −16
Original line number Diff line number Diff line
@@ -18,9 +18,11 @@
#include <media/v4l2-chip-ident.h>
#include <media/soc_camera.h>

/* mt9v022 i2c address 0x48, 0x4c, 0x58, 0x5c
/*
 * mt9v022 i2c address 0x48, 0x4c, 0x58, 0x5c
 * The platform has to define ctruct i2c_board_info objects and link to them
 * from struct soc_camera_link */
 * from struct soc_camera_link
 */

static char *sensor_type;
module_param(sensor_type, charp, S_IRUGO);
@@ -63,8 +65,10 @@ MODULE_PARM_DESC(sensor_type, "Sensor type: \"colour\" or \"monochrome\"");
#define MT9V022_ROW_SKIP		4

static const struct soc_camera_data_format mt9v022_colour_formats[] = {
	/* Order important: first natively supported,
	 * second supported with a GPIO extender */
	/*
	 * Order important: first natively supported,
	 * second supported with a GPIO extender
	 */
	{
		.name		= "Bayer (sRGB) 10 bit",
		.depth		= 10,
@@ -144,9 +148,11 @@ static int mt9v022_init(struct i2c_client *client)
	struct mt9v022 *mt9v022 = to_mt9v022(client);
	int ret;

	/* Almost the default mode: master, parallel, simultaneous, and an
	/*
	 * Almost the default mode: master, parallel, simultaneous, and an
	 * undocumented bit 0x200, which is present in table 7, but not in 8,
	 * plus snapshot mode to disable scan for now */
	 * plus snapshot mode to disable scan for now
	 */
	mt9v022->chip_control |= 0x10;
	ret = reg_write(client, MT9V022_CHIP_CONTROL, mt9v022->chip_control);
	if (!ret)
@@ -298,8 +304,10 @@ static int mt9v022_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
	if (!ret)
		ret = reg_write(client, MT9V022_ROW_START, rect.top);
	if (!ret)
		/* Default 94, Phytec driver says:
		 * "width + horizontal blank >= 660" */
		/*
		 * Default 94, Phytec driver says:
		 * "width + horizontal blank >= 660"
		 */
		ret = reg_write(client, MT9V022_HORIZONTAL_BLANKING,
				rect.width > 660 - 43 ? 43 :
				660 - rect.width);
@@ -376,8 +384,10 @@ static int mt9v022_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
	};
	int ret;

	/* The caller provides a supported format, as verified per call to
	 * icd->try_fmt(), datawidth is from our supported format list */
	/*
	 * The caller provides a supported format, as verified per call to
	 * icd->try_fmt(), datawidth is from our supported format list
	 */
	switch (pix->pixelformat) {
	case V4L2_PIX_FMT_GREY:
	case V4L2_PIX_FMT_Y16:
@@ -635,8 +645,10 @@ static int mt9v022_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
					      48 + range / 2) / range + 16;
			if (gain >= 32)
				gain &= ~1;
			/* The user wants to set gain manually, hope, she
			 * knows, what she's doing... Switch AGC off. */
			/*
			 * The user wants to set gain manually, hope, she
			 * knows, what she's doing... Switch AGC off.
			 */

			if (reg_clear(client, MT9V022_AEC_AGC_ENABLE, 0x2) < 0)
				return -EIO;
@@ -655,8 +667,10 @@ static int mt9v022_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
			unsigned long range = qctrl->maximum - qctrl->minimum;
			unsigned long shutter = ((ctrl->value - qctrl->minimum) *
						 479 + range / 2) / range + 1;
			/* The user wants to set shutter width manually, hope,
			 * she knows, what she's doing... Switch AEC off. */
			/*
			 * The user wants to set shutter width manually, hope,
			 * she knows, what she's doing... Switch AEC off.
			 */

			if (reg_clear(client, MT9V022_AEC_AGC_ENABLE, 0x1) < 0)
				return -EIO;
@@ -689,8 +703,10 @@ static int mt9v022_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
	return 0;
}

/* Interface active, can use i2c. If it fails, it can indeed mean, that
 * this wasn't our capture interface, so, we wait for the right one */
/*
 * Interface active, can use i2c. If it fails, it can indeed mean, that
 * this wasn't our capture interface, so, we wait for the right one
 */
static int mt9v022_video_probe(struct soc_camera_device *icd,
			       struct i2c_client *client)
{
+24 −12
Original line number Diff line number Diff line
@@ -99,9 +99,11 @@ struct mx1_buffer {
	int inwork;
};

/* i.MX1/i.MXL is only supposed to handle one camera on its Camera Sensor
/*
 * i.MX1/i.MXL is only supposed to handle one camera on its Camera Sensor
 * Interface. If anyone ever builds hardware to enable more than
 * one camera, they will have to modify this driver too */
 * one camera, they will have to modify this driver too
 */
struct mx1_camera_dev {
	struct soc_camera_host		soc_host;
	struct soc_camera_device	*icd;
@@ -151,8 +153,10 @@ static void free_buffer(struct videobuf_queue *vq, struct mx1_buffer *buf)
	dev_dbg(icd->dev.parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
		vb, vb->baddr, vb->bsize);

	/* This waits until this buffer is out of danger, i.e., until it is no
	 * longer in STATE_QUEUED or STATE_ACTIVE */
	/*
	 * This waits until this buffer is out of danger, i.e., until it is no
	 * longer in STATE_QUEUED or STATE_ACTIVE
	 */
	videobuf_waiton(vb, 0, 0);
	videobuf_dma_contig_free(vq, vb);

@@ -174,8 +178,10 @@ static int mx1_videobuf_prepare(struct videobuf_queue *vq,

	BUG_ON(NULL == icd->current_fmt);

	/* I think, in buf_prepare you only have to protect global data,
	 * the actual buffer is yours */
	/*
	 * I think, in buf_prepare you only have to protect global data,
	 * the actual buffer is yours
	 */
	buf->inwork = 1;

	if (buf->fmt	!= icd->current_fmt ||
@@ -381,8 +387,10 @@ static int mclk_get_divisor(struct mx1_camera_dev *pcdev)

	lcdclk = clk_get_rate(pcdev->clk);

	/* We verify platform_mclk_10khz != 0, so if anyone breaks it, here
	 * they get a nice Oops */
	/*
	 * We verify platform_mclk_10khz != 0, so if anyone breaks it, here
	 * they get a nice Oops
	 */
	div = (lcdclk + 2 * mclk - 1) / (2 * mclk) - 1;

	dev_dbg(pcdev->icd->dev.parent,
@@ -420,8 +428,10 @@ static void mx1_camera_deactivate(struct mx1_camera_dev *pcdev)
	clk_disable(pcdev->clk);
}

/* The following two functions absolutely depend on the fact, that
 * there can be only one camera on i.MX1/i.MXL camera sensor interface */
/*
 * The following two functions absolutely depend on the fact, that
 * there can be only one camera on i.MX1/i.MXL camera sensor interface
 */
static int mx1_camera_add_device(struct soc_camera_device *icd)
{
	struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
@@ -578,10 +588,12 @@ static int mx1_camera_reqbufs(struct soc_camera_file *icf,
{
	int i;

	/* This is for locking debugging only. I removed spinlocks and now I
	/*
	 * This is for locking debugging only. I removed spinlocks and now I
	 * check whether .prepare is ever called on a linked buffer, or whether
	 * a dma IRQ can occur for an in-work or unlinked buffer. Until now
	 * it hadn't triggered */
	 * it hadn't triggered
	 */
	for (i = 0; i < p->count; i++) {
		struct mx1_buffer *buf = container_of(icf->vb_vidq.bufs[i],
						      struct mx1_buffer, vb);
+12 −6
Original line number Diff line number Diff line
@@ -564,8 +564,10 @@ static int test_platform_param(struct mx3_camera_dev *mx3_cam,
		SOCAM_DATA_ACTIVE_HIGH |
		SOCAM_DATA_ACTIVE_LOW;

	/* If requested data width is supported by the platform, use it or any
	 * possible lower value - i.MX31 is smart enough to schift bits */
	/*
	 * If requested data width is supported by the platform, use it or any
	 * possible lower value - i.MX31 is smart enough to schift bits
	 */
	switch (buswidth) {
	case 15:
		if (!(mx3_cam->platform_flags & MX3_CAMERA_DATAWIDTH_15))
@@ -1027,8 +1029,10 @@ static int mx3_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt)
			common_flags &= ~SOCAM_PCLK_SAMPLE_FALLING;
	}

	/* Make the camera work in widest common mode, we'll take care of
	 * the rest */
	/*
	 * Make the camera work in widest common mode, we'll take care of
	 * the rest
	 */
	if (common_flags & SOCAM_DATAWIDTH_15)
		common_flags = (common_flags & ~SOCAM_DATAWIDTH_MASK) |
			SOCAM_DATAWIDTH_15;
@@ -1152,8 +1156,10 @@ static int __devinit mx3_camera_probe(struct platform_device *pdev)
	if (!(mx3_cam->platform_flags & (MX3_CAMERA_DATAWIDTH_4 |
			MX3_CAMERA_DATAWIDTH_8 | MX3_CAMERA_DATAWIDTH_10 |
			MX3_CAMERA_DATAWIDTH_15))) {
		/* Platform hasn't set available data widths. This is bad.
		 * Warn and use a default. */
		/*
		 * Platform hasn't set available data widths. This is bad.
		 * Warn and use a default.
		 */
		dev_warn(&pdev->dev, "WARNING! Platform hasn't set available "
			 "data widths, using default 8 bit\n");
		mx3_cam->platform_flags |= MX3_CAMERA_DATAWIDTH_8;
Loading