public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][2.6] Add command function to struct i2c_adapter
@ 2004-09-20 17:19 Michael Hunold
  2004-09-21 15:41 ` Greg KH
  0 siblings, 1 reply; 33+ messages in thread
From: Michael Hunold @ 2004-09-20 17:19 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Greg KH, Andrew Morton, Linus Torvalds

[-- Attachment #1: Type: text/plain, Size: 1096 bytes --]

Hi there,

the attached patch adds a command function to struct i2c_adapter, 
similar to the command function that is already there for struct i2c_client.

The reason behind this is as follows:
In the DVB subsystem, the tuners are accessed via normal kernel i2c 
drivers. One big problem is, that tuners can be wired very differently 
depending on the surrounding hardware. Currently, we need to keep 
specific settings which are unique to a hardware design in the 
independent i2c tuner driver. This is both very ugly and makes it 
impossible to support DVB drivers which are not in the official Linux 
kernel tree, but could otherwise use in-kernel frontend driver.

If the struct i2c_adapter has a command function, it would be possible 
to get additional informations from the adapter in the i2c client's 
attach_adapter() function *before* probing the device and guessing 
things like i2c addresses or other hardware settings.

This patch is non-intrusive. It doesn't affect any current drivers, but 
only future developments.

Are there any objections against this patch?

Regards
Michael.

[-- Attachment #2: i2c-add-command.diff --]
[-- Type: text/plain, Size: 633 bytes --]

diff -ura linux-2.6.9-rc2-mm1/include/linux/i2c.h b/include/linux/i2c.h
--- linux-2.6.9-rc2-mm1/include/linux/i2c.h	2004-09-20 12:38:24.000000000 +0200
+++ b/include/linux/i2c.h	2004-09-20 18:53:32.000000000 +0200
@@ -231,6 +231,11 @@
 	struct i2c_algorithm *algo;/* the algorithm to access the bus	*/
 	void *algo_data;
 
+	/* a ioctl like command that can be used to perform specific functions
+	 * with the adapter.
+	 */
+	int (*command)(struct i2c_adapter *adapter, unsigned int cmd, void *arg);
+
 	/* --- administration stuff. */
 	int (*client_register)(struct i2c_client *);
 	int (*client_unregister)(struct i2c_client *);

^ permalink raw reply	[flat|nested] 33+ messages in thread
[parent not found: <41500BED.8090607@linuxtv.org>]

end of thread, other threads:[~2004-10-01 23:47 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-20 17:19 [PATCH][2.6] Add command function to struct i2c_adapter Michael Hunold
2004-09-21 15:41 ` Greg KH
2004-09-21 17:10   ` Michael Hunold
2004-09-21 17:39     ` Jon Smirl
2004-09-21 18:05       ` Michael Hunold
2004-09-22  8:56         ` Adrian Cox
2004-09-22 12:08           ` Jean Delvare
2004-09-22 11:54             ` Adrian Cox
2004-09-22 13:38               ` Jean Delvare
2004-09-22 13:13                 ` Adrian Cox
2004-09-22 15:40                 ` Jon Smirl
2004-09-22 15:56                   ` Adrian Cox
2004-09-22 16:07                     ` Jon Smirl
2004-09-22 16:51                       ` Adrian Cox
2004-09-22 17:17                         ` Jon Smirl
2004-09-22 18:55                         ` Jean Delvare
2004-09-22 18:32                 ` Adrian Cox
2004-09-22 20:04                   ` Mark M. Hoffman
2004-09-23  7:41                   ` Michael Hunold
2004-09-23  7:48                   ` Michael Hunold
2004-09-23  7:09               ` Michael Hunold
2004-09-23 20:18                 ` Adrian Cox
2004-09-21 20:33       ` Jean Delvare
2004-09-21 21:02         ` Jon Smirl
2004-09-24 17:06   ` Michael Hunold
2004-09-24 18:05     ` Jean Delvare
2004-09-24 20:21       ` Michael Hunold
2004-10-01  6:52         ` Greg KH
2004-10-01 12:22           ` Adrian Cox
2004-10-01 13:57             ` Jean Delvare
2004-10-01 23:41             ` Greg KH
     [not found] <41500BED.8090607@linuxtv.org>
2004-09-21 13:28 ` Jean Delvare
2004-09-21 14:38   ` Michael Hunold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox