Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 05-23-2018, 10:53 AM   #1
LQ Newbie
Registered: Dec 2014
Posts: 22

Rep: Reputation: Disabled
How Probe will bind driver and device in below driver snippet

How Probe will bind driver and device in below driver snippet. I was trying to understand i2c_device_id and platform_device_id.For platform_device_id I see these type of drivers and device declarations. The names in id table are different than How they will be matched later ? file


static const struct platform_device_id it913x_id_table[] = {
    {"it9133ax-tuner", 1},
    {"it9133bx-tuner", 2},
MODULE_DEVICE_TABLE(platform, it913x_id_table);

static struct platform_driver it913x_driver = {
    .driver = {
        .name   = "it913x",
        .suppress_bind_attrs    = true,
    .probe      = it913x_probe,
    .remove     = it913x_remove,
    .id_table   = it913x_id_table,
At first I thought that these names should be in arch directory as board file entries. So of the drivers i can find board entries (such as /drivers/crypto/marvell/cesa.c) but for some I can't.

I referred this

"If an ID table is present, the platform bus code will scan through it every time it has to find a driver for a new platform device. If the device's name matches the name in an ID table entry, the device will be given to the driver for management a pointer to the matching ID table entry will be made available to the driver as well."

the bold line I thought should be if the driver's name and device name in the ID table matches then the device will be given to the driver for management.

Am I correct ?

How does platform_device_id helps in binding the device and driver?
Old 05-26-2018, 01:13 AM   #2
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,509

Rep: Reputation: 1000Reputation: 1000Reputation: 1000Reputation: 1000Reputation: 1000Reputation: 1000Reputation: 1000Reputation: 1000
I think one is for legacy applications and hardware. So, just to make sure, you should use both.


driver, kernel 4.14.xx, linux, platform

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Driver core binding device to driver and Udev loading driver module-difference? ayyasprings Linux - Embedded & Single-board computer 0 01-23-2016 02:44 PM
Bind only 1 device to vfio driver that have same vendor/device id's Eusaphious Linux - General 1 05-19-2015 10:41 PM
Howto Bind USB Device to Driver? im.thatoneguy Linux - Hardware 1 02-19-2015 05:37 AM
Bind device to compiled-in driver? PlancksCnst Linux - Hardware 1 07-28-2010 02:42 PM
probe method on bus and device driver not being called kunice Linux - Hardware 0 02-24-2008 12:47 PM > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 05:06 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration