Re: [PATCH 10/11] ov534: Add Powerline Frequency control

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

 



On Sun, 28 Feb 2010 19:49:51 +0100
Jean-Francois Moine <moinejf@xxxxxxx> wrote:

> On Sat, 27 Feb 2010 21:20:27 +0100
> Antonio Ospite <ospite@xxxxxxxxxxxxxxxxx> wrote:
> 
> > +static int sd_querymenu(struct gspca_dev *gspca_dev,
> > +		struct v4l2_querymenu *menu)
> > +{
> > +	switch (menu->id) {
> > +	case V4L2_CID_POWER_LINE_FREQUENCY:
> > +		switch (menu->index) {
> > +		case 0:         /*
> > V4L2_CID_POWER_LINE_FREQUENCY_50HZ */
> > +			strcpy((char *) menu->name, "50 Hz");
> > +			return 0;
> > +		case 1:         /*
> > V4L2_CID_POWER_LINE_FREQUENCY_60HZ */
> > +			strcpy((char *) menu->name, "60 Hz");
> > +			return 0;
> > +		}
> > +		break;
> > +	}
> > +
> > +	return -EINVAL;
> > +}
> 
> In videodev2.h, there is:
> 
> V4L2_CID_POWER_LINE_FREQUENCY_50HZ      = 1,
> V4L2_CID_POWER_LINE_FREQUENCY_60HZ      = 2,
>

Maybe we could just use
	V4L2_CID_POWER_LINE_FREQUENCY_DISABLED	= 0,
	V4L2_CID_POWER_LINE_FREQUENCY_50HZ	= 1,

It looks like the code matches the DISABLED state (writing 0 to the
register). Mosalam?

Regards,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

Attachment: pgpklcCkdagy0.pgp
Description: PGP signature


[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