mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Jean Delvare <khali@linux-fr.org>
Cc: linux-kernel@vger.kernel.org
Subject: [patch 2.6.18-git] i2c/tps65010, update for current i2c-omap
Date: Thu, 28 Sep 2006 23:28:09 -0700	[thread overview]
Message-ID: <200609282328.09871.david-b@pacbell.net> (raw)

This updates the TPS6501x driver to stop trying to use the faked-out
I2C probe protocol (never guaranteed to work), since the OMAP I2C
driver merged to kernel.org no longer tries to support it.

Until the I2C stack is updated to offer full driver model support from
static board-specific device tables, and is able to pass things like
IRQ resources and chip IDs, the only way to address this type of issue
is for drivers to have board-specific info kick in before registering
the driver (for addressing), and in the probe code (for other resources).
So that's what this patch adds.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>

------
please merge for 2.6.18-rc ...

--- osk.orig/drivers/i2c/chips/tps65010.c	2006-09-28 19:27:51.000000000 -0700
+++ osk/drivers/i2c/chips/tps65010.c	2006-09-28 21:06:10.000000000 -0700
@@ -42,15 +42,38 @@
 
 /*-------------------------------------------------------------------------*/
 
-#define	DRIVER_VERSION	"2 May 2005"
+#define	DRIVER_VERSION	"28 Sept 2006"
 #define	DRIVER_NAME	(tps65010_driver.driver.name)
 
 MODULE_DESCRIPTION("TPS6501x Power Management Driver");
 MODULE_LICENSE("GPL");
 
-static unsigned short normal_i2c[] = { 0x48, /* 0x49, */ I2C_CLIENT_END };
 
-I2C_CLIENT_INSMOD;
+/* The i2c-omap driver doesn't support the i2c request used to fake probes,
+ * so we need board-specific tables saying what devices exist.
+ *
+ * Until the I2C stack doesn't support such tables, we need to fake them
+ * in the module initialization code (and in driver init for IRQs etc).
+ *
+ * Note we expect only ONE tps chip per board; no point in having more.
+ */
+
+static unsigned short force[3] __devinitdata = {
+	0, 0x48,		/* default address */
+	I2C_CLIENT_END,
+};
+static unsigned short *forces[] __devinitdata = { force, NULL, };
+
+static unsigned short ignore[] __devinitdata = {
+	I2C_CLIENT_END, I2C_CLIENT_END,
+};
+
+static struct i2c_client_address_data addr_data __devinitdata = {
+	.forces		= forces,
+	.probe		= ignore,
+	.normal_i2c	= ignore,
+	.ignore		= ignore,
+};
 
 static struct i2c_driver tps65010_driver;
 
@@ -990,6 +1013,15 @@ static int __init tps_init(void)
 	u32	tries = 3;
 	int	status = -ENODEV;
 
+#ifdef	CONFIG_ARM
+	if (machine_is_omap_osk()
+			|| machine_is_omap_h2()
+			|| machine_is_omap_h3())
+		/* ok */ ;
+	else
+		return status;
+#endif
+
 	printk(KERN_INFO "%s: version %s\n", DRIVER_NAME, DRIVER_VERSION);
 
 	/* some boards have startup glitches */

                 reply	other threads:[~2006-09-29  6:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200609282328.09871.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@vger.kernel.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

Powered by JetHome