Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] cx18: add device_caps support

This was missing in this driver, so add this functionality.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
dfdf780b 1fb69bfd

+16 -4
+2 -1
drivers/media/pci/cx18/cx18-cards.h
··· 57 57 /* V4L2 capability aliases */ 58 58 #define CX18_CAP_ENCODER (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_TUNER | \ 59 59 V4L2_CAP_AUDIO | V4L2_CAP_READWRITE | \ 60 - V4L2_CAP_VBI_CAPTURE | V4L2_CAP_SLICED_VBI_CAPTURE) 60 + V4L2_CAP_STREAMING | V4L2_CAP_VBI_CAPTURE | \ 61 + V4L2_CAP_SLICED_VBI_CAPTURE) 61 62 62 63 struct cx18_card_video_input { 63 64 u8 video_type; /* video input type */
+1
drivers/media/pci/cx18/cx18-driver.h
··· 379 379 const char *name; /* name of the stream */ 380 380 int type; /* stream type */ 381 381 u32 handle; /* task handle */ 382 + u32 v4l2_dev_caps; /* device capabilities */ 382 383 unsigned int mdl_base_idx; 383 384 384 385 u32 id;
+4 -3
drivers/media/pci/cx18/cx18-ioctl.c
··· 393 393 struct v4l2_capability *vcap) 394 394 { 395 395 struct cx18_open_id *id = fh2id(fh); 396 + struct cx18_stream *s = video_drvdata(file); 396 397 struct cx18 *cx = id->cx; 397 398 398 399 strlcpy(vcap->driver, CX18_DRIVER_NAME, sizeof(vcap->driver)); 399 400 strlcpy(vcap->card, cx->card_name, sizeof(vcap->card)); 400 401 snprintf(vcap->bus_info, sizeof(vcap->bus_info), 401 402 "PCI:%s", pci_name(cx->pci_dev)); 402 - vcap->capabilities = cx->v4l2_cap; /* capabilities */ 403 - if (id->type == CX18_ENC_STREAM_TYPE_YUV) 404 - vcap->capabilities |= V4L2_CAP_STREAMING; 403 + vcap->capabilities = cx->v4l2_cap; /* capabilities */ 404 + vcap->device_caps = s->v4l2_dev_caps; /* device capabilities */ 405 + vcap->capabilities |= V4L2_CAP_DEVICE_CAPS; 405 406 return 0; 406 407 } 407 408
+9
drivers/media/pci/cx18/cx18-streams.c
··· 58 58 int vfl_type; 59 59 int num_offset; 60 60 int dma; 61 + u32 caps; 61 62 } cx18_stream_info[] = { 62 63 { /* CX18_ENC_STREAM_TYPE_MPG */ 63 64 "encoder MPEG", 64 65 VFL_TYPE_GRABBER, 0, 65 66 PCI_DMA_FROMDEVICE, 67 + V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | 68 + V4L2_CAP_AUDIO | V4L2_CAP_TUNER 66 69 }, 67 70 { /* CX18_ENC_STREAM_TYPE_TS */ 68 71 "TS", ··· 76 73 "encoder YUV", 77 74 VFL_TYPE_GRABBER, CX18_V4L2_ENC_YUV_OFFSET, 78 75 PCI_DMA_FROMDEVICE, 76 + V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | 77 + V4L2_CAP_STREAMING | V4L2_CAP_AUDIO | V4L2_CAP_TUNER 79 78 }, 80 79 { /* CX18_ENC_STREAM_TYPE_VBI */ 81 80 "encoder VBI", 82 81 VFL_TYPE_VBI, 0, 83 82 PCI_DMA_FROMDEVICE, 83 + V4L2_CAP_VBI_CAPTURE | V4L2_CAP_SLICED_VBI_CAPTURE | 84 + V4L2_CAP_READWRITE | V4L2_CAP_TUNER 84 85 }, 85 86 { /* CX18_ENC_STREAM_TYPE_PCM */ 86 87 "encoder PCM audio", ··· 100 93 "encoder radio", 101 94 VFL_TYPE_RADIO, 0, 102 95 PCI_DMA_NONE, 96 + V4L2_CAP_RADIO | V4L2_CAP_TUNER 103 97 }, 104 98 }; 105 99 ··· 268 260 s->handle = CX18_INVALID_TASK_HANDLE; 269 261 270 262 s->dma = cx18_stream_info[type].dma; 263 + s->v4l2_dev_caps = cx18_stream_info[type].caps; 271 264 s->buffers = cx->stream_buffers[type]; 272 265 s->buf_size = cx->stream_buf_size[type]; 273 266 INIT_LIST_HEAD(&s->buf_pool);