diff options
Diffstat (limited to 'include/media')
| -rw-r--r-- | include/media/v4l2-ctrls.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 6890f5e11ad0..801adb466bd2 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h | |||
| @@ -384,14 +384,28 @@ struct v4l2_ctrl *v4l2_ctrl_add_ctrl(struct v4l2_ctrl_handler *hdl, | |||
| 384 | * @hdl: The control handler. | 384 | * @hdl: The control handler. |
| 385 | * @add: The control handler whose controls you want to add to | 385 | * @add: The control handler whose controls you want to add to |
| 386 | * the @hdl control handler. | 386 | * the @hdl control handler. |
| 387 | * @filter: This function will filter which controls should be added. | ||
| 387 | * | 388 | * |
| 388 | * Does nothing if either of the two is a NULL pointer. | 389 | * Does nothing if either of the two handlers is a NULL pointer. |
| 390 | * If @filter is NULL, then all controls are added. Otherwise only those | ||
| 391 | * controls for which @filter returns true will be added. | ||
| 389 | * In case of an error @hdl->error will be set to the error code (if it | 392 | * In case of an error @hdl->error will be set to the error code (if it |
| 390 | * wasn't set already). | 393 | * wasn't set already). |
| 391 | */ | 394 | */ |
| 392 | int v4l2_ctrl_add_handler(struct v4l2_ctrl_handler *hdl, | 395 | int v4l2_ctrl_add_handler(struct v4l2_ctrl_handler *hdl, |
| 393 | struct v4l2_ctrl_handler *add); | 396 | struct v4l2_ctrl_handler *add, |
| 397 | bool (*filter)(const struct v4l2_ctrl *ctrl)); | ||
| 394 | 398 | ||
| 399 | /** v4l2_ctrl_radio_filter() - Standard filter for radio controls. | ||
| 400 | * @ctrl: The control that is filtered. | ||
| 401 | * | ||
| 402 | * This will return true for any controls that are valid for radio device | ||
| 403 | * nodes. Those are all of the V4L2_CID_AUDIO_* user controls and all FM | ||
| 404 | * transmitter class controls. | ||
| 405 | * | ||
| 406 | * This function is to be used with v4l2_ctrl_add_handler(). | ||
| 407 | */ | ||
| 408 | bool v4l2_ctrl_radio_filter(const struct v4l2_ctrl *ctrl); | ||
| 395 | 409 | ||
| 396 | /** v4l2_ctrl_cluster() - Mark all controls in the cluster as belonging to that cluster. | 410 | /** v4l2_ctrl_cluster() - Mark all controls in the cluster as belonging to that cluster. |
| 397 | * @ncontrols: The number of controls in this cluster. | 411 | * @ncontrols: The number of controls in this cluster. |
