Skip to content
Snippets Groups Projects
Commit 435e5267 authored by Suhrid Subramaniam's avatar Suhrid Subramaniam Committed by Oleksii Kutuzov
Browse files

BACKPORT: media: v4l: subdev: Rename sub-device state information access functions


Rename the sub-devices state information access functions, removing
"_stream" from them and replacing "format" by "ffmt". This makes them
shorter and so more convenient to use. No other sets of functions will be
needed to access this information.

Change-Id: I36d266db8fda873a710882fe5a35144a99eee44d
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
(cherry picked from commit d0fde6aae2bacdc024fff43461ba0f325375fa97)
parent 25df2cc6
No related branches found
No related tags found
1 merge request!14[UPSTREAM] Add Media-related patches from Mediatek's Release 24.0
......@@ -1356,6 +1356,43 @@ extern const struct v4l2_subdev_ops v4l2_subdev_call_wrappers;
void v4l2_subdev_notify_event(struct v4l2_subdev *sd,
const struct v4l2_event *ev);
/*
* A macro to generate the macro or function name for sub-devices state access
* wrapper macros below.
*/
#define __v4l2_subdev_state_gen_call(NAME, _1, ARG, ...) \
__v4l2_subdev_state_get_ ## NAME ## ARG
/**
* v4l2_subdev_state_get_format() - Get pointer to a stream format
* @state: subdevice state
* @pad: pad id
* @...: stream id (optional argument)
*
* This returns a pointer to &struct v4l2_mbus_framefmt for the given pad +
* stream in the subdev state.
*
* For stream-unaware drivers the format for the corresponding pad is returned.
* If the pad does not exist, NULL is returned.
*/
/*
* Wrap v4l2_subdev_state_get_format(), allowing the function to be called with
* two or three arguments. The purpose of the __v4l2_subdev_state_get_format()
* macro below is to come up with the name of the function or macro to call,
* using the last two arguments (_stream and _pad). The selected function or
* macro is then called using the arguments specified by the caller. A similar
* arrangement is used for v4l2_subdev_state_crop() and
* v4l2_subdev_state_compose() below.
*/
#define v4l2_subdev_state_get_format(state, pad, ...) \
__v4l2_subdev_state_gen_call(format, ##__VA_ARGS__, , _pad) \
(state, pad, ##__VA_ARGS__)
#define __v4l2_subdev_state_get_format_pad(state, pad) \
__v4l2_subdev_state_get_format(state, pad, 0)
struct v4l2_mbus_framefmt *
__v4l2_subdev_state_get_format(struct v4l2_subdev_state *state,
unsigned int pad, u32 stream);
/**
* v4l2_subdev_init_finalize() - Finalize the initialization of the subdevice
* @sd: The subdev
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment