public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nathan Lutchansky <lutchann@litech.org>
To: LKML <linux-kernel@vger.kernel.org>,
	lm-sensors <lm-sensors@lm-sensors.org>
Cc: Greg KH <greg@kroah.com>
Subject: [PATCH 5/5] new flag to disable i2c probing for an adapter
Date: Mon, 15 Aug 2005 13:55:05 -0400	[thread overview]
Message-ID: <20050815175505.GF24959@litech.org> (raw)
In-Reply-To: <20050815175106.GA24959@litech.org>

Re-add the flags field to the i2c_adapter structure so we can add a new
flag I2C_ADAPTER_SKIP_PROBE.  When an adapter sets this flag, the bus
will never be probed by any i2c client driver, even if forced addresses
are listed.  Adapters that set this flag will need to use the
i2c_probe_device function to attach new clients.

Signed-off-by: Nathan Lutchansky <lutchann@litech.org>

 drivers/i2c/i2c-core.c |    3 +++
 include/linux/i2c.h    |    4 ++++
 2 files changed, 7 insertions(+)

Index: linux-2.6.13-rc6+gregkh/drivers/i2c/i2c-core.c
===================================================================
--- linux-2.6.13-rc6+gregkh.orig/drivers/i2c/i2c-core.c
+++ linux-2.6.13-rc6+gregkh/drivers/i2c/i2c-core.c
@@ -788,6 +788,9 @@ int i2c_probe(struct i2c_adapter *adapte
 	int i, err;
 	int adap_id = i2c_adapter_id(adapter);
 
+	if (adapter->flags & I2C_ADAPTER_SKIP_PROBE)
+		return 0;
+
 	/* Forget it if we can't probe using SMBUS_QUICK */
 	if (! i2c_check_functionality(adapter,I2C_FUNC_SMBUS_QUICK))
 		return -1;
Index: linux-2.6.13-rc6+gregkh/include/linux/i2c.h
===================================================================
--- linux-2.6.13-rc6+gregkh.orig/include/linux/i2c.h
+++ linux-2.6.13-rc6+gregkh/include/linux/i2c.h
@@ -233,6 +233,7 @@ struct i2c_adapter {
 	unsigned int id;/* == is algo->id | hwdep.struct->id, 		*/
 			/* for registered values see below		*/
 	unsigned int class;
+	unsigned int flags;		/* div., see below		*/
 	struct i2c_algorithm *algo;/* the algorithm to access the bus	*/
 	void *algo_data;
 
@@ -290,6 +291,9 @@ static inline void i2c_set_adapdata (str
 #define I2C_CLIENT_TEN	0x10			/* we have a ten bit chip address	*/
 						/* Must equal I2C_M_TEN below */
 
+/*flags for the adapter struct: */
+#define I2C_ADAPTER_SKIP_PROBE		0x01	/* Don't probe for devices */
+
 /* i2c adapter classes (bitmask) */
 #define I2C_CLASS_HWMON		(1<<0)	/* lm_sensors, ... */
 #define I2C_CLASS_TV_ANALOG	(1<<1)	/* bttv + friends */

  parent reply	other threads:[~2005-08-15 17:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-15 17:51 [PATCH 0/5] improve i2c probing Nathan Lutchansky
2005-08-15 17:52 ` [PATCH 1/5] call i2c_probe from i2c core Nathan Lutchansky
2005-08-15 21:55   ` Jean Delvare
2005-08-16  3:14     ` Nathan Lutchansky
2005-08-16 12:13       ` Jean Delvare
2005-08-15 17:53 ` [PATCH 2/5] remove attach_adapter from i2c hwmon drivers Nathan Lutchansky
2005-08-15 22:00   ` Jean Delvare
2005-08-15 17:54 ` [PATCH 3/5] remove attach_adapter from misc i2c chip drivers Nathan Lutchansky
2005-08-15 17:54 ` [PATCH 4/5] add i2c_probe_device and i2c_remove_device Nathan Lutchansky
2005-08-15 22:14   ` Jean Delvare
2005-08-16  3:33     ` Nathan Lutchansky
2005-08-16 16:38       ` Jean Delvare
2005-08-15 17:55 ` Nathan Lutchansky [this message]
2005-08-15 21:39 ` [PATCH 0/5] improve i2c probing Jean Delvare
2005-08-16  3:05   ` Nathan Lutchansky
2005-08-16 20:30     ` Jean Delvare
2005-08-18 18:54 ` Greg KH
2005-08-20  0:11   ` Nathan Lutchansky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050815175505.GF24959@litech.org \
    --to=lutchann@litech.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox