Commit 614d0691 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

[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: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent e0657be5
...@@ -3912,7 +3912,6 @@ static int sd_start(struct gspca_dev *gspca_dev) ...@@ -3912,7 +3912,6 @@ static int sd_start(struct gspca_dev *gspca_dev)
pressed while we weren't streaming */ pressed while we weren't streaming */
sd->snapshot_needs_reset = 1; sd->snapshot_needs_reset = 1;
sd_reset_snapshot(gspca_dev); sd_reset_snapshot(gspca_dev);
sd->snapshot_pressed = 0;
sd->first_frame = 3; sd->first_frame = 3;
...@@ -3940,6 +3939,15 @@ static void sd_stop0(struct gspca_dev *gspca_dev) ...@@ -3940,6 +3939,15 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
if (sd->bridge == BRIDGE_W9968CF) if (sd->bridge == BRIDGE_W9968CF)
w9968cf_stop0(sd); 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) static void ov51x_handle_button(struct gspca_dev *gspca_dev, u8 state)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment