Bug 198817

Summary: [PATCH] Update i2c(8) to use the I2CRDRW ioctl
Product: Base System Reporter: Emmanuel Vadot <manu>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed Not A Bug    
Severity: Affects Only Me Keywords: patch
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch i2c(8)
none
New patch
none
i2c_patch_3 none

Description Emmanuel Vadot 2015-03-23 02:05:57 UTC
Created attachment 154684 [details]
patch i2c(8)

This patch updates i2c(8) to use the I2CRDRW ioctl instead of the old start / stop /read / write method.
i2c_read and i2c_write have been merged to one function.
Scanning works now on beaglebone :
$ i2c -s
Scanning I2C devices on /dev/iic0: 0x24 0x34 0x50 

And dumping the on-board eeprom works too :
$ i2c -a 0x50 -d r -o 0 -w16 -c 16 -b | hexdump -Cv

00000000  aa 55 33 ee 41 33 33 35  42 4e 4c 54 30 30 43 30  |.U3.A335BNLT00C0|
00000010

Cheers,
Comment 1 Emmanuel Vadot 2015-07-05 07:11:04 UTC
Created attachment 158368 [details]
New patch

I've rewritten the patch so i2c still use the I2CREAD/I2CWRITE/... by default but uses the I2CRDRW with the newly added -x switch.

Cheers,
Comment 2 Emmanuel Vadot 2015-07-07 07:31:18 UTC
Created attachment 158475 [details]
i2c_patch_3

As seen with loos :
 - update to support 8-bits addresses
 - scan mimic the linux command i2cdetect(8)
Comment 3 Emmanuel Vadot 2016-02-27 03:12:59 UTC
Patch is on phab now : https://reviews.freebsd.org/D5470