Skip to contentSkip to conversation

Must omap34xxcam be a module?

DISCUSSION Michael Jones 2 participants 2 messages Aug 13, 2010 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Hi Laurent & Sakari,

Regarding the omap3camera/devel branch:

In v4l2-common.c:v4l2_i2c_new_subdev_board(), request_module() is called to ensure that the sensor driver is already registered before registering the sensor device. When I compile-in both my sensor driver and omap34xxcam with the kernel, this call to request_module() fails, and indeed omap34xxcam is initialized before my sensor driver, causing the omap34xxcam device registration to fail. When I leave omap34xxcam compiled-in and try to just let it load the sensor module when needed on bootup, request_module() fails. I haven't managed to track down why that is. When I compile both omap34xxcam and my sensor driver as modules, and load them after boot-up, registration succeeds.

Is it neccessary for omap34xxcam and its subdevices to be modules? How are you guys building these?

Full disclosure: my sensor is actually an SPI device, but the v4l2_spi_new_subdev() function I'm actually using seems to be _very_ analogous to its I2C counterpart, so I'm assuming SPI is not responsible.

thanks,
Michael

MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, Hans-Joachim Reich

#1 lore raw

Hi Michael,

Quoted 11 lines · On Friday 13 August 2010 16:43:13 Michael Jones wrote:

Hi Laurent & Sakari,

Regarding the omap3camera/devel branch:

In v4l2-common.c:v4l2_i2c_new_subdev_board(), request_module() is called to ensure that the sensor driver is already registered before registering the sensor device. When I compile-in both my sensor driver and omap34xxcam with the kernel, this call to request_module() fails, and indeed omap34xxcam is initialized before my sensor driver, causing the omap34xxcam device registration to fail.

Quoted 3 lines

When I leave omap34xxcam compiled-in and try to just let it load the sensor module when needed on bootup, request_module() fails. I haven't managed to track down why that is.

That's because userspace isn't available yet when the omap34xxcam driver is initialized, so there's no way to load a module at that time.

Quoted 5 lines

When I compile both omap34xxcam and my sensor driver as modules, and load them after boot-up, registration succeeds.

Is it neccessary for omap34xxcam and its subdevices to be modules? How are you guys building these?

At the moment it's indeed necessary. It's a V4L2 core issue, not specific to omap34xxcam. I'm not aware of plans to fix this, but a proposal is welcome :-)

Quoted 3 lines

Full disclosure: my sensor is actually an SPI device, but the v4l2_spi_new_subdev() function I'm actually using seems to be _very_ analogous to its I2C counterpart, so I'm assuming SPI is not responsible.

The same issue exists with I2C, SPI is not responsible.

Signature · 3 lines
Regards,

Laurent Pinchart