Commit 0c8a2f9d authored by Jean Delvare's avatar Jean Delvare Committed by Deepak Saxena

[PATCH] I2C: Rename hardware monitoring I2C class

Quoting myself:

> Mmm, I once proposed that I2C_ADAP_CLASS_SMBUS would be better renamed
> I2C_ADAP_CLASS_SENSORS (so I2C_CLASS_SENSORS now). What about that? I
> think it would be great to embed that change into your patch, so that
> the name changes only once.
>
> BTW, if HWMON is prefered to SENSORS, this is fine with me too, I
> have no strong preference.

Below is a patch that does that. I finally went for HWMON. Yes, it's
big, but it's actually nothing more than
s/I2C_CLASS_SMBUS/I2C_CLASS_HWMON/ (thanks perl -wip :)).
parent ebd5b5d9
...@@ -62,9 +62,9 @@ Technical changes: ...@@ -62,9 +62,9 @@ Technical changes:
patch to the Documentation/i2c/sysfs-interface file. patch to the Documentation/i2c/sysfs-interface file.
* [Attach] For I2C drivers, the attach function should make sure * [Attach] For I2C drivers, the attach function should make sure
that the adapter's class has I2C_CLASS_SMBUS, using the that the adapter's class has I2C_CLASS_HWMON, using the
following construct: following construct:
if (!(adapter->class & I2C_CLASS_SMBUS)) if (!(adapter->class & I2C_CLASS_HWMON))
return 0; return 0;
ISA-only drivers of course don't need this. ISA-only drivers of course don't need this.
......
...@@ -480,7 +480,7 @@ static struct i2c_algorithm smbus_algorithm = { ...@@ -480,7 +480,7 @@ static struct i2c_algorithm smbus_algorithm = {
static struct i2c_adapter ali1535_adapter = { static struct i2c_adapter ali1535_adapter = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.class = I2C_CLASS_SMBUS, .class = I2C_CLASS_HWMON,
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
.name = "unset", .name = "unset",
}; };
......
...@@ -357,7 +357,7 @@ static struct i2c_algorithm ali1563_algorithm = { ...@@ -357,7 +357,7 @@ static struct i2c_algorithm ali1563_algorithm = {
static struct i2c_adapter ali1563_adapter = { static struct i2c_adapter ali1563_adapter = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.class = I2C_CLASS_SMBUS, .class = I2C_CLASS_HWMON,
.algo = &ali1563_algorithm, .algo = &ali1563_algorithm,
}; };
......
...@@ -470,7 +470,7 @@ static struct i2c_algorithm smbus_algorithm = { ...@@ -470,7 +470,7 @@ static struct i2c_algorithm smbus_algorithm = {
static struct i2c_adapter ali15x3_adapter = { static struct i2c_adapter ali15x3_adapter = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.class = I2C_CLASS_SMBUS, .class = I2C_CLASS_HWMON,
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
.name = "unset", .name = "unset",
}; };
......
...@@ -303,7 +303,7 @@ static struct i2c_algorithm smbus_algorithm = { ...@@ -303,7 +303,7 @@ static struct i2c_algorithm smbus_algorithm = {
static struct i2c_adapter amd756_adapter = { static struct i2c_adapter amd756_adapter = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.class = I2C_CLASS_SMBUS, .class = I2C_CLASS_HWMON,
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
.name = "unset", .name = "unset",
}; };
......
...@@ -359,7 +359,7 @@ static int __devinit amd8111_probe(struct pci_dev *dev, const struct pci_device_ ...@@ -359,7 +359,7 @@ static int __devinit amd8111_probe(struct pci_dev *dev, const struct pci_device_
smbus->adapter.owner = THIS_MODULE; smbus->adapter.owner = THIS_MODULE;
snprintf(smbus->adapter.name, I2C_NAME_SIZE, snprintf(smbus->adapter.name, I2C_NAME_SIZE,
"SMBus2 AMD8111 adapter at %04x", smbus->base); "SMBus2 AMD8111 adapter at %04x", smbus->base);
smbus->adapter.class = I2C_CLASS_SMBUS; smbus->adapter.class = I2C_CLASS_HWMON;
smbus->adapter.algo = &smbus_algorithm; smbus->adapter.algo = &smbus_algorithm;
smbus->adapter.algo_data = smbus; smbus->adapter.algo_data = smbus;
......
...@@ -539,7 +539,7 @@ static struct i2c_algorithm smbus_algorithm = { ...@@ -539,7 +539,7 @@ static struct i2c_algorithm smbus_algorithm = {
static struct i2c_adapter i801_adapter = { static struct i2c_adapter i801_adapter = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.class = I2C_CLASS_SMBUS, .class = I2C_CLASS_HWMON,
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
.name = "unset", .name = "unset",
}; };
......
...@@ -43,7 +43,7 @@ static struct i2c_algorithm isa_algorithm = { ...@@ -43,7 +43,7 @@ static struct i2c_algorithm isa_algorithm = {
/* There can only be one... */ /* There can only be one... */
static struct i2c_adapter isa_adapter = { static struct i2c_adapter isa_adapter = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.class = I2C_CLASS_SMBUS, .class = I2C_CLASS_HWMON,
.algo = &isa_algorithm, .algo = &isa_algorithm,
.name = "ISA main adapter", .name = "ISA main adapter",
}; };
......
...@@ -119,7 +119,7 @@ static struct i2c_algorithm smbus_algorithm = { ...@@ -119,7 +119,7 @@ static struct i2c_algorithm smbus_algorithm = {
static struct i2c_adapter nforce2_adapter = { static struct i2c_adapter nforce2_adapter = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.class = I2C_CLASS_SMBUS, .class = I2C_CLASS_HWMON,
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
.name = "unset", .name = "unset",
}; };
......
...@@ -112,7 +112,7 @@ static struct i2c_algo_bit_data parport_algo_data = { ...@@ -112,7 +112,7 @@ static struct i2c_algo_bit_data parport_algo_data = {
static struct i2c_adapter parport_adapter = { static struct i2c_adapter parport_adapter = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.class = I2C_CLASS_SMBUS, .class = I2C_CLASS_HWMON,
.id = I2C_HW_B_LP, .id = I2C_HW_B_LP,
.algo_data = &parport_algo_data, .algo_data = &parport_algo_data,
.name = "Parallel port adapter (light)", .name = "Parallel port adapter (light)",
......
...@@ -147,7 +147,7 @@ static struct i2c_algo_bit_data parport_algo_data = { ...@@ -147,7 +147,7 @@ static struct i2c_algo_bit_data parport_algo_data = {
static struct i2c_adapter parport_adapter = { static struct i2c_adapter parport_adapter = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.class = I2C_CLASS_SMBUS, .class = I2C_CLASS_HWMON,
.id = I2C_HW_B_LP, .id = I2C_HW_B_LP,
.name = "Parallel port adapter", .name = "Parallel port adapter",
}; };
......
...@@ -409,7 +409,7 @@ static struct i2c_algorithm smbus_algorithm = { ...@@ -409,7 +409,7 @@ static struct i2c_algorithm smbus_algorithm = {
static struct i2c_adapter piix4_adapter = { static struct i2c_adapter piix4_adapter = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.class = I2C_CLASS_SMBUS, .class = I2C_CLASS_HWMON,
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
.name = "unset", .name = "unset",
}; };
......
...@@ -360,7 +360,7 @@ static struct i2c_algorithm smbus_algorithm = { ...@@ -360,7 +360,7 @@ static struct i2c_algorithm smbus_algorithm = {
static struct i2c_adapter sis5595_adapter = { static struct i2c_adapter sis5595_adapter = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.class = I2C_CLASS_SMBUS, .class = I2C_CLASS_HWMON,
.name = "unset", .name = "unset",
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
}; };
......
...@@ -456,7 +456,7 @@ static struct i2c_algorithm smbus_algorithm = { ...@@ -456,7 +456,7 @@ static struct i2c_algorithm smbus_algorithm = {
static struct i2c_adapter sis630_adapter = { static struct i2c_adapter sis630_adapter = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.class = I2C_CLASS_SMBUS, .class = I2C_CLASS_HWMON,
.name = "unset", .name = "unset",
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
}; };
......
...@@ -260,7 +260,7 @@ static struct i2c_algorithm smbus_algorithm = { ...@@ -260,7 +260,7 @@ static struct i2c_algorithm smbus_algorithm = {
static struct i2c_adapter sis96x_adapter = { static struct i2c_adapter sis96x_adapter = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.class = I2C_CLASS_SMBUS, .class = I2C_CLASS_HWMON,
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
.name = "unset", .name = "unset",
}; };
......
...@@ -88,7 +88,7 @@ static struct i2c_algo_bit_data bit_data = { ...@@ -88,7 +88,7 @@ static struct i2c_algo_bit_data bit_data = {
static struct i2c_adapter vt586b_adapter = { static struct i2c_adapter vt586b_adapter = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.class = I2C_CLASS_SMBUS, .class = I2C_CLASS_HWMON,
.name = "VIA i2c", .name = "VIA i2c",
.algo_data = &bit_data, .algo_data = &bit_data,
}; };
......
...@@ -289,7 +289,7 @@ static struct i2c_algorithm smbus_algorithm = { ...@@ -289,7 +289,7 @@ static struct i2c_algorithm smbus_algorithm = {
static struct i2c_adapter vt596_adapter = { static struct i2c_adapter vt596_adapter = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.class = I2C_CLASS_SMBUS, .class = I2C_CLASS_HWMON,
.algo = &smbus_algorithm, .algo = &smbus_algorithm,
.name = "unset", .name = "unset",
}; };
......
...@@ -200,7 +200,7 @@ static DEVICE_ATTR(die_code, S_IRUGO, show_die_code, NULL); ...@@ -200,7 +200,7 @@ static DEVICE_ATTR(die_code, S_IRUGO, show_die_code, NULL);
static int adm1021_attach_adapter(struct i2c_adapter *adapter) static int adm1021_attach_adapter(struct i2c_adapter *adapter)
{ {
if (!(adapter->class & I2C_CLASS_SMBUS)) if (!(adapter->class & I2C_CLASS_HWMON))
return 0; return 0;
return i2c_detect(adapter, &addr_data, adm1021_detect); return i2c_detect(adapter, &addr_data, adm1021_detect);
} }
......
...@@ -609,7 +609,7 @@ static DEVICE_ATTR(fan1_pwm_enable, S_IRUGO | S_IWUSR, ...@@ -609,7 +609,7 @@ static DEVICE_ATTR(fan1_pwm_enable, S_IRUGO | S_IWUSR,
*/ */
static int asb100_attach_adapter(struct i2c_adapter *adapter) static int asb100_attach_adapter(struct i2c_adapter *adapter)
{ {
if (!(adapter->class & I2C_CLASS_SMBUS)) if (!(adapter->class & I2C_CLASS_HWMON))
return 0; return 0;
return i2c_detect(adapter, &addr_data, asb100_detect); return i2c_detect(adapter, &addr_data, asb100_detect);
} }
......
...@@ -293,7 +293,7 @@ do { \ ...@@ -293,7 +293,7 @@ do { \
static int fscher_attach_adapter(struct i2c_adapter *adapter) static int fscher_attach_adapter(struct i2c_adapter *adapter)
{ {
if (!(adapter->class & I2C_CLASS_SMBUS)) if (!(adapter->class & I2C_CLASS_HWMON))
return 0; return 0;
return i2c_detect(adapter, &addr_data, fscher_detect); return i2c_detect(adapter, &addr_data, fscher_detect);
} }
......
...@@ -335,7 +335,7 @@ static DEVICE_ATTR(beep_mask, S_IWUSR|S_IRUGO, ...@@ -335,7 +335,7 @@ static DEVICE_ATTR(beep_mask, S_IWUSR|S_IRUGO,
static int gl518_attach_adapter(struct i2c_adapter *adapter) static int gl518_attach_adapter(struct i2c_adapter *adapter)
{ {
if (!(adapter->class & I2C_CLASS_SMBUS)) if (!(adapter->class & I2C_CLASS_HWMON))
return 0; return 0;
return i2c_detect(adapter, &addr_data, gl518_detect); return i2c_detect(adapter, &addr_data, gl518_detect);
} }
......
...@@ -500,7 +500,7 @@ static DEVICE_ATTR(alarms, S_IRUGO | S_IWUSR, show_alarms, NULL); ...@@ -500,7 +500,7 @@ static DEVICE_ATTR(alarms, S_IRUGO | S_IWUSR, show_alarms, NULL);
* when a new adapter is inserted (and it87_driver is still present) */ * when a new adapter is inserted (and it87_driver is still present) */
static int it87_attach_adapter(struct i2c_adapter *adapter) static int it87_attach_adapter(struct i2c_adapter *adapter)
{ {
if (!(adapter->class & I2C_CLASS_SMBUS)) if (!(adapter->class & I2C_CLASS_HWMON))
return 0; return 0;
return i2c_detect(adapter, &addr_data, it87_detect); return i2c_detect(adapter, &addr_data, it87_detect);
} }
......
...@@ -105,7 +105,7 @@ static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp_input, NULL); ...@@ -105,7 +105,7 @@ static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp_input, NULL);
static int lm75_attach_adapter(struct i2c_adapter *adapter) static int lm75_attach_adapter(struct i2c_adapter *adapter)
{ {
if (!(adapter->class & I2C_CLASS_SMBUS)) if (!(adapter->class & I2C_CLASS_HWMON))
return 0; return 0;
return i2c_detect(adapter, &addr_data, lm75_detect); return i2c_detect(adapter, &addr_data, lm75_detect);
} }
......
...@@ -488,7 +488,7 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); ...@@ -488,7 +488,7 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
* when a new adapter is inserted (and lm78_driver is still present) */ * when a new adapter is inserted (and lm78_driver is still present) */
static int lm78_attach_adapter(struct i2c_adapter *adapter) static int lm78_attach_adapter(struct i2c_adapter *adapter)
{ {
if (!(adapter->class & I2C_CLASS_SMBUS)) if (!(adapter->class & I2C_CLASS_HWMON))
return 0; return 0;
return i2c_detect(adapter, &addr_data, lm78_detect); return i2c_detect(adapter, &addr_data, lm78_detect);
} }
......
...@@ -376,7 +376,7 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); ...@@ -376,7 +376,7 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
static int lm80_attach_adapter(struct i2c_adapter *adapter) static int lm80_attach_adapter(struct i2c_adapter *adapter)
{ {
if (!(adapter->class & I2C_CLASS_SMBUS)) if (!(adapter->class & I2C_CLASS_HWMON))
return 0; return 0;
return i2c_detect(adapter, &addr_data, lm80_detect); return i2c_detect(adapter, &addr_data, lm80_detect);
} }
......
...@@ -216,7 +216,7 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); ...@@ -216,7 +216,7 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
static int lm83_attach_adapter(struct i2c_adapter *adapter) static int lm83_attach_adapter(struct i2c_adapter *adapter)
{ {
if (!(adapter->class & I2C_CLASS_SMBUS)) if (!(adapter->class & I2C_CLASS_HWMON))
return 0; return 0;
return i2c_detect(adapter, &addr_data, lm83_detect); return i2c_detect(adapter, &addr_data, lm83_detect);
} }
......
...@@ -274,7 +274,7 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); ...@@ -274,7 +274,7 @@ static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
static int lm90_attach_adapter(struct i2c_adapter *adapter) static int lm90_attach_adapter(struct i2c_adapter *adapter)
{ {
if (!(adapter->class & I2C_CLASS_SMBUS)) if (!(adapter->class & I2C_CLASS_HWMON))
return 0; return 0;
return i2c_detect(adapter, &addr_data, lm90_detect); return i2c_detect(adapter, &addr_data, lm90_detect);
} }
......
...@@ -573,7 +573,7 @@ static struct i2c_driver via686a_driver = { ...@@ -573,7 +573,7 @@ static struct i2c_driver via686a_driver = {
/* This is called when the module is loaded */ /* This is called when the module is loaded */
static int via686a_attach_adapter(struct i2c_adapter *adapter) static int via686a_attach_adapter(struct i2c_adapter *adapter)
{ {
if (!(adapter->class & I2C_CLASS_SMBUS)) if (!(adapter->class & I2C_CLASS_HWMON))
return 0; return 0;
return i2c_detect(adapter, &addr_data, via686a_detect); return i2c_detect(adapter, &addr_data, via686a_detect);
} }
......
...@@ -911,7 +911,7 @@ device_create_file(&client->dev, &dev_attr_rt##offset); \ ...@@ -911,7 +911,7 @@ device_create_file(&client->dev, &dev_attr_rt##offset); \
static int static int
w83781d_attach_adapter(struct i2c_adapter *adapter) w83781d_attach_adapter(struct i2c_adapter *adapter)
{ {
if (!(adapter->class & I2C_CLASS_SMBUS)) if (!(adapter->class & I2C_CLASS_HWMON))
return 0; return 0;
return i2c_detect(adapter, &addr_data, w83781d_detect); return i2c_detect(adapter, &addr_data, w83781d_detect);
} }
......
...@@ -145,7 +145,7 @@ static DEVICE_ATTR(temp1_max, S_IRUGO, show_temp_over, NULL) ...@@ -145,7 +145,7 @@ static DEVICE_ATTR(temp1_max, S_IRUGO, show_temp_over, NULL)
static int w83l785ts_attach_adapter(struct i2c_adapter *adapter) static int w83l785ts_attach_adapter(struct i2c_adapter *adapter)
{ {
if (!(adapter->class & I2C_CLASS_SMBUS)) if (!(adapter->class & I2C_CLASS_HWMON))
return 0; return 0;
return i2c_detect(adapter, &addr_data, w83l785ts_detect); return i2c_detect(adapter, &addr_data, w83l785ts_detect);
} }
......
...@@ -286,7 +286,7 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data) ...@@ -286,7 +286,7 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data)
/* Must equal I2C_M_TEN below */ /* Must equal I2C_M_TEN below */
/* i2c adapter classes (bitmask) */ /* i2c adapter classes (bitmask) */
#define I2C_CLASS_SMBUS (1<<0) /* lm_sensors, ... */ #define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */
#define I2C_CLASS_TV_ANALOG (1<<1) /* bttv + friends */ #define I2C_CLASS_TV_ANALOG (1<<1) /* bttv + friends */
#define I2C_CLASS_TV_DIGITAL (1<<2) /* dvb cards */ #define I2C_CLASS_TV_DIGITAL (1<<2) /* dvb cards */
#define I2C_CLASS_DDC (1<<3) /* i2c-matroxfb ? */ #define I2C_CLASS_DDC (1<<3) /* i2c-matroxfb ? */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment