The patch number 14374 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_sonixj: Add camera button support


gspca_sonixj: Add camera button support

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/sonixj.c |   33 ++++++++++++++++++++---
 1 file changed, 30 insertions(+), 3 deletions(-)

diff -r e971d142bdc1 -r 01eac6dcca12 linux/drivers/media/video/gspca/sonixj.c
--- a/linux/drivers/media/video/gspca/sonixj.c  Wed Mar 03 20:48:15 2010 -0300
+++ b/linux/drivers/media/video/gspca/sonixj.c  Thu Mar 04 00:09:08 2010 -0300
@@ -21,6 +21,7 @@
 
 #define MODULE_NAME "sonixj"
 
+#include <linux/input.h>
 #include "gspca.h"
 #include "jpeg.h"
 
@@ -1396,7 +1397,8 @@
                {0x00, 0x40, 0x38, 0x30, 0x00, 0x20};
        static const u8 regd4[] = {0x60, 0x00, 0x00};
 
-       reg_w1(gspca_dev, 0xf1, 0x00);
+       /* sensor clock already enabled in sd_init */
+       /* reg_w1(gspca_dev, 0xf1, 0x00); */
 #if 1
        reg_w1(gspca_dev, 0x01, sn9c1xx[1]);
 #else
@@ -1600,7 +1602,9 @@
                break;
        }
 
-       reg_w1(gspca_dev, 0xf1, 0x01);
+       /* Note we do not disable the sensor clock here (power saving mode),
+          as that also disables the button on the cam. */
+       reg_w1(gspca_dev, 0xf1, 0x00);
 
        /* set the i2c address */
        sn9c1xx = sn_tb[sd->sensor];
@@ -2302,7 +2306,8 @@
        reg_w1(gspca_dev, 0x17, sn9c1xx[0x17]);
        reg_w1(gspca_dev, 0x01, sn9c1xx[1]);
        reg_w1(gspca_dev, 0x01, data);
-       reg_w1(gspca_dev, 0xf1, 0x00);
+       /* Don't disable sensor clock as that disables the button on the cam */
+       /* reg_w1(gspca_dev, 0xf1, 0x01); */
 }
 
 static void sd_stop0(struct gspca_dev *gspca_dev)
@@ -2655,6 +2660,25 @@
        return -EINVAL;
 }
 
+#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] == 1) {
+               input_report_key(gspca_dev->input_dev, KEY_CAMERA, 1);
+               input_sync(gspca_dev->input_dev);
+               input_report_key(gspca_dev->input_dev, KEY_CAMERA, 0);
+               input_sync(gspca_dev->input_dev);
+               ret = 0;
+       }
+
+       return ret;
+}
+#endif
+
 /* sub-driver description */
 static const struct sd_desc sd_desc = {
        .name = MODULE_NAME,
@@ -2670,6 +2694,9 @@
        .get_jcomp = sd_get_jcomp,
        .set_jcomp = sd_set_jcomp,
        .querymenu = sd_querymenu,
+#ifdef CONFIG_INPUT
+       .int_pkt_scan = sd_int_pkt_scan,
+#endif
 };
 
 /* -- module initialisation -- */


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/01eac6dcca12a6f3aa25f504060f9344d7fd7f66

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

Reply via email to