From ff179c8cf5caa17bf3d407edbb5872aa2eee6900 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 26 Nov 2005 20:24:59 +0100 Subject: [PATCH] i2c: Drop i2c_driver.flags, 1 of 3 The I2C_DF_DUMMY flag is gone since 2.5.70, it's about time to drop all ifdef'd out references thereto. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 5e19a7ba69b..0316ba1294c 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -252,11 +252,6 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data) /*flags for the driver struct: */ #define I2C_DF_NOTIFY 0x01 /* notify on bus (de/a)ttaches */ -#if 0 -/* this flag is gone -- there is a (optional) driver->detach_adapter - * callback now which can be used instead */ -# define I2C_DF_DUMMY 0x02 -#endif /*flags for the client struct: */ #define I2C_CLIENT_ALLOW_USE 0x01 /* Client allows access */ -- cgit v1.2.3 From 8a9947552d43b0d20d5fa23ac0ba435d526be454 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 26 Nov 2005 20:28:06 +0100 Subject: [PATCH] i2c: Drop i2c_driver.flags, 2 of 3 Just about every i2c chip driver sets the I2C_DF_NOTIFY flag, so we can simply make it the default and drop the flag. If any driver really doesn't want to be notified when i2c adapters are added, that driver can simply omit to set .attach_adapter. This approach is also more robust as it prevents accidental NULL pointer dereferences. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 0316ba1294c..99399fadf13 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -251,7 +251,6 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data) } /*flags for the driver struct: */ -#define I2C_DF_NOTIFY 0x01 /* notify on bus (de/a)ttaches */ /*flags for the client struct: */ #define I2C_CLIENT_ALLOW_USE 0x01 /* Client allows access */ -- cgit v1.2.3 From 5d7b851dcced3611e4a4432308618b1ed1a9fc31 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 27 Nov 2005 08:57:10 +0100 Subject: [PATCH] i2c: Drop i2c_driver.flags, 3 of 3 The flags member of the i2c_driver structure is no more used. Drop it. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 99399fadf13..3c16a8fb95f 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -112,7 +112,6 @@ struct i2c_driver { char name[32]; int id; unsigned int class; - unsigned int flags; /* div., see below */ /* Notifies the driver that a new bus has appeared. This routine * can be used by the driver to test if the bus meets its conditions @@ -250,8 +249,6 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data) dev_set_drvdata (&dev->dev, data); } -/*flags for the driver struct: */ - /*flags for the client struct: */ #define I2C_CLIENT_ALLOW_USE 0x01 /* Client allows access */ #define I2C_CLIENT_ALLOW_MULTIPLE_USE 0x02 /* Allow multiple access-locks */ -- cgit v1.2.3 From cb748fb20186d4b345c68a7f580429f379fdd268 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 26 Nov 2005 20:58:35 +0100 Subject: [PATCH] i2c: Rework client usage count, 1 of 3 No i2c client uses the I2C_CLIENT_ALLOW_MULTIPLE_USE flag, drop it. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 3c16a8fb95f..4487c518974 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -251,8 +251,6 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data) /*flags for the client struct: */ #define I2C_CLIENT_ALLOW_USE 0x01 /* Client allows access */ -#define I2C_CLIENT_ALLOW_MULTIPLE_USE 0x02 /* Allow multiple access-locks */ - /* on an i2c_client */ #define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */ #define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */ /* Must equal I2C_M_TEN below */ -- cgit v1.2.3 From cde7859bda0d1124392b44e50aa11df99707e1d9 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 26 Nov 2005 21:00:54 +0100 Subject: [PATCH] i2c: Rework client usage count, 2 of 3 Make I2C_CLIENT_ALLOW_USE the default for all i2c clients. It doesn't hurt if the usage count is actually never used for any given driver, and allows for nice code simplifications in i2c-core. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 4487c518974..8b4d4695de0 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -250,7 +250,6 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data) } /*flags for the client struct: */ -#define I2C_CLIENT_ALLOW_USE 0x01 /* Client allows access */ #define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */ #define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */ /* Must equal I2C_M_TEN below */ -- cgit v1.2.3 From cf02df770228350254251fde520007a2709db785 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 26 Nov 2005 21:03:41 +0100 Subject: [PATCH] i2c: Rework client usage count, 3 of 3 Do not limit the usage count of i2c clients to 1. In other words, change the client usage count behavior from the old I2C_CLIENT_ALLOW_USE to the old I2C_CLIENT_ALLOW_MULTIPLE_USE. The rationale is that no driver actually needs the limiting behavior, and the unlimiting behavior is slightly easier to implement. Update the documentation to reflect this change. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 8b4d4695de0..85c517a9b05 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -307,9 +307,7 @@ extern struct i2c_client *i2c_get_client(int driver_id, int adapter_id, extern struct i2c_client *i2c_get_client(int,int,struct i2c_client *); to make sure that client-struct is valid and that it is okay to access the i2c-client. - returns -EACCES if client doesn't allow use (default) - returns -EBUSY if client doesn't allow multiple use (default) and - usage_count >0 */ + returns -ENODEV if client has gone in the meantime */ extern int i2c_use_client(struct i2c_client *); extern int i2c_release_client(struct i2c_client *); -- cgit v1.2.3 From 482c788ded0aa9710722eaf9cf60886d3b923218 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 26 Nov 2005 21:06:08 +0100 Subject: [PATCH] i2c: i2c_get_client is gone The i2c_get_client function doesn't exist anymore, so we shouldn't have a definition for it in i2c.h. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 85c517a9b05..a9cea62fd48 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -296,17 +296,8 @@ extern int i2c_del_driver(struct i2c_driver *); extern int i2c_attach_client(struct i2c_client *); extern int i2c_detach_client(struct i2c_client *); -/* New function: This is to get an i2c_client-struct for controlling the - client either by using i2c_control-function or having the - client-module export functions that can be used with the i2c_client - -struct. */ -extern struct i2c_client *i2c_get_client(int driver_id, int adapter_id, - struct i2c_client *prev); - -/* Should be used with new function - extern struct i2c_client *i2c_get_client(int,int,struct i2c_client *); - to make sure that client-struct is valid and that it is okay to access - the i2c-client. +/* Should be used to make sure that client-struct is valid and that it + is okay to access the i2c-client. returns -ENODEV if client has gone in the meantime */ extern int i2c_use_client(struct i2c_client *); extern int i2c_release_client(struct i2c_client *); -- cgit v1.2.3 From 35d8b2e6b8e86b0d5126f36613b5202d4eb978b6 Mon Sep 17 00:00:00 2001 From: Laurent Riffard Date: Sat, 26 Nov 2005 20:34:05 +0100 Subject: [PATCH] i2c: Drop i2c_driver.{owner,name}, 1 of 11 We should use the i2c_driver.driver's .name and .owner fields instead of the i2c_driver's ones. This patch updates the core of the i2c drivers: it removes .name and .owner fields from the struct i2c_device and modify various functions to use struct device fields instead. Signed-off-by: Laurent Riffard Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index a9cea62fd48..75aa18e865d 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -105,11 +105,12 @@ extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, * A driver is capable of handling one or more physical devices present on * I2C adapters. This information is used to inform the driver of adapter * events. + * + * The driver.owner field should be set to the module owner of this driver. + * The driver.name field should be set to the name of this driver. */ struct i2c_driver { - struct module *owner; - char name[32]; int id; unsigned int class; -- cgit v1.2.3 From 604f28e2b8d34cbaf08f0351374645f161335a82 Mon Sep 17 00:00:00 2001 From: Laurent Riffard Date: Sat, 26 Nov 2005 20:43:39 +0100 Subject: [PATCH] i2c: Drop i2c_driver.{owner,name}, 5 of 11 We should use the i2c_driver.driver's .name and .owner fields instead of the i2c_driver's ones. This patch updates the drivers/media/video and usb/media drivers. Signed-off-by: Laurent Riffard Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/media/tuner.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/media/tuner.h b/include/media/tuner.h index faa0f8e3091..b37cde60669 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h @@ -218,14 +218,15 @@ extern int default_tuner_init(struct i2c_client *c); extern int tea5767_autodetection(struct i2c_client *c); #define tuner_warn(fmt, arg...) do {\ - printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->name, \ + printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) #define tuner_info(fmt, arg...) do {\ - printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->name, \ + printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) #define tuner_dbg(fmt, arg...) do {\ if (tuner_debug) \ - printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->name, \ + printk(KERN_DEBUG "%s %d-%04x: " fmt, \ + t->i2c.driver->driver.name, \ t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) #endif /* __KERNEL__ */ -- cgit v1.2.3 From de59cf9ed44f64991e52a9de6094729537f0420c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 6 Dec 2005 15:33:15 -0800 Subject: [PATCH] I2C: Make i2c_add_driver automatically set the proper module owner This prevents i2c drivers from messing up and forgetting to set the module owner of their driver. It also reduces the size of their drivers by one line :) Signed-off-by: Greg Kroah-Hartman Cc: Jean Delvare --- include/linux/i2c.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 75aa18e865d..7863a59bd59 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -291,9 +291,14 @@ struct i2c_client_address_data { extern int i2c_add_adapter(struct i2c_adapter *); extern int i2c_del_adapter(struct i2c_adapter *); -extern int i2c_add_driver(struct i2c_driver *); +extern int i2c_register_driver(struct module *, struct i2c_driver *); extern int i2c_del_driver(struct i2c_driver *); +static inline int i2c_add_driver(struct i2c_driver *driver) +{ + return i2c_register_driver(THIS_MODULE, driver); +} + extern int i2c_attach_client(struct i2c_client *); extern int i2c_detach_client(struct i2c_client *); -- cgit v1.2.3 From 734a12a36676ad3b9418fa5a829c518afec02b8a Mon Sep 17 00:00:00 2001 From: Rudolf Marek Date: Sun, 18 Dec 2005 16:36:52 +0100 Subject: [PATCH] hwmon: add VRM/VID support for some VIA CPUs This patch adds the VIA CENTAUR CPUs to detection table. Table was updated to treat future Intel x86 CPUs as VRD10. Stepping field was added, because some VIA CPUs have different VRM specs across stepping. I changed the vrm type to u8 because all drivers use u8 anyway. Signed-off-by: Rudolf Marek Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/hwmon-vid.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/hwmon-vid.h b/include/linux/hwmon-vid.h index cd4b7a042b8..f346e4d5381 100644 --- a/include/linux/hwmon-vid.h +++ b/include/linux/hwmon-vid.h @@ -23,14 +23,14 @@ #ifndef _LINUX_HWMON_VID_H #define _LINUX_HWMON_VID_H -int vid_from_reg(int val, int vrm); -int vid_which_vrm(void); +int vid_from_reg(int val, u8 vrm); +u8 vid_which_vrm(void); /* vrm is the VRM/VRD document version multiplied by 10. val is in mV to avoid floating point in the kernel. Returned value is the 4-, 5- or 6-bit VID code. Note that only VRM 9.x is supported for now. */ -static inline int vid_to_reg(int val, int vrm) +static inline int vid_to_reg(int val, u8 vrm) { switch (vrm) { case 91: /* VRM 9.1 */ -- cgit v1.2.3 From 04b4b8434a92b9ef127985113c0bd961957778b7 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 18 Dec 2005 16:42:35 +0100 Subject: [PATCH] i2c: driver ID list cleanups Cleanups to i2c driver ID list: * Remove mostly bogus comments about driver ID ranges. * Drop experimental driver IDs, as the concept is pretty broken. * Drop now unused IDs of non-I2C (ISA) drivers. * Drop a few more IDs which are no more used. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c-id.h | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'include') diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 006c81ef4d5..fb46f8d5699 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h @@ -25,12 +25,6 @@ /* * ---- Driver types ----------------------------------------------------- - * device id name + number function description, i2c address(es) - * - * Range 1000-1999 range is defined in sensors/sensors.h - * Range 0x100 - 0x1ff is for V4L2 Common Components - * Range 0xf000 - 0xffff is reserved for local experimentation, and should - * never be used in official drivers */ #define I2C_DRIVERID_MSP3400 1 @@ -110,13 +104,7 @@ #define I2C_DRIVERID_AKITAIOEXP 74 /* IO Expander on Sharp SL-C1000 */ #define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */ -#define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */ -#define I2C_DRIVERID_EXP1 0xF1 -#define I2C_DRIVERID_EXP2 0xF2 -#define I2C_DRIVERID_EXP3 0xF3 - #define I2C_DRIVERID_I2CDEV 900 -#define I2C_DRIVERID_I2CPROC 901 #define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ #define I2C_DRIVERID_ALERT 903 /* SMBus Alert Responder Client */ @@ -131,15 +119,12 @@ #define I2C_DRIVERID_ADM1021 1008 #define I2C_DRIVERID_ADM9240 1009 #define I2C_DRIVERID_LTC1710 1010 -#define I2C_DRIVERID_SIS5595 1011 #define I2C_DRIVERID_ICSPLL 1012 #define I2C_DRIVERID_BT869 1013 #define I2C_DRIVERID_MAXILIFE 1014 #define I2C_DRIVERID_MATORB 1015 #define I2C_DRIVERID_GL520 1016 #define I2C_DRIVERID_THMC50 1017 -#define I2C_DRIVERID_DDCMON 1018 -#define I2C_DRIVERID_VIA686A 1019 #define I2C_DRIVERID_ADM1025 1020 #define I2C_DRIVERID_LM87 1021 #define I2C_DRIVERID_PCF8574 1022 @@ -151,21 +136,16 @@ #define I2C_DRIVERID_FSCPOS 1028 #define I2C_DRIVERID_FSCSCY 1029 #define I2C_DRIVERID_PCF8591 1030 -#define I2C_DRIVERID_SMSC47M1 1031 -#define I2C_DRIVERID_VT1211 1032 #define I2C_DRIVERID_LM92 1033 -#define I2C_DRIVERID_VT8231 1034 #define I2C_DRIVERID_SMARTBATT 1035 #define I2C_DRIVERID_BMCSENSORS 1036 #define I2C_DRIVERID_FS451 1037 -#define I2C_DRIVERID_W83627HF 1038 #define I2C_DRIVERID_LM85 1039 #define I2C_DRIVERID_LM83 1040 #define I2C_DRIVERID_LM90 1042 #define I2C_DRIVERID_ASB100 1043 #define I2C_DRIVERID_FSCHER 1046 #define I2C_DRIVERID_W83L785TS 1047 -#define I2C_DRIVERID_SMSC47B397 1050 /* * ---- Adapter types ---------------------------------------------------- -- cgit v1.2.3 From 7c72ccf09b6debe55b8e049377ad3183ed4f4cb3 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 18 Dec 2005 17:25:18 +0100 Subject: [PATCH] i2c: i2c-nforce2 add nforce4 MCP-04 device ID One more supported PCI ID for the i2c-nforce2 driver. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/pci_ids.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 4f01710485c..96a0403f61f 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -976,6 +976,7 @@ #define PCI_DEVICE_ID_NVIDIA_TNT_UNKNOWN 0x002a #define PCI_DEVICE_ID_NVIDIA_VTNT2 0x002C #define PCI_DEVICE_ID_NVIDIA_UVTNT2 0x002D +#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SMBUS 0x0034 #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE 0x0035 #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA 0x0036 #define PCI_DEVICE_ID_NVIDIA_NVENET_10 0x0037 -- cgit v1.2.3