aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/i2c
Commit message (Collapse)AuthorAgeFilesLines
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* i2c(8): clean up and clarify read operationAndriy Gapon2017-10-132-25/+32
| | | | | | | | | | | | | | | | | | | | | | | | The code went to a lot of trouble to issue either a start+stop condition or a repeated start condition only to follow it with a stop condition and a read(2) call that issues a new start condition. So, fix the read in I2C_MODE_REPEATED_START mode by using I2CREAD ioctl within the running transaction. This obviously requires that the slave address has the read bit set which was not required before. Another problem was with width parameter of zero and I2C_MODE_REPEATED_START mode. In that case we issued a repeated start without any preceding start. While here, remove the redundant (unused) argument to I2CSTOP throughout the program. Also, clarify the meaning of -w option, especially "-w 0", in the manual page. Reviewed by: no one Differential Revision: https://reviews.freebsd.org/D12331 Notes: svn path=/head/; revision=324590
* Make i2c -s (device scan) work on hardware that supports only full xfers.Ian Lepore2017-09-111-11/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing scan code is based on sending an i2c START condition and if there is no error it assumes there is a device at that i2c address. Some i2c controllers don't support sending individual start/stop signals on the bus, they can only perform complete data transfers with start/stop handled in the silicon. This adds a fallback mechanism that attempts to read a single byte from each i2c address. It's less reliable than looking for an an ACK repsonse to a start, because some devices will NAK an attempt to read that isn't preceeded by a write of a register address. Writing to devices to probe them is too dangerous to even consider. The user is told that a less-reliable scan is being done, so even if the read-scan comes up empty too, it's still a vast improvement over the old situation where it would just claim there were no devices on the bus even though the devices were there and working fine. If the i2c controller responds with a proper ENODEV (device doesn't support operation) or an almost-proper EOPNOTSUPP, the START/STOP scan is switched to a read-scan right away. Most controllers respond with ENXIO or EIO if they don't support START/STOP, so no quick-out is available. For those, if a scan of all 127 addresses and come up empty, the scan is re-done using the read method. Reported by: Maxim Filimonov <che@bein.link> Notes: svn path=/head/; revision=323465
* More typos in strings.Nick Hibma2016-12-021-4/+4
| | | | | | | | Submitted by: bde MFC after: 3 days Notes: svn path=/head/; revision=309409
* Speling fixes and fix line endings for err_msg output.Nick Hibma2016-12-011-10/+10
| | | | | | | In some cases there was not \n, in other cases there was. Notes: svn path=/head/; revision=309357
* i2c(8): uninitialized variable (UNINIT).Pedro F. Giffuni2016-05-131-1/+3
| | | | | | | | | | If i2c_opt.width is somehow zero, buf will be left uninitialized and may cause trouble later on. This is a followup to r299586. CID: 1331548 Notes: svn path=/head/; revision=299682
* i2c(8): uninitialized variable (UNINIT).Pedro F. Giffuni2016-05-131-1/+2
| | | | | | | | | | If i2c_opt.width is somehow zero, the bufsize will be left uninitialized and make cause trouble later on. CID: 1331549 Notes: svn path=/head/; revision=299586
* Perform I2C transmission in a single burst when mode is "none" or not setZbigniew Bodek2015-09-151-28/+79
| | | | | | | | | | | | | | | | | | | | | | | | | Some more automated I2C controllers cannot explicitly create START/STOP/etc. conditions on the bus. Instead, the correct condition is set automatically according to the pending transfer status. This particular behavior can cause trouble if some I2C slave requires sending address offset within the chip followed by the actual data or command. In that case we cannot assume that the driver will not STOP immediately after sending offset. To avoid that, do not split offset transfer from data transfer for default transmission modes and do exactly that if requested in command line (stop-start and repeated-start modes). This more generic approach should cover special cases like the one described. Reviewed by: imp Submitted by: Marcin Mazurek <mma@semihalf.com> Obtained from: Semihalf Notes: svn path=/head/; revision=287820
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge from head@274682Simon J. Gerraty2014-11-191-2/+8
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=274683
| * Merge head from 7/28Simon J. Gerraty2014-08-191-4/+2
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * | Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | Fix a few cases of use of uninitialized variables. Found with -Wall.Luiz Otavio O Souza2014-11-121-2/+8
| |/ |/| | | | | | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=274416
* | use .Mt to mark up email addresses consistently (part2)Baptiste Daroussin2014-06-201-4/+2
|/ | | | | | | | PR: 191174 Submitted by: Franco Fichtner <franco@lastsummer.de> Notes: svn path=/head/; revision=267668
* Fixes to man8 groff mandoc style, usage mistakes, or typos.Warren Block2012-05-241-1/+1
| | | | | | | | | | PR: 168016 Submitted by: Nobuyuki Koganemaru Approved by: gjb MFC after: 3 days Notes: svn path=/head/; revision=235873
* Remove trailing whitespace per mdoc lint warningEitan Adler2012-03-291-5/+5
| | | | | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days Notes: svn path=/head/; revision=233648
* Fix warning when compiling with gcc46:Eitan Adler2012-01-201-2/+1
| | | | | | | | | | error: variable 'i2c' set but not used Approved by: dim, cperciva (mentor, blanket for pre-mentorship already-approved commits) MFC after: 3 days Notes: svn path=/head/; revision=230356
* In usr.sbin/i2c/i2c.c, fix a few warnings about format strings not beingDimitry Andric2011-12-171-2/+2
| | | | | | | | | literals. MFC after: 1 week Notes: svn path=/head/; revision=228660
* mdoc: drop redundant .Pp and .LP callsUlrich Spörlein2010-10-081-1/+0
| | | | | | | They have no effect when coming in pairs, or before .Bl/.Bd Notes: svn path=/head/; revision=213573
* Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki whileJoel Dahl2010-08-161-1/+1
| | | | | | | | | translating these manual pages. Minor corrections by me. Submitted by: Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp> Notes: svn path=/head/; revision=211397
* mdoc: Remove leading garbage, empty lines and order preambleUlrich Spörlein2010-05-271-1/+0
| | | | Notes: svn path=/head/; revision=208593
* Use our canonical .Dd format.Christian Brueffer2009-11-021-1/+1
| | | | | | | Submitted by: Ulrich Spoerlein Notes: svn path=/head/; revision=198788
* Introduce the I2C diagnostic utility. It let's discover and inspect slaveRafal Jaworowski2009-01-263-0/+809
devices on the bus. Reviewed by: bms, stas Obtained from: Semihalf Notes: svn path=/head/; revision=187712