~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise-security

« back to all changes in this revision

Viewing changes to drivers/media/video/cx231xx/cx231xx-video.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2011-12-06 15:56:07 UTC
  • Revision ID: package-import@ubuntu.com-20111206155607-pcf44kv5fmhk564f
Tags: 3.2.0-1401.1
[ Paolo Pisati ]

* Rebased on top of Ubuntu-3.2.0-3.8
* Tilt-tracking @ ef2487af4bb15bdd0689631774b5a5e3a59f74e2
* Delete debian.ti-omap4/control, it shoudln't be tracked
* Fix architecture spelling (s/armel/armhf/)
* [Config] Update configs following 3.2 import
* [Config] Fix compilation: disable CODA and ARCH_OMAP3
* [Config] Fix compilation: disable Ethernet Faraday
* Update series to precise

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include <linux/bitmap.h>
30
30
#include <linux/usb.h>
31
31
#include <linux/i2c.h>
32
 
#include <linux/version.h>
33
32
#include <linux/mm.h>
34
33
#include <linux/mutex.h>
35
34
#include <linux/slab.h>
45
44
#include "cx231xx.h"
46
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
49
#define DRIVER_AUTHOR   "Srinivasa Deevi <srinivasa.deevi@conexant.com>"
51
50
#define DRIVER_DESC     "Conexant cx231xx based USB video device driver"
70
69
MODULE_AUTHOR(DRIVER_AUTHOR);
71
70
MODULE_DESCRIPTION(DRIVER_DESC);
72
71
MODULE_LICENSE("GPL");
 
72
MODULE_VERSION(CX231XX_VERSION);
73
73
 
74
74
static unsigned int card[]     = {[0 ... (CX231XX_MAXBOARDS - 1)] = UNSET };
75
75
static unsigned int video_nr[] = {[0 ... (CX231XX_MAXBOARDS - 1)] = UNSET };
1179
1179
{
1180
1180
        struct cx231xx_fh *fh = priv;
1181
1181
        struct cx231xx *dev = fh->dev;
1182
 
        unsigned int n;
 
1182
        u32 gen_stat;
 
1183
        unsigned int ret, n;
1183
1184
 
1184
1185
        n = i->index;
1185
1186
        if (n >= MAX_CX231XX_INPUT)
1198
1199
 
1199
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
1214
        return 0;
1202
1215
}
1203
1216
 
1869
1882
        strlcpy(cap->card, cx231xx_boards[dev->model].name, sizeof(cap->card));
1870
1883
        usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));
1871
1884
 
1872
 
        cap->version = CX231XX_VERSION_CODE;
1873
 
 
1874
1885
        cap->capabilities = V4L2_CAP_VBI_CAPTURE |
1875
1886
#if 0
1876
1887
                V4L2_CAP_SLICED_VBI_CAPTURE |
2057
2068
        strlcpy(cap->card, cx231xx_boards[dev->model].name, sizeof(cap->card));
2058
2069
        usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));
2059
2070
 
2060
 
        cap->version = CX231XX_VERSION_CODE;
2061
2071
        cap->capabilities = V4L2_CAP_TUNER;
2062
2072
        return 0;
2063
2073
}
2570
2580
{
2571
2581
        int ret;
2572
2582
 
2573
 
        cx231xx_info("%s: v4l2 driver version %d.%d.%d\n",
2574
 
                     dev->name,
2575
 
                     (CX231XX_VERSION_CODE >> 16) & 0xff,
2576
 
                     (CX231XX_VERSION_CODE >> 8) & 0xff,
2577
 
                     CX231XX_VERSION_CODE & 0xff);
 
2583
        cx231xx_info("%s: v4l2 driver version %s\n",
 
2584
                     dev->name, CX231XX_VERSION);
2578
2585
 
2579
2586
        /* set default norm */
2580
2587
        /*dev->norm = cx231xx_video_template.current_norm; */