LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-18-2011, 04: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, 02:58 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
Check following link
http://www.mjmwired.net/kernel/Docum.../dev-interface
 
Old 08-23-2011, 02: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



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

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

All times are GMT -5. The time now is 04:07 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
Open Source Consulting | Domain Registration