aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-core.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-core.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
index a41cc5566778..d3813ed789d9 100644
--- a/drivers/media/video/em28xx/em28xx-core.c
+++ b/drivers/media/video/em28xx/em28xx-core.c
@@ -782,11 +782,15 @@ int em28xx_resolution_set(struct em28xx *dev)
782 782
783 em28xx_accumulator_set(dev, 1, (width - 4) >> 2, 1, (height - 4) >> 2); 783 em28xx_accumulator_set(dev, 1, (width - 4) >> 2, 1, (height - 4) >> 2);
784 784
785 /* If we don't set the start position to 4 in VBI mode, we end up 785 /* If we don't set the start position to 2 in VBI mode, we end up
786 with line 21 being YUYV encoded instead of being in 8-bit 786 with line 20/21 being YUYV encoded instead of being in 8-bit
787 greyscale */ 787 greyscale. The core of the issue is that line 21 (and line 23 for
788 PAL WSS) are inside of active video region, and as a result they
789 get the pixelformatting associated with that area. So by cropping
790 it out, we end up with the same format as the rest of the VBI
791 region */
788 if (em28xx_vbi_supported(dev) == 1) 792 if (em28xx_vbi_supported(dev) == 1)
789 em28xx_capture_area_set(dev, 0, 4, width >> 2, height >> 2); 793 em28xx_capture_area_set(dev, 0, 2, width >> 2, height >> 2);
790 else 794 else
791 em28xx_capture_area_set(dev, 0, 0, width >> 2, height >> 2); 795 em28xx_capture_area_set(dev, 0, 0, width >> 2, height >> 2);
792 796
@@ -1174,21 +1178,18 @@ void em28xx_add_into_devlist(struct em28xx *dev)
1174 */ 1178 */
1175 1179
1176static LIST_HEAD(em28xx_extension_devlist); 1180static LIST_HEAD(em28xx_extension_devlist);
1177static DEFINE_MUTEX(em28xx_extension_devlist_lock);
1178 1181
1179int em28xx_register_extension(struct em28xx_ops *ops) 1182int em28xx_register_extension(struct em28xx_ops *ops)
1180{ 1183{
1181 struct em28xx *dev = NULL; 1184 struct em28xx *dev = NULL;
1182 1185
1183 mutex_lock(&em28xx_devlist_mutex); 1186 mutex_lock(&em28xx_devlist_mutex);
1184 mutex_lock(&em28xx_extension_devlist_lock);
1185 list_add_tail(&ops->next, &em28xx_extension_devlist); 1187 list_add_tail(&ops->next, &em28xx_extension_devlist);
1186 list_for_each_entry(dev, &em28xx_devlist, devlist) { 1188 list_for_each_entry(dev, &em28xx_devlist, devlist) {
1187 if (dev) 1189 if (dev)
1188 ops->init(dev); 1190 ops->init(dev);
1189 } 1191 }
1190 printk(KERN_INFO "Em28xx: Initialized (%s) extension\n", ops->name); 1192 printk(KERN_INFO "Em28xx: Initialized (%s) extension\n", ops->name);
1191 mutex_unlock(&em28xx_extension_devlist_lock);
1192 mutex_unlock(&em28xx_devlist_mutex); 1193 mutex_unlock(&em28xx_devlist_mutex);
1193 return 0; 1194 return 0;
1194} 1195}
@@ -1204,10 +1205,8 @@ void em28xx_unregister_extension(struct em28xx_ops *ops)
1204 ops->fini(dev); 1205 ops->fini(dev);
1205 } 1206 }
1206 1207
1207 mutex_lock(&em28xx_extension_devlist_lock);
1208 printk(KERN_INFO "Em28xx: Removed (%s) extension\n", ops->name); 1208 printk(KERN_INFO "Em28xx: Removed (%s) extension\n", ops->name);
1209 list_del(&ops->next); 1209 list_del(&ops->next);
1210 mutex_unlock(&em28xx_extension_devlist_lock);
1211 mutex_unlock(&em28xx_devlist_mutex); 1210 mutex_unlock(&em28xx_devlist_mutex);
1212} 1211}
1213EXPORT_SYMBOL(em28xx_unregister_extension); 1212EXPORT_SYMBOL(em28xx_unregister_extension);
@@ -1216,26 +1215,26 @@ void em28xx_init_extension(struct em28xx *dev)
1216{ 1215{
1217 struct em28xx_ops *ops = NULL; 1216 struct em28xx_ops *ops = NULL;
1218 1217
1219 mutex_lock(&em28xx_extension_devlist_lock); 1218 mutex_lock(&em28xx_devlist_mutex);
1220 if (!list_empty(&em28xx_extension_devlist)) { 1219 if (!list_empty(&em28xx_extension_devlist)) {
1221 list_for_each_entry(ops, &em28xx_extension_devlist, next) { 1220 list_for_each_entry(ops, &em28xx_extension_devlist, next) {
1222 if (ops->init) 1221 if (ops->init)
1223 ops->init(dev); 1222 ops->init(dev);
1224 } 1223 }
1225 } 1224 }
1226 mutex_unlock(&em28xx_extension_devlist_lock); 1225 mutex_unlock(&em28xx_devlist_mutex);
1227} 1226}
1228 1227
1229void em28xx_close_extension(struct em28xx *dev) 1228void em28xx_close_extension(struct em28xx *dev)
1230{ 1229{
1231 struct em28xx_ops *ops = NULL; 1230 struct em28xx_ops *ops = NULL;
1232 1231
1233 mutex_lock(&em28xx_extension_devlist_lock); 1232 mutex_lock(&em28xx_devlist_mutex);
1234 if (!list_empty(&em28xx_extension_devlist)) { 1233 if (!list_empty(&em28xx_extension_devlist)) {
1235 list_for_each_entry(ops, &em28xx_extension_devlist, next) { 1234 list_for_each_entry(ops, &em28xx_extension_devlist, next) {
1236 if (ops->fini) 1235 if (ops->fini)
1237 ops->fini(dev); 1236 ops->fini(dev);
1238 } 1237 }
1239 } 1238 }
1240 mutex_unlock(&em28xx_extension_devlist_lock); 1239 mutex_unlock(&em28xx_devlist_mutex);
1241} 1240}