diff options
author | Hans de Goede <hdegoede@redhat.com> | 2010-02-20 02:45:49 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:11:10 -0500 |
commit | 88e8d20a8c7c84533e1aa89dd45354cb5edded37 (patch) | |
tree | 248c206efddf478ba536a3d55b1c8af6d6bcafb2 | |
parent | 92e232acd61f610e09449dad3f6ff6d3c78887e9 (diff) |
V4L/DVB: gspca_ov519: add support for the button on ov511 based cams
Due to hardware limitations this only works while the camera is
streaming.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/gspca/ov519.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c index 016f8bb5c375..bc4ced6c013b 100644 --- a/drivers/media/video/gspca/ov519.c +++ b/drivers/media/video/gspca/ov519.c | |||
@@ -2702,6 +2702,11 @@ static void sd_reset_snapshot(struct gspca_dev *gspca_dev) | |||
2702 | sd->snapshot_needs_reset = 0; | 2702 | sd->snapshot_needs_reset = 0; |
2703 | 2703 | ||
2704 | switch (sd->bridge) { | 2704 | switch (sd->bridge) { |
2705 | case BRIDGE_OV511: | ||
2706 | case BRIDGE_OV511PLUS: | ||
2707 | reg_w(sd, R51x_SYS_SNAP, 0x02); | ||
2708 | reg_w(sd, R51x_SYS_SNAP, 0x00); | ||
2709 | break; | ||
2705 | case BRIDGE_OV518: | 2710 | case BRIDGE_OV518: |
2706 | case BRIDGE_OV518PLUS: | 2711 | case BRIDGE_OV518PLUS: |
2707 | reg_w(sd, R51x_SYS_SNAP, 0x02); /* Reset */ | 2712 | reg_w(sd, R51x_SYS_SNAP, 0x02); /* Reset */ |
@@ -3996,11 +4001,17 @@ static void ov51x_handle_button(struct gspca_dev *gspca_dev, u8 state) | |||
3996 | 4001 | ||
3997 | sd->snapshot_pressed = state; | 4002 | sd->snapshot_pressed = state; |
3998 | } else { | 4003 | } else { |
3999 | /* On the ov519 we need to reset the button state multiple | 4004 | /* On the ov511 / ov519 we need to reset the button state |
4000 | times, as resetting does not work as long as the button | 4005 | multiple times, as resetting does not work as long as the |
4001 | stays pressed */ | 4006 | button stays pressed */ |
4002 | if (sd->bridge == BRIDGE_OV519 && state) | 4007 | switch (sd->bridge) { |
4003 | sd->snapshot_needs_reset = 1; | 4008 | case BRIDGE_OV511: |
4009 | case BRIDGE_OV511PLUS: | ||
4010 | case BRIDGE_OV519: | ||
4011 | if (state) | ||
4012 | sd->snapshot_needs_reset = 1; | ||
4013 | break; | ||
4014 | } | ||
4004 | } | 4015 | } |
4005 | } | 4016 | } |
4006 | 4017 | ||
@@ -4025,6 +4036,7 @@ static void ov511_pkt_scan(struct gspca_dev *gspca_dev, | |||
4025 | */ | 4036 | */ |
4026 | if (!(in[0] | in[1] | in[2] | in[3] | in[4] | in[5] | in[6] | in[7]) && | 4037 | if (!(in[0] | in[1] | in[2] | in[3] | in[4] | in[5] | in[6] | in[7]) && |
4027 | (in[8] & 0x08)) { | 4038 | (in[8] & 0x08)) { |
4039 | ov51x_handle_button(gspca_dev, (in[8] >> 2) & 1); | ||
4028 | if (in[8] & 0x80) { | 4040 | if (in[8] & 0x80) { |
4029 | /* Frame end */ | 4041 | /* Frame end */ |
4030 | if ((in[9] + 1) * 8 != gspca_dev->width || | 4042 | if ((in[9] + 1) * 8 != gspca_dev->width || |