Hi,
 
I m implementing a driver for accelerometer KXSD9 in linux kernel 2.6.24.7 for 
OMAP-3430. KXSD9 sensor will be connected to the i2c bus so it will be an i2c 
client.
 
I m implementing a new style driver, so following are the steps that I m 
following:
 
1. Putting the device info (busnum, address, irq) in the board specific 
initialization code. From this the i2c-core will create a client for my device 
when the corresponding bus adapter (i2c_adapter) is registered.
 
2. I m implementing the following i2c_driver for my device
 
struct i2c_driver KXSD9_i2c_driver =
{
            .driver = {
                        .name = "KXSD9_driver",
            },
            
            .probe = KXSD9_probe, /* this will do the device initialization */
            .remove = KXSD9_remove,
 
            .shutdown = KXSD9_shutdown,
            .suspend = KXSD9_suspend,
            .resume = KXSD9_resume,
};
 
3. My requirement is that I need to export the file operations (specific ioctl 
commands) to the user space. I am not sure how it has to be done from this 
driver????
 
I thought of the following approach:
Registering a misc device to export the file operations
 
int __init KXSD9_driver_init()
{
           /*Provide /dev interface to user space and export the file   
             operations */
           misc_register(&KXSD9_misc_device);
 
           /*Request the IRQ and install the interrupt handler*/
           request_irq(.. KXSD9_IRQ . .);
 
           /*Add the i2c_driver*/
           i2c_add_driver(&KXSD9_i2c_driver);
}
 
Is this the correct way of doing it???????? Or the file operations should be 
exported using some other method in case of i2c_drivers????
 
Your reply will be highly helpful… Thanks in advance….
 
Varun


      Download prohibited? No problem. CHAT from any browser, without download. 
Go to http://in.webmessenger.yahoo.com/
_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

Reply via email to