aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/msp3400-driver.c
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/msp3400-driver.c
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/msp3400-driver.c')
-rw-r--r--drivers/media/video/msp3400-driver.c89
1 files changed, 16 insertions, 73 deletions
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c
index 5e55f71572f3..dbb75a7db199 100644
--- a/drivers/media/video/msp3400-driver.c
+++ b/drivers/media/video/msp3400-driver.c
@@ -385,67 +385,6 @@ static int msp_mode_v4l1_to_v4l2(int mode)
385 return V4L2_TUNER_MODE_MONO; 385 return V4L2_TUNER_MODE_MONO;
386} 386}
387 387
388static struct v4l2_queryctrl msp_qctrl_std[] = {
389 {
390 .id = V4L2_CID_AUDIO_VOLUME,
391 .name = "Volume",
392 .minimum = 0,
393 .maximum = 65535,
394 .step = 65535/100,
395 .default_value = 58880,
396 .flags = 0,
397 .type = V4L2_CTRL_TYPE_INTEGER,
398 },{
399 .id = V4L2_CID_AUDIO_MUTE,
400 .name = "Mute",
401 .minimum = 0,
402 .maximum = 1,
403 .step = 1,
404 .default_value = 1,
405 .flags = 0,
406 .type = V4L2_CTRL_TYPE_BOOLEAN,
407 },
408};
409
410static struct v4l2_queryctrl msp_qctrl_sound_processing[] = {
411 {
412 .id = V4L2_CID_AUDIO_BALANCE,
413 .name = "Balance",
414 .minimum = 0,
415 .maximum = 65535,
416 .step = 65535/100,
417 .default_value = 32768,
418 .flags = 0,
419 .type = V4L2_CTRL_TYPE_INTEGER,
420 },{
421 .id = V4L2_CID_AUDIO_BASS,
422 .name = "Bass",
423 .minimum = 0,
424 .maximum = 65535,
425 .step = 65535/100,
426 .default_value = 32768,
427 .type = V4L2_CTRL_TYPE_INTEGER,
428 },{
429 .id = V4L2_CID_AUDIO_TREBLE,
430 .name = "Treble",
431 .minimum = 0,
432 .maximum = 65535,
433 .step = 65535/100,
434 .default_value = 32768,
435 .type = V4L2_CTRL_TYPE_INTEGER,
436 },{
437 .id = V4L2_CID_AUDIO_LOUDNESS,
438 .name = "Loudness",
439 .minimum = 0,
440 .maximum = 1,
441 .step = 1,
442 .default_value = 1,
443 .flags = 0,
444 .type = V4L2_CTRL_TYPE_BOOLEAN,
445 },
446};
447
448
449static int msp_get_ctrl(struct i2c_client *client, struct v4l2_control *ctrl) 388static int msp_get_ctrl(struct i2c_client *client, struct v4l2_control *ctrl)
450{ 389{
451 struct msp_state *state = i2c_get_clientdata(client); 390 struct msp_state *state = i2c_get_clientdata(client);
@@ -753,21 +692,25 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
753 case VIDIOC_QUERYCTRL: 692 case VIDIOC_QUERYCTRL:
754 { 693 {
755 struct v4l2_queryctrl *qc = arg; 694 struct v4l2_queryctrl *qc = arg;
756 int i;
757 695
758 for (i = 0; i < ARRAY_SIZE(msp_qctrl_std); i++) 696 switch (qc->id) {
759 if (qc->id && qc->id == msp_qctrl_std[i].id) { 697 case V4L2_CID_AUDIO_VOLUME:
760 memcpy(qc, &msp_qctrl_std[i], sizeof(*qc)); 698 case V4L2_CID_AUDIO_MUTE:
761 return 0; 699 return v4l2_ctrl_query_fill_std(qc);
762 } 700 default:
701 break;
702 }
763 if (!state->has_sound_processing) 703 if (!state->has_sound_processing)
764 return -EINVAL; 704 return -EINVAL;
765 for (i = 0; i < ARRAY_SIZE(msp_qctrl_sound_processing); i++) 705 switch (qc->id) {
766 if (qc->id && qc->id == msp_qctrl_sound_processing[i].id) { 706 case V4L2_CID_AUDIO_LOUDNESS:
767 memcpy(qc, &msp_qctrl_sound_processing[i], sizeof(*qc)); 707 case V4L2_CID_AUDIO_BALANCE:
768 return 0; 708 case V4L2_CID_AUDIO_BASS:
769 } 709 case V4L2_CID_AUDIO_TREBLE:
770 return -EINVAL; 710 return v4l2_ctrl_query_fill_std(qc);
711 default:
712 return -EINVAL;
713 }
771 } 714 }
772 715
773 case VIDIOC_G_CTRL: 716 case VIDIOC_G_CTRL: