Commit 20d9d9a0 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon patches from Guenter Roeck:
 - Fix crash in ad7314 driver
 - Add support for AMD Trinity CPUs to k10temp driver
 - Fix __initdata/__initconst mixup in w83627ehf driver
 - Fix runtime warnings in acpi_power_meter and max6639 drivers
 - Fix build warnings in adm1031, f75375s, sht15, and gpio-fan drivers

* tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (ad7314) Adds missing spi_dev initialization
  hwmon: (k10temp) Add support for AMD Trinity CPUs
  hwmon: (w83627ehf) mark const init data with __initconst instead of __initdata
  hwmon: (acpi_power_meter) fix lockdep spew due to non-static lock class
  hwmon: (adm1031) Fix compiler warning
  hwmon: (f75375s) Fix warning message seen in some configurations
  hwmon: (max6639) Convert to dev_pm_ops
  hwmon: (sht15) Fix Kconfig dependencies
  hwmon: (gpio-fan) Fix Kconfig dependencies
parents 7114a72f e16de913
...@@ -11,7 +11,7 @@ Supported chips: ...@@ -11,7 +11,7 @@ Supported chips:
Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra) Socket S1G2: Athlon (X2), Sempron (X2), Turion X2 (Ultra)
* AMD Family 12h processors: "Llano" (E2/A4/A6/A8-Series) * AMD Family 12h processors: "Llano" (E2/A4/A6/A8-Series)
* AMD Family 14h processors: "Brazos" (C/E/G/Z-Series) * AMD Family 14h processors: "Brazos" (C/E/G/Z-Series)
* AMD Family 15h processors: "Bulldozer" * AMD Family 15h processors: "Bulldozer" (FX-Series), "Trinity"
Prefix: 'k10temp' Prefix: 'k10temp'
Addresses scanned: PCI space Addresses scanned: PCI space
......
...@@ -253,7 +253,8 @@ config SENSORS_K10TEMP ...@@ -253,7 +253,8 @@ config SENSORS_K10TEMP
If you say yes here you get support for the temperature If you say yes here you get support for the temperature
sensor(s) inside your CPU. Supported are later revisions of sensor(s) inside your CPU. Supported are later revisions of
the AMD Family 10h and all revisions of the AMD Family 11h, the AMD Family 10h and all revisions of the AMD Family 11h,
12h (Llano), 14h (Brazos) and 15h (Bulldozer) microarchitectures. 12h (Llano), 14h (Brazos) and 15h (Bulldozer/Trinity)
microarchitectures.
This driver can also be built as a module. If so, the module This driver can also be built as a module. If so, the module
will be called k10temp. will be called k10temp.
...@@ -425,7 +426,7 @@ config SENSORS_GL520SM ...@@ -425,7 +426,7 @@ config SENSORS_GL520SM
config SENSORS_GPIO_FAN config SENSORS_GPIO_FAN
tristate "GPIO fan" tristate "GPIO fan"
depends on GENERIC_GPIO depends on GPIOLIB
help help
If you say yes here you get support for fans connected to GPIO lines. If you say yes here you get support for fans connected to GPIO lines.
...@@ -883,7 +884,7 @@ source drivers/hwmon/pmbus/Kconfig ...@@ -883,7 +884,7 @@ source drivers/hwmon/pmbus/Kconfig
config SENSORS_SHT15 config SENSORS_SHT15
tristate "Sensiron humidity and temperature sensors. SHT15 and compat." tristate "Sensiron humidity and temperature sensors. SHT15 and compat."
depends on GENERIC_GPIO depends on GPIOLIB
help help
If you say yes here you get support for the Sensiron SHT10, SHT11, If you say yes here you get support for the Sensiron SHT10, SHT11,
SHT15, SHT71, SHT75 humidity and temperature sensors. SHT15, SHT71, SHT75 humidity and temperature sensors.
......
...@@ -632,6 +632,7 @@ static int register_ro_attrs(struct acpi_power_meter_resource *resource, ...@@ -632,6 +632,7 @@ static int register_ro_attrs(struct acpi_power_meter_resource *resource,
sensors->dev_attr.show = ro->show; sensors->dev_attr.show = ro->show;
sensors->index = ro->index; sensors->index = ro->index;
sysfs_attr_init(&sensors->dev_attr.attr);
res = device_create_file(dev, &sensors->dev_attr); res = device_create_file(dev, &sensors->dev_attr);
if (res) { if (res) {
sensors->dev_attr.attr.name = NULL; sensors->dev_attr.attr.name = NULL;
...@@ -661,6 +662,7 @@ static int register_rw_attrs(struct acpi_power_meter_resource *resource, ...@@ -661,6 +662,7 @@ static int register_rw_attrs(struct acpi_power_meter_resource *resource,
sensors->dev_attr.store = rw->set; sensors->dev_attr.store = rw->set;
sensors->index = rw->index; sensors->index = rw->index;
sysfs_attr_init(&sensors->dev_attr.attr);
res = device_create_file(dev, &sensors->dev_attr); res = device_create_file(dev, &sensors->dev_attr);
if (res) { if (res) {
sensors->dev_attr.attr.name = NULL; sensors->dev_attr.attr.name = NULL;
......
...@@ -128,6 +128,7 @@ static int __devinit ad7314_probe(struct spi_device *spi_dev) ...@@ -128,6 +128,7 @@ static int __devinit ad7314_probe(struct spi_device *spi_dev)
ret = PTR_ERR(chip->hwmon_dev); ret = PTR_ERR(chip->hwmon_dev);
goto error_remove_group; goto error_remove_group;
} }
chip->spi_dev = spi_dev;
return 0; return 0;
error_remove_group: error_remove_group:
......
...@@ -233,18 +233,15 @@ static const auto_chan_table_t auto_channel_select_table_adm1030 = { ...@@ -233,18 +233,15 @@ static const auto_chan_table_t auto_channel_select_table_adm1030 = {
* nearest match if no exact match where found. * nearest match if no exact match where found.
*/ */
static int static int
get_fan_auto_nearest(struct adm1031_data *data, get_fan_auto_nearest(struct adm1031_data *data, int chan, u8 val, u8 reg)
int chan, u8 val, u8 reg, u8 *new_reg)
{ {
int i; int i;
int first_match = -1, exact_match = -1; int first_match = -1, exact_match = -1;
u8 other_reg_val = u8 other_reg_val =
(*data->chan_select_table)[FAN_CHAN_FROM_REG(reg)][chan ? 0 : 1]; (*data->chan_select_table)[FAN_CHAN_FROM_REG(reg)][chan ? 0 : 1];
if (val == 0) { if (val == 0)
*new_reg = 0;
return 0; return 0;
}
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
if ((val == (*data->chan_select_table)[i][chan]) && if ((val == (*data->chan_select_table)[i][chan]) &&
...@@ -264,13 +261,11 @@ get_fan_auto_nearest(struct adm1031_data *data, ...@@ -264,13 +261,11 @@ get_fan_auto_nearest(struct adm1031_data *data,
} }
if (exact_match >= 0) if (exact_match >= 0)
*new_reg = exact_match; return exact_match;
else if (first_match >= 0) else if (first_match >= 0)
*new_reg = first_match; return first_match;
else
return -EINVAL;
return 0; return -EINVAL;
} }
static ssize_t show_fan_auto_channel(struct device *dev, static ssize_t show_fan_auto_channel(struct device *dev,
...@@ -301,11 +296,12 @@ set_fan_auto_channel(struct device *dev, struct device_attribute *attr, ...@@ -301,11 +296,12 @@ set_fan_auto_channel(struct device *dev, struct device_attribute *attr,
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
ret = get_fan_auto_nearest(data, nr, val, data->conf1, &reg); ret = get_fan_auto_nearest(data, nr, val, data->conf1);
if (ret) { if (ret < 0) {
mutex_unlock(&data->update_lock); mutex_unlock(&data->update_lock);
return ret; return ret;
} }
reg = ret;
data->conf1 = FAN_CHAN_TO_REG(reg, data->conf1); data->conf1 = FAN_CHAN_TO_REG(reg, data->conf1);
if ((data->conf1 & ADM1031_CONF1_AUTO_MODE) ^ if ((data->conf1 & ADM1031_CONF1_AUTO_MODE) ^
(old_fan_mode & ADM1031_CONF1_AUTO_MODE)) { (old_fan_mode & ADM1031_CONF1_AUTO_MODE)) {
......
...@@ -276,6 +276,7 @@ static bool duty_mode_enabled(u8 pwm_enable) ...@@ -276,6 +276,7 @@ static bool duty_mode_enabled(u8 pwm_enable)
return false; return false;
default: default:
BUG(); BUG();
return true;
} }
} }
...@@ -291,6 +292,7 @@ static bool auto_mode_enabled(u8 pwm_enable) ...@@ -291,6 +292,7 @@ static bool auto_mode_enabled(u8 pwm_enable)
return true; return true;
default: default:
BUG(); BUG();
return false;
} }
} }
......
...@@ -33,6 +33,9 @@ static bool force; ...@@ -33,6 +33,9 @@ static bool force;
module_param(force, bool, 0444); module_param(force, bool, 0444);
MODULE_PARM_DESC(force, "force loading on processors with erratum 319"); MODULE_PARM_DESC(force, "force loading on processors with erratum 319");
/* PCI-IDs for Northbridge devices not used anywhere else */
#define PCI_DEVICE_ID_AMD_15H_M10H_NB_F3 0x1403
/* CPUID function 0x80000001, ebx */ /* CPUID function 0x80000001, ebx */
#define CPUID_PKGTYPE_MASK 0xf0000000 #define CPUID_PKGTYPE_MASK 0xf0000000
#define CPUID_PKGTYPE_F 0x00000000 #define CPUID_PKGTYPE_F 0x00000000
...@@ -210,6 +213,7 @@ static DEFINE_PCI_DEVICE_TABLE(k10temp_id_table) = { ...@@ -210,6 +213,7 @@ static DEFINE_PCI_DEVICE_TABLE(k10temp_id_table) = {
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_11H_NB_MISC) }, { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_11H_NB_MISC) },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) }, { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F3) }, { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F3) },
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M10H_NB_F3) },
{} {}
}; };
MODULE_DEVICE_TABLE(pci, k10temp_id_table); MODULE_DEVICE_TABLE(pci, k10temp_id_table);
......
...@@ -596,8 +596,10 @@ static int max6639_remove(struct i2c_client *client) ...@@ -596,8 +596,10 @@ static int max6639_remove(struct i2c_client *client)
return 0; return 0;
} }
static int max6639_suspend(struct i2c_client *client, pm_message_t mesg) #ifdef CONFIG_PM_SLEEP
static int max6639_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev);
int data = i2c_smbus_read_byte_data(client, MAX6639_REG_GCONFIG); int data = i2c_smbus_read_byte_data(client, MAX6639_REG_GCONFIG);
if (data < 0) if (data < 0)
return data; return data;
...@@ -606,8 +608,9 @@ static int max6639_suspend(struct i2c_client *client, pm_message_t mesg) ...@@ -606,8 +608,9 @@ static int max6639_suspend(struct i2c_client *client, pm_message_t mesg)
MAX6639_REG_GCONFIG, data | MAX6639_GCONFIG_STANDBY); MAX6639_REG_GCONFIG, data | MAX6639_GCONFIG_STANDBY);
} }
static int max6639_resume(struct i2c_client *client) static int max6639_resume(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev);
int data = i2c_smbus_read_byte_data(client, MAX6639_REG_GCONFIG); int data = i2c_smbus_read_byte_data(client, MAX6639_REG_GCONFIG);
if (data < 0) if (data < 0)
return data; return data;
...@@ -615,6 +618,7 @@ static int max6639_resume(struct i2c_client *client) ...@@ -615,6 +618,7 @@ static int max6639_resume(struct i2c_client *client)
return i2c_smbus_write_byte_data(client, return i2c_smbus_write_byte_data(client,
MAX6639_REG_GCONFIG, data & ~MAX6639_GCONFIG_STANDBY); MAX6639_REG_GCONFIG, data & ~MAX6639_GCONFIG_STANDBY);
} }
#endif /* CONFIG_PM_SLEEP */
static const struct i2c_device_id max6639_id[] = { static const struct i2c_device_id max6639_id[] = {
{"max6639", 0}, {"max6639", 0},
...@@ -623,15 +627,18 @@ static const struct i2c_device_id max6639_id[] = { ...@@ -623,15 +627,18 @@ static const struct i2c_device_id max6639_id[] = {
MODULE_DEVICE_TABLE(i2c, max6639_id); MODULE_DEVICE_TABLE(i2c, max6639_id);
static const struct dev_pm_ops max6639_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(max6639_suspend, max6639_resume)
};
static struct i2c_driver max6639_driver = { static struct i2c_driver max6639_driver = {
.class = I2C_CLASS_HWMON, .class = I2C_CLASS_HWMON,
.driver = { .driver = {
.name = "max6639", .name = "max6639",
.pm = &max6639_pm_ops,
}, },
.probe = max6639_probe, .probe = max6639_probe,
.remove = max6639_remove, .remove = max6639_remove,
.suspend = max6639_suspend,
.resume = max6639_resume,
.id_table = max6639_id, .id_table = max6639_id,
.detect = max6639_detect, .detect = max6639_detect,
.address_list = normal_i2c, .address_list = normal_i2c,
......
...@@ -2619,15 +2619,15 @@ static struct platform_driver w83627ehf_driver = { ...@@ -2619,15 +2619,15 @@ static struct platform_driver w83627ehf_driver = {
static int __init w83627ehf_find(int sioaddr, unsigned short *addr, static int __init w83627ehf_find(int sioaddr, unsigned short *addr,
struct w83627ehf_sio_data *sio_data) struct w83627ehf_sio_data *sio_data)
{ {
static const char __initdata sio_name_W83627EHF[] = "W83627EHF"; static const char sio_name_W83627EHF[] __initconst = "W83627EHF";
static const char __initdata sio_name_W83627EHG[] = "W83627EHG"; static const char sio_name_W83627EHG[] __initconst = "W83627EHG";
static const char __initdata sio_name_W83627DHG[] = "W83627DHG"; static const char sio_name_W83627DHG[] __initconst = "W83627DHG";
static const char __initdata sio_name_W83627DHG_P[] = "W83627DHG-P"; static const char sio_name_W83627DHG_P[] __initconst = "W83627DHG-P";
static const char __initdata sio_name_W83627UHG[] = "W83627UHG"; static const char sio_name_W83627UHG[] __initconst = "W83627UHG";
static const char __initdata sio_name_W83667HG[] = "W83667HG"; static const char sio_name_W83667HG[] __initconst = "W83667HG";
static const char __initdata sio_name_W83667HG_B[] = "W83667HG-B"; static const char sio_name_W83667HG_B[] __initconst = "W83667HG-B";
static const char __initdata sio_name_NCT6775[] = "NCT6775F"; static const char sio_name_NCT6775[] __initconst = "NCT6775F";
static const char __initdata sio_name_NCT6776[] = "NCT6776F"; static const char sio_name_NCT6776[] __initconst = "NCT6776F";
u16 val; u16 val;
const char *sio_name; const char *sio_name;
......
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