Skip to content

Commit

Permalink
Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/groeck/linux-staging

Pull hwmon updates from Guenter Roeck:
 "Introduce new hwmon API functions hwmon_device_register_with_groups
  and devm_hwmon_device_register_with_groups, and convert several
  drivers to use the new API.

  Add support for EMC1404, EMC1424, LTC2977, LTC2978A, LM25063 to
  existing drivers

  Various cleanups in several drivers"

* tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (49 commits)
  hwmon: (w83793) Clean up a signedness issue
  hwmon: (nct6775) Remove an unused variable
  hwmon: (emc1403) Add support for EMC1404 and EMC1424
  hwmon: (emc1403) Convert to use devm_hwmon_device_register_with_groups
  hwmon: (pmbus/ltc2978): Add support for LTC2978A
  hwmon: (pmbus/ltc2978): Add support for LTC2977
  hwmon: (pmbus/lm25066) Add support for LM25063
  hwmon: Correct some typos
  hwmon: (gpio-fan) Include linux/of.h header
  hwmon: (lm70) Remove redundant spi_set_drvdata
  hwmon: (adcxx) Remove redundant spi_set_drvdata
  hwmon: (jc42) fix coccinelle warnings
  hwmon: (ltc4261) fix coccinelle warnings
  hwmon: (lm95234) fix coccinelle warnings
  hwmon: (max6697) fix coccinelle warnings
  hwmon: (max6642 fix coccinelle warnings
  hwmon: (ds1621) fix coccinelle warnings
  hwmon: (nct6775) fix coccinelle warnings
  hwmon: (jc42) Convert to use devm_hwmon_device_register_with_groups
  hwmon: (ltc4261) Convert to use devm_hwmon_device_register_with_groups
  ...
  • Loading branch information
torvalds committed Nov 12, 2013
2 parents 66a173b + 26336c8 commit 7e238a2
Show file tree
Hide file tree
Showing 40 changed files with 805 additions and 888 deletions.
20 changes: 19 additions & 1 deletion Documentation/hwmon/lm25066
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ Supported chips:
Datasheets:
http://www.ti.com/lit/gpn/lm25056
http://www.ti.com/lit/gpn/lm25056a
* TI LM25063
Prefix: 'lm25063'
Addresses scanned: -
Datasheet:
To be announced
* National Semiconductor LM25066
Prefix: 'lm25066'
Addresses scanned: -
Expand All @@ -32,7 +37,7 @@ Description
-----------

This driver supports hardware montoring for National Semiconductor / TI LM25056,
LM25066, LM5064, and LM5064 Power Management, Monitoring, Control, and
LM25063, LM25066, LM5064, and LM5066 Power Management, Monitoring, Control, and
Protection ICs.

The driver is a client driver to the core PMBus driver. Please see
Expand Down Expand Up @@ -64,8 +69,12 @@ in1_input Measured input voltage.
in1_average Average measured input voltage.
in1_min Minimum input voltage.
in1_max Maximum input voltage.
in1_crit Critical high input voltage (LM25063 only).
in1_lcrit Critical low input voltage (LM25063 only).
in1_min_alarm Input voltage low alarm.
in1_max_alarm Input voltage high alarm.
in1_lcrit_alarm Input voltage critical low alarm (LM25063 only).
in1_crit_alarm Input voltage critical high alarm. (LM25063 only).

in2_label "vmon"
in2_input Measured voltage on VAUX pin
Expand All @@ -80,12 +89,16 @@ in3_input Measured output voltage.
in3_average Average measured output voltage.
in3_min Minimum output voltage.
in3_min_alarm Output voltage low alarm.
in3_highest Historical minimum output voltage (LM25063 only).
in3_lowest Historical maximum output voltage (LM25063 only).

curr1_label "iin"
curr1_input Measured input current.
curr1_average Average measured input current.
curr1_max Maximum input current.
curr1_crit Critical input current (LM25063 only).
curr1_max_alarm Input current high alarm.
curr1_crit_alarm Input current critical high alarm (LM25063 only).

power1_label "pin"
power1_input Measured input power.
Expand All @@ -95,6 +108,11 @@ power1_alarm Input power alarm
power1_input_highest Historical maximum power.
power1_reset_history Write any value to reset maximum power history.

power2_label "pout". LM25063 only.
power2_input Measured output power.
power2_max Maximum output power limit.
power2_crit Critical output power limit.

temp1_input Measured temperature.
temp1_max Maximum temperature.
temp1_crit Critical high temperature.
Expand Down
44 changes: 29 additions & 15 deletions Documentation/hwmon/ltc2978
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ Supported chips:
Prefix: 'ltc2974'
Addresses scanned: -
Datasheet: http://www.linear.com/product/ltc2974
* Linear Technology LTC2978
* Linear Technology LTC2977
Prefix: 'ltc2977'
Addresses scanned: -
Datasheet: http://www.linear.com/product/ltc2977
* Linear Technology LTC2978, LTC2978A
Prefix: 'ltc2978'
Addresses scanned: -
Datasheet: http://www.linear.com/product/ltc2978
http://www.linear.com/product/ltc2978a
* Linear Technology LTC3880
Prefix: 'ltc3880'
Addresses scanned: -
Expand All @@ -26,8 +31,9 @@ Description
-----------

LTC2974 is a quad digital power supply manager. LTC2978 is an octal power supply
monitor. LTC3880 is a dual output poly-phase step-down DC/DC controller. LTC3883
is a single phase step-down DC/DC controller.
monitor. LTC2977 is a pin compatible replacement for LTC2978. LTC3880 is a dual
output poly-phase step-down DC/DC controller. LTC3883 is a single phase
step-down DC/DC controller.


Usage Notes
Expand All @@ -49,21 +55,25 @@ Sysfs attributes
in1_label "vin"
in1_input Measured input voltage.
in1_min Minimum input voltage.
in1_max Maximum input voltage. LTC2974 and LTC2978 only.
in1_lcrit Critical minimum input voltage. LTC2974 and LTC2978
only.
in1_max Maximum input voltage.
LTC2974, LTC2977, and LTC2978 only.
in1_lcrit Critical minimum input voltage.
LTC2974, LTC2977, and LTC2978 only.
in1_crit Critical maximum input voltage.
in1_min_alarm Input voltage low alarm.
in1_max_alarm Input voltage high alarm. LTC2974 and LTC2978 only.
in1_lcrit_alarm Input voltage critical low alarm. LTC2974 and LTC2978
only.
in1_max_alarm Input voltage high alarm.
LTC2974, LTC2977, and LTC2978 only.
in1_lcrit_alarm Input voltage critical low alarm.
LTC2974, LTC2977, and LTC2978 only.
in1_crit_alarm Input voltage critical high alarm.
in1_lowest Lowest input voltage. LTC2974 and LTC2978 only.
in1_lowest Lowest input voltage.
LTC2974, LTC2977, and LTC2978 only.
in1_highest Highest input voltage.
in1_reset_history Reset input voltage history.

in[N]_label "vout[1-8]".
LTC2974: N=2-5
LTC2977: N=2-9
LTC2978: N=2-9
LTC3880: N=2-3
LTC3883: N=2
Expand All @@ -83,21 +93,23 @@ in[N]_reset_history Reset output voltage history.
temp[N]_input Measured temperature.
On LTC2974, temp[1-4] report external temperatures,
and temp5 reports the chip temperature.
On LTC2978, only one temperature measurement is
supported and reports the chip temperature.
On LTC2977 and LTC2978, only one temperature measurement
is supported and reports the chip temperature.
On LTC3880, temp1 and temp2 report external
temperatures, and temp3 reports the chip temperature.
On LTC3883, temp1 reports an external temperature,
and temp2 reports the chip temperature.
temp[N]_min Mimimum temperature. LTC2974 and LTC2978 only.
temp[N]_min Mimimum temperature. LTC2974, LCT2977, and LTC2978 only.
temp[N]_max Maximum temperature.
temp[N]_lcrit Critical low temperature.
temp[N]_crit Critical high temperature.
temp[N]_min_alarm Temperature low alarm. LTC2974 and LTC2978 only.
temp[N]_min_alarm Temperature low alarm.
LTC2974, LTC2977, and LTC2978 only.
temp[N]_max_alarm Temperature high alarm.
temp[N]_lcrit_alarm Temperature critical low alarm.
temp[N]_crit_alarm Temperature critical high alarm.
temp[N]_lowest Lowest measured temperature. LTC2974 and LTC2978 only.
temp[N]_lowest Lowest measured temperature.
LTC2974, LTC2977, and LTC2978 only.
Not supported for chip temperature sensor on LTC2974.
temp[N]_highest Highest measured temperature. Not supported for chip
temperature sensor on LTC2974.
Expand All @@ -109,6 +121,7 @@ power1_input Measured input power.

power[N]_label "pout[1-4]".
LTC2974: N=1-4
LTC2977: Not supported
LTC2978: Not supported
LTC3880: N=1-2
LTC3883: N=2
Expand All @@ -123,6 +136,7 @@ curr1_reset_history Reset input current history. LTC3883 only.

curr[N]_label "iout[1-4]".
LTC2974: N=1-4
LTC2977: not supported
LTC2978: not supported
LTC3880: N=2-3
LTC3883: N=2
Expand Down
6 changes: 3 additions & 3 deletions drivers/hwmon/abituguru.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ static const u8 abituguru_bank2_max_threshold = 50;
static const int abituguru_pwm_settings_multiplier[5] = { 0, 1, 1, 1000, 1000 };
/*
* Min / Max allowed values for pwm_settings. Note: pwm1 (CPU fan) is a
* special case the minium allowed pwm% setting for this is 30% (77) on
* special case the minimum allowed pwm% setting for this is 30% (77) on
* some MB's this special case is handled in the code!
*/
static const u8 abituguru_pwm_min[5] = { 0, 170, 170, 25, 25 };
Expand Down Expand Up @@ -517,7 +517,7 @@ abituguru_detect_bank1_sensor_type(struct abituguru_data *data,

ABIT_UGURU_DEBUG(2, "testing bank1 sensor %d\n", (int)sensor_addr);
/*
* Volt sensor test, enable volt low alarm, set min value ridicously
* Volt sensor test, enable volt low alarm, set min value ridiculously
* high, or vica versa if the reading is very high. If its a volt
* sensor this should always give us an alarm.
*/
Expand Down Expand Up @@ -564,7 +564,7 @@ abituguru_detect_bank1_sensor_type(struct abituguru_data *data,

/*
* Temp sensor test, enable sensor as a temp sensor, set beep value
* ridicously low (but not too low, otherwise uguru ignores it).
* ridiculously low (but not too low, otherwise uguru ignores it).
* If its a temp sensor this should always give us an alarm.
*/
buf[0] = ABIT_UGURU_TEMP_HIGH_ALARM_ENABLE;
Expand Down
2 changes: 1 addition & 1 deletion drivers/hwmon/abituguru3.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ struct abituguru3_data {

/*
* The abituguru3 supports up to 48 sensors, and thus has registers
* sets for 48 sensors, for convienence reasons / simplicity of the
* sets for 48 sensors, for convenience reasons / simplicity of the
* code we always read and store all registers for all 48 sensors
*/

Expand Down
13 changes: 9 additions & 4 deletions drivers/hwmon/acpi_power_meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,10 @@ static ssize_t show_str(struct device *dev,
val = resource->oem_info;
break;
default:
BUG();
WARN(1, "Implementation error: unexpected attribute index %d\n",
attr->index);
val = "";
break;
}

return sprintf(buf, "%s\n", val);
Expand Down Expand Up @@ -436,7 +438,9 @@ static ssize_t show_val(struct device *dev,
val = resource->trip[attr->index - 7] * 1000;
break;
default:
BUG();
WARN(1, "Implementation error: unexpected attribute index %d\n",
attr->index);
break;
}

return sprintf(buf, "%llu\n", val);
Expand Down Expand Up @@ -855,7 +859,8 @@ static void acpi_power_meter_notify(struct acpi_device *device, u32 event)
dev_info(&device->dev, "Capping in progress.\n");
break;
default:
BUG();
WARN(1, "Unexpected event %d\n", event);
break;
}
mutex_unlock(&resource->lock);

Expand Down Expand Up @@ -991,7 +996,7 @@ static int __init acpi_power_meter_init(void)

result = acpi_bus_register_driver(&acpi_power_meter_driver);
if (result < 0)
return -ENODEV;
return result;

return 0;
}
Expand Down
2 changes: 0 additions & 2 deletions drivers/hwmon/adcxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ static int adcxx_probe(struct spi_device *spi)
for (i--; i >= 0; i--)
device_remove_file(&spi->dev, &ad_input[i].dev_attr);

spi_set_drvdata(spi, NULL);
mutex_unlock(&adc->lock);
return status;
}
Expand All @@ -218,7 +217,6 @@ static int adcxx_remove(struct spi_device *spi)
for (i = 0; i < 3 + adc->channels; i++)
device_remove_file(&spi->dev, &ad_input[i].dev_attr);

spi_set_drvdata(spi, NULL);
mutex_unlock(&adc->lock);

return 0;
Expand Down
6 changes: 3 additions & 3 deletions drivers/hwmon/adm1026.c
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ static struct adm1026_data *adm1026_update_device(struct device *dev)
data->gpio = gpio;

data->last_reading = jiffies;
}; /* last_reading */
} /* last_reading */

if (!data->valid ||
time_after(jiffies, data->last_config + ADM1026_CONFIG_INTERVAL)) {
Expand Down Expand Up @@ -700,7 +700,7 @@ static struct adm1026_data *adm1026_update_device(struct device *dev)
}

data->last_config = jiffies;
}; /* last_config */
} /* last_config */

data->valid = 1;
mutex_unlock(&data->update_lock);
Expand Down Expand Up @@ -1791,7 +1791,7 @@ static int adm1026_detect(struct i2c_client *client,
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) {
/* We need to be able to do byte I/O */
return -ENODEV;
};
}

/* Now, we do the remaining detection. */

Expand Down
5 changes: 2 additions & 3 deletions drivers/hwmon/adt7462.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ static int find_trange_value(int trange)
if (trange_values[i] == trange)
return i;

return -ENODEV;
return -EINVAL;
}

static struct adt7462_data *adt7462_update_device(struct device *dev)
Expand Down Expand Up @@ -1294,9 +1294,8 @@ static ssize_t set_pwm_tmax(struct device *dev,
/* trange = tmax - tmin */
tmin = (data->pwm_tmin[attr->index] - 64) * 1000;
trange_value = find_trange_value(trange - tmin);

if (trange_value < 0)
return -EINVAL;
return trange_value;

temp = trange_value << ADT7462_PWM_RANGE_SHIFT;
temp |= data->pwm_trange[attr->index] & ADT7462_PWM_HYST_MASK;
Expand Down
12 changes: 6 additions & 6 deletions drivers/hwmon/asc7621.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static inline u8 read_byte(struct i2c_client *client, u8 reg)
dev_err(&client->dev,
"Unable to read from register 0x%02x.\n", reg);
return 0;
};
}
return res & 0xff;
}

Expand All @@ -149,7 +149,7 @@ static inline int write_byte(struct i2c_client *client, u8 reg, u8 data)
dev_err(&client->dev,
"Unable to write value 0x%02x to register 0x%02x.\n",
data, reg);
};
}
return res;
}

Expand Down Expand Up @@ -1030,7 +1030,7 @@ static struct asc7621_data *asc7621_update_device(struct device *dev)
}
}
data->last_high_reading = jiffies;
}; /* last_reading */
} /* last_reading */

/* Read all the low priority registers. */

Expand All @@ -1044,7 +1044,7 @@ static struct asc7621_data *asc7621_update_device(struct device *dev)
}
}
data->last_low_reading = jiffies;
}; /* last_reading */
} /* last_reading */

data->valid = 1;

Expand Down Expand Up @@ -1084,11 +1084,11 @@ static void asc7621_init_client(struct i2c_client *client)
dev_err(&client->dev,
"Client (%d,0x%02x) config is locked.\n",
i2c_adapter_id(client->adapter), client->addr);
};
}
if (!(value & 0x04)) {
dev_err(&client->dev, "Client (%d,0x%02x) is not ready.\n",
i2c_adapter_id(client->adapter), client->addr);
};
}

/*
* Start monitoring
Expand Down
2 changes: 1 addition & 1 deletion drivers/hwmon/asus_atk0110.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ struct atk_data {
acpi_handle rtmp_handle;
acpi_handle rvlt_handle;
acpi_handle rfan_handle;
/* new inteface */
/* new interface */
acpi_handle enumerate_handle;
acpi_handle read_handle;
acpi_handle write_handle;
Expand Down
3 changes: 1 addition & 2 deletions drivers/hwmon/atxp1.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,9 @@ static ssize_t atxp1_storevcore(struct device *dev,

/* Calculate VID */
vid = vid_to_reg(vcore, data->vrm);

if (vid < 0) {
dev_err(dev, "VID calculation failed.\n");
return -1;
return vid;
}

/*
Expand Down
Loading

0 comments on commit 7e238a2

Please sign in to comment.