From patchwork Wed Oct 27 12:35:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 285672 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9RCVlQN006540 for ; Wed, 27 Oct 2010 12:31:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761153Ab0J0Mbp (ORCPT ); Wed, 27 Oct 2010 08:31:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16619 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761149Ab0J0Mbo (ORCPT ); Wed, 27 Oct 2010 08:31:44 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9RCVe6X026088 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 27 Oct 2010 08:31:40 -0400 Received: from shalem.localdomain (vpn1-7-216.ams2.redhat.com [10.36.7.216]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id o9RCVO5T009135; Wed, 27 Oct 2010 08:31:38 -0400 From: Hans de Goede To: Mauro Carvalho Chehab Cc: Linux Media Mailing List , Lee Jones , Jean-Francois Moine , Hans de Goede Subject: [PATCH 7/7] gspca_ov519: generate release button event on stream stop if needed Date: Wed, 27 Oct 2010 14:35:26 +0200 Message-Id: <1288182926-25400-8-git-send-email-hdegoede@redhat.com> In-Reply-To: <1288182926-25400-1-git-send-email-hdegoede@redhat.com> References: <1288182926-25400-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 27 Oct 2010 12:31:47 +0000 (UTC) diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c index 6cf6855..7e86faf 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); + +#if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE) + /* 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)