xref: /openbmc/linux/Documentation/userspace-api/media/mediactl/media-request-ioc-reinit.rst (revision cbecf716ca618fd44feda6bd9a64a8179d031fc5)
184d33341SMauro Carvalho Chehab.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later
2*937e6805SMauro Carvalho Chehab.. c:namespace:: MC
354f38fcaSMauro Carvalho Chehab
454f38fcaSMauro Carvalho Chehab.. _media_request_ioc_reinit:
554f38fcaSMauro Carvalho Chehab
654f38fcaSMauro Carvalho Chehab******************************
754f38fcaSMauro Carvalho Chehabioctl MEDIA_REQUEST_IOC_REINIT
854f38fcaSMauro Carvalho Chehab******************************
954f38fcaSMauro Carvalho Chehab
1054f38fcaSMauro Carvalho ChehabName
1154f38fcaSMauro Carvalho Chehab====
1254f38fcaSMauro Carvalho Chehab
1354f38fcaSMauro Carvalho ChehabMEDIA_REQUEST_IOC_REINIT - Re-initialize a request
1454f38fcaSMauro Carvalho Chehab
1554f38fcaSMauro Carvalho ChehabSynopsis
1654f38fcaSMauro Carvalho Chehab========
1754f38fcaSMauro Carvalho Chehab
18*937e6805SMauro Carvalho Chehab.. c:macro:: MEDIA_REQUEST_IOC_REINIT
1954f38fcaSMauro Carvalho Chehab
20*937e6805SMauro Carvalho Chehab``int ioctl(int request_fd, MEDIA_REQUEST_IOC_REINIT)``
2154f38fcaSMauro Carvalho Chehab
2254f38fcaSMauro Carvalho ChehabArguments
2354f38fcaSMauro Carvalho Chehab=========
2454f38fcaSMauro Carvalho Chehab
2554f38fcaSMauro Carvalho Chehab``request_fd``
2654f38fcaSMauro Carvalho Chehab    File descriptor returned by :ref:`MEDIA_IOC_REQUEST_ALLOC`.
2754f38fcaSMauro Carvalho Chehab
2854f38fcaSMauro Carvalho ChehabDescription
2954f38fcaSMauro Carvalho Chehab===========
3054f38fcaSMauro Carvalho Chehab
3154f38fcaSMauro Carvalho ChehabIf the media device supports :ref:`requests <media-request-api>`, then
3254f38fcaSMauro Carvalho Chehabthis request ioctl can be used to re-initialize a previously allocated
3354f38fcaSMauro Carvalho Chehabrequest.
3454f38fcaSMauro Carvalho Chehab
3554f38fcaSMauro Carvalho ChehabRe-initializing a request will clear any existing data from the request.
36*937e6805SMauro Carvalho ChehabThis avoids having to :c:func:`close()` a completed
3754f38fcaSMauro Carvalho Chehabrequest and allocate a new request. Instead the completed request can just
3854f38fcaSMauro Carvalho Chehabbe re-initialized and it is ready to be used again.
3954f38fcaSMauro Carvalho Chehab
4054f38fcaSMauro Carvalho ChehabA request can only be re-initialized if it either has not been queued
4154f38fcaSMauro Carvalho Chehabyet, or if it was queued and completed. Otherwise it will set ``errno``
4254f38fcaSMauro Carvalho Chehabto ``EBUSY``. No other error codes can be returned.
4354f38fcaSMauro Carvalho Chehab
4454f38fcaSMauro Carvalho ChehabReturn Value
4554f38fcaSMauro Carvalho Chehab============
4654f38fcaSMauro Carvalho Chehab
4754f38fcaSMauro Carvalho ChehabOn success 0 is returned, on error -1 and the ``errno`` variable is set
4854f38fcaSMauro Carvalho Chehabappropriately.
4954f38fcaSMauro Carvalho Chehab
5054f38fcaSMauro Carvalho ChehabEBUSY
5154f38fcaSMauro Carvalho Chehab    The request is queued but not yet completed.
52