Bug 198817 - [PATCH] Update i2c(8) to use the I2CRDRW ioctl
Summary: [PATCH] Update i2c(8) to use the I2CRDRW ioctl
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-03-23 02:05 UTC by Emmanuel Vadot
Modified: 2016-02-27 03:12 UTC (History)
0 users

See Also:


Attachments
patch i2c(8) (8.16 KB, patch)
2015-03-23 02:05 UTC, Emmanuel Vadot
no flags Details | Diff
New patch (7.29 KB, patch)
2015-07-05 07:11 UTC, Emmanuel Vadot
no flags Details | Diff
i2c_patch_3 (9.63 KB, patch)
2015-07-07 07:31 UTC, Emmanuel Vadot
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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