Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] media/Documentation: New flag EXECUTE_ON_WRITE

Document new flag V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, and the new behavior
of CH_VALUE event on VOLATILE controls.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Ricardo Ribalda and committed by
Mauro Carvalho Chehab
acd2b672 45f014c5

+17 -5
+3 -3
Documentation/DocBook/media/v4l/vidioc-dqevent.xml
··· 425 425 <entry><constant>V4L2_EVENT_CTRL_CH_VALUE</constant></entry> 426 426 <entry>0x0001</entry> 427 427 <entry>This control event was triggered because the value of the control 428 - changed. Special case: if a button control is pressed, then this 429 - event is sent as well, even though there is not explicit value 430 - associated with a button control.</entry> 428 + changed. Special cases: Volatile controls do no generate this event; 429 + If a control has the <constant>V4L2_CTRL_FLAG_EXECUTE_ON_WRITE</constant> 430 + flag set, then this event is sent as well, regardless its value.</entry> 431 431 </row> 432 432 <row> 433 433 <entry><constant>V4L2_EVENT_CTRL_CH_FLAGS</constant></entry>
+11 -1
Documentation/DocBook/media/v4l/vidioc-queryctrl.xml
··· 600 600 changes continuously. A typical example would be the current gain value if the device 601 601 is in auto-gain mode. In such a case the hardware calculates the gain value based on 602 602 the lighting conditions which can change over time. Note that setting a new value for 603 - a volatile control will have no effect. The new value will just be ignored.</entry> 603 + a volatile control will have no effect and no <constant>V4L2_EVENT_CTRL_CH_VALUE</constant> 604 + will be sent, unless the <constant>V4L2_CTRL_FLAG_EXECUTE_ON_WRITE</constant> flag 605 + (see below) is also set. Otherwise the new value will just be ignored.</entry> 604 606 </row> 605 607 <row> 606 608 <entry><constant>V4L2_CTRL_FLAG_HAS_PAYLOAD</constant></entry> ··· 611 609 using one of the pointer fields of &v4l2-ext-control;. This flag is set for controls 612 610 that are an array, string, or have a compound type. In all cases you have to set a 613 611 pointer to memory containing the payload of the control.</entry> 612 + </row> 613 + <row> 614 + <entry><constant>V4L2_CTRL_FLAG_EXECUTE_ON_WRITE</constant></entry> 615 + <entry>0x0200</entry> 616 + <entry>The value provided to the control will be propagated to the driver 617 + even if remains constant. This is required when the control represents an action 618 + on the hardware. For example: clearing an error flag or triggering the flash. All the 619 + controls of the type <constant>V4L2_CTRL_TYPE_BUTTON</constant> have this flag set.</entry> 614 620 </row> 615 621 </tbody> 616 622 </tgroup>
+3 -1
Documentation/video4linux/v4l2-controls.txt
··· 344 344 } 345 345 346 346 Note that you use the 'new value' union as well in g_volatile_ctrl. In general 347 - controls that need to implement g_volatile_ctrl are read-only controls. 347 + controls that need to implement g_volatile_ctrl are read-only controls. If they 348 + are not, a V4L2_EVENT_CTRL_CH_VALUE will not be generated when the control 349 + changes. 348 350 349 351 To mark a control as volatile you have to set V4L2_CTRL_FLAG_VOLATILE: 350 352