LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 04-08-2020, 09:14 AM   #1
DeanAnderson
LQ Newbie
 
Registered: Nov 2019
Posts: 19

Rep: Reputation: Disabled
Have You ever seen in i2c node part of dts driver which has probe(struct platform_device *pdev


Hi
I mean something like that:
Code:
&i2c1 {
    some_label: some_driver@0 {
        compatible = "name,subnam";
        /*some properties*/
     };
};
where driver has in probe(struct platform_device*) instead of probe(struct i2c_client*) ???
I see that every driver has probe(struct* i2c_client).
I need to add some driver which is handling part of hardware (i2c device). Another part is handled in linux build-in driver which CONFIG is by default = n. If somebody from other team, in company in which I am working, will add do dts configuration for this built-in linux driver then probe for one of driver will fail as there can't be two nodes in i2c1 with the same <reg> property.
Currently my solution is - I am out of i2c1 node and my driver is platform driver probe(struct platform_device*):

Code:
	my_label: my_device@18 {
		compatible = "xyz,abc";
		addr = <0x18>;
		bus-id = <4>;
		/*other properties*/
	};
and <reg> is <addr> and <bus-id> is number of i2c bus. I parse both in probe.
I wonder if I can still be inside i2c1 node and remove at least bus-id property. But how to get this bus-id.
 
  


Reply



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
How to extract DTS core from DTS-HD MA? earthw0rmjim Linux - Software 0 09-06-2012 01:24 PM
Platform_device structure with more than one driver AustinMarton Linux - Kernel 0 01-19-2009 10:36 PM
GCC compile problem:struct A have a member variable which is just a struct type name? leon.zcom Programming 3 04-18-2008 04:40 PM

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

All times are GMT -5. The time now is 11:45 AM.

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
Open Source Consulting | Domain Registration