aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-common.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-11-20 11:19:20 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-12-10 06:05:01 -0500
commite75f9cee32827853fc2f9d1ceb6352e3edc33e9d (patch)
treee1f1db30c237a08773fcf155a771545f3b6aa54f /drivers/media/video/v4l2-common.c
parent207705cd7f82b9f160c6ed552d5788a823701fd1 (diff)
V4L/DVB (4861): Remove the need of a STD array for drivers using video_ioctl2
video_ioctl2 will auto-generate standard entries at ENUM_FMT. Also, now, a driver may return a subset of the video array at the return, to be stored as the current_norm. For example, a driver may ask for V4L2_STD_PAL. At return, driver may change it to V4L2_STD_PAL_B. This way, a futher call to G_STD will return the exact detected video std. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/v4l2-common.c')
-rw-r--r--drivers/media/video/v4l2-common.c73
1 files changed, 73 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index b0b4abe5c297..752c82c37f55 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -87,6 +87,78 @@ MODULE_LICENSE("GPL");
87 */ 87 */
88 88
89 89
90char *v4l2_norm_to_name(v4l2_std_id id)
91{
92 char *name;
93
94 switch (id) {
95 case V4L2_STD_PAL:
96 name="PAL"; break;
97 case V4L2_STD_PAL_BG:
98 name="PAL-BG"; break;
99 case V4L2_STD_PAL_DK:
100 name="PAL-DK"; break;
101 case V4L2_STD_PAL_B:
102 name="PAL-B"; break;
103 case V4L2_STD_PAL_B1:
104 name="PAL-B1"; break;
105 case V4L2_STD_PAL_G:
106 name="PAL-G"; break;
107 case V4L2_STD_PAL_H:
108 name="PAL-H"; break;
109 case V4L2_STD_PAL_I:
110 name="PAL-I"; break;
111 case V4L2_STD_PAL_D:
112 name="PAL-D"; break;
113 case V4L2_STD_PAL_D1:
114 name="PAL-D1"; break;
115 case V4L2_STD_PAL_K:
116 name="PAL-K"; break;
117 case V4L2_STD_PAL_M:
118 name="PAL-M"; break;
119 case V4L2_STD_PAL_N:
120 name="PAL-N"; break;
121 case V4L2_STD_PAL_Nc:
122 name="PAL-Nc"; break;
123 case V4L2_STD_PAL_60:
124 name="PAL-60"; break;
125 case V4L2_STD_NTSC:
126 name="NTSC"; break;
127 case V4L2_STD_NTSC_M:
128 name="NTSC-M"; break;
129 case V4L2_STD_NTSC_M_JP:
130 name="NTSC-M-JP"; break;
131 case V4L2_STD_NTSC_443:
132 name="NTSC-443"; break;
133 case V4L2_STD_NTSC_M_KR:
134 name="NTSC-M-KR"; break;
135 case V4L2_STD_SECAM:
136 name="SECAM"; break;
137 case V4L2_STD_SECAM_DK:
138 name="SECAM-DK"; break;
139 case V4L2_STD_SECAM_B:
140 name="SECAM-B"; break;
141 case V4L2_STD_SECAM_D:
142 name="SECAM-D"; break;
143 case V4L2_STD_SECAM_G:
144 name="SECAM-G"; break;
145 case V4L2_STD_SECAM_H:
146 name="SECAM-H"; break;
147 case V4L2_STD_SECAM_K:
148 name="SECAM-K"; break;
149 case V4L2_STD_SECAM_K1:
150 name="SECAM-K1"; break;
151 case V4L2_STD_SECAM_L:
152 name="SECAM-L"; break;
153 case V4L2_STD_SECAM_LC:
154 name="SECAM-LC"; break;
155 default:
156 name="Unknown"; break;
157 }
158
159 return name;
160}
161
90/* Fill in the fields of a v4l2_standard structure according to the 162/* Fill in the fields of a v4l2_standard structure according to the
91 'id' and 'transmission' parameters. Returns negative on error. */ 163 'id' and 'transmission' parameters. Returns negative on error. */
92int v4l2_video_std_construct(struct v4l2_standard *vs, 164int v4l2_video_std_construct(struct v4l2_standard *vs,
@@ -1453,6 +1525,7 @@ u32 v4l2_ctrl_next(const u32 * const * ctrl_classes, u32 id)
1453 1525
1454/* ----------------------------------------------------------------- */ 1526/* ----------------------------------------------------------------- */
1455 1527
1528EXPORT_SYMBOL(v4l2_norm_to_name);
1456EXPORT_SYMBOL(v4l2_video_std_construct); 1529EXPORT_SYMBOL(v4l2_video_std_construct);
1457 1530
1458EXPORT_SYMBOL(v4l2_prio_init); 1531EXPORT_SYMBOL(v4l2_prio_init);