diff options
Diffstat (limited to 'drivers/media/video/cx231xx/cx231xx-video.c')
-rw-r--r-- | drivers/media/video/cx231xx/cx231xx-video.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/drivers/media/video/cx231xx/cx231xx-video.c b/drivers/media/video/cx231xx/cx231xx-video.c index a69c24d8db06..6e81f970dc7d 100644 --- a/drivers/media/video/cx231xx/cx231xx-video.c +++ b/drivers/media/video/cx231xx/cx231xx-video.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/bitmap.h> | 29 | #include <linux/bitmap.h> |
30 | #include <linux/usb.h> | 30 | #include <linux/usb.h> |
31 | #include <linux/i2c.h> | 31 | #include <linux/i2c.h> |
32 | #include <linux/version.h> | ||
33 | #include <linux/mm.h> | 32 | #include <linux/mm.h> |
34 | #include <linux/mutex.h> | 33 | #include <linux/mutex.h> |
35 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
@@ -45,7 +44,7 @@ | |||
45 | #include "cx231xx.h" | 44 | #include "cx231xx.h" |
46 | #include "cx231xx-vbi.h" | 45 | #include "cx231xx-vbi.h" |
47 | 46 | ||
48 | #define CX231XX_VERSION_CODE KERNEL_VERSION(0, 0, 1) | 47 | #define CX231XX_VERSION "0.0.2" |
49 | 48 | ||
50 | #define DRIVER_AUTHOR "Srinivasa Deevi <srinivasa.deevi@conexant.com>" | 49 | #define DRIVER_AUTHOR "Srinivasa Deevi <srinivasa.deevi@conexant.com>" |
51 | #define DRIVER_DESC "Conexant cx231xx based USB video device driver" | 50 | #define DRIVER_DESC "Conexant cx231xx based USB video device driver" |
@@ -70,6 +69,7 @@ do {\ | |||
70 | MODULE_AUTHOR(DRIVER_AUTHOR); | 69 | MODULE_AUTHOR(DRIVER_AUTHOR); |
71 | MODULE_DESCRIPTION(DRIVER_DESC); | 70 | MODULE_DESCRIPTION(DRIVER_DESC); |
72 | MODULE_LICENSE("GPL"); | 71 | MODULE_LICENSE("GPL"); |
72 | MODULE_VERSION(CX231XX_VERSION); | ||
73 | 73 | ||
74 | static unsigned int card[] = {[0 ... (CX231XX_MAXBOARDS - 1)] = UNSET }; | 74 | static unsigned int card[] = {[0 ... (CX231XX_MAXBOARDS - 1)] = UNSET }; |
75 | static unsigned int video_nr[] = {[0 ... (CX231XX_MAXBOARDS - 1)] = UNSET }; | 75 | static unsigned int video_nr[] = {[0 ... (CX231XX_MAXBOARDS - 1)] = UNSET }; |
@@ -1179,7 +1179,8 @@ static int vidioc_enum_input(struct file *file, void *priv, | |||
1179 | { | 1179 | { |
1180 | struct cx231xx_fh *fh = priv; | 1180 | struct cx231xx_fh *fh = priv; |
1181 | struct cx231xx *dev = fh->dev; | 1181 | struct cx231xx *dev = fh->dev; |
1182 | unsigned int n; | 1182 | u32 gen_stat; |
1183 | unsigned int ret, n; | ||
1183 | 1184 | ||
1184 | n = i->index; | 1185 | n = i->index; |
1185 | if (n >= MAX_CX231XX_INPUT) | 1186 | if (n >= MAX_CX231XX_INPUT) |
@@ -1198,6 +1199,18 @@ static int vidioc_enum_input(struct file *file, void *priv, | |||
1198 | 1199 | ||
1199 | i->std = dev->vdev->tvnorms; | 1200 | i->std = dev->vdev->tvnorms; |
1200 | 1201 | ||
1202 | /* If they are asking about the active input, read signal status */ | ||
1203 | if (n == dev->video_input) { | ||
1204 | ret = cx231xx_read_i2c_data(dev, VID_BLK_I2C_ADDRESS, | ||
1205 | GEN_STAT, 2, &gen_stat, 4); | ||
1206 | if (ret > 0) { | ||
1207 | if ((gen_stat & FLD_VPRES) == 0x00) | ||
1208 | i->status |= V4L2_IN_ST_NO_SIGNAL; | ||
1209 | if ((gen_stat & FLD_HLOCK) == 0x00) | ||
1210 | i->status |= V4L2_IN_ST_NO_H_LOCK; | ||
1211 | } | ||
1212 | } | ||
1213 | |||
1201 | return 0; | 1214 | return 0; |
1202 | } | 1215 | } |
1203 | 1216 | ||
@@ -1869,8 +1882,6 @@ static int vidioc_querycap(struct file *file, void *priv, | |||
1869 | strlcpy(cap->card, cx231xx_boards[dev->model].name, sizeof(cap->card)); | 1882 | strlcpy(cap->card, cx231xx_boards[dev->model].name, sizeof(cap->card)); |
1870 | usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info)); | 1883 | usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info)); |
1871 | 1884 | ||
1872 | cap->version = CX231XX_VERSION_CODE; | ||
1873 | |||
1874 | cap->capabilities = V4L2_CAP_VBI_CAPTURE | | 1885 | cap->capabilities = V4L2_CAP_VBI_CAPTURE | |
1875 | #if 0 | 1886 | #if 0 |
1876 | V4L2_CAP_SLICED_VBI_CAPTURE | | 1887 | V4L2_CAP_SLICED_VBI_CAPTURE | |
@@ -2057,7 +2068,6 @@ static int radio_querycap(struct file *file, void *priv, | |||
2057 | strlcpy(cap->card, cx231xx_boards[dev->model].name, sizeof(cap->card)); | 2068 | strlcpy(cap->card, cx231xx_boards[dev->model].name, sizeof(cap->card)); |
2058 | usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info)); | 2069 | usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info)); |
2059 | 2070 | ||
2060 | cap->version = CX231XX_VERSION_CODE; | ||
2061 | cap->capabilities = V4L2_CAP_TUNER; | 2071 | cap->capabilities = V4L2_CAP_TUNER; |
2062 | return 0; | 2072 | return 0; |
2063 | } | 2073 | } |
@@ -2570,11 +2580,8 @@ int cx231xx_register_analog_devices(struct cx231xx *dev) | |||
2570 | { | 2580 | { |
2571 | int ret; | 2581 | int ret; |
2572 | 2582 | ||
2573 | cx231xx_info("%s: v4l2 driver version %d.%d.%d\n", | 2583 | cx231xx_info("%s: v4l2 driver version %s\n", |
2574 | dev->name, | 2584 | dev->name, CX231XX_VERSION); |
2575 | (CX231XX_VERSION_CODE >> 16) & 0xff, | ||
2576 | (CX231XX_VERSION_CODE >> 8) & 0xff, | ||
2577 | CX231XX_VERSION_CODE & 0xff); | ||
2578 | 2585 | ||
2579 | /* set default norm */ | 2586 | /* set default norm */ |
2580 | /*dev->norm = cx231xx_video_template.current_norm; */ | 2587 | /*dev->norm = cx231xx_video_template.current_norm; */ |