ioctl VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER
&manvol;
VIDIOC_DBG_G_REGISTERVIDIOC_DBG_S_REGISTERRead or write hardware registersint ioctlint fdint requeststruct v4l2_dbg_register *argpint ioctlint fdint requestconst struct v4l2_dbg_register
*argpArgumentsfd&fd;requestVIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTERargpDescriptionExperimentalThis is an experimental
interface and may change in the future.For driver debugging purposes these ioctls allow test
applications to access hardware registers directly. Regular
applications must not use them.Since writing or even reading registers can jeopardize the
system security, its stability and damage the hardware, both ioctls
require superuser privileges. Additionally the Linux kernel must be
compiled with the CONFIG_VIDEO_ADV_DEBUG option
to enable these ioctls.To write a register applications must initialize all fields
of a &v4l2-dbg-register; except for size and call
VIDIOC_DBG_S_REGISTER with a pointer to this
structure. The match.type and
match.addr or match.name
fields select a chip on the TV
card, the reg field specifies a register
number and the val field the value to be
written into the register.To read a register applications must initialize the
match.type,
match.addr or match.name and
reg fields, and call
VIDIOC_DBG_G_REGISTER with a pointer to this
structure. On success the driver stores the register value in the
val field and the size (in bytes) of the
value in size.When match.type is
V4L2_CHIP_MATCH_BRIDGE,
match.addr selects the nth non-sub-device chip
on the TV card. The number zero always selects the host chip, ⪚ the
chip connected to the PCI or USB bus. You can find out which chips are
present with the &VIDIOC-DBG-G-CHIP-INFO; ioctl.When match.type is
V4L2_CHIP_MATCH_SUBDEV,
match.addr selects the nth sub-device.These ioctls are optional, not all drivers may support them.
However when a driver supports these ioctls it must also support
&VIDIOC-DBG-G-CHIP-INFO;. Conversely it may support
VIDIOC_DBG_G_CHIP_INFO but not these ioctls.VIDIOC_DBG_G_REGISTER and
VIDIOC_DBG_S_REGISTER were introduced in Linux
2.6.21, but their API was changed to the one described here in kernel 2.6.29.We recommended the v4l2-dbg
utility over calling these ioctls directly. It is available from the
LinuxTV v4l-dvb repository; see http://linuxtv.org/repo/ for
access instructions.
struct v4l2_dbg_match
&cs-ustr;
__u32typeSee for a list of
possible types.union(anonymous)__u32addrMatch a chip by this number, interpreted according
to the type field.charname[32]Match a chip by this name, interpreted according
to the type field. Currently unused.
struct v4l2_dbg_registerstruct v4l2_dbg_matchmatchHow to match the chip, see .__u32sizeThe register size in bytes.__u64regA register number.__u64valThe value read from, or to be written into the
register.
Chip Match Types
&cs-def;
V4L2_CHIP_MATCH_BRIDGE0Match the nth chip on the card, zero for the
bridge chip. Does not match sub-devices.V4L2_CHIP_MATCH_SUBDEV4Match the nth sub-device.
&return-value;
EPERMInsufficient permissions. Root privileges are required
to execute these ioctls.