STRUCT GB_CAMERA_OPS(9)
π struct gb_camera_ops(9) π
okay bestie, welcome to the Kernel API Manual (section 9, very demure, very kernel) β today we're doing struct gb_camera_ops, which is literally the Greybus camera operations table. It's what the Greybus camera driver uses to expose operations to the host camera driver. think of it as the group chat between the two of them π«Ά
β¨ SYNOPSIS β¨
struct gb_camera_ops {
ssize_t (*capabilities)(void *priv, char *buf, size_t len);
int (*configure_streams)(void *priv, unsigned int *nstreams,
unsigned int *flags, struct gb_camera_stream *streams, struct
gb_camera_csi_params *csi_params);
int (*capture)(void *priv, u32 request_id, unsigned int streams,
unsigned int num_frames, size_t settings_size, const void *settings);
int (*flush)(void *priv, u32 *request_id);
};
like yes, the indentation is a little feral, that's just how it is, we don't fix it π
π Members π
capabilitiesβ this one retrieves the camera capabilities and stashes them in the buffer, with the caller providing the size in thesizeparameter, and the effective capabilities size gets returned from the function. and if the buffer size is too small to hold the capabilities? it returns an error and the buffer is left completely untouched, no cap π ββοΈconfigure_streamsβ negotiate the configuration and get the module ready for video capture. the caller says how many streams it wants in thenstreamsargument, and the matching stream configs go in thestreamsargument. you can set theGB_CAMERA_IN_FLAG_TESTflagto test a configuration without applying it β otherwise the module actually applies it. the module is allowed to decide to modify the requested configuration, including using a different number of streams. and when that happens the modified config won't be applied, theGB_CAMERA_OUT_FLAG_ADJUSTEDflaggets set on return, and the modified configuration and number of streams get stored instreamsandarray. also, in all cases the module returns its CSI-2 bus parameters in thecsi_paramsstructure β¨captureβ submits a capture request. therequest_idyou pass must be unique and higher than the IDs of all the previously submitted requests (no cap, that's the rule π). thestreamsargument says which streams the request affects, in the form of a bitmask, with bits corresponding to the configured streams indexes. if the request contains settings, the specified by thesettings_sizeargument β otherwise thesettingsargument should be set toNULLandsettings_sizeto0π«‘flushβ flushes the capture requests queue. it returns the ID of the last request that will processed by the device before it stops transmitting video frames. and heads up π¨: all queued capture requests with IDs higher than the returned ID get dropped, just like that, without being processed π
π SEE ALSO π
- Kernel file
./drivers/staging/greybus/gb-camera.hβ go read it, iykyk struct gb_camera_stream(9)struct gb_camera_csi_params(9)struct gb_camera_module(9)
and that's the whole page, bestie! π¦ this came to you straight from ./drivers/staging/greybus, dated October 2026, and honestly it ate π periodt β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms