diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2013-08-19 09:19:54 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-08-24 03:28:05 -0400 |
commit | d1c65ad6a44b0ff79d2f0bf726fa6fd9248991f4 (patch) | |
tree | ec6f649e311a44c214da1dbc7644762ae30cc17c | |
parent | 074ca43f2f99c926a250847ae59a337ebdec6d61 (diff) |
[media] v4l2-dv-timings: export the timings list
Some drivers need to be able to access the full list of timings.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r-- | drivers/media/v4l2-core/v4l2-dv-timings.c | 18 | ||||
-rw-r--r-- | include/media/v4l2-dv-timings.h | 4 |
2 files changed, 14 insertions, 8 deletions
diff --git a/drivers/media/v4l2-core/v4l2-dv-timings.c b/drivers/media/v4l2-core/v4l2-dv-timings.c index c2f5af7acbed..f515997a7341 100644 --- a/drivers/media/v4l2-core/v4l2-dv-timings.c +++ b/drivers/media/v4l2-core/v4l2-dv-timings.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <linux/v4l2-dv-timings.h> | 26 | #include <linux/v4l2-dv-timings.h> |
27 | #include <media/v4l2-dv-timings.h> | 27 | #include <media/v4l2-dv-timings.h> |
28 | 28 | ||
29 | static const struct v4l2_dv_timings timings[] = { | 29 | const struct v4l2_dv_timings v4l2_dv_timings_presets[] = { |
30 | V4L2_DV_BT_CEA_640X480P59_94, | 30 | V4L2_DV_BT_CEA_640X480P59_94, |
31 | V4L2_DV_BT_CEA_720X480I59_94, | 31 | V4L2_DV_BT_CEA_720X480I59_94, |
32 | V4L2_DV_BT_CEA_720X480P59_94, | 32 | V4L2_DV_BT_CEA_720X480P59_94, |
@@ -127,7 +127,9 @@ static const struct v4l2_dv_timings timings[] = { | |||
127 | V4L2_DV_BT_DMT_2560X1600P75, | 127 | V4L2_DV_BT_DMT_2560X1600P75, |
128 | V4L2_DV_BT_DMT_2560X1600P85, | 128 | V4L2_DV_BT_DMT_2560X1600P85, |
129 | V4L2_DV_BT_DMT_2560X1600P120_RB, | 129 | V4L2_DV_BT_DMT_2560X1600P120_RB, |
130 | { } | ||
130 | }; | 131 | }; |
132 | EXPORT_SYMBOL_GPL(v4l2_dv_timings_presets); | ||
131 | 133 | ||
132 | bool v4l2_dv_valid_timings(const struct v4l2_dv_timings *t, | 134 | bool v4l2_dv_valid_timings(const struct v4l2_dv_timings *t, |
133 | const struct v4l2_dv_timings_cap *dvcap) | 135 | const struct v4l2_dv_timings_cap *dvcap) |
@@ -159,10 +161,10 @@ int v4l2_enum_dv_timings_cap(struct v4l2_enum_dv_timings *t, | |||
159 | u32 i, idx; | 161 | u32 i, idx; |
160 | 162 | ||
161 | memset(t->reserved, 0, sizeof(t->reserved)); | 163 | memset(t->reserved, 0, sizeof(t->reserved)); |
162 | for (i = idx = 0; i < ARRAY_SIZE(timings); i++) { | 164 | for (i = idx = 0; v4l2_dv_timings_presets[i].bt.width; i++) { |
163 | if (v4l2_dv_valid_timings(timings + i, cap) && | 165 | if (v4l2_dv_valid_timings(v4l2_dv_timings_presets + i, cap) && |
164 | idx++ == t->index) { | 166 | idx++ == t->index) { |
165 | t->timings = timings[i]; | 167 | t->timings = v4l2_dv_timings_presets[i]; |
166 | return 0; | 168 | return 0; |
167 | } | 169 | } |
168 | } | 170 | } |
@@ -179,10 +181,10 @@ bool v4l2_find_dv_timings_cap(struct v4l2_dv_timings *t, | |||
179 | if (!v4l2_dv_valid_timings(t, cap)) | 181 | if (!v4l2_dv_valid_timings(t, cap)) |
180 | return false; | 182 | return false; |
181 | 183 | ||
182 | for (i = 0; i < ARRAY_SIZE(timings); i++) { | 184 | for (i = 0; i < v4l2_dv_timings_presets[i].bt.width; i++) { |
183 | if (v4l2_dv_valid_timings(timings + i, cap) && | 185 | if (v4l2_dv_valid_timings(v4l2_dv_timings_presets + i, cap) && |
184 | v4l2_match_dv_timings(t, timings + i, pclock_delta)) { | 186 | v4l2_match_dv_timings(t, v4l2_dv_timings_presets + i, pclock_delta)) { |
185 | *t = timings[i]; | 187 | *t = v4l2_dv_timings_presets[i]; |
186 | return true; | 188 | return true; |
187 | } | 189 | } |
188 | } | 190 | } |
diff --git a/include/media/v4l2-dv-timings.h b/include/media/v4l2-dv-timings.h index 43f6b67af1cb..0fe310b8bc80 100644 --- a/include/media/v4l2-dv-timings.h +++ b/include/media/v4l2-dv-timings.h | |||
@@ -23,6 +23,10 @@ | |||
23 | 23 | ||
24 | #include <linux/videodev2.h> | 24 | #include <linux/videodev2.h> |
25 | 25 | ||
26 | /** v4l2_dv_timings_presets: list of all dv_timings presets. | ||
27 | */ | ||
28 | extern const struct v4l2_dv_timings v4l2_dv_timings_presets[]; | ||
29 | |||
26 | /** v4l2_dv_valid_timings() - are these timings valid? | 30 | /** v4l2_dv_valid_timings() - are these timings valid? |
27 | * @t: the v4l2_dv_timings struct. | 31 | * @t: the v4l2_dv_timings struct. |
28 | * @cap: the v4l2_dv_timings_cap capabilities. | 32 | * @cap: the v4l2_dv_timings_cap capabilities. |