LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 10-05-2010, 05:38 PM   #1
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
Forcing a specific driver for a device, through udev


My co-workers and I are trying to develop a USB device, which uses an FTDI chip as a USB-serial controller. The thing is, we would ideally like to set a cusom idVendor and idProduct on the FTDI chip.

The problem occurs that when we set custom idVendor and idProduct values, udev(7) loads the "usb" driver. If we leave the idVendor and idProduct values to their originals, udev(7) loads the "ftdi_sio" driver. The whole reason for the custom idVendor and idProduct values is so that I can (hopefully) write a udev(7) rule to map that particular device to a specific entry in /dev.

Is there a way to write a udev(7) rule so that you can forcefully load a particular driver for a device? Is there something else that could be done to get a similar result?

Google searching hasn't yielded anything conclusive, yet.
 
Old 10-06-2010, 04:56 AM   #2
gdejonge
Member
 
Registered: Aug 2010
Location: Netherlands
Distribution: Kubuntu, Debian, Suse, Slackware
Posts: 285

Rep: Reputation: 70
Strange, I did a google search on writing udev rules and it came up with
http://www.reactivated.net/writing_udev_rules.html

So you probably need something like this:
Code:
SUBSYSTEM="usb", ATTRS{idVendor}="xxxx", ATTRS{idProduct}="xxxx", RUN+="modprobe ftdi_sio" NAME="Whatever"
Also you should check the directories /etc/udev/rules.d and /lib/udev/rules.d

_______________
Gerrard
 
Old 10-06-2010, 11:46 AM   #3
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Original Poster
Rep: Reputation: 65
Thanks, gdejonge. I've read that too.

After poking around on IRC last night, I discovered that once it gets to udev(7), it's a little too late. The kernel needs to somehow be told that the device is supposed to use the ftdi_sio driver, instead of the usb driver.

It's starting to look like I might need to copy and modify the ftdi_sio driver to look for the specific idVendor and idProduct values, unless there is a way to do it with modules.d and surrounding bits.

EDIT: Alright, so I have solved this issue. We cannot change the idVendor and idProduct values of the FTDI chip if we want the kernel to recognize the device and use the ftdi_sio driver. I ended up concocting a udev(7) rule that will catch the FTDI USB-serial device and provide a nice, descriptive symlink.

The only other alternative I could see was copying and modifying the ftdi_sio driver from the kernel sources.

Last edited by indienick; 10-07-2010 at 03:03 PM.
 
  


Reply

Tags
ftdi_sio, udev, usb


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
Can't bind my device to a driver, or get a /dev/<devname> created by udev will_berry70 Linux - General 1 12-07-2009 09:32 AM
How to load a specific device driver hasmak Linux - Newbie 11 01-02-2009 01:07 PM
Installing Device Specific driver? Zangai Linux - Wireless Networking 1 05-03-2008 09:29 PM
USB device is recognized, but wount access it's specific driver. Lechium Linux - Software 2 08-05-2004 01:26 PM
Traffi forcing on a specific interface kbassyouny Linux - Software 0 07-04-2003 04:53 AM


All times are GMT -5. The time now is 12:41 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration