aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/pac7311.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2010-01-29 09:04:19 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 13:11:08 -0500
commit32ea3e44b9d9125960e23f56ce86c39700447717 (patch)
tree328da258306efa8f9bf2c2cd4d15a79d7621bf7a /drivers/media/video/gspca/pac7311.c
parent937a6f54e31f3899c93cbe975d2ea7599dadd666 (diff)
V4L/DVB: gscpa_pac7311: Add support for camera button
gscpa_pac7311: Add support for camera button Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/pac7311.c')
-rw-r--r--drivers/media/video/gspca/pac7311.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/media/video/gspca/pac7311.c b/drivers/media/video/gspca/pac7311.c
index ba73eb847fd1..44fed9686729 100644
--- a/drivers/media/video/gspca/pac7311.c
+++ b/drivers/media/video/gspca/pac7311.c
@@ -51,6 +51,7 @@
51 51
52#define MODULE_NAME "pac7311" 52#define MODULE_NAME "pac7311"
53 53
54#include <linux/input.h>
54#include "gspca.h" 55#include "gspca.h"
55 56
56MODULE_AUTHOR("Thomas Kaiser thomas@kaiser-linux.li"); 57MODULE_AUTHOR("Thomas Kaiser thomas@kaiser-linux.li");
@@ -798,6 +799,37 @@ static int sd_getvflip(struct gspca_dev *gspca_dev, __s32 *val)
798 return 0; 799 return 0;
799} 800}
800 801
802#ifdef CONFIG_INPUT
803static int sd_int_pkt_scan(struct gspca_dev *gspca_dev,
804 u8 *data, /* interrupt packet data */
805 int len) /* interrupt packet length */
806{
807 int ret = -EINVAL;
808 u8 data0, data1;
809
810 if (len == 2) {
811 data0 = data[0];
812 data1 = data[1];
813 if ((data0 == 0x00 && data1 == 0x11) ||
814 (data0 == 0x22 && data1 == 0x33) ||
815 (data0 == 0x44 && data1 == 0x55) ||
816 (data0 == 0x66 && data1 == 0x77) ||
817 (data0 == 0x88 && data1 == 0x99) ||
818 (data0 == 0xaa && data1 == 0xbb) ||
819 (data0 == 0xcc && data1 == 0xdd) ||
820 (data0 == 0xee && data1 == 0xff)) {
821 input_report_key(gspca_dev->input_dev, KEY_CAMERA, 1);
822 input_sync(gspca_dev->input_dev);
823 input_report_key(gspca_dev->input_dev, KEY_CAMERA, 0);
824 input_sync(gspca_dev->input_dev);
825 ret = 0;
826 }
827 }
828
829 return ret;
830}
831#endif
832
801/* sub-driver description for pac7311 */ 833/* sub-driver description for pac7311 */
802static const struct sd_desc sd_desc = { 834static const struct sd_desc sd_desc = {
803 .name = MODULE_NAME, 835 .name = MODULE_NAME,
@@ -810,6 +842,9 @@ static const struct sd_desc sd_desc = {
810 .stop0 = sd_stop0, 842 .stop0 = sd_stop0,
811 .pkt_scan = sd_pkt_scan, 843 .pkt_scan = sd_pkt_scan,
812 .dq_callback = do_autogain, 844 .dq_callback = do_autogain,
845#ifdef CONFIG_INPUT
846 .int_pkt_scan = sd_int_pkt_scan,
847#endif
813}; 848};
814 849
815/* -- module initialisation -- */ 850/* -- module initialisation -- */