Re: [PATCH] v4l: Add driver for Micron MT9M032 camera sensor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday, January 19, 2011 00:50:35 Laurent Pinchart wrote:
> Hi Hans and Martin,
> 
> On Wednesday 19 January 2011 00:05:10 Hans Verkuil wrote:
> > On Tuesday, January 18, 2011 23:18:42 Martin Hostettler wrote:
> 
> [snip]
> 
> > > +	return mt9m032_write_reg(client, MT9M032_VBLANK,
> > > additional_blanking_rows);
> > 
> > I've found it easier to do the v4l2_subdev to i2c_client conversion at the
> > lowest level: the read/write register functions. That way the conversion is
> > done at only a few places, rather than at every place these read/write reg
> > functions are called. Just my opinion, though.
> 
> I agree with this.
> 
> > > +#ifdef CONFIG_VIDEO_ADV_DEBUG
> > > +static long mt9m032_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void
> > > *arg) +{
> > > +	if (cmd == VIDIOC_DBG_G_REGISTER || cmd == VIDIOC_DBG_S_REGISTER) {
> > > +		struct v4l2_dbg_register *p = arg;
> > > +
> > > +		if (!capable(CAP_SYS_ADMIN))
> > > +			return -EPERM;
> > > +
> > > +		if (cmd == VIDIOC_DBG_G_REGISTER)
> > > +			return v4l2_subdev_call(sd, core, g_register, p);
> > > +		else
> > > +			return v4l2_subdev_call(sd, core, s_register, p);
> > > +	} else {
> > > +		return -ENOIOCTLCMD;
> > > +	}
> > > +}
> > 
> > Huh? Ah, I get it. This is for when the user uses the subdev's device node
> > directly. This is not good, the v4l2 framework should do translate this to
> > g/s_register.
> 
> Agreed.
> 
> > The same should be done for g_chip_ident, I guess.
> 
> I don't think we need g_chip_ident for subdev nodes, do we ?

Why not? It makes the use of v4l2-dbg a bit easier if it is there. If you
provide g/s_register, then you should provide this one as well.

I though of another one that should be handled in the framework: VIDIOC_LOG_STATUS.

That definitely should be handled as well.

Regards,

	Hans

> 
> > > +#endif
> 
> 

-- 
Hans Verkuil - video4linux developer - sponsored by Cisco
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux