LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-15-2011, 10:14 AM   #1
Khadidja
LQ Newbie
 
Registered: Feb 2011
Location: France
Posts: 2

Rep: Reputation: Disabled
URGENT : How to handle one device through two separted device drivers


Hi,

I'm working on a linux kernel 2.6.32.25 for a board that has a PCI UART device that handles both serial ports and GPIO. For now, the device driver that handles this device contains the code to drive serial ports and GPIO, so through the same device node.

I want to split this driver into two drivers: one handling the serial port part (ttySERIALx) and one handling the GPIO part (ttyGPIOx), is it possible to do such a thing?

Until now I've tested to duplicate the code of the driver and change only the major and minor numbers, the dev_name s(ttyGPIO...) and driver_names to differentiate them. What happens at boot time (the two drivers are built-in) is that one driver is initialized and probed, everything goes well, the ttyXRSERIALx exist, but the second driver is registered (add driver appears in dmesg), but the probe function is not called.
From what I've read in the kernel source document pci.txt this normal as the probe function won't be called if a matching device is already owned by another driver.
So I thought may be it would work if the second driver is of class gpio and not serial, but I don't think this will solve the problem, cause the problem seems to be at the pci level as a driver has been already matched to the device I want to bind the second driver to. So, it seems not to be the solution to my problem. am I wrong?

Is there a way to access the same device through two drivers at the same time?

Thanks a lot for your help in advance, I'm really out of idea, here! and kind of newbie in kernel programming
 
Old 02-16-2011, 12:40 AM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
URGENT : How to handle one device through two separted device drivers
this is NOT "URGENT"
and we will not respond any faster with that in the massage title

BUT you will get a bunch of
" do not use URGENT in the title " from 2 to 30 people .
 
Old 02-16-2011, 02:33 AM   #3
Khadidja
LQ Newbie
 
Registered: Feb 2011
Location: France
Posts: 2

Original Poster
Rep: Reputation: Disabled
Sorry, it was in an example of title, so I put it because for me is kind of urgent, anyway... thanks for your answer, it helps a lot.
 
  


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
linux device drivers : how can i unregister a character device ? zampa Linux - General 5 06-21-2012 05:34 AM
(Please an urgent help) mount: special device dev/sdb1 does not exist madani Linux - Newbie 28 12-09-2009 11:39 PM
[SOLVED] HOWTO handle Bad Block in mass storage device Niraj Kulkarni Linux - Newbie 3 11-05-2009 12:39 AM
Sorry, don't know how to handle device 0x0107 TheSpork Linux - General 0 12-04-2003 03:27 PM
lilo install problem - Sorry - don't know how to handle device 0x0102 spiky Linux - General 4 01-21-2003 04:24 PM

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

All times are GMT -5. The time now is 01:55 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