Linux Media Controller development
 help / color / mirror / Atom feed
* soc-camera: Why are exposure and gain handled via special cases?
@ 2009-06-08 16:31 Jonathan Cameron
  2009-06-08 17:53 ` Guennadi Liakhovetski
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Cameron @ 2009-06-08 16:31 UTC (permalink / raw)
  To: Linux Media Mailing List

Hi All,

Whilst working on merging the various ov7670 drivers posted
recently, I came across the following in soc-camera:

static int soc_camera_g_ctrl(struct file *file, void *priv,
			     struct v4l2_control *ctrl)
{
	struct soc_camera_file *icf = file->private_data;
	struct soc_camera_device *icd = icf->icd;
	struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);

	WARN_ON(priv != file->private_data);

	switch (ctrl->id) {
	case V4L2_CID_GAIN:
		if (icd->gain == (unsigned short)~0)
			return -EINVAL;
		ctrl->value = icd->gain;
		return 0;
	case V4L2_CID_EXPOSURE:
		if (icd->exposure == (unsigned short)~0)
			return -EINVAL;
		ctrl->value = icd->exposure;
		return 0;
	}

	return v4l2_device_call_until_err(&ici->v4l2_dev, (__u32)icd, core, g_ctrl, ctrl);
}

Why are these two cases and only these two handled by soc-camera rather than being passed
on to the drivers?

Thanks,

Jonathan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-08 17:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-08 16:31 soc-camera: Why are exposure and gain handled via special cases? Jonathan Cameron
2009-06-08 17:53 ` Guennadi Liakhovetski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox