diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-01-02 10:18:23 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-02-13 18:10:10 -0500 |
commit | e31a0ba7df6ce21ac4ed58c4182ec12ca8fd78fb (patch) | |
tree | 9e9afc96b5c9343d0c615dcd39cfd7d7d22e000a | |
parent | bc0c5aa35ac88342831933ca7758ead62d9bae2b (diff) |
[media] media: Fix DVB devnode representation at media controller
The previous provision for DVB media controller support were to
define an ID (likely meaning the adapter number) for the DVB
devnodes.
This is just plain wrong. Just like V4L, DVB devices (and any other
device node)) are uniquely identified via a (major, minor) tuple.
This is enough to uniquely identify a devnode, no matter what
API it implements.
So, before we go too far, let's mark the old v4l, fb, dvb and alsa
"devnode" info as deprecated, and just call it as "dev".
We can latter add fields specific to each API if needed.
As we don't want to break compilation on already existing apps,
let's just keep the old definitions as-is, adding a note that
those are deprecated at media-entity.h.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/v4l2-core/v4l2-dev.c | 4 | ||||
-rw-r--r-- | drivers/media/v4l2-core/v4l2-device.c | 4 | ||||
-rw-r--r-- | include/media/media-entity.h | 12 | ||||
-rw-r--r-- | include/uapi/linux/media.h | 15 |
4 files changed, 20 insertions, 15 deletions
diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c index 86bb93fd7db8..d89d5cb465d9 100644 --- a/drivers/media/v4l2-core/v4l2-dev.c +++ b/drivers/media/v4l2-core/v4l2-dev.c | |||
@@ -943,8 +943,8 @@ int __video_register_device(struct video_device *vdev, int type, int nr, | |||
943 | vdev->vfl_type != VFL_TYPE_SUBDEV) { | 943 | vdev->vfl_type != VFL_TYPE_SUBDEV) { |
944 | vdev->entity.type = MEDIA_ENT_T_DEVNODE_V4L; | 944 | vdev->entity.type = MEDIA_ENT_T_DEVNODE_V4L; |
945 | vdev->entity.name = vdev->name; | 945 | vdev->entity.name = vdev->name; |
946 | vdev->entity.info.v4l.major = VIDEO_MAJOR; | 946 | vdev->entity.info.dev.major = VIDEO_MAJOR; |
947 | vdev->entity.info.v4l.minor = vdev->minor; | 947 | vdev->entity.info.dev.minor = vdev->minor; |
948 | ret = media_device_register_entity(vdev->v4l2_dev->mdev, | 948 | ret = media_device_register_entity(vdev->v4l2_dev->mdev, |
949 | &vdev->entity); | 949 | &vdev->entity); |
950 | if (ret < 0) | 950 | if (ret < 0) |
diff --git a/drivers/media/v4l2-core/v4l2-device.c b/drivers/media/v4l2-core/v4l2-device.c index 015f92aab44a..204cc67c84e8 100644 --- a/drivers/media/v4l2-core/v4l2-device.c +++ b/drivers/media/v4l2-core/v4l2-device.c | |||
@@ -248,8 +248,8 @@ int v4l2_device_register_subdev_nodes(struct v4l2_device *v4l2_dev) | |||
248 | goto clean_up; | 248 | goto clean_up; |
249 | } | 249 | } |
250 | #if defined(CONFIG_MEDIA_CONTROLLER) | 250 | #if defined(CONFIG_MEDIA_CONTROLLER) |
251 | sd->entity.info.v4l.major = VIDEO_MAJOR; | 251 | sd->entity.info.dev.major = VIDEO_MAJOR; |
252 | sd->entity.info.v4l.minor = vdev->minor; | 252 | sd->entity.info.dev.minor = vdev->minor; |
253 | #endif | 253 | #endif |
254 | sd->devnode = vdev; | 254 | sd->devnode = vdev; |
255 | } | 255 | } |
diff --git a/include/media/media-entity.h b/include/media/media-entity.h index e00459185d20..d6d74bcfe183 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h | |||
@@ -87,17 +87,7 @@ struct media_entity { | |||
87 | struct { | 87 | struct { |
88 | u32 major; | 88 | u32 major; |
89 | u32 minor; | 89 | u32 minor; |
90 | } v4l; | 90 | } dev; |
91 | struct { | ||
92 | u32 major; | ||
93 | u32 minor; | ||
94 | } fb; | ||
95 | struct { | ||
96 | u32 card; | ||
97 | u32 device; | ||
98 | u32 subdevice; | ||
99 | } alsa; | ||
100 | int dvb; | ||
101 | 91 | ||
102 | /* Sub-device specifications */ | 92 | /* Sub-device specifications */ |
103 | /* Nothing needed yet */ | 93 | /* Nothing needed yet */ |
diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h index d847c760e8f0..418f4fec391a 100644 --- a/include/uapi/linux/media.h +++ b/include/uapi/linux/media.h | |||
@@ -78,6 +78,20 @@ struct media_entity_desc { | |||
78 | struct { | 78 | struct { |
79 | __u32 major; | 79 | __u32 major; |
80 | __u32 minor; | 80 | __u32 minor; |
81 | } dev; | ||
82 | |||
83 | #if 1 | ||
84 | /* | ||
85 | * DEPRECATED: previous node specifications. Kept just to | ||
86 | * avoid breaking compilation, but media_entity_desc.dev | ||
87 | * should be used instead. In particular, alsa and dvb | ||
88 | * fields below are wrong: for all devnodes, there should | ||
89 | * be just major/minor inside the struct, as this is enough | ||
90 | * to represent any devnode, no matter what type. | ||
91 | */ | ||
92 | struct { | ||
93 | __u32 major; | ||
94 | __u32 minor; | ||
81 | } v4l; | 95 | } v4l; |
82 | struct { | 96 | struct { |
83 | __u32 major; | 97 | __u32 major; |
@@ -89,6 +103,7 @@ struct media_entity_desc { | |||
89 | __u32 subdevice; | 103 | __u32 subdevice; |
90 | } alsa; | 104 | } alsa; |
91 | int dvb; | 105 | int dvb; |
106 | #endif | ||
92 | 107 | ||
93 | /* Sub-device specifications */ | 108 | /* Sub-device specifications */ |
94 | /* Nothing needed yet */ | 109 | /* Nothing needed yet */ |