Skip to content

Add units to controls

Sakari Ailus linux-media 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 18 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5videodev2.h: Use 8 hexadecimals (32 bits) for control flagsDocumentation/media/uapi/v4l/vidioc-queryctrl.rst include/uapi/linux/videodev2.h+22 -222 replies
2/5v4l: controls: Add support for exponential bases, prefixes and unitsinclude/uapi/linux/videodev2.h+31 -15 replies
3/5Documentation: media: Document control exponential bases, units, prefixesDocumentation/media/uapi/v4l/extended-controls.rst Documentation/media/uapi/v4l/vidioc-queryctrl.rst Documentation/media/videodev2.h.rst.exceptions+175 -13 replies
4/5v4l: controls: QUERY_EXT_CTRL support for base, prefix and unitdrivers/media/v4l2-core/v4l2-ctrls.c include/media/v4l2-ctrls.h+5 -01 reply
5/5smiapp: Set control unitsdrivers/media/i2c/smiapp/smiapp-core.c+9 -71 reply

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by.

PatchLaurent PinchartHans Verkuil
1/5R-b A-b
2/5
3/5
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/5] Add units to controls

Hi all,

This set adds a few things to the current control framework in terms of what kind of information the user space may have on controls. It adds support for units and prefixes, exponential base as well as information on whether a control is linear or exponential, to struct v4l2_query_ext_ctrl.

The smiapp driver gains support for the feature. In the near term, some controls could also be assigned the unit automatically. The pixel rate, for instance. Fewer driver changes would be needed this way. A driver could override the value if there's a need to.

I think I'll merge the undefined and no unit cases. Same for the exponential base actually --- the flag can be removed, too...

Regarding Ricardo's suggestion --- I was thinking of adding a control flag (yes, there are a few bits available) to tell how to round the value. The user could use the TRY_EXT_CTRLS IOCTL to figure out the next (or previous) control value by incrementing the current value and setting the appropriate flag. This is out of the scope of this set though.

Comments, questions?

Sakari Ailus (5):
videodev2.h: Use 8 hexadecimals (32 bits) for control flags
v4l: controls: Add support for exponential bases, prefixes and units
Documentation: media: Document control exponential bases, units,
prefixes
v4l: controls: QUERY_EXT_CTRL support for base, prefix and unit
smiapp: Set control units

 Documentation/media/uapi/v4l/extended-controls.rst |   2 +
 Documentation/media/uapi/v4l/vidioc-queryctrl.rst  | 174 +++++++++++++++++++--
 Documentation/media/videodev2.h.rst.exceptions     |  22 +++
 drivers/media/i2c/smiapp/smiapp-core.c             |  16 +-
 drivers/media/v4l2-core/v4l2-ctrls.c               |   3 +
 include/media/v4l2-ctrls.h                         |   2 +
 include/uapi/linux/videodev2.h                     |  54 +++++--
 7 files changed, 242 insertions(+), 31 deletions(-)
Signature · 1 line
2.11.0