mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
staging: bcm2835-codec: Add role to device name
Three entities are created, Decode, Encode and ISP but all of the video nodes use the same video name string "bcm2835-codec" which makes it difficult to identify each role. Append the role-name to the video name to facilitate identifying a specific instance from userspace. The Card-Type is also extended with the role name to support identifying the device context from within QUERY_CAP operations. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
committed by
popcornmix
parent
44501ea86b
commit
933c8a960e
@@ -947,8 +947,10 @@ static void device_run(void *priv)
|
|||||||
static int vidioc_querycap(struct file *file, void *priv,
|
static int vidioc_querycap(struct file *file, void *priv,
|
||||||
struct v4l2_capability *cap)
|
struct v4l2_capability *cap)
|
||||||
{
|
{
|
||||||
|
struct bcm2835_codec_dev *dev = video_drvdata(file);
|
||||||
|
|
||||||
strncpy(cap->driver, MEM2MEM_NAME, sizeof(cap->driver) - 1);
|
strncpy(cap->driver, MEM2MEM_NAME, sizeof(cap->driver) - 1);
|
||||||
strncpy(cap->card, MEM2MEM_NAME, sizeof(cap->card) - 1);
|
strncpy(cap->card, dev->vfd.name, sizeof(cap->card) - 1);
|
||||||
snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
|
snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
|
||||||
MEM2MEM_NAME);
|
MEM2MEM_NAME);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -2657,8 +2659,8 @@ static int bcm2835_codec_create(struct platform_device *pdev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
video_set_drvdata(vfd, dev);
|
video_set_drvdata(vfd, dev);
|
||||||
snprintf(vfd->name, sizeof(vfd->name), "%s",
|
snprintf(vfd->name, sizeof(vfd->name), "%s-%s",
|
||||||
bcm2835_codec_videodev.name);
|
bcm2835_codec_videodev.name, roles[role]);
|
||||||
v4l2_info(&dev->v4l2_dev, "Device registered as /dev/video%d\n",
|
v4l2_info(&dev->v4l2_dev, "Device registered as /dev/video%d\n",
|
||||||
vfd->num);
|
vfd->num);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user