STRUCT CAMIF_DEV(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct camif_dev(9) ✨

okay so bestie, welcome to the Kernel API Manual β€” specifically the page for struct camif_dev(9), and trust, this one is a whole mood. it's giving "the CAMIF driver's own private little diary" energy πŸ’… let's get into it.


πŸ’– NAME πŸ’–

struct camif_dev β€” the CAMIF driver private data structure

like, this is the driver's personal data structure. its whole personality lives in here 🫢


πŸŽ€ SYNOPSIS πŸŽ€

   struct camif_dev {
       struct media_device             media_dev;
       struct v4l2_device              v4l2_dev;
       struct v4l2_subdev              subdev;
       struct v4l2_mbus_framefmt       mbus_fmt;
       struct v4l2_rect                camif_crop;
       struct media_pad                pads[CAMIF_SD_PADS_NUM];
       int stream_count;
       struct cam_sensor {
         struct v4l2_subdev      *sd;
         short power_count;
         short stream_count;
       } sensor;
       struct media_pipeline           *m_pipeline;
       struct v4l2_ctrl_handler        ctrl_handler;
       struct v4l2_ctrl                *ctrl_test_pattern;
       struct {
         struct v4l2_ctrl        *ctrl_colorfx;
         struct v4l2_ctrl        *ctrl_colorfx_cbcr;
       };
       u8 test_pattern;
       u8 colorfx;
       u8 colorfx_cb;
       u8 colorfx_cr;
       struct camif_vp                 vp[CAMIF_VP_NUM];
       const struct s3c_camif_variant  *variant;
       struct device                   *dev;
       struct s3c_camif_plat_data      pdata;
       struct clk                      *clock[CLK_MAX_NUM];
       struct mutex                    lock;
       spinlock_t slock;
       void __iomem                    *io_base;
    };

🌸 Members 🌸

time for the member-by-member vibe check. every single field, no skipping, we stan a complete list πŸ‘‘

  • media_dev β€” top-level media device structure. the big boss of the media side of things πŸ‘‘
  • v4l2_dev β€” root v4l2_device. the main character of the V4L2 world here ✨
  • subdev β€” the camera interface ("catchcam") subdev. yes, that's literally its nickname, iconic πŸ’…
  • mbus_fmt β€” camera input media bus format. what shape the pixels are arriving in πŸ¦‹
  • camif_crop β€” camera input interface crop rectangle. the crop, she is defined πŸ“
  • pads β€” the camif subdev's media pads
  • stream_count β€” the camera interface streaming reference counter. keeping count, fr fr πŸ”₯
  • sensor β€” image sensor data structure (nested struct cam_sensor, with its own sd, power_count and stream_count inside β€” a struct within a struct, we love a nesting moment πŸͺ†)
  • m_pipeline β€” video entity pipeline description. the pipeline! the ~flow~ 🌈
  • ctrl_handler β€” v4l2 control handler (owned by subdev β€” noted, so don't go thinking it's yours 😌)
  • ctrl_test_pattern β€” the V4L2_CID_TEST_PATTERN control ⭐
  • {unnamed_struct} β€” anonymous. yes bestie, an anonymous struct, it's mysterious, it's lowkey giving nothing but it's holding two very real controls πŸ‘‡
    • ctrl_colorfx β€” the V4L2_CID_COLORFX control
    • ctrl_colorfx_cbcr β€” the V4L2_CID_COLORFX_CBCR control
  • test_pattern β€” test pattern πŸŽ€
  • colorfx β€” color effect 🌈
  • colorfx_cb β€” Cb value for V4L2_COLORFX_SET_CBCR
  • colorfx_cr β€” Cr value for V4L2_COLORFX_SET_CBCR
  • vp β€” video path (DMA) description (codec/preview). an array of them, CAMIF_VP_NUM of them to be exact 🎬
  • variant β€” variant information for this device 🧚
  • dev β€” pointer to the CAMIF device struct
  • pdata β€” a copy of the driver's platform data πŸ“‹
  • clock β€” clocks required for the CAMIF operation, as an array of CLK_MAX_NUM pointers ⏰
  • lock β€” mutex protecting this data structure πŸ”’
  • slock β€” spinlock protecting CAMIF registers πŸ’€ (different lock, different rules, don't mix them up)
  • io_base β€” start address of the mmapped CAMIF registers. hi registers, we're here 🫢

πŸ¦‹ SEE ALSO πŸ¦‹

  • Kernel file ./drivers/media/platform/samsung/s3c-camif/camif-core.h β€” go read the source bestie, it ate πŸ’–
  • struct camif_fmt(9), struct camif_dma_offset(9), struct camif_frame(9), struct s3c_camif_variant(9), struct camif_vp(9), struct camif_addr(9), struct camif_buffer(9) β€” the whole friend group, go say hi ✨

aaaand that's the page πŸŽ‰ this one shipped from ./drivers/media/platform/samsu... back in October 2026 β€” so like, mark your calendar, and go forth and stream some camera frames, bestie. no cap, you got this πŸ’œπŸŒΈ

πŸ“¦ where this page comes from