diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-07-03 05:14:37 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-09-13 15:08:03 -0400 |
commit | 977ebec754cce0ab0c7d62d54ac6cd95833504f2 (patch) | |
tree | 757e2169106f9594177917b6662d2e9b4f759265 /drivers/media/v4l2-core | |
parent | ed45ce2cc0b31cb442685934b627916f83d1d7c6 (diff) |
[media] v4l2-ctrls.c: add support for the new DV controls
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/v4l2-core')
-rw-r--r-- | drivers/media/v4l2-core/v4l2-ctrls.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index b6a2ee71e5c3..6a34c30fff5b 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c | |||
@@ -425,6 +425,18 @@ const char * const *v4l2_ctrl_get_menu(u32 id) | |||
425 | "Gray", | 425 | "Gray", |
426 | NULL, | 426 | NULL, |
427 | }; | 427 | }; |
428 | static const char * const dv_tx_mode[] = { | ||
429 | "DVI-D", | ||
430 | "HDMI", | ||
431 | NULL, | ||
432 | }; | ||
433 | static const char * const dv_rgb_range[] = { | ||
434 | "Automatic", | ||
435 | "RGB limited range (16-235)", | ||
436 | "RGB full range (0-255)", | ||
437 | NULL, | ||
438 | }; | ||
439 | |||
428 | 440 | ||
429 | switch (id) { | 441 | switch (id) { |
430 | case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ: | 442 | case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ: |
@@ -502,6 +514,11 @@ const char * const *v4l2_ctrl_get_menu(u32 id) | |||
502 | return mpeg4_profile; | 514 | return mpeg4_profile; |
503 | case V4L2_CID_JPEG_CHROMA_SUBSAMPLING: | 515 | case V4L2_CID_JPEG_CHROMA_SUBSAMPLING: |
504 | return jpeg_chroma_subsampling; | 516 | return jpeg_chroma_subsampling; |
517 | case V4L2_CID_DV_TX_MODE: | ||
518 | return dv_tx_mode; | ||
519 | case V4L2_CID_DV_TX_RGB_RANGE: | ||
520 | case V4L2_CID_DV_RX_RGB_RANGE: | ||
521 | return dv_rgb_range; | ||
505 | 522 | ||
506 | default: | 523 | default: |
507 | return NULL; | 524 | return NULL; |
@@ -733,6 +750,16 @@ const char *v4l2_ctrl_get_name(u32 id) | |||
733 | case V4L2_CID_LINK_FREQ: return "Link Frequency"; | 750 | case V4L2_CID_LINK_FREQ: return "Link Frequency"; |
734 | case V4L2_CID_PIXEL_RATE: return "Pixel Rate"; | 751 | case V4L2_CID_PIXEL_RATE: return "Pixel Rate"; |
735 | 752 | ||
753 | /* DV controls */ | ||
754 | case V4L2_CID_DV_CLASS: return "Digital Video Controls"; | ||
755 | case V4L2_CID_DV_TX_HOTPLUG: return "Hotplug Present"; | ||
756 | case V4L2_CID_DV_TX_RXSENSE: return "RxSense Present"; | ||
757 | case V4L2_CID_DV_TX_EDID_PRESENT: return "EDID Present"; | ||
758 | case V4L2_CID_DV_TX_MODE: return "Transmit Mode"; | ||
759 | case V4L2_CID_DV_TX_RGB_RANGE: return "Tx RGB Quantization Range"; | ||
760 | case V4L2_CID_DV_RX_POWER_PRESENT: return "Power Present"; | ||
761 | case V4L2_CID_DV_RX_RGB_RANGE: return "Rx RGB Quantization Range"; | ||
762 | |||
736 | default: | 763 | default: |
737 | return NULL; | 764 | return NULL; |
738 | } | 765 | } |
@@ -832,6 +859,9 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, | |||
832 | case V4L2_CID_ISO_SENSITIVITY_AUTO: | 859 | case V4L2_CID_ISO_SENSITIVITY_AUTO: |
833 | case V4L2_CID_EXPOSURE_METERING: | 860 | case V4L2_CID_EXPOSURE_METERING: |
834 | case V4L2_CID_SCENE_MODE: | 861 | case V4L2_CID_SCENE_MODE: |
862 | case V4L2_CID_DV_TX_MODE: | ||
863 | case V4L2_CID_DV_TX_RGB_RANGE: | ||
864 | case V4L2_CID_DV_RX_RGB_RANGE: | ||
835 | *type = V4L2_CTRL_TYPE_MENU; | 865 | *type = V4L2_CTRL_TYPE_MENU; |
836 | break; | 866 | break; |
837 | case V4L2_CID_LINK_FREQ: | 867 | case V4L2_CID_LINK_FREQ: |
@@ -853,6 +883,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, | |||
853 | case V4L2_CID_JPEG_CLASS: | 883 | case V4L2_CID_JPEG_CLASS: |
854 | case V4L2_CID_IMAGE_SOURCE_CLASS: | 884 | case V4L2_CID_IMAGE_SOURCE_CLASS: |
855 | case V4L2_CID_IMAGE_PROC_CLASS: | 885 | case V4L2_CID_IMAGE_PROC_CLASS: |
886 | case V4L2_CID_DV_CLASS: | ||
856 | *type = V4L2_CTRL_TYPE_CTRL_CLASS; | 887 | *type = V4L2_CTRL_TYPE_CTRL_CLASS; |
857 | /* You can neither read not write these */ | 888 | /* You can neither read not write these */ |
858 | *flags |= V4L2_CTRL_FLAG_READ_ONLY | V4L2_CTRL_FLAG_WRITE_ONLY; | 889 | *flags |= V4L2_CTRL_FLAG_READ_ONLY | V4L2_CTRL_FLAG_WRITE_ONLY; |
@@ -869,6 +900,10 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, | |||
869 | case V4L2_CID_JPEG_ACTIVE_MARKER: | 900 | case V4L2_CID_JPEG_ACTIVE_MARKER: |
870 | case V4L2_CID_3A_LOCK: | 901 | case V4L2_CID_3A_LOCK: |
871 | case V4L2_CID_AUTO_FOCUS_STATUS: | 902 | case V4L2_CID_AUTO_FOCUS_STATUS: |
903 | case V4L2_CID_DV_TX_HOTPLUG: | ||
904 | case V4L2_CID_DV_TX_RXSENSE: | ||
905 | case V4L2_CID_DV_TX_EDID_PRESENT: | ||
906 | case V4L2_CID_DV_RX_POWER_PRESENT: | ||
872 | *type = V4L2_CTRL_TYPE_BITMASK; | 907 | *type = V4L2_CTRL_TYPE_BITMASK; |
873 | break; | 908 | break; |
874 | case V4L2_CID_MIN_BUFFERS_FOR_CAPTURE: | 909 | case V4L2_CID_MIN_BUFFERS_FOR_CAPTURE: |
@@ -933,6 +968,10 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, | |||
933 | case V4L2_CID_FLASH_STROBE_STATUS: | 968 | case V4L2_CID_FLASH_STROBE_STATUS: |
934 | case V4L2_CID_AUTO_FOCUS_STATUS: | 969 | case V4L2_CID_AUTO_FOCUS_STATUS: |
935 | case V4L2_CID_FLASH_READY: | 970 | case V4L2_CID_FLASH_READY: |
971 | case V4L2_CID_DV_TX_HOTPLUG: | ||
972 | case V4L2_CID_DV_TX_RXSENSE: | ||
973 | case V4L2_CID_DV_TX_EDID_PRESENT: | ||
974 | case V4L2_CID_DV_RX_POWER_PRESENT: | ||
936 | *flags |= V4L2_CTRL_FLAG_READ_ONLY; | 975 | *flags |= V4L2_CTRL_FLAG_READ_ONLY; |
937 | break; | 976 | break; |
938 | } | 977 | } |