All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 0/2] Add /sys media_dev attr for V4L/DVB devices
@ 2021-02-01  9:36 Hans Verkuil
  2021-02-01  9:36 ` [PATCHv2 1/2] v4l2-dev: add /sys media_dev attr for video devices Hans Verkuil
  2021-02-01  9:36 ` [PATCHv2 2/2] dvbdev: add /sys media_dev attr for dvb devices Hans Verkuil
  0 siblings, 2 replies; 6+ messages in thread
From: Hans Verkuil @ 2021-02-01  9:36 UTC (permalink / raw)
  To: linux-media; +Cc: Laurent Pinchart, Sakari Ailus

A long standing issue is how to find the associated media device for
a V4L or DVB device node. This is primarily useful for applications
like v4l2-ctl and v4l2-compliance.

Until recently these applications relied on /sys and the fact that
the media device was accessible in /sys via:

/sys/class/video4linux/videoX/device/mediaY/

But commit ee494cf377e1 ("media: v4l2-device: Link subdevices to their
parent devices if available") broke that scheme for subdevices. That
scheme was rather a hack anyway.

Attempts to report the major/minor number of the media device via the
public API (i.e. by extending VIDIOC_QUERYCAP or VIDIOC_SUBDEV_QUERYCAP)
failed, so this patch series now just adds a media_dev attribute when a
V4L or DVB device node is created. This attribute contains the major:minor
of the media device. It is only created if the device node is actually
associated with a media controller.

This issue was reported by Sebastian Frick:

https://lore.kernel.org/linux-media/20210120183054.5ltnjdtrmumplevt@basti-TUXEDO-Book-XA1510/T/#t

Regards,

	Hans

Changes since v1: use the is_visible callback to ensure the attribute
is only shown if mdev is non-NULL.

Hans Verkuil (2):
  v4l2-dev: add /sys media_dev attr for video devices
  dvbdev: add /sys media_dev attr for dvb devices

 drivers/media/dvb-core/dvbdev.c    | 46 ++++++++++++++++++++++++++++
 drivers/media/v4l2-core/v4l2-dev.c | 48 +++++++++++++++++++++++++++++-
 2 files changed, 93 insertions(+), 1 deletion(-)

-- 
2.29.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-02-04 23:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01  9:36 [PATCHv2 0/2] Add /sys media_dev attr for V4L/DVB devices Hans Verkuil
2021-02-01  9:36 ` [PATCHv2 1/2] v4l2-dev: add /sys media_dev attr for video devices Hans Verkuil
2021-02-01 20:26   ` Laurent Pinchart
2021-02-02  9:48     ` Hans Verkuil
2021-02-04 23:06       ` Laurent Pinchart
2021-02-01  9:36 ` [PATCHv2 2/2] dvbdev: add /sys media_dev attr for dvb devices Hans Verkuil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.