2009-11-12 07:41:35     user space i2c_smbus_write_i2c_block_data returning -EPERM

Document created by Aaronwu Employee on Aug 19, 2013
Version 1Show Document
  • View in full screen mode

2009-11-12 07:41:35     user space i2c_smbus_write_i2c_block_data returning -EPERM

Martin Strubel (SWITZERLAND)

Message: 82313   

 

Hello,

 

Before I start digging around, I'd wanted to ask if I'm missing something trivial:

 

The i2c_smbus_write_i2c_block_data() user space call, which wraps:

 

i2c_smbus_access(file,I2C_SMBUS_WRITE,command,I2C_SMBUS_I2C_BLOCK_BROKEN, &data);

 

returns -EPERM, whereas the non i2c call

 

i2c_smbus_write_block_data()

 

works, but prepends the length byte to the data block.

 

These calls are inline wrapper functions taken from user/i2c-tools/i2c-tools-3.0.2/include.

 

Could there be something out of sync? The 'BLOCK_BROKEN' define is puzzling, but seems to be taken care of inside the driver. Any ideas?

 

 

 

Cheers,

 

- Strubi

QuoteReplyEditDelete

 

 

2009-11-15 16:04:08     Re: user space i2c_smbus_write_i2c_block_data returning -EPERM

Mike Frysinger (UNITED STATES)

Message: 82382   

 

you didnt say which kernel version you were using, so you might want to recheck with latest 2009R1 branch as there have been a fix or two related to smbus transfers with the Blackfin TWI driver.

QuoteReplyEditDelete

 

 

2009-11-21 04:46:06     Re: user space i2c_smbus_write_i2c_block_data returning -EPERM

Martin Strubel (SWITZERLAND)

Message: 82617   

 

My apology: I'm working with the 2009R1 branch. I pulled the latest changes from trunk where the above i2c block command works, however, the newer kernel code introduces other problems (rootfs no longer mounts via INITRD, and mallocs keep failing, even though there is enough free memory). Haven't investigated the reason any further. So, upgrading is not an option right now. I guess I'll have to dive into it and backport the changes..

 

Greetings,

 

- Martin

QuoteReplyEditDelete

 

 

2009-11-22 22:39:47     Re: user space i2c_smbus_write_i2c_block_data returning -EPERM

Sonic Zhang (CHINA)

Message: 82627   

 

Don't use trunk kernel, but use 2009R1 branch instead.

Attachments

    Outcomes