I recently acquired a 3rd party driver for a hardware device from the manufacturer that interfaces to the hardware device through i2c. The driver acts as an input device driver for a touchscreen controller.
It appears that in the initialization section of the driver there is a call to 'i2c_get_adapter()' which implies that the i2c adapter driver must have previously been loaded and running in order for the function call to be successful.
Having read the i2c readme under Linux/Documentation, the readme describes opening a device file for the adapter "/dev/i2c-x" in userspace.
Rather than having to open the i2c adapter device from userspace first before loading my 3rd party driver, is there another mechanism to do this from the driver? What is the common practice for doing this? Can I not just open the i2c adapter driver from my input driver? I'm asking because having taken a look at several other device drivers that communicate over i2c, it appears that they all make the same presumption that my input driver does. Which is a bit curious to me.