v4l2_i2c_new_subdev(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– v4l2_i2c_new_subdev πŸ’–

okay so bestie, we're in the Kernel API Manual (section 9, the kernel-api girlies) and today's main character is v4l2_i2c_new_subdev. yes it's a long name. no we're not shortening it. periodt.


✨ NAME ✨

v4l2_i2c_new_subdev β€” loads an i2c module and hands you back an initialized &struct v4l2_subdev. that's the whole vibe. load module β†’ get subdev. iconic behavior honestly πŸ’…


🌸 SYNOPSIS 🌸

struct v4l2_subdev * v4l2_i2c_new_subdev (struct v4l2_device *v4l2_dev ,
struct i2c_adapter *adapter , const char *client_type , u8 addr , const
unsigned short *probe_addrs );

like, yes, that's a lot of parameters. we'll get through them together 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • v4l2_dev β€” pointer to struct v4l2_device. your v4l2 home base, basically.
  • adapter β€” pointer to struct i2c_adapter. the adapter we're working with, slay.
  • client_type β€” name of the chip that's on the adapter. just the chip's name, as a string, ngl very self-explanatory of it.
  • addr β€” the I2C address. and here's the tea: if zero, it will use probe_addrs β˜• so zero is your "you pick for me" energy.
  • probe_addrs β€” array with a list of address. and the important bit, lowkey a trap if you forget: the last entry at such array should be I2C_CLIENT_END 🚨 like a proper terminator bestie, do not skip it.

πŸ¦‹ DESCRIPTION πŸ¦‹

returns a struct v4l2_subdev pointer. that's it. that's the sentence. short and honestly kind of powerful ✨


🌈 SEE ALSO 🌈

the whole friend group, in order, no one left out:


πŸ’€ reminder from your girl: that probe_addrs array needs I2C_CLIENT_END at the end. no terminator, no party. fr fr.

and that's the page!! brought to you by ./include/media πŸ“, dated October 2026 πŸ—“οΈ, shipped under the very official title v4l2_i2c_new_subdev(9) πŸ’œ mwah, go write some drivers bestie 🧚✨

πŸ“¦ where this page comes from