diff options
author | Hans de Goede <j.w.r.degoede@hhs.nl> | 2008-09-03 15:48:16 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-09-03 17:37:00 -0400 |
commit | 89a44b8a690ff2d8639b72931d9c197a8db0c803 (patch) | |
tree | 05a958f34d5e713712d3545a1f2519f94b37410c /drivers/media/video | |
parent | f9b4a377dc6601a3299171c7b24c2c5189c0c10b (diff) |
V4L/DVB (8720): gspca: V4L2_CAP_SENSOR_UPSIDE_DOWN added as a cap for some webcams.
This patch adds a V4L2_CAP_SENSOR_UPSIDE_DOWN flag to the capabilities flags,
and sets this flag for the Philips SPC200NC cam (which has its sensor installed
upside down). The same flag is also needed and added for the Philips SPC300NC.
Together with a patch to libv4l which adds flipping the image in software this
fixes the upside down display with the SPC200NC cam.
Signed-of-by: Hans de Goede <j.w.r.degoede@hhs.nl>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/gspca/gspca.c | 2 | ||||
-rw-r--r-- | drivers/media/video/gspca/gspca.h | 4 | ||||
-rw-r--r-- | drivers/media/video/gspca/zc3xx.c | 31 |
3 files changed, 25 insertions, 12 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 061e1912924..3461bc9e473 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c | |||
@@ -851,6 +851,8 @@ static int vidioc_querycap(struct file *file, void *priv, | |||
851 | cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | 851 | cap->capabilities = V4L2_CAP_VIDEO_CAPTURE |
852 | | V4L2_CAP_STREAMING | 852 | | V4L2_CAP_STREAMING |
853 | | V4L2_CAP_READWRITE; | 853 | | V4L2_CAP_READWRITE; |
854 | if (gspca_dev->flags & GSPCA_SENSOR_UPSIDE_DOWN_FLAG) | ||
855 | cap->capabilities |= V4L2_CAP_SENSOR_UPSIDE_DOWN; | ||
854 | return 0; | 856 | return 0; |
855 | } | 857 | } |
856 | 858 | ||
diff --git a/drivers/media/video/gspca/gspca.h b/drivers/media/video/gspca/gspca.h index 2596568e82f..1920c99d6f4 100644 --- a/drivers/media/video/gspca/gspca.h +++ b/drivers/media/video/gspca/gspca.h | |||
@@ -118,6 +118,9 @@ struct gspca_frame { | |||
118 | struct v4l2_buffer v4l2_buf; | 118 | struct v4l2_buffer v4l2_buf; |
119 | }; | 119 | }; |
120 | 120 | ||
121 | /* defines for the flags member */ | ||
122 | #define GSPCA_SENSOR_UPSIDE_DOWN_FLAG 0x01 | ||
123 | |||
121 | struct gspca_dev { | 124 | struct gspca_dev { |
122 | struct video_device vdev; /* !! must be the first item */ | 125 | struct video_device vdev; /* !! must be the first item */ |
123 | struct file_operations fops; | 126 | struct file_operations fops; |
@@ -163,6 +166,7 @@ struct gspca_dev { | |||
163 | char nurbs; /* number of allocated URBs */ | 166 | char nurbs; /* number of allocated URBs */ |
164 | char memory; /* memory type (V4L2_MEMORY_xxx) */ | 167 | char memory; /* memory type (V4L2_MEMORY_xxx) */ |
165 | __u8 nbalt; /* number of USB alternate settings */ | 168 | __u8 nbalt; /* number of USB alternate settings */ |
169 | __u8 flags; /* see GSPCA_XXX_FLAG defines */ | ||
166 | }; | 170 | }; |
167 | 171 | ||
168 | int gspca_dev_probe(struct usb_interface *intf, | 172 | int gspca_dev_probe(struct usb_interface *intf, |
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c index 79436f27cd4..f1d8c7a08ba 100644 --- a/drivers/media/video/gspca/zc3xx.c +++ b/drivers/media/video/gspca/zc3xx.c | |||
@@ -70,6 +70,10 @@ struct sd { | |||
70 | unsigned short chip_revision; | 70 | unsigned short chip_revision; |
71 | }; | 71 | }; |
72 | 72 | ||
73 | #define DRIVER_INFO(sensor, flags) .driver_info = ((sensor) << 8) | (flags) | ||
74 | #define DRIVER_INFO_GET_SENSOR(driver_info) ((driver_info) >> 8) | ||
75 | #define DRIVER_INFO_GET_FLAGS(driver_info) ((driver_info) & 0xff) | ||
76 | |||
73 | /* V4L2 controls supported by the driver */ | 77 | /* V4L2 controls supported by the driver */ |
74 | static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val); | 78 | static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val); |
75 | static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val); | 79 | static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val); |
@@ -7015,7 +7019,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
7015 | 7019 | ||
7016 | /* define some sensors from the vendor/product */ | 7020 | /* define some sensors from the vendor/product */ |
7017 | sd->sharpness = 2; | 7021 | sd->sharpness = 2; |
7018 | sd->sensor = id->driver_info; | 7022 | sd->sensor = DRIVER_INFO_GET_SENSOR(id->driver_info); |
7023 | gspca_dev->flags = DRIVER_INFO_GET_FLAGS(id->driver_info); | ||
7019 | sensor = zcxx_probeSensor(gspca_dev); | 7024 | sensor = zcxx_probeSensor(gspca_dev); |
7020 | if (sensor >= 0) | 7025 | if (sensor >= 0) |
7021 | PDEBUG(D_PROBE, "probe sensor -> %02x", sensor); | 7026 | PDEBUG(D_PROBE, "probe sensor -> %02x", sensor); |
@@ -7505,19 +7510,19 @@ static const __devinitdata struct usb_device_id device_table[] = { | |||
7505 | {USB_DEVICE(0x041e, 0x041e)}, | 7510 | {USB_DEVICE(0x041e, 0x041e)}, |
7506 | #ifndef CONFIG_USB_ZC0301 | 7511 | #ifndef CONFIG_USB_ZC0301 |
7507 | {USB_DEVICE(0x041e, 0x4017)}, | 7512 | {USB_DEVICE(0x041e, 0x4017)}, |
7508 | {USB_DEVICE(0x041e, 0x401c), .driver_info = SENSOR_PAS106}, | 7513 | {USB_DEVICE(0x041e, 0x401c), DRIVER_INFO(SENSOR_PAS106, 0)}, |
7509 | {USB_DEVICE(0x041e, 0x401e)}, | 7514 | {USB_DEVICE(0x041e, 0x401e)}, |
7510 | {USB_DEVICE(0x041e, 0x401f)}, | 7515 | {USB_DEVICE(0x041e, 0x401f)}, |
7511 | #endif | 7516 | #endif |
7512 | {USB_DEVICE(0x041e, 0x4029)}, | 7517 | {USB_DEVICE(0x041e, 0x4029)}, |
7513 | #ifndef CONFIG_USB_ZC0301 | 7518 | #ifndef CONFIG_USB_ZC0301 |
7514 | {USB_DEVICE(0x041e, 0x4034), .driver_info = SENSOR_PAS106}, | 7519 | {USB_DEVICE(0x041e, 0x4034), DRIVER_INFO(SENSOR_PAS106, 0)}, |
7515 | {USB_DEVICE(0x041e, 0x4035), .driver_info = SENSOR_PAS106}, | 7520 | {USB_DEVICE(0x041e, 0x4035), DRIVER_INFO(SENSOR_PAS106, 0)}, |
7516 | {USB_DEVICE(0x041e, 0x4036)}, | 7521 | {USB_DEVICE(0x041e, 0x4036)}, |
7517 | {USB_DEVICE(0x041e, 0x403a)}, | 7522 | {USB_DEVICE(0x041e, 0x403a)}, |
7518 | #endif | 7523 | #endif |
7519 | {USB_DEVICE(0x041e, 0x4051), .driver_info = SENSOR_TAS5130C_VF0250}, | 7524 | {USB_DEVICE(0x041e, 0x4051), DRIVER_INFO(SENSOR_TAS5130C_VF0250, 0)}, |
7520 | {USB_DEVICE(0x041e, 0x4053), .driver_info = SENSOR_TAS5130C_VF0250}, | 7525 | {USB_DEVICE(0x041e, 0x4053), DRIVER_INFO(SENSOR_TAS5130C_VF0250, 0)}, |
7521 | #ifndef CONFIG_USB_ZC0301 | 7526 | #ifndef CONFIG_USB_ZC0301 |
7522 | {USB_DEVICE(0x0458, 0x7007)}, | 7527 | {USB_DEVICE(0x0458, 0x7007)}, |
7523 | {USB_DEVICE(0x0458, 0x700c)}, | 7528 | {USB_DEVICE(0x0458, 0x700c)}, |
@@ -7543,11 +7548,13 @@ static const __devinitdata struct usb_device_id device_table[] = { | |||
7543 | {USB_DEVICE(0x046d, 0x08d9)}, | 7548 | {USB_DEVICE(0x046d, 0x08d9)}, |
7544 | {USB_DEVICE(0x046d, 0x08d8)}, | 7549 | {USB_DEVICE(0x046d, 0x08d8)}, |
7545 | {USB_DEVICE(0x046d, 0x08da)}, | 7550 | {USB_DEVICE(0x046d, 0x08da)}, |
7546 | {USB_DEVICE(0x046d, 0x08dd), .driver_info = SENSOR_MC501CB}, | 7551 | {USB_DEVICE(0x046d, 0x08dd), DRIVER_INFO(SENSOR_MC501CB, 0)}, |
7547 | {USB_DEVICE(0x0471, 0x0325), .driver_info = SENSOR_PAS106}, | 7552 | {USB_DEVICE(0x0471, 0x0325), DRIVER_INFO(SENSOR_PAS106, |
7548 | {USB_DEVICE(0x0471, 0x0326), .driver_info = SENSOR_PAS106}, | 7553 | GSPCA_SENSOR_UPSIDE_DOWN_FLAG)}, |
7549 | {USB_DEVICE(0x0471, 0x032d), .driver_info = SENSOR_PAS106}, | 7554 | {USB_DEVICE(0x0471, 0x0326), DRIVER_INFO(SENSOR_PAS106, |
7550 | {USB_DEVICE(0x0471, 0x032e), .driver_info = SENSOR_PAS106}, | 7555 | GSPCA_SENSOR_UPSIDE_DOWN_FLAG)}, |
7556 | {USB_DEVICE(0x0471, 0x032d), DRIVER_INFO(SENSOR_PAS106, 0)}, | ||
7557 | {USB_DEVICE(0x0471, 0x032e), DRIVER_INFO(SENSOR_PAS106, 0)}, | ||
7551 | {USB_DEVICE(0x055f, 0xc005)}, | 7558 | {USB_DEVICE(0x055f, 0xc005)}, |
7552 | #ifndef CONFIG_USB_ZC0301 | 7559 | #ifndef CONFIG_USB_ZC0301 |
7553 | {USB_DEVICE(0x055f, 0xd003)}, | 7560 | {USB_DEVICE(0x055f, 0xd003)}, |
@@ -7559,7 +7566,7 @@ static const __devinitdata struct usb_device_id device_table[] = { | |||
7559 | {USB_DEVICE(0x0ac8, 0x301b)}, | 7566 | {USB_DEVICE(0x0ac8, 0x301b)}, |
7560 | {USB_DEVICE(0x0ac8, 0x303b)}, | 7567 | {USB_DEVICE(0x0ac8, 0x303b)}, |
7561 | #endif | 7568 | #endif |
7562 | {USB_DEVICE(0x0ac8, 0x305b), .driver_info = SENSOR_TAS5130C_VF0250}, | 7569 | {USB_DEVICE(0x0ac8, 0x305b), DRIVER_INFO(SENSOR_TAS5130C_VF0250, 0)}, |
7563 | #ifndef CONFIG_USB_ZC0301 | 7570 | #ifndef CONFIG_USB_ZC0301 |
7564 | {USB_DEVICE(0x0ac8, 0x307b)}, | 7571 | {USB_DEVICE(0x0ac8, 0x307b)}, |
7565 | {USB_DEVICE(0x10fd, 0x0128)}, | 7572 | {USB_DEVICE(0x10fd, 0x0128)}, |