The patch number 14391 was added via Douglas Schilling Landgraf 
<dougsl...@redhat.com>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        Linux Media Mailing List <linux-me...@vger.kernel.org>

------

From: Hans de Goede  <hdego...@redhat.com>
gspca_stv06xx: Add support for camera button


Only tested with an stv6422 based cam, as that is the only stv06xx cam
I have with a button.

Priority: normal

Signed-off-by: Hans de Goede <hdego...@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mche...@redhat.com>
Signed-off-by: Douglas Schilling Landgraf <dougsl...@redhat.com>


---

 linux/drivers/media/video/gspca/stv06xx/stv06xx.c |   29 +++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff -r 34d81dd7d1e6 -r 41c5482f2dac 
linux/drivers/media/video/gspca/stv06xx/stv06xx.c
--- a/linux/drivers/media/video/gspca/stv06xx/stv06xx.c Thu Mar 04 02:48:20 
2010 -0300
+++ b/linux/drivers/media/video/gspca/stv06xx/stv06xx.c Thu Mar 04 02:49:46 
2010 -0300
@@ -27,6 +27,7 @@
  * P/N 861040-0000: Sensor ST VV6410       ASIC STV0610   - QuickCam Web
  */
 
+#include <linux/input.h>
 #include "stv06xx_sensor.h"
 
 MODULE_AUTHOR("Erik Andrén");
@@ -427,6 +428,29 @@
        }
 }
 
+#ifdef CONFIG_INPUT
+static int sd_int_pkt_scan(struct gspca_dev *gspca_dev,
+                       u8 *data,               /* interrupt packet data */
+                       int len)                /* interrupt packet length */
+{
+       int ret = -EINVAL;
+
+       if (len == 1 && data[0] == 0x80) {
+               input_report_key(gspca_dev->input_dev, KEY_CAMERA, 1);
+               input_sync(gspca_dev->input_dev);
+               ret = 0;
+       }
+
+       if (len == 1 && data[0] == 0x88) {
+               input_report_key(gspca_dev->input_dev, KEY_CAMERA, 0);
+               input_sync(gspca_dev->input_dev);
+               ret = 0;
+       }
+
+       return ret;
+}
+#endif
+
 static int stv06xx_config(struct gspca_dev *gspca_dev,
                          const struct usb_device_id *id);
 
@@ -437,7 +461,10 @@
        .init = stv06xx_init,
        .start = stv06xx_start,
        .stopN = stv06xx_stopN,
-       .pkt_scan = stv06xx_pkt_scan
+       .pkt_scan = stv06xx_pkt_scan,
+#ifdef CONFIG_INPUT
+       .int_pkt_scan = sd_int_pkt_scan,
+#endif
 };
 
 /* This function is called at probe time */


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/41c5482f2dac1ab475a7633758f1086eabea133d

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to