diff options
-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 | ||||
-rw-r--r-- | include/linux/videodev2.h | 5 |
4 files changed, 30 insertions, 12 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 061e19129245..3461bc9e4739 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 2596568e82fd..1920c99d6f4a 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 79436f27cd4e..f1d8c7a08ba2 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)}, |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 6c73516b74c4..4c30655b293f 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -261,6 +261,11 @@ struct v4l2_capability { | |||
261 | #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ | 261 | #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ |
262 | #define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */ | 262 | #define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */ |
263 | 263 | ||
264 | /* This flags gets set if the "sensor" is known to be upside down and this can | ||
265 | *not* be fixed using v4l2 flipx/y controls. Note that absence of this flag | ||
266 | is not a guarantee for the image not being upside down. */ | ||
267 | #define V4L2_CAP_SENSOR_UPSIDE_DOWN 0x10000000 | ||
268 | |||
264 | /* | 269 | /* |
265 | * V I D E O I M A G E F O R M A T | 270 | * V I D E O I M A G E F O R M A T |
266 | */ | 271 | */ |