Archive for March, 2010|Monthly archive page

Platform drivers @ Linux

What the heck it is!!!!

Linux Kernel 2.6 introduced us the unified driver model. In PC based environment, the devices are connected to different kind of buses like PCI, ISA etc. When a device is connected to a bus, it receives a unique identification which will be used for further communication with the CPU. The driver for the related device can be initialized/removed using the probe/remove method normally.

What about the embedded system? Mobile phones?

Mobile phones usually don’t have a sophisticated bus mechanism found in PC systems. So there must be a way to attach a device to the embedded system like Memory, input MIC, accelerometer etc.

The answer is Platform Drivers. They are similar to normal drivers, but the major difference is their working mechanism. They help the devices directly connect to CPU. The driver can be identified using the unique name within the system and it can be configured for interrupt.

A platform driver should be register and unregister using platform_driver_register() and platform_driver_unregister(). The machine file for a particular board can maintain an array of devices connected to CPU and add them using platform_add_devices().

When platform_add_devices() is called, it internally calls probe() function of each of the driver which helps the driver to initialize.

Follow

Get every new post delivered to your Inbox.