As i am new to embedded field i am facing difficulties in understanding the clear difference between i2c device/driver and platform device/driver.
i have read this link:
What is the difference between Platform driver and normal device driver..?
which say platform devices/driver are use for not discoverable device like devices connected at i2c bus and Platform devices are bound to drivers by matching names.
I have gone through a board file, in which audio codec(non discoverable device) connected at i2c bus is registered using i2c API (i2c_register_board_info, omap_i2c_add_bus etc.), so my questions are
Every SOC(Silicon on Chip) or microcontroller will have a I2C controller, which provides a way to connect and communicate to I2C devices like camera sensors, PMIC, temperature sensor etc. The driver used for configuring and using this I2C controller is called platform driver. This I2C controller is called platform device. Mostly platform devices will be part of the SOC. The registers of the I2C controller are programmed using platform driver. These registers are in say ARM memory mapped and will be available on TRM of the SOC.
Now all the I2C devices that can be connected to the SOC or microcontroller via I2C controller like Camera sensors, PMIC, temperature sensor etc need a driver to control them. This driver is called device driver. The registers of these devices are not part of memory map of SOC. Need the datasheet of the I2C device like OV5640 Camera Sensor to program the registers. I2C data are sent out to program the registers and access data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With