diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2013-04-13 05:06:18 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-04-16 16:59:56 -0400 |
commit | 3dd473ca58838f1dd93e915cfa7a5c150186bb0f (patch) | |
tree | 2535fef9d7529dac60f34cd6d0b517cffd565d97 /drivers/media | |
parent | 18c73af6961c528fe5ce95eb510ef63582d47014 (diff) |
[media] cx25821: fix log_status, querycap
log_status shouldn't print LOG STATUS lines, the core does that already.
Fix querycap version number and add device_caps support.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/pci/cx25821/cx25821-video.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/media/pci/cx25821/cx25821-video.c b/drivers/media/pci/cx25821/cx25821-video.c index 8ff8fc218f38..7cd888581f9e 100644 --- a/drivers/media/pci/cx25821/cx25821-video.c +++ b/drivers/media/pci/cx25821/cx25821-video.c | |||
@@ -923,21 +923,14 @@ static int vidioc_log_status(struct file *file, void *priv) | |||
923 | { | 923 | { |
924 | struct cx25821_dev *dev = ((struct cx25821_fh *)priv)->dev; | 924 | struct cx25821_dev *dev = ((struct cx25821_fh *)priv)->dev; |
925 | struct cx25821_fh *fh = priv; | 925 | struct cx25821_fh *fh = priv; |
926 | char name[32 + 2]; | 926 | struct sram_channel *sram_ch = |
927 | 927 | dev->channels[fh->channel_id].sram_channels; | |
928 | struct sram_channel *sram_ch = dev->channels[fh->channel_id] | ||
929 | .sram_channels; | ||
930 | u32 tmp = 0; | 928 | u32 tmp = 0; |
931 | 929 | ||
932 | snprintf(name, sizeof(name), "%s/2", dev->name); | ||
933 | pr_info("%s/2: ============ START LOG STATUS ============\n", | ||
934 | dev->name); | ||
935 | cx25821_call_all(dev, core, log_status); | 930 | cx25821_call_all(dev, core, log_status); |
936 | tmp = cx_read(sram_ch->dma_ctl); | 931 | tmp = cx_read(sram_ch->dma_ctl); |
937 | pr_info("Video input 0 is %s\n", | 932 | pr_info("Video input 0 is %s\n", |
938 | (tmp & 0x11) ? "streaming" : "stopped"); | 933 | (tmp & 0x11) ? "streaming" : "stopped"); |
939 | pr_info("%s/2: ============= END LOG STATUS =============\n", | ||
940 | dev->name); | ||
941 | return 0; | 934 | return 0; |
942 | } | 935 | } |
943 | 936 | ||
@@ -1027,13 +1020,19 @@ int cx25821_vidioc_querycap(struct file *file, void *priv, | |||
1027 | struct v4l2_capability *cap) | 1020 | struct v4l2_capability *cap) |
1028 | { | 1021 | { |
1029 | struct cx25821_dev *dev = ((struct cx25821_fh *)priv)->dev; | 1022 | struct cx25821_dev *dev = ((struct cx25821_fh *)priv)->dev; |
1023 | struct cx25821_fh *fh = priv; | ||
1024 | const u32 cap_input = V4L2_CAP_VIDEO_CAPTURE | | ||
1025 | V4L2_CAP_READWRITE | V4L2_CAP_STREAMING; | ||
1026 | const u32 cap_output = V4L2_CAP_VIDEO_OUTPUT; | ||
1030 | 1027 | ||
1031 | strcpy(cap->driver, "cx25821"); | 1028 | strcpy(cap->driver, "cx25821"); |
1032 | strlcpy(cap->card, cx25821_boards[dev->board].name, sizeof(cap->card)); | 1029 | strlcpy(cap->card, cx25821_boards[dev->board].name, sizeof(cap->card)); |
1033 | sprintf(cap->bus_info, "PCIe:%s", pci_name(dev->pci)); | 1030 | sprintf(cap->bus_info, "PCIe:%s", pci_name(dev->pci)); |
1034 | cap->version = CX25821_VERSION_CODE; | 1031 | if (fh->channel_id >= VID_CHANNEL_NUM) |
1035 | cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | | 1032 | cap->device_caps = cap_output; |
1036 | V4L2_CAP_STREAMING; | 1033 | else |
1034 | cap->device_caps = cap_input; | ||
1035 | cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; | ||
1037 | return 0; | 1036 | return 0; |
1038 | } | 1037 | } |
1039 | 1038 | ||