LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 05-23-2018, 09:53 AM   #1
mrigendra
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 driver.driver.name How they will be matched later ? file

/drivers/media/tuners/it913x.c

Code:
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

https://lwn.net/Articles/448499/

"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, 12:13 AM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,475

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


Reply

Tags
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 01:44 PM
Bind only 1 device to vfio driver that have same vendor/device id's Eusaphious Linux - General 1 05-19-2015 09:41 PM
Howto Bind USB Device to Driver? im.thatoneguy Linux - Hardware 1 02-19-2015 04:37 AM
Bind device to compiled-in driver? PlancksCnst Linux - Hardware 1 07-28-2010 01:42 PM
probe method on bus and device driver not being called kunice Linux - Hardware 0 02-24-2008 11:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 01:51 PM.

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