Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e238a2e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
  ...
parents 66a173b9 26336c8a
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -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: -
@@ -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
@@ -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
@@ -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.
@@ -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.
+29 −15
Original line number Diff line number Diff line
@@ -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: -
@@ -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
@@ -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
@@ -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.
@@ -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
@@ -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
+3 −3
Original line number Diff line number Diff line
@@ -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 };
@@ -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.
	 */
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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
	 */

+9 −4
Original line number Diff line number Diff line
@@ -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);
@@ -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);
@@ -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);

@@ -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;
}
Loading