2008-07-23 05:54:28     probe function in device drivers

Document created by Aaronwu Employee on Aug 7, 2013
Version 1Show Document
  • View in full screen mode

2008-07-23 05:54:28     probe function in device drivers

murti iki (GERMANY)

Message: 59274   

 

Hello,

 

I have one doubt about the spi subsystem. Once we register our spi driver to the spi subsystem with spi_register_driver() we also provide the probe callback function so that when a device is detected by the subsytem it can call our driver's probe function.

 

If I am right untill this point, then the question I have is how does the subsystem detects this device. In the spi bus, I would say that the only way spi subsytem can identify a new device would be according to the slave select line that the device is connected but still I don't understand how the subsystem understands if a device is physically connected.

 

Is it the case that the slave select pin voltage level shows a difference when a device is connected?

 

Regards

 

murti

QuoteReplyEditDelete

 

 

2008-07-23 08:26:30     Re: probe function in device drivers

Yi Li (CHINA)

Message: 59278   

 

Murti,

 

You are asking "how does the subsystem detects this device?". The SPI framework cannot "detect" the SPI devices. All the devices are defined statically in the board file, e.g, arch/blackfin/mach-bf537/boards/stamp.c, as "bfin_spi_board_info[]".

 

The SPI master driver scans the device table (spi.c: scan_boardinfo() ) . The kernel will invoke a spi driver's probe function if a device "match" with this driver. Here "match" simply means they have the same name (modalias).

 

-Yi

 

 

QuoteReplyEditDelete

 

 

2008-07-23 10:33:14     Re: probe function in device drivers

murti iki (GERMANY)

Message: 59281   

 

Thank you for the informative answer Yi.

 

have a nice day

Attachments

    Outcomes