aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx25840
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-06-18 13:49:52 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 01:05:22 -0400
commit18318e00040e0a5c783f6d79c136c2141b779dbd (patch)
tree17939de5ef7387dfd80a288ed4221ba1eeb1d31a /drivers/media/video/cx25840
parent5d1a9ae6d9d7fc14b2259cd550eb87364a21190a (diff)
V4L/DVB (4192): Use control helpers for saa7115, cx25840, msp3400.
Replace hardcoded control description by the standard ones supplied by v4l2-common. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx25840')
-rw-r--r--drivers/media/video/cx25840/cx25840-core.c119
1 files changed, 19 insertions, 100 deletions
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c
index cb9e8625708d..5c2036b40ea1 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -617,95 +617,6 @@ static int set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt)
617 617
618/* ----------------------------------------------------------------------- */ 618/* ----------------------------------------------------------------------- */
619 619
620static struct v4l2_queryctrl cx25836_qctrl[] = {
621 {
622 .id = V4L2_CID_BRIGHTNESS,
623 .type = V4L2_CTRL_TYPE_INTEGER,
624 .name = "Brightness",
625 .minimum = 0,
626 .maximum = 255,
627 .step = 1,
628 .default_value = 128,
629 .flags = 0,
630 }, {
631 .id = V4L2_CID_CONTRAST,
632 .type = V4L2_CTRL_TYPE_INTEGER,
633 .name = "Contrast",
634 .minimum = 0,
635 .maximum = 127,
636 .step = 1,
637 .default_value = 64,
638 .flags = 0,
639 }, {
640 .id = V4L2_CID_SATURATION,
641 .type = V4L2_CTRL_TYPE_INTEGER,
642 .name = "Saturation",
643 .minimum = 0,
644 .maximum = 127,
645 .step = 1,
646 .default_value = 64,
647 .flags = 0,
648 }, {
649 .id = V4L2_CID_HUE,
650 .type = V4L2_CTRL_TYPE_INTEGER,
651 .name = "Hue",
652 .minimum = -128,
653 .maximum = 127,
654 .step = 1,
655 .default_value = 0,
656 .flags = 0,
657 },
658};
659
660static struct v4l2_queryctrl cx25840_qctrl[] = {
661 {
662 .id = V4L2_CID_AUDIO_VOLUME,
663 .type = V4L2_CTRL_TYPE_INTEGER,
664 .name = "Volume",
665 .minimum = 0,
666 .maximum = 65535,
667 .step = 65535/100,
668 .default_value = 58880,
669 .flags = 0,
670 }, {
671 .id = V4L2_CID_AUDIO_BALANCE,
672 .type = V4L2_CTRL_TYPE_INTEGER,
673 .name = "Balance",
674 .minimum = 0,
675 .maximum = 65535,
676 .step = 65535/100,
677 .default_value = 32768,
678 .flags = 0,
679 }, {
680 .id = V4L2_CID_AUDIO_MUTE,
681 .type = V4L2_CTRL_TYPE_BOOLEAN,
682 .name = "Mute",
683 .minimum = 0,
684 .maximum = 1,
685 .step = 1,
686 .default_value = 1,
687 .flags = 0,
688 }, {
689 .id = V4L2_CID_AUDIO_BASS,
690 .type = V4L2_CTRL_TYPE_INTEGER,
691 .name = "Bass",
692 .minimum = 0,
693 .maximum = 65535,
694 .step = 65535/100,
695 .default_value = 32768,
696 }, {
697 .id = V4L2_CID_AUDIO_TREBLE,
698 .type = V4L2_CTRL_TYPE_INTEGER,
699 .name = "Treble",
700 .minimum = 0,
701 .maximum = 65535,
702 .step = 65535/100,
703 .default_value = 32768,
704 },
705};
706
707/* ----------------------------------------------------------------------- */
708
709static int cx25840_command(struct i2c_client *client, unsigned int cmd, 620static int cx25840_command(struct i2c_client *client, unsigned int cmd,
710 void *arg) 621 void *arg)
711{ 622{
@@ -773,21 +684,29 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd,
773 case VIDIOC_QUERYCTRL: 684 case VIDIOC_QUERYCTRL:
774 { 685 {
775 struct v4l2_queryctrl *qc = arg; 686 struct v4l2_queryctrl *qc = arg;
776 int i;
777 687
778 for (i = 0; i < ARRAY_SIZE(cx25836_qctrl); i++) 688 switch (qc->id) {
779 if (qc->id && qc->id == cx25836_qctrl[i].id) { 689 case V4L2_CID_BRIGHTNESS:
780 memcpy(qc, &cx25836_qctrl[i], sizeof(*qc)); 690 case V4L2_CID_CONTRAST:
781 return 0; 691 case V4L2_CID_SATURATION:
782 } 692 case V4L2_CID_HUE:
693 return v4l2_ctrl_query_fill_std(qc);
694 default:
695 break;
696 }
783 if (state->is_cx25836) 697 if (state->is_cx25836)
784 return -EINVAL; 698 return -EINVAL;
785 699
786 for (i = 0; i < ARRAY_SIZE(cx25840_qctrl); i++) 700 switch (qc->id) {
787 if (qc->id && qc->id == cx25840_qctrl[i].id) { 701 case V4L2_CID_AUDIO_VOLUME:
788 memcpy(qc, &cx25840_qctrl[i], sizeof(*qc)); 702 case V4L2_CID_AUDIO_MUTE:
789 return 0; 703 case V4L2_CID_AUDIO_BALANCE:
790 } 704 case V4L2_CID_AUDIO_BASS:
705 case V4L2_CID_AUDIO_TREBLE:
706 return v4l2_ctrl_query_fill_std(qc);
707 default:
708 return -EINVAL;
709 }
791 return -EINVAL; 710 return -EINVAL;
792 } 711 }
793 712