Received: by mail.netbsd.org (Postfix, from userid 605) id 6FE9C84EB6; Thu, 7 Jun 2018 13:30:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 8F70F84E4B for ; Thu, 7 Jun 2018 13:30:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id 52QOf7F7hFhD for ; Thu, 7 Jun 2018 13:30:50 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id C689584D3E for ; Thu, 7 Jun 2018 13:30:49 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id AF5DEFBEC; Thu, 7 Jun 2018 13:30:49 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Thu, 7 Jun 2018 13:30:49 +0000 From: "Jason R Thorpe" Subject: CVS commit: src/sys/dev/i2c To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20180607133049.AF5DEFBEC@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: source-changes.NetBSD.org Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Jason R Thorpe" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: thorpej Date: Thu Jun 7 13:30:49 UTC 2018 Modified Files: src/sys/dev/i2c: i2c.c i2cvar.h Log Message: Changes / enhancements to i2c indirect device auto-configuration: — iic_search() chooses a “probe strategy” based on the "i2c-indirect-probe-strategy” property on the “iic” instance. Valid values are "smbus-quick-write”, "smbus-receive-byte”, and “none”. If no value is specified, the default is "smbus-quick-write”. — If the "i2c-indirect-device-whitelist” exists on the “iic” instance, iic_search() will first check the driver name in the cfdata_t against this list, and only allow the match/probe to move forward if the cfdata_t driver name is in the list. This is primarily to accommodate the Intel integrated memory controller neutered-i2c-thing. — If the cfdata_t specifies a wildcard address, each address of the i2c bus will be consulted. If the cfdata_t contains a nailed-down address, then we limit the bus scan to that specific address. — We explicitly skip reserved / special i2c addresses, such as the General-Call address, etc. — We introduce the notion of a “match quality” for i2c drivers. From lowest-quality to highest-quality: matched by plausible address only, matched by plausible address and poking at the bus to see if the device looks reasonable, matched by direct-config “compatible” string, matched by direct-config “driver name” string. — If the “match quality” is merely “plausible address only”, then iic_search() will use the probe strategy selected above to see if a device responds to that address. To generate a diff of this commit: cvs rdiff -u -r1.60 -r1.61 src/sys/dev/i2c/i2c.c cvs rdiff -u -r1.12 -r1.13 src/sys/dev/i2c/i2cvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.