Commit 2856643e authored by Jean-François Moine's avatar Jean-François Moine Committed by Mauro Carvalho Chehab

V4L/DVB: gspca - many subdrivers: Handle the buttons when CONFIG_INPUT=m

Signed-off-by: default avatarJean-François Moine <moinejf@free.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 85c55efb
...@@ -352,7 +352,7 @@ static void sd_stopN(struct gspca_dev *gspca_dev) ...@@ -352,7 +352,7 @@ static void sd_stopN(struct gspca_dev *gspca_dev)
struct sd *sd = (struct sd *) gspca_dev; struct sd *sd = (struct sd *) gspca_dev;
konica_stream_off(gspca_dev); konica_stream_off(gspca_dev);
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
/* Don't keep the button in the pressed state "forever" if it was /* Don't keep the button in the pressed state "forever" if it was
pressed when streaming is stopped */ pressed when streaming is stopped */
if (sd->snapshot_pressed) { if (sd->snapshot_pressed) {
...@@ -451,7 +451,7 @@ static void sd_isoc_irq(struct urb *urb) ...@@ -451,7 +451,7 @@ static void sd_isoc_irq(struct urb *urb)
gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0); gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
gspca_frame_add(gspca_dev, FIRST_PACKET, NULL, 0); gspca_frame_add(gspca_dev, FIRST_PACKET, NULL, 0);
} else { } else {
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
u8 button_state = st & 0x40 ? 1 : 0; u8 button_state = st & 0x40 ? 1 : 0;
if (sd->snapshot_pressed != button_state) { if (sd->snapshot_pressed != button_state) {
input_report_key(gspca_dev->input_dev, input_report_key(gspca_dev->input_dev,
...@@ -601,7 +601,7 @@ static const struct sd_desc sd_desc = { ...@@ -601,7 +601,7 @@ static const struct sd_desc sd_desc = {
.init = sd_init, .init = sd_init,
.start = sd_start, .start = sd_start,
.stopN = sd_stopN, .stopN = sd_stopN,
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
.other_input = 1, .other_input = 1,
#endif #endif
}; };
......
...@@ -3997,7 +3997,7 @@ static void ov51x_handle_button(struct gspca_dev *gspca_dev, u8 state) ...@@ -3997,7 +3997,7 @@ static void ov51x_handle_button(struct gspca_dev *gspca_dev, u8 state)
struct sd *sd = (struct sd *) gspca_dev; struct sd *sd = (struct sd *) gspca_dev;
if (sd->snapshot_pressed != state) { if (sd->snapshot_pressed != state) {
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
input_report_key(gspca_dev->input_dev, KEY_CAMERA, state); input_report_key(gspca_dev->input_dev, KEY_CAMERA, state);
input_sync(gspca_dev->input_dev); input_sync(gspca_dev->input_dev);
#endif #endif
...@@ -4598,7 +4598,7 @@ static const struct sd_desc sd_desc = { ...@@ -4598,7 +4598,7 @@ static const struct sd_desc sd_desc = {
.querymenu = sd_querymenu, .querymenu = sd_querymenu,
.get_jcomp = sd_get_jcomp, .get_jcomp = sd_get_jcomp,
.set_jcomp = sd_set_jcomp, .set_jcomp = sd_set_jcomp,
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
.other_input = 1, .other_input = 1,
#endif #endif
}; };
......
...@@ -494,7 +494,7 @@ static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val) ...@@ -494,7 +494,7 @@ static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val)
return 0; return 0;
} }
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
static int sd_int_pkt_scan(struct gspca_dev *gspca_dev, static int sd_int_pkt_scan(struct gspca_dev *gspca_dev,
u8 *data, /* interrupt packet data */ u8 *data, /* interrupt packet data */
int len) /* interrput packet length */ int len) /* interrput packet length */
...@@ -524,7 +524,7 @@ static const struct sd_desc sd_desc = { ...@@ -524,7 +524,7 @@ static const struct sd_desc sd_desc = {
.stopN = sd_stopN, .stopN = sd_stopN,
.dq_callback = pac207_do_auto_gain, .dq_callback = pac207_do_auto_gain,
.pkt_scan = sd_pkt_scan, .pkt_scan = sd_pkt_scan,
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
.int_pkt_scan = sd_int_pkt_scan, .int_pkt_scan = sd_int_pkt_scan,
#endif #endif
}; };
......
...@@ -1132,7 +1132,7 @@ static int sd_chip_ident(struct gspca_dev *gspca_dev, ...@@ -1132,7 +1132,7 @@ static int sd_chip_ident(struct gspca_dev *gspca_dev,
} }
#endif #endif
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
static int sd_int_pkt_scan(struct gspca_dev *gspca_dev, static int sd_int_pkt_scan(struct gspca_dev *gspca_dev,
u8 *data, /* interrupt packet data */ u8 *data, /* interrupt packet data */
int len) /* interrput packet length */ int len) /* interrput packet length */
...@@ -1179,7 +1179,7 @@ static const struct sd_desc sd_desc = { ...@@ -1179,7 +1179,7 @@ static const struct sd_desc sd_desc = {
.set_register = sd_dbg_s_register, .set_register = sd_dbg_s_register,
.get_chip_ident = sd_chip_ident, .get_chip_ident = sd_chip_ident,
#endif #endif
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
.int_pkt_scan = sd_int_pkt_scan, .int_pkt_scan = sd_int_pkt_scan,
#endif #endif
}; };
......
...@@ -789,7 +789,7 @@ static int sd_getvflip(struct gspca_dev *gspca_dev, __s32 *val) ...@@ -789,7 +789,7 @@ static int sd_getvflip(struct gspca_dev *gspca_dev, __s32 *val)
return 0; return 0;
} }
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
static int sd_int_pkt_scan(struct gspca_dev *gspca_dev, static int sd_int_pkt_scan(struct gspca_dev *gspca_dev,
u8 *data, /* interrupt packet data */ u8 *data, /* interrupt packet data */
int len) /* interrupt packet length */ int len) /* interrupt packet length */
...@@ -832,7 +832,7 @@ static const struct sd_desc sd_desc = { ...@@ -832,7 +832,7 @@ static const struct sd_desc sd_desc = {
.stop0 = sd_stop0, .stop0 = sd_stop0,
.pkt_scan = sd_pkt_scan, .pkt_scan = sd_pkt_scan,
.dq_callback = do_autogain, .dq_callback = do_autogain,
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
.int_pkt_scan = sd_int_pkt_scan, .int_pkt_scan = sd_int_pkt_scan,
#endif #endif
}; };
......
...@@ -18,9 +18,7 @@ ...@@ -18,9 +18,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifdef CONFIG_INPUT
#include <linux/input.h> #include <linux/input.h>
#endif
#include "gspca.h" #include "gspca.h"
#include "jpeg.h" #include "jpeg.h"
...@@ -2304,7 +2302,7 @@ static void sd_dqcallback(struct gspca_dev *gspca_dev) ...@@ -2304,7 +2302,7 @@ static void sd_dqcallback(struct gspca_dev *gspca_dev)
do_autoexposure(gspca_dev, avg_lum); do_autoexposure(gspca_dev, avg_lum);
} }
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
static int sd_int_pkt_scan(struct gspca_dev *gspca_dev, static int sd_int_pkt_scan(struct gspca_dev *gspca_dev,
u8 *data, /* interrupt packet */ u8 *data, /* interrupt packet */
int len) /* interrupt packet length */ int len) /* interrupt packet length */
...@@ -2386,7 +2384,7 @@ static const struct sd_desc sd_desc = { ...@@ -2386,7 +2384,7 @@ static const struct sd_desc sd_desc = {
.start = sd_start, .start = sd_start,
.stopN = sd_stopN, .stopN = sd_stopN,
.pkt_scan = sd_pkt_scan, .pkt_scan = sd_pkt_scan,
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
.int_pkt_scan = sd_int_pkt_scan, .int_pkt_scan = sd_int_pkt_scan,
#endif #endif
.dq_callback = sd_dqcallback, .dq_callback = sd_dqcallback,
......
...@@ -1388,7 +1388,7 @@ static int sd_querymenu(struct gspca_dev *gspca_dev, ...@@ -1388,7 +1388,7 @@ static int sd_querymenu(struct gspca_dev *gspca_dev,
return -EINVAL; return -EINVAL;
} }
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
static int sd_int_pkt_scan(struct gspca_dev *gspca_dev, static int sd_int_pkt_scan(struct gspca_dev *gspca_dev,
u8 *data, /* interrupt packet data */ u8 *data, /* interrupt packet data */
int len) /* interrupt packet length */ int len) /* interrupt packet length */
...@@ -1419,7 +1419,7 @@ static const struct sd_desc sd_desc = { ...@@ -1419,7 +1419,7 @@ static const struct sd_desc sd_desc = {
.pkt_scan = sd_pkt_scan, .pkt_scan = sd_pkt_scan,
.querymenu = sd_querymenu, .querymenu = sd_querymenu,
.dq_callback = do_autogain, .dq_callback = do_autogain,
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
.int_pkt_scan = sd_int_pkt_scan, .int_pkt_scan = sd_int_pkt_scan,
#endif #endif
}; };
......
...@@ -2993,7 +2993,7 @@ static int sd_querymenu(struct gspca_dev *gspca_dev, ...@@ -2993,7 +2993,7 @@ static int sd_querymenu(struct gspca_dev *gspca_dev,
return -EINVAL; return -EINVAL;
} }
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
static int sd_int_pkt_scan(struct gspca_dev *gspca_dev, static int sd_int_pkt_scan(struct gspca_dev *gspca_dev,
u8 *data, /* interrupt packet data */ u8 *data, /* interrupt packet data */
int len) /* interrupt packet length */ int len) /* interrupt packet length */
...@@ -3026,7 +3026,7 @@ static const struct sd_desc sd_desc = { ...@@ -3026,7 +3026,7 @@ static const struct sd_desc sd_desc = {
.get_jcomp = sd_get_jcomp, .get_jcomp = sd_get_jcomp,
.set_jcomp = sd_set_jcomp, .set_jcomp = sd_set_jcomp,
.querymenu = sd_querymenu, .querymenu = sd_querymenu,
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
.int_pkt_scan = sd_int_pkt_scan, .int_pkt_scan = sd_int_pkt_scan,
#endif #endif
}; };
......
...@@ -787,7 +787,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, ...@@ -787,7 +787,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
return; return;
} }
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
if (data[0] & 0x20) { if (data[0] & 0x20) {
input_report_key(gspca_dev->input_dev, KEY_CAMERA, 1); input_report_key(gspca_dev->input_dev, KEY_CAMERA, 1);
input_sync(gspca_dev->input_dev); input_sync(gspca_dev->input_dev);
...@@ -1037,7 +1037,7 @@ static const struct sd_desc sd_desc_12a = { ...@@ -1037,7 +1037,7 @@ static const struct sd_desc sd_desc_12a = {
.start = sd_start_12a, .start = sd_start_12a,
.stopN = sd_stopN, .stopN = sd_stopN,
.pkt_scan = sd_pkt_scan, .pkt_scan = sd_pkt_scan,
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
.other_input = 1, .other_input = 1,
#endif #endif
}; };
...@@ -1051,7 +1051,7 @@ static const struct sd_desc sd_desc_72a = { ...@@ -1051,7 +1051,7 @@ static const struct sd_desc sd_desc_72a = {
.stopN = sd_stopN, .stopN = sd_stopN,
.pkt_scan = sd_pkt_scan, .pkt_scan = sd_pkt_scan,
.dq_callback = do_autogain, .dq_callback = do_autogain,
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
.other_input = 1, .other_input = 1,
#endif #endif
}; };
......
...@@ -428,7 +428,7 @@ static void stv06xx_pkt_scan(struct gspca_dev *gspca_dev, ...@@ -428,7 +428,7 @@ static void stv06xx_pkt_scan(struct gspca_dev *gspca_dev,
} }
} }
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
static int sd_int_pkt_scan(struct gspca_dev *gspca_dev, static int sd_int_pkt_scan(struct gspca_dev *gspca_dev,
u8 *data, /* interrupt packet data */ u8 *data, /* interrupt packet data */
int len) /* interrupt packet length */ int len) /* interrupt packet length */
...@@ -462,7 +462,7 @@ static const struct sd_desc sd_desc = { ...@@ -462,7 +462,7 @@ static const struct sd_desc sd_desc = {
.start = stv06xx_start, .start = stv06xx_start,
.stopN = stv06xx_stopN, .stopN = stv06xx_stopN,
.pkt_scan = stv06xx_pkt_scan, .pkt_scan = stv06xx_pkt_scan,
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
.int_pkt_scan = sd_int_pkt_scan, .int_pkt_scan = sd_int_pkt_scan,
#endif #endif
}; };
......
...@@ -21,9 +21,7 @@ ...@@ -21,9 +21,7 @@
#define MODULE_NAME "zc3xx" #define MODULE_NAME "zc3xx"
#ifdef CONFIG_INPUT
#include <linux/input.h> #include <linux/input.h>
#endif
#include "gspca.h" #include "gspca.h"
#include "jpeg.h" #include "jpeg.h"
...@@ -7006,7 +7004,7 @@ static int sd_get_jcomp(struct gspca_dev *gspca_dev, ...@@ -7006,7 +7004,7 @@ static int sd_get_jcomp(struct gspca_dev *gspca_dev,
return 0; return 0;
} }
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
static int sd_int_pkt_scan(struct gspca_dev *gspca_dev, static int sd_int_pkt_scan(struct gspca_dev *gspca_dev,
u8 *data, /* interrupt packet data */ u8 *data, /* interrupt packet data */
int len) /* interrput packet length */ int len) /* interrput packet length */
...@@ -7034,7 +7032,7 @@ static const struct sd_desc sd_desc = { ...@@ -7034,7 +7032,7 @@ static const struct sd_desc sd_desc = {
.querymenu = sd_querymenu, .querymenu = sd_querymenu,
.get_jcomp = sd_get_jcomp, .get_jcomp = sd_get_jcomp,
.set_jcomp = sd_set_jcomp, .set_jcomp = sd_set_jcomp,
#ifdef CONFIG_INPUT #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
.int_pkt_scan = sd_int_pkt_scan, .int_pkt_scan = sd_int_pkt_scan,
#endif #endif
}; };
......
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