diff options
author | Hans de Goede <hdegoede@redhat.com> | 2010-10-27 10:42:28 (GMT) |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-12-29 10:16:31 (GMT) |
commit | 614d06917de2823d598a4b231256d08074044235 (patch) | |
tree | 0106456b2adadef61f61fbafa7530ed8ccda29b5 /drivers/media | |
parent | e0657be5615f666f261206ed62c3f0dc2527956e (diff) | |
download | linux-fsl-qoriq-614d06917de2823d598a4b231256d08074044235.tar.xz |
[media] gspca_ov519: generate release button event on stream stop if needed
Generate a release button event when the button is still pressed when the
stream stops.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/gspca/ov519.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c index 6cf6855..19f943e 100644 --- a/drivers/media/video/gspca/ov519.c +++ b/drivers/media/video/gspca/ov519.c @@ -3912,7 +3912,6 @@ static int sd_start(struct gspca_dev *gspca_dev) pressed while we weren't streaming */ sd->snapshot_needs_reset = 1; sd_reset_snapshot(gspca_dev); - sd->snapshot_pressed = 0; sd->first_frame = 3; @@ -3940,6 +3939,15 @@ static void sd_stop0(struct gspca_dev *gspca_dev) if (sd->bridge == BRIDGE_W9968CF) w9968cf_stop0(sd); + +#ifdef CONFIG_INPUT + /* If the last button state is pressed, release it now! */ + if (sd->snapshot_pressed) { + input_report_key(gspca_dev->input_dev, KEY_CAMERA, 0); + input_sync(gspca_dev->input_dev); + sd->snapshot_pressed = 0; + } +#endif } static void ov51x_handle_button(struct gspca_dev *gspca_dev, u8 state) |