Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (12549): v4l2: video device: Add FM TX controls default configurations

This patch adds basic configurations for FM TX extended controls.
That includes controls names, menu strings, pointer identification,
type classification and flags configuration.

Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Eduardo Valentin and committed by
Mauro Carvalho Chehab
fdf82dc2 6b424941

+58 -6
+50
drivers/media/video/v4l2-common.c
··· 342 342 "Sepia", 343 343 NULL 344 344 }; 345 + static const char *tune_preemphasis[] = { 346 + "No preemphasis", 347 + "50 useconds", 348 + "75 useconds", 349 + NULL, 350 + }; 345 351 346 352 switch (id) { 347 353 case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ: ··· 386 380 return camera_exposure_auto; 387 381 case V4L2_CID_COLORFX: 388 382 return colorfx; 383 + case V4L2_CID_TUNE_PREEMPHASIS: 384 + return tune_preemphasis; 389 385 default: 390 386 return NULL; 391 387 } ··· 486 478 case V4L2_CID_ZOOM_CONTINUOUS: return "Zoom, Continuous"; 487 479 case V4L2_CID_PRIVACY: return "Privacy"; 488 480 481 + /* FM Radio Modulator control */ 482 + case V4L2_CID_FM_TX_CLASS: return "FM Radio Modulator Controls"; 483 + case V4L2_CID_RDS_TX_DEVIATION: return "RDS Signal Deviation"; 484 + case V4L2_CID_RDS_TX_PI: return "RDS Program ID"; 485 + case V4L2_CID_RDS_TX_PTY: return "RDS Program Type"; 486 + case V4L2_CID_RDS_TX_PS_NAME: return "RDS PS Name"; 487 + case V4L2_CID_RDS_TX_RADIO_TEXT: return "RDS Radio Text"; 488 + case V4L2_CID_AUDIO_LIMITER_ENABLED: return "Audio Limiter Feature Enabled"; 489 + case V4L2_CID_AUDIO_LIMITER_RELEASE_TIME: return "Audio Limiter Release Time"; 490 + case V4L2_CID_AUDIO_LIMITER_DEVIATION: return "Audio Limiter Deviation"; 491 + case V4L2_CID_AUDIO_COMPRESSION_ENABLED: return "Audio Compression Feature Enabled"; 492 + case V4L2_CID_AUDIO_COMPRESSION_GAIN: return "Audio Compression Gain"; 493 + case V4L2_CID_AUDIO_COMPRESSION_THRESHOLD: return "Audio Compression Threshold"; 494 + case V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME: return "Audio Compression Attack Time"; 495 + case V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME: return "Audio Compression Release Time"; 496 + case V4L2_CID_PILOT_TONE_ENABLED: return "Pilot Tone Feature Enabled"; 497 + case V4L2_CID_PILOT_TONE_DEVIATION: return "Pilot Tone Deviation"; 498 + case V4L2_CID_PILOT_TONE_FREQUENCY: return "Pilot Tone Frequency"; 499 + case V4L2_CID_TUNE_PREEMPHASIS: return "Pre-emphasis settings"; 500 + case V4L2_CID_TUNE_POWER_LEVEL: return "Tune Power Level"; 501 + case V4L2_CID_TUNE_ANTENNA_CAPACITOR: return "Tune Antenna Capacitor"; 502 + 489 503 default: 490 504 return NULL; 491 505 } ··· 540 510 case V4L2_CID_EXPOSURE_AUTO_PRIORITY: 541 511 case V4L2_CID_FOCUS_AUTO: 542 512 case V4L2_CID_PRIVACY: 513 + case V4L2_CID_AUDIO_LIMITER_ENABLED: 514 + case V4L2_CID_AUDIO_COMPRESSION_ENABLED: 515 + case V4L2_CID_PILOT_TONE_ENABLED: 543 516 qctrl->type = V4L2_CTRL_TYPE_BOOLEAN; 544 517 min = 0; 545 518 max = step = 1; ··· 571 538 case V4L2_CID_MPEG_STREAM_VBI_FMT: 572 539 case V4L2_CID_EXPOSURE_AUTO: 573 540 case V4L2_CID_COLORFX: 541 + case V4L2_CID_TUNE_PREEMPHASIS: 574 542 qctrl->type = V4L2_CTRL_TYPE_MENU; 575 543 step = 1; 544 + break; 545 + case V4L2_CID_RDS_TX_PS_NAME: 546 + case V4L2_CID_RDS_TX_RADIO_TEXT: 547 + qctrl->type = V4L2_CTRL_TYPE_STRING; 576 548 break; 577 549 case V4L2_CID_USER_CLASS: 578 550 case V4L2_CID_CAMERA_CLASS: 579 551 case V4L2_CID_MPEG_CLASS: 552 + case V4L2_CID_FM_TX_CLASS: 580 553 qctrl->type = V4L2_CTRL_TYPE_CTRL_CLASS; 581 554 qctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY; 582 555 min = max = step = def = 0; ··· 611 572 case V4L2_CID_BLUE_BALANCE: 612 573 case V4L2_CID_GAMMA: 613 574 case V4L2_CID_SHARPNESS: 575 + case V4L2_CID_RDS_TX_DEVIATION: 576 + case V4L2_CID_AUDIO_LIMITER_RELEASE_TIME: 577 + case V4L2_CID_AUDIO_LIMITER_DEVIATION: 578 + case V4L2_CID_AUDIO_COMPRESSION_GAIN: 579 + case V4L2_CID_AUDIO_COMPRESSION_THRESHOLD: 580 + case V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME: 581 + case V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME: 582 + case V4L2_CID_PILOT_TONE_DEVIATION: 583 + case V4L2_CID_PILOT_TONE_FREQUENCY: 584 + case V4L2_CID_TUNE_POWER_LEVEL: 585 + case V4L2_CID_TUNE_ANTENNA_CAPACITOR: 614 586 qctrl->flags |= V4L2_CTRL_FLAG_SLIDER; 615 587 break; 616 588 case V4L2_CID_PAN_RELATIVE:
+8 -6
drivers/media/video/v4l2-compat-ioctl32.c
··· 616 616 for now this will do. */ 617 617 618 618 /* Return non-zero if this control is a pointer type. Currently only 619 - * type STRING is a pointer type. 620 - * 621 - * Note that there are currently no controls of this type, but at least the 622 - * compat32 code is in place to properly handle such controls. Please 623 - * remove this note once the first pointer controls are added. */ 619 + type STRING is a pointer type. */ 624 620 static inline int ctrl_is_pointer(u32 id) 625 621 { 626 - return 0; 622 + switch (id) { 623 + case V4L2_CID_RDS_TX_PS_NAME: 624 + case V4L2_CID_RDS_TX_RADIO_TEXT: 625 + return 1; 626 + default: 627 + return 0; 628 + } 627 629 } 628 630 629 631 static int get_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext_controls32 __user *up)