LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 08-18-2011, 05:19 AM   #1
elonica.pl
LQ Newbie
 
Registered: Jun 2011
Posts: 21

Rep: Reputation: Disabled
How to forward IOCTL's from i2c-dev.c to adapter driver (i2c-rt3352.c)


I'm writing the I2C adapter driver for SOC. This adapter exist now in system and RTC driver works with it via .master_xfer.

I would like to send IOCTL's from application via /dev/i2c. I have loaded i2c_dev and all modules. After sending IOCTL I get following :

#i2ccmd read 0
i2cdev_open[382]
i2c_dev_get_by_minor[54]
i2c_get_adapter[896]
i2cdev_ioctl[186]
ioctl, cmd=0x03, arg=0x00
i2c_control[731]
i2cdev_release[420]
i2c_put_adapter[910]


i2cdev_ioctl method doesn't send I2C_RDWR IOCT'L to my adapter driver. How can I forward those IOCTL's to i2c-rt3352.c ?
 
Old 08-19-2011, 03:58 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,045

Rep: Reputation: 86
Check following link
http://www.mjmwired.net/kernel/Docum.../dev-interface
 
Old 08-23-2011, 03:03 AM   #3
elonica.pl
LQ Newbie
 
Registered: Jun 2011
Posts: 21

Original Poster
Rep: Reputation: Disabled
I've found the way to pass my own IOCTL's: .algo_control function pointer in i2c_algorithm struct will handle special ioctl's.

i2cdev_ioctl -> (default) -> i2c_control -> (default) -> (adap->algo->algo_control)
 
  


Reply


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
[SOLVED] No /dev/i2c-0 entry after insmod i2c-dev sajnanazeer Linux - Newbie 1 08-10-2011 08:39 AM
how to enable ioctl( ) feature in i2c driver tanniru Linux - Kernel 7 07-14-2011 06:23 AM
i2c-dev.h Issues napier Linux - Embedded & Single-board computer 1 03-24-2011 01:20 PM
Help! Problems with i2c-dev. No more /dev/i2c-* em1l Fedora 0 10-28-2005 06:48 AM
I can't detect I2c-philips-par adapter? thaodt Linux - Software 0 06-07-2004 03:17 AM


All times are GMT -5. The time now is 03:38 PM.

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