c - What is the difference between a Linux platform driver and normal device driver? -


i had thought platform driver normal device driver :

please explain.

your references lack definition of what platform device. there 1 on lwn. can learn page:

  1. platform devices inherently not discoverable, i.e. hardware cannot "hey! i'm present!" software. typical examples i2c devices, kernel/documentation/i2c/instantiating-devices states:

    unlike pci or usb devices, i2c devices not enumerated @ hardware level (at run time). instead, software must know (at compile time) devices connected on each i2c bus segment. usb , pci not platform devices.

  2. platform devices bound drivers by matching names,

  3. platform devices should registered early during system boot. because critical rest of system (platform) , drivers.

so basically, question "is platform device or standard device?" more question of bus uses. work particular platform device, have to:

  1. register platform driver manage device. should define unique name,
  2. register platform device, defining same name driver.

platform driver devices on chip.

not true (in theory, true in practice). i2c devices not onchip, platform devices because not discoverable. can think of onchip devices normal devices. example: integrated pci gpu chip on modern x86 processor. discoverable, not platform device.

normal device driver interfaced processor chip. before coming across 1 i2c driver.

not true. many normal devices interfaced processor, not through i2c bus. example: usb mouse.

[edit] in case, have drivers/usb/host/ohci-pnx4008.c, usb host controller platform device (here usb host controller not discoverable, whereas usb devices, connect it, are). platform device registered board file (arch/arm/mach-pnx4008/core.c:pnx4008_init). , within probe function, registers i2c device bus i2c_register_driver. can infer usb host controller chipset talks to cpu through i2c bus.

why architecture? because on 1 hand, device can considered bare i2c device providing functionalities system. on other hand, usb host capable device. needs register usb stack (usb_create_hcd). probing i2c insufficient. have documentation/i2c/instantiating-devices.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -