于 2013年02月04日 03:38, Hans Verkuil 写道: > On Mon February 4 2013 05:36:56 Huang Shijie wrote: >> 于 2013年01月31日 05:25, Hans Verkuil 写道: >>> From: Hans Verkuil >>> >>> Signed-off-by: Hans Verkuil >>> --- >>> drivers/media/usb/tlg2300/pd-radio.c | 7 ++++++- >>> 1 file changed, 6 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/media/usb/tlg2300/pd-radio.c b/drivers/media/usb/tlg2300/pd-radio.c >>> index 854ffa0..80307d3 100644 >>> --- a/drivers/media/usb/tlg2300/pd-radio.c >>> +++ b/drivers/media/usb/tlg2300/pd-radio.c >>> @@ -147,7 +147,12 @@ static int vidioc_querycap(struct file *file, void *priv, >>> strlcpy(v->driver, "tele-radio", sizeof(v->driver)); >>> strlcpy(v->card, "Telegent Poseidon", sizeof(v->card)); >>> usb_make_path(p->udev, v->bus_info, sizeof(v->bus_info)); >>> - v->capabilities = V4L2_CAP_TUNER | V4L2_CAP_RADIO; >>> + v->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO; >>> + /* Report all capabilities of the USB device */ >>> + v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS | >>> + V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VBI_CAPTURE | >> why add these video/vbi capabilities? > The capabilities field contains the V4L2 capabilities of the whole device > (i.e. radio+video+vbi), the device_caps field contains the capabilities of > just that node. > > In the past different drivers interpreted the capabilities field differently: > either with the capabilities of the whole device or the capabilities of just > that device node. This situation was clarified recently and the device_caps > field was added instead so both the caps for the full device and the current > device node are now available. > > This wasn't there when the tlg2300 driver was developed, and the spec was > never clear enough regarding the meaning of the capabilities field. > > So this is a later improvement to the V4L2 API. thanks for the explanation. Acked-by: Huang Shijie > Regards, > > Hans > >>> + V4L2_CAP_AUDIO | V4L2_CAP_STREAMING >>> + V4L2_CAP_READWRITE; >>> return 0; >>> } >>>