diff options
author | Ian Armstrong <ian@iarmst.demon.co.uk> | 2010-05-23 21:10:30 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-06-01 00:24:32 -0400 |
commit | 5f39b9f660778c3b095fc380da178d58a040add5 (patch) | |
tree | 95a59b4af26df8481c10953cd37838a953abcd4c /drivers/media | |
parent | 064a2485aa45956cf1e8520e716839e9d7555b90 (diff) |
V4L/DVB: ivtvfb : Module load / unload fixes
Check firmware state when loading module & if firmware is not responding exit
with an error. When module is unloaded, only disable the framebuffer & not all
decoder output.
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/ivtv/ivtvfb.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/media/video/ivtv/ivtvfb.c b/drivers/media/video/ivtv/ivtvfb.c index 49e1a283ed36..9ff3425891ed 100644 --- a/drivers/media/video/ivtv/ivtvfb.c +++ b/drivers/media/video/ivtv/ivtvfb.c | |||
@@ -1066,7 +1066,11 @@ static int ivtvfb_init_io(struct ivtv *itv) | |||
1066 | } | 1066 | } |
1067 | mutex_unlock(&itv->serialize_lock); | 1067 | mutex_unlock(&itv->serialize_lock); |
1068 | 1068 | ||
1069 | ivtvfb_get_framebuffer(itv, &oi->video_rbase, &oi->video_buffer_size); | 1069 | if (ivtvfb_get_framebuffer(itv, &oi->video_rbase, |
1070 | &oi->video_buffer_size) < 0) { | ||
1071 | IVTVFB_ERR("Firmware failed to respond\n"); | ||
1072 | return -EIO; | ||
1073 | } | ||
1070 | 1074 | ||
1071 | /* The osd buffer size depends on the number of video buffers allocated | 1075 | /* The osd buffer size depends on the number of video buffers allocated |
1072 | on the PVR350 itself. For now we'll hardcode the smallest osd buffer | 1076 | on the PVR350 itself. For now we'll hardcode the smallest osd buffer |
@@ -1158,8 +1162,11 @@ static int ivtvfb_init_card(struct ivtv *itv) | |||
1158 | } | 1162 | } |
1159 | 1163 | ||
1160 | /* Find & setup the OSD buffer */ | 1164 | /* Find & setup the OSD buffer */ |
1161 | if ((rc = ivtvfb_init_io(itv))) | 1165 | rc = ivtvfb_init_io(itv); |
1166 | if (rc) { | ||
1167 | ivtvfb_release_buffers(itv); | ||
1162 | return rc; | 1168 | return rc; |
1169 | } | ||
1163 | 1170 | ||
1164 | /* Set the startup video mode information */ | 1171 | /* Set the startup video mode information */ |
1165 | if ((rc = ivtvfb_init_vidmode(itv))) { | 1172 | if ((rc = ivtvfb_init_vidmode(itv))) { |
@@ -1210,6 +1217,7 @@ static int ivtvfb_callback_cleanup(struct device *dev, void *p) | |||
1210 | { | 1217 | { |
1211 | struct v4l2_device *v4l2_dev = dev_get_drvdata(dev); | 1218 | struct v4l2_device *v4l2_dev = dev_get_drvdata(dev); |
1212 | struct ivtv *itv = container_of(v4l2_dev, struct ivtv, v4l2_dev); | 1219 | struct ivtv *itv = container_of(v4l2_dev, struct ivtv, v4l2_dev); |
1220 | struct osd_info *oi = itv->osd_info; | ||
1213 | 1221 | ||
1214 | if (itv && (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) { | 1222 | if (itv && (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) { |
1215 | if (unregister_framebuffer(&itv->osd_info->ivtvfb_info)) { | 1223 | if (unregister_framebuffer(&itv->osd_info->ivtvfb_info)) { |
@@ -1218,7 +1226,7 @@ static int ivtvfb_callback_cleanup(struct device *dev, void *p) | |||
1218 | return 0; | 1226 | return 0; |
1219 | } | 1227 | } |
1220 | IVTVFB_INFO("Unregister framebuffer %d\n", itv->instance); | 1228 | IVTVFB_INFO("Unregister framebuffer %d\n", itv->instance); |
1221 | ivtvfb_blank(FB_BLANK_POWERDOWN, &itv->osd_info->ivtvfb_info); | 1229 | ivtvfb_blank(FB_BLANK_VSYNC_SUSPEND, &oi->ivtvfb_info); |
1222 | ivtvfb_release_buffers(itv); | 1230 | ivtvfb_release_buffers(itv); |
1223 | itv->osd_video_pbase = 0; | 1231 | itv->osd_video_pbase = 0; |
1224 | } | 1232 | } |