aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx25840/cx25840-core.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-01-09 12:32:41 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-09 12:32:41 -0500
commitd92c20e0a5b560bbe46d7e68bb47df2366cddf8f (patch)
tree6fe906f5fb4c7bb3d3581a298ffb2ad864f43545 /drivers/media/video/cx25840/cx25840-core.c
parentfac9e89999a12f378112fe93764b30196bc03f46 (diff)
V4L/DVB (3279): Added VIDIOC_QUERYCTRL to cx25840.
- Added VIDIOC_QUERYCTRL - Removed unnecessary inlines. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'drivers/media/video/cx25840/cx25840-core.c')
-rw-r--r--drivers/media/video/cx25840/cx25840-core.c102
1 files changed, 100 insertions, 2 deletions
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c
index 2bf057ec626c..d7ece6eecb5c 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -121,7 +121,7 @@ static void log_status(struct i2c_client *client);
121 121
122/* ----------------------------------------------------------------------- */ 122/* ----------------------------------------------------------------------- */
123 123
124static inline void init_dll1(struct i2c_client *client) 124static void init_dll1(struct i2c_client *client)
125{ 125{
126 /* This is the Hauppauge sequence used to 126 /* This is the Hauppauge sequence used to
127 * initialize the Delay Lock Loop 1 (ADC DLL). */ 127 * initialize the Delay Lock Loop 1 (ADC DLL). */
@@ -135,7 +135,7 @@ static inline void init_dll1(struct i2c_client *client)
135 cx25840_write(client, 0x15b, 0x10); 135 cx25840_write(client, 0x15b, 0x10);
136} 136}
137 137
138static inline void init_dll2(struct i2c_client *client) 138static void init_dll2(struct i2c_client *client)
139{ 139{
140 /* This is the Hauppauge sequence used to 140 /* This is the Hauppauge sequence used to
141 * initialize the Delay Lock Loop 2 (ADC DLL). */ 141 * initialize the Delay Lock Loop 2 (ADC DLL). */
@@ -562,6 +562,91 @@ static int set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt)
562 562
563/* ----------------------------------------------------------------------- */ 563/* ----------------------------------------------------------------------- */
564 564
565static struct v4l2_queryctrl cx25840_qctrl[] = {
566 {
567 .id = V4L2_CID_BRIGHTNESS,
568 .type = V4L2_CTRL_TYPE_INTEGER,
569 .name = "Brightness",
570 .minimum = 0,
571 .maximum = 255,
572 .step = 1,
573 .default_value = 128,
574 .flags = 0,
575 }, {
576 .id = V4L2_CID_CONTRAST,
577 .type = V4L2_CTRL_TYPE_INTEGER,
578 .name = "Contrast",
579 .minimum = 0,
580 .maximum = 255,
581 .step = 1,
582 .default_value = 64,
583 .flags = 0,
584 }, {
585 .id = V4L2_CID_SATURATION,
586 .type = V4L2_CTRL_TYPE_INTEGER,
587 .name = "Saturation",
588 .minimum = 0,
589 .maximum = 255,
590 .step = 1,
591 .default_value = 64,
592 .flags = 0,
593 }, {
594 .id = V4L2_CID_HUE,
595 .type = V4L2_CTRL_TYPE_INTEGER,
596 .name = "Hue",
597 .minimum = -128,
598 .maximum = 127,
599 .step = 1,
600 .default_value = 0,
601 .flags = 0,
602 }, {
603 .id = V4L2_CID_AUDIO_VOLUME,
604 .type = V4L2_CTRL_TYPE_INTEGER,
605 .name = "Volume",
606 .minimum = 0,
607 .maximum = 65535,
608 .step = 65535/100,
609 .default_value = 58880,
610 .flags = 0,
611 }, {
612 .id = V4L2_CID_AUDIO_BALANCE,
613 .type = V4L2_CTRL_TYPE_INTEGER,
614 .name = "Balance",
615 .minimum = 0,
616 .maximum = 65535,
617 .step = 65535/100,
618 .default_value = 32768,
619 .flags = 0,
620 }, {
621 .id = V4L2_CID_AUDIO_MUTE,
622 .type = V4L2_CTRL_TYPE_BOOLEAN,
623 .name = "Mute",
624 .minimum = 0,
625 .maximum = 1,
626 .step = 1,
627 .default_value = 1,
628 .flags = 0,
629 }, {
630 .id = V4L2_CID_AUDIO_BASS,
631 .type = V4L2_CTRL_TYPE_INTEGER,
632 .name = "Bass",
633 .minimum = 0,
634 .maximum = 65535,
635 .step = 65535/100,
636 .default_value = 32768,
637 }, {
638 .id = V4L2_CID_AUDIO_TREBLE,
639 .type = V4L2_CTRL_TYPE_INTEGER,
640 .name = "Treble",
641 .minimum = 0,
642 .maximum = 65535,
643 .step = 65535/100,
644 .default_value = 32768,
645 },
646};
647
648/* ----------------------------------------------------------------------- */
649
565static int cx25840_command(struct i2c_client *client, unsigned int cmd, 650static int cx25840_command(struct i2c_client *client, unsigned int cmd,
566 void *arg) 651 void *arg)
567{ 652{
@@ -623,6 +708,19 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd,
623 case VIDIOC_S_CTRL: 708 case VIDIOC_S_CTRL:
624 return set_v4lctrl(client, (struct v4l2_control *)arg); 709 return set_v4lctrl(client, (struct v4l2_control *)arg);
625 710
711 case VIDIOC_QUERYCTRL:
712 {
713 struct v4l2_queryctrl *qc = arg;
714 int i;
715
716 for (i = 0; i < ARRAY_SIZE(cx25840_qctrl); i++)
717 if (qc->id && qc->id == cx25840_qctrl[i].id) {
718 memcpy(qc, &cx25840_qctrl[i], sizeof(*qc));
719 return 0;
720 }
721 return -EINVAL;
722 }
723
626 case VIDIOC_G_STD: 724 case VIDIOC_G_STD:
627 *(v4l2_std_id *)arg = cx25840_get_v4lstd(client); 725 *(v4l2_std_id *)arg = cx25840_get_v4lstd(client);
628 break; 726 break;