Respected Sir,
I have Connectcore Wi-i.mx51 board, I written driver for battery management, that is connected externally through i2c.
- I am getting 00 for reading and writing data from userspace.
- Other method if i include all in driver part (copy-to-user and copy-from-user) showing segmentation fault while insmod driver.
kernelspace - i2c driver
userspace - simple program to access my driver
using file descriptor and ioctl operations.
(I tried another method using fd and
sm_bus_read_word_data() it also
showing error)
Whenever i am going to access my driver its showing error after including i2c-dev.h in userspace program.
I am giving input from user(pgm) -> copyfromuser(driver)->smbusread(driver)->gettingdata and copytouser(driver)->accessing data( userspace pgm) showing error.
i2c-dev.h showing partial header file after including to digi. outside digi its showing smbus_read and smbus_write is there.
Please help me to get out from this problem.
Send If any sample code of i2c driver for charger and program for access driver from userspace.
thank you,