Skip to contentSkip to conversation

Add Maxim Integrated MAX31760 fan controller driver.

PATCH In review John Muir 5 participants 11 messages Apr 4, 2017 – Apr 19, 2017 3 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

John Muir

author
#0 lore raw

cover Add Maxim Integrated MAX31760 fan controller driver.

Add a device driver for the MAX31760 I2C device with a hwmon interface and a few open firmware device properties.

John Muir (2):
hwmon: Add MAX31760 fan controller driver.
devicetree: Document the max31760 device binding.

 .../devicetree/bindings/hwmon/max31760.txt         |   58 +
 Documentation/hwmon/max31760                       |   41 +
 drivers/hwmon/Kconfig                              |   10 +
 drivers/hwmon/Makefile                             |    1 +
 drivers/hwmon/max31760.c                           | 1430 ++++++++++++++++++++
 5 files changed, 1540 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/max31760.txt
 create mode 100644 Documentation/hwmon/max31760
 create mode 100644 drivers/hwmon/max31760.c
Signature · 1 line
2.12.2.715.g7642488e1d-goog
author
#1 lore raw

PATCH 1/2 hwmon: Add MAX31760 fan controller driver.

Add a driver for the Maxim Integrated MAX31760 Precision Fan Speed Controller.

---
 Documentation/hwmon/max31760 |   41 ++
 drivers/hwmon/Kconfig        |   10 +
 drivers/hwmon/Makefile       |    1 +
 drivers/hwmon/max31760.c     | 1430 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 1482 insertions(+)
 create mode 100644 Documentation/hwmon/max31760
 create mode 100644 drivers/hwmon/max31760.c
Documentation/hwmon/max31760 new file +41 -0
new file mode 100644
index 000000000000..95937844ed18
@@ -0,0 +1,41 @@
+Kernel driver max31760
+======================
+
+Supported chips:
+  * Maxim Integrated MAX31760
+    Prefix: 'max31760'
+    Addresses scanned: none
+    Datasheet: https://datasheets.maximintegrated.com/en/ds/MAX31760.pdf
+
+Author:
+	John Muir <[email protected]>
+
+Description
+-----------
+
+The MAX31760 integrates temperature sensing along with precision PWM fan
+control. Please read the datasheet referenced above for a comprehensive
+description of this device.
+
+This device driver's hwmon integration provides the common sysfs interfaces to
+manage two fans and two temperature sensors, and pwm controls for the fan speed.
+A temperature to pwm lookup table is exposed via a series of 'auto_point'
+configuration files. See Documentation/hwmon/sysfs-interface for more
+information.
+
+The following custom controls are defined (in the custom sub-directory):
+
+control		- Accepts control commands:
+		  "reset"   - Execute a soft reset of the device.
+		  "clearff" - Clear the fan fault.
+
+eeprom_read	- Read from the EEPROM into registers.
+eeprom_write    - Write register contents to the EEPROM.
+		  Write "0" to these to read or write the entire register
+		  contents. Write a bit-field as per the data-sheet to write a
+		  portion of the register contents.
+
+pwm1_fan_fault  - PWM value in the range of 0 to 255 used when a fan is faulty.
+
+pwm1_ramp_rate  - PWM increment per second when the PWM value is changed.
+		  Accepted values are 8, 16, 32, or 255 (instantaneous).
drivers/hwmon/Kconfig +10 -0
index 2d5447bebab6..3aef5c07f1c3 100644
@@ -849,6 +849,16 @@ config SENSORS_MAX6697
 	  This driver can also be built as a module.  If so, the module
 	  will be called max6697.
 
+config SENSORS_MAX31760
+	tristate "Maxim MAX31760 fan controller"
+	depends on I2C
+	help
+	  If you say yes here you get support for the Maxim Integrated
+	  MAX31760 Precision Fan-Speed Controller.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called max31760.
+
 config SENSORS_MAX31790
 	tristate "Maxim MAX31790 sensor chip"
 	depends on I2C
drivers/hwmon/Makefile +1 -0
index 76e1456ddf2f..7b08f069d5a4 100644
@@ -116,6 +116,7 @@ obj-$(CONFIG_SENSORS_MAX6639)	+= max6639.o
 obj-$(CONFIG_SENSORS_MAX6642)	+= max6642.o
 obj-$(CONFIG_SENSORS_MAX6650)	+= max6650.o
 obj-$(CONFIG_SENSORS_MAX6697)	+= max6697.o
+obj-$(CONFIG_SENSORS_MAX31760)  += max31760.o
 obj-$(CONFIG_SENSORS_MAX31790)	+= max31790.o
 obj-$(CONFIG_SENSORS_MC13783_ADC)+= mc13783-adc.o
 obj-$(CONFIG_SENSORS_MCP3021)	+= mcp3021.o
drivers/hwmon/max31760.c new file +1430 -0

1,430 lines not on this page · raw message

Signature · 1 line
2.12.2.715.g7642488e1d-goog
author
#2 lore raw

PATCH 2/2 devicetree: Document the max31760 device binding.

In reply to John Muir
---
 .../devicetree/bindings/hwmon/max31760.txt         | 58 ++++++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/max31760.txt
Documentation/devicetree/bindings/hwmon/max31760.txt new file +58 -0
new file mode 100644
index 000000000000..43787a77c322
@@ -0,0 +1,58 @@
+MAX31760 fan controller
+-----------------------
+
+This device supports I2C only. Many properties of this device are configurable
+thorugh the hwmon interface. See also Documentation/hwmon/max31760.
+
+Required node properties:
+- compatible : "maxim,max31760"
+- reg : The I2C address of the device. This is 0x50 - 0x57 depending on the
+	hardware configuration.
+
+Optional node properties:
+- maxim,fan1-enabled		- 1 to enable, 0 to disable. Default: 1.
+- maxim,fan2-enabled		- 1 to enable, 0 to disable. Default: 1.
+- maxim,fan1-label		- String: Hwmon fan1_label.
+- maxim,fan2-label		- String: Hwmon fan2_label.
+- maxim,fan-fail-full-only	- Set to 1 to assert a fan failure only when the
+				  PWM is at 100%. Default: 0.
+- maxim,fan-rd-signal		- Set to 1 if fan(s) provide a rotation
+				  detection (RD) signal, or 0 if the fan
+				  generates square-wave pulses. Default: 0.
+- maxim,fan-rd-polarity		- 0: RD is low when the fan is running.
+				  1: RD is high when the fan is running.
+				  Only relevant when fan-rd-signal is 1.
+				  Default: 0.
+- maxim,fan-signal-enabled	- Set to 1 if externally driving FF/FS low
+				  should force PWM output to 100%. Default: 0.
+- maxim,fan-spin-up-enabled     - For fan startup: Set to 1 to set the PWM to
+				  100% until tach is detected or two seconds
+				  have passed before reducing to the target
+				  value. Default: 0.
+- maxim,pwm-polarity		- 0: 100% PWM is when PWM is high.
+				  1: 100% PWM is when PWM is low.
+				  Default: 0.
+- maxim,pwm-pulse-stretch-enabled
+				- 1 to enable PWM pulse stretching, 0 to
+				  disable. Default: 0.
+- maxim,pwm-zero-fan-can-fail	- 0: Fan failure detection disabled when PWM is
+				     ramping to 0%.
+				  1: Fan failure detection enabled for all PWM
+				     values.
+				  Default: 0.
+- maxim,temp1-label		- String: Hwmon temp1_label.
+- maxim,temp2-label		- String: Hwmon temp2_label.
+- maxim,temp2-ideality		- Set ideality factor for the remote temperature
+				  sensor. Integer with range 0 to 63,
+				  representing a multiplication factor of 0.9844
+				  to 1.0489. Default: 24 (1.0080).
+
+Example:
+	max31760@50 {
+		compatible = "maxim,max31760";
+		reg = <0x50>;
+		maxim,fan1-label = "Left";
+		maxim,fan2-label = "Right";
+		maxim,fan-spin-up-enabled = <1>;
+		maxim,temp2-label = "CPU";
+	};
Signature · 1 line
2.12.2.715.g7642488e1d-goog

A message that is not in the archive (sent off-list or not yet received): 20170404192034.158901-3-john-eXjPKP/[email protected]

#4 lore raw

Re: [PATCH 2/2] devicetree: Document the max31760 device binding.

Quoted 12 lines · John Muir
---
 .../devicetree/bindings/hwmon/max31760.txt         | 58 ++++++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/max31760.txt
Documentation/devicetree/bindings/hwmon/max31760.txt new file +0 -0
new file mode 100644
index 000000000000..43787a77c322

Documentation/devicetree/bindings/hwmon/max31760.txt line 5

Quoted 5 lines
Documentation/devicetree/bindings/hwmon/max31760.txt new file +5 -0
@@ -0,0 +1,58 @@
+MAX31760 fan controller
+-----------------------
+
+This device supports I2C only. Many properties of this device are configurable
+thorugh the hwmon interface. See also Documentation/hwmon/max31760.

I really think we need to describe the fans as separate nodes and preferably with a common binding. This is the second fan controller binding recently[1].

Features of the "hwmon interface" are not relevant to the binding. Bindings describe h/w.

Documentation/devicetree/bindings/hwmon/max31760.txt line 16

Quoted 11 lines
Documentation/devicetree/bindings/hwmon/max31760.txt new file +11 -0
+
+Required node properties:
+- compatible : "maxim,max31760"
+- reg : The I2C address of the device. This is 0x50 - 0x57 depending on the
+	hardware configuration.
+
+Optional node properties:
+- maxim,fan1-enabled		- 1 to enable, 0 to disable. Default: 1.
+- maxim,fan2-enabled		- 1 to enable, 0 to disable. Default: 1.
+- maxim,fan1-label		- String: Hwmon fan1_label.
+- maxim,fan2-label		- String: Hwmon fan2_label.

Perhaps 2 fan sub nodes. reg for fan number, status for enabled, and label for label.

Documentation/devicetree/bindings/hwmon/max31760.txt line 18

Quoted 2 lines
Documentation/devicetree/bindings/hwmon/max31760.txt new file +2 -0
+- maxim,fan-fail-full-only	- Set to 1 to assert a fan failure only when the
+				  PWM is at 100%. Default: 0.

Make this a boolean.

Documentation/devicetree/bindings/hwmon/max31760.txt line 21

Quoted 3 lines
Documentation/devicetree/bindings/hwmon/max31760.txt new file +3 -0
+- maxim,fan-rd-signal		- Set to 1 if fan(s) provide a rotation
+				  detection (RD) signal, or 0 if the fan
+				  generates square-wave pulses. Default: 0.

Make this a boolean.

Quoted 11 lines
Documentation/devicetree/bindings/hwmon/max31760.txt new file +11 -0
+- maxim,fan-rd-polarity		- 0: RD is low when the fan is running.
+				  1: RD is high when the fan is running.
+				  Only relevant when fan-rd-signal is 1.
+				  Default: 0.
+- maxim,fan-signal-enabled	- Set to 1 if externally driving FF/FS low
+				  should force PWM output to 100%. Default: 0.
+- maxim,fan-spin-up-enabled     - For fan startup: Set to 1 to set the PWM to
+				  100% until tach is detected or two seconds
+				  have passed before reducing to the target
+				  value. Default: 0.
+- maxim,pwm-polarity		- 0: 100% PWM is when PWM is high.

Documentation/devicetree/bindings/hwmon/max31760.txt line 42

Quoted 10 lines
Documentation/devicetree/bindings/hwmon/max31760.txt new file +10 -0
+				  1: 100% PWM is when PWM is low.
+				  Default: 0.
+- maxim,pwm-pulse-stretch-enabled
+				- 1 to enable PWM pulse stretching, 0 to
+				  disable. Default: 0.
+- maxim,pwm-zero-fan-can-fail	- 0: Fan failure detection disabled when PWM is
+				     ramping to 0%.
+				  1: Fan failure detection enabled for all PWM
+				     values.
+				  Default: 0.

All these can be boolean...

Documentation/devicetree/bindings/hwmon/max31760.txt line 48

Quoted 6 lines
Documentation/devicetree/bindings/hwmon/max31760.txt new file +6 -0
+- maxim,temp1-label		- String: Hwmon temp1_label.
+- maxim,temp2-label		- String: Hwmon temp2_label.
+- maxim,temp2-ideality		- Set ideality factor for the remote temperature
+				  sensor. Integer with range 0 to 63,
+				  representing a multiplication factor of 0.9844
+				  to 1.0489. Default: 24 (1.0080).

No maxim,temp1-ideality? Not sure what to do with these, but perhaps also as sub-nodes. Surely we have some bindings already for devices with multiple temp sensors. Don't invent something custom here.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#5 lore raw

Re: [PATCH 2/2] devicetree: Document the max31760 device binding.

Quoted 7 lines · Rob Herring
Quoted 6 lines · John Muir
---
 .../devicetree/bindings/hwmon/max31760.txt         | 58 ++++++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/max31760.txt
Quoted 15 lines

Documentation/devicetree/bindings/hwmon/max31760.txt line 5

Quoted 11 lines
Documentation/devicetree/bindings/hwmon/max31760.txt new file +5 -0
new file mode 100644
index 000000000000..43787a77c322
@@ -0,0 +1,58 @@
+MAX31760 fan controller
+-----------------------
+
+This device supports I2C only. Many properties of this device are configurable
+thorugh the hwmon interface. See also Documentation/hwmon/max31760.

I really think we need to describe the fans as separate nodes and preferably with a common binding. This is the second fan controller binding recently[1].

Forgot the link: https://patchwork.kernel.org/patch/9643643/

author
#6 lore raw

Re: [PATCH 2/2] devicetree: Document the max31760 device binding.

In reply to Rob Herring
Quoted 13 lines · Rob Herring

Documentation/devicetree/bindings/hwmon/max31760.txt line 5

Quoted 5 lines · John Muir
Documentation/devicetree/bindings/hwmon/max31760.txt new file +5 -0
+MAX31760 fan controller
+-----------------------
+
+This device supports I2C only. Many properties of this device are configurable
+thorugh the hwmon interface. See also Documentation/hwmon/max31760.

I really think we need to describe the fans as separate nodes and preferably with a common binding. This is the second fan controller binding recently[1].

Quoted 2 lines

Features of the "hwmon interface" are not relevant to the binding. Bindings describe h/w.

It seems to me that referring to the hwmon interface is only helpful. You are suggesting removing those sentences? If so, can I add a link to the data sheet?

Quoted 9 lines
Quoted 6 lines

+Optional node properties:

+- maxim,fan1-enabled		- 1 to enable, 0 to disable. Default: 1.
+- maxim,fan2-enabled		- 1 to enable, 0 to disable. Default: 1.
+- maxim,fan1-label		- String: Hwmon fan1_label.
+- maxim,fan2-label		- String: Hwmon fan2_label.

Perhaps 2 fan sub nodes. reg for fan number, status for enabled, and label for label.

OK.

Right now a fan’s number of pulses and the PWM frequency are configured using the hwmon sysfs interface (which defines standard controls for those), but as those are characteristics of the hardware, should they also be configured via the device tree binding?

Quoted 7 lines

Documentation/devicetree/bindings/hwmon/max31760.txt line 42

Quoted 5 lines

+- maxim,pwm-zero-fan-can-fail - 0: Fan failure detection disabled when PWM is

Documentation/devicetree/bindings/hwmon/max31760.txt new file +4 -0
+				     ramping to 0%.
+				  1: Fan failure detection enabled for all PWM
+				     values.
+				  Default: 0.

All these can be boolean…

OK. The only issue I see is when the default is ‘true’ in the device, but I’ll try to avoid that. Sometimes I wish that you could set a boolean to false in DTS files.

Quoted 9 lines

Documentation/devicetree/bindings/hwmon/max31760.txt line 48

Quoted 7 lines
+- maxim,temp1-label		- String: Hwmon temp1_label.
+- maxim,temp2-label		- String: Hwmon temp2_label.
+- maxim,temp2-ideality		- Set ideality factor for the remote temperature
Documentation/devicetree/bindings/hwmon/max31760.txt new file +3 -0
+				  sensor. Integer with range 0 to 63,
+				  representing a multiplication factor of 0.9844
+				  to 1.0489. Default: 24 (1.0080).

No maxim,temp1-ideality?

No - the device only lets you set the ideality of the ‘external' temperature sensor. I guess if there is an ideality for the internal temperature sensor, it would be hard-wired as a characteristic of the part that was used.

Quoted 3 lines

Not sure what to do with these, but perhaps
also as sub-nodes. Surely we have some bindings already for devices with multiple temp sensors. Don't invent something custom here.

I’ll look into it.

What is the best way to distinguish between ‘fan’ and ‘temp’ sub-nodes? Do I require a ‘compatible’ string?

Thanks!

John.

maintainer
#7 lore raw

Re: [PATCH 2/2] devicetree: Document the max31760 device binding.

Quoted 13 lines · John Muir
Quoted 13 lines · Rob Herring

Documentation/devicetree/bindings/hwmon/max31760.txt line 5

Quoted 5 lines · John Muir
Documentation/devicetree/bindings/hwmon/max31760.txt new file +5 -0
+MAX31760 fan controller
+-----------------------
+
+This device supports I2C only. Many properties of this device are configurable
+thorugh the hwmon interface. See also Documentation/hwmon/max31760.

I really think we need to describe the fans as separate nodes and preferably with a common binding. This is the second fan controller binding recently[1].

Quoted 5 lines
Quoted 2 lines

Features of the "hwmon interface" are not relevant to the binding. Bindings describe h/w.

It seems to me that referring to the hwmon interface is only helpful. You are suggesting removing those sentences? If so, can I add a link to the data sheet?

Devicetree properties are supposed to be operating system independent. Any mention of how access to the device is implemented on a given operating system is out of scope for this document.

Guenter

Quoted 48 lines
Quoted 9 lines
Quoted 6 lines

+Optional node properties:

+- maxim,fan1-enabled		- 1 to enable, 0 to disable. Default: 1.
+- maxim,fan2-enabled		- 1 to enable, 0 to disable. Default: 1.
+- maxim,fan1-label		- String: Hwmon fan1_label.
+- maxim,fan2-label		- String: Hwmon fan2_label.

Perhaps 2 fan sub nodes. reg for fan number, status for enabled, and label for label.

OK.

Right now a fan’s number of pulses and the PWM frequency are configured using the hwmon sysfs interface (which defines standard controls for those), but as those are characteristics of the hardware, should they also be configured via the device tree binding?

Quoted 7 lines

Documentation/devicetree/bindings/hwmon/max31760.txt line 42

Quoted 5 lines

+- maxim,pwm-zero-fan-can-fail - 0: Fan failure detection disabled when PWM is

Documentation/devicetree/bindings/hwmon/max31760.txt new file +4 -0
+				     ramping to 0%.
+				  1: Fan failure detection enabled for all PWM
+				     values.
+				  Default: 0.

All these can be boolean…

OK. The only issue I see is when the default is ‘true’ in the device, but I’ll try to avoid that. Sometimes I wish that you could set a boolean to false in DTS files.

Quoted 9 lines

Documentation/devicetree/bindings/hwmon/max31760.txt line 48

Quoted 7 lines
+- maxim,temp1-label		- String: Hwmon temp1_label.
+- maxim,temp2-label		- String: Hwmon temp2_label.
+- maxim,temp2-ideality		- Set ideality factor for the remote temperature
Documentation/devicetree/bindings/hwmon/max31760.txt new file +3 -0
+				  sensor. Integer with range 0 to 63,
+				  representing a multiplication factor of 0.9844
+				  to 1.0489. Default: 24 (1.0080).

No maxim,temp1-ideality?

No - the device only lets you set the ideality of the ‘external' temperature sensor. I guess if there is an ideality for the internal temperature sensor, it would be hard-wired as a characteristic of the part that was used.

Quoted 3 lines

Not sure what to do with these, but perhaps
also as sub-nodes. Surely we have some bindings already for devices with multiple temp sensors. Don't invent something custom here.

I’ll look into it.

What is the best way to distinguish between ‘fan’ and ‘temp’ sub-nodes? Do I require a ‘compatible’ string?

Thanks!

John.

A message that is not in the archive (sent off-list or not yet received): 20170404192034.158901-1-john-eXjPKP/[email protected]

#9 lore raw

v2 cover Add Maxim Integrated MAX31760 fan controller driver.

Add a device driver for the MAX31760 I2C device with a hwmon interface and a few open firmware device properties.

v2:
- Fixup device tree binding documentation.
- max32760: Fix OF code and add some comments.

John Muir (2):
hwmon: Add MAX31760 fan controller driver.
devicetree: Document the max31760 device binding.

 .../devicetree/bindings/hwmon/max31760.txt         |   72 +
 Documentation/hwmon/max31760                       |   41 +
 drivers/hwmon/Kconfig                              |   10 +
 drivers/hwmon/Makefile                             |    1 +
 drivers/hwmon/max31760.c                           | 1461 ++++++++++++++++++++
 5 files changed, 1585 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/max31760.txt
 create mode 100644 Documentation/hwmon/max31760
 create mode 100644 drivers/hwmon/max31760.c
Signature · 6 lines
2.12.2.715.g7642488e1d-goog

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20170411213218.138718-1-john-eXjPKP/[email protected]

#11 lore raw

PATCH v2 1/2 hwmon: Add MAX31760 fan controller driver.

Add a driver for the Maxim Integrated MAX31760 Precision Fan Speed Controller.

v2:
- Fixup open firmware code.
- Add a few comments.

---
 Documentation/hwmon/max31760 |   41 ++
 drivers/hwmon/Kconfig        |   10 +
 drivers/hwmon/Makefile       |    1 +
 drivers/hwmon/max31760.c     | 1461 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 1513 insertions(+)
 create mode 100644 Documentation/hwmon/max31760
 create mode 100644 drivers/hwmon/max31760.c
Documentation/hwmon/max31760 new file +41 -0
new file mode 100644
index 000000000000..6f53ac6112a5
@@ -0,0 +1,41 @@
+Kernel driver max31760
+======================
+
+Supported chips:
+  * Maxim Integrated MAX31760
+    Prefix: 'max31760'
+    Addresses scanned: none
+    Datasheet: https://datasheets.maximintegrated.com/en/ds/MAX31760.pdf
+
+Author:
+	John Muir <john-eXjPKP/[email protected]>
+
+Description
+-----------
+
+The MAX31760 integrates temperature sensing along with precision PWM fan
+control. Please read the datasheet referenced above for a comprehensive
+description of this device.
+
+This device driver's hwmon integration provides the common sysfs interfaces to
+manage two fans and two temperature sensors, and pwm controls for the fan speed.
+A temperature to pwm lookup table is exposed via a series of 'auto_point'
+configuration files. See Documentation/hwmon/sysfs-interface for more
+information.
+
+The following custom controls are defined (in the custom sub-directory):
+
+control		- Accepts control commands:
+		  "reset"   - Execute a soft reset of the device.
+		  "clearff" - Clear the fan fault.
+
+eeprom_read	- Read from the EEPROM into registers.
+eeprom_write    - Write register contents to the EEPROM.
+		  Write "0" to these to read or write the entire register
+		  contents. Write a bit-field as per the datasheet to write a
+		  portion of the register contents.
+
+pwm1_fan_fault  - PWM value in the range of 0 to 255 used when a fan is faulty.
+
+pwm1_ramp_rate  - PWM increment per second when the PWM value is changed.
+		  Accepted values are 8, 16, 32, or 255 (instantaneous).
drivers/hwmon/Kconfig +10 -0
index 337e9078df0a..83c9b46a3876 100644
@@ -895,6 +895,16 @@ config SENSORS_MAX6697
 	  This driver can also be built as a module.  If so, the module
 	  will be called max6697.
 
+config SENSORS_MAX31760
+	tristate "Maxim MAX31760 fan controller"
+	depends on I2C
+	help
+	  If you say yes here you get support for the Maxim Integrated
+	  MAX31760 Precision Fan-Speed Controller.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called max31760.
+
 config SENSORS_MAX31790
 	tristate "Maxim MAX31790 sensor chip"
 	depends on I2C
drivers/hwmon/Makefile +1 -0
index d2bdccc000e6..e0ab73e0caa6 100644
@@ -120,6 +120,7 @@ obj-$(CONFIG_SENSORS_MAX6639)	+= max6639.o
 obj-$(CONFIG_SENSORS_MAX6642)	+= max6642.o
 obj-$(CONFIG_SENSORS_MAX6650)	+= max6650.o
 obj-$(CONFIG_SENSORS_MAX6697)	+= max6697.o
+obj-$(CONFIG_SENSORS_MAX31760)  += max31760.o
 obj-$(CONFIG_SENSORS_MAX31790)	+= max31790.o
 obj-$(CONFIG_SENSORS_MC13783_ADC)+= mc13783-adc.o
 obj-$(CONFIG_SENSORS_MCP3021)	+= mcp3021.o
drivers/hwmon/max31760.c new file +1461 -0

1,461 lines not on this page · raw message

Signature · 6 lines
2.12.2.715.g7642488e1d-goog

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#12 lore raw

PATCH v2 2/2 devicetree: Document the max31760 device binding.

In reply to a message not in the archive

v2:
- Fixup based on comments.

---
 .../devicetree/bindings/hwmon/max31760.txt         | 72 ++++++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/max31760.txt
Documentation/devicetree/bindings/hwmon/max31760.txt new file +72 -0
new file mode 100644
index 000000000000..760fdf0b55e0
@@ -0,0 +1,72 @@
+MAX31760 fan controller
+-----------------------
+
+This device supports I2C only. Fan sub-nodes must be defined in order to enable
+the fan tachometer input. See also the datasheet:
+https://datasheets.maximintegrated.com/en/ds/MAX31760.pdf
+
+Required node properties:
+ - compatible: "maxim,max31760"
+ - reg: The I2C address of the device. This is 0x50 - 0x57 depending on the
+   hardware configuration.
+ - #address-cells: Must be 1.
+ - #size-cells: Must be 0.
+
+Optional node properties:
+ - maxim,fan-fail-full-only: Boolean; Assert a fan failure only when the PWM is
+   at 100%.
+ - maxim,fan-rd-signal: Boolean; Fans provide a rotation detection (RD) signal
+   instead of generating square-wave pulses.
+ - maxim,fan-rd-polarity-high: Boolean; RD is high when the fan is running, not
+   low. Only relevant when fan-rd-signal is true.
+ - maxim,fan-signal-enabled: Boolean; Externally driving FF/FS low should force
+   PWM output to 100%.
+ - maxim,fan-spin-up-enabled: Boolean; For fan startup set the PWM to 100% until
+   tach is detected or two seconds have passed before reducing to the target
+   value.
+ - maxim,pwm-polarity-negative: Boolean; 100% PWM is when PWM is low, not high.
+ - maxim,pwm-pulse-stretch-enabled: Boolean; Enable PWM pulse stretching.
+ - maxim,pwm-zero-fan-can-fail: Boolean; Enable fan failure detection while
+   ramping to 0% PWM.
+
+Fan sub-nodes must be present in order to enable the fan.
+
+Required fan sub-node properties:
+ - reg: Fan address. Must be <0x00> or <0x01>.
+
+Optional fan sub-node properties:
+ - label: String; Assigned to the hwmon fanX_label property.
+
+Temperature sub-nodes are optional.
+
+Required temp sub-node properties:
+ - reg: Temperature sensor address. Must be <0x00> or <0x01>.
+
+Optional temp sub-node properties:
+ - label: String; Assigned to the hwmon tempX_label property.
+ - ideality: For temperature node with reg 1 only: Set ideality factor for the
+   remote temperature sensor. Integer with range 0 to 63, representing a
+   multiplication factor of 0.9844 to 1.0489. Default: 24 (1.0080).
+
+Example:
+	max31760@50 {
+		compatible = "maxim,max31760";
+		reg = <0x50>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		maxim,fan-spin-up-enabled;
+
+		fan@0 {
+			reg = <0x00>;
+			label = "Left";
+		};
+		fan@1 {
+			reg = <0x01>;
+			label = "Right";
+		};
+		temp@1 {
+			reg = <0x01>;
+			label = "CPU";
+		};
+	};
Signature · 6 lines
2.12.2.715.g7642488e1d-goog

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer
#13 lore raw

Re: [PATCH v2 2/2] devicetree: Document the max31760 device binding.

Quoted 2 lines · John Muir

v2:
- Fixup based on comments.

While you should have a commit msg here, the patch versioning goes below the '---'.

This history is not too useful either. You should describe what you changed so reviewers don't have to go find the previous versions. I may remember reviewing a patch, but I likely don't remember what I said.

Quoted 50 lines
---
 .../devicetree/bindings/hwmon/max31760.txt         | 72 ++++++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/max31760.txt
Documentation/devicetree/bindings/hwmon/max31760.txt new file +37 -0
new file mode 100644
index 000000000000..760fdf0b55e0
@@ -0,0 +1,72 @@
+MAX31760 fan controller
+-----------------------
+
+This device supports I2C only. Fan sub-nodes must be defined in order to enable
+the fan tachometer input. See also the datasheet:
+https://datasheets.maximintegrated.com/en/ds/MAX31760.pdf
+
+Required node properties:
+ - compatible: "maxim,max31760"
+ - reg: The I2C address of the device. This is 0x50 - 0x57 depending on the
+   hardware configuration.
+ - #address-cells: Must be 1.
+ - #size-cells: Must be 0.
+
+Optional node properties:
+ - maxim,fan-fail-full-only: Boolean; Assert a fan failure only when the PWM is
+   at 100%.
+ - maxim,fan-rd-signal: Boolean; Fans provide a rotation detection (RD) signal
+   instead of generating square-wave pulses.
+ - maxim,fan-rd-polarity-high: Boolean; RD is high when the fan is running, not
+   low. Only relevant when fan-rd-signal is true.
+ - maxim,fan-signal-enabled: Boolean; Externally driving FF/FS low should force
+   PWM output to 100%.
+ - maxim,fan-spin-up-enabled: Boolean; For fan startup set the PWM to 100% until
+   tach is detected or two seconds have passed before reducing to the target
+   value.
+ - maxim,pwm-polarity-negative: Boolean; 100% PWM is when PWM is low, not high.
+ - maxim,pwm-pulse-stretch-enabled: Boolean; Enable PWM pulse stretching.
+ - maxim,pwm-zero-fan-can-fail: Boolean; Enable fan failure detection while
+   ramping to 0% PWM.
+
+Fan sub-nodes must be present in order to enable the fan.
+
+Required fan sub-node properties:
+ - reg: Fan address. Must be <0x00> or <0x01>.
+
+Optional fan sub-node properties:

Documentation/devicetree/bindings/hwmon/max31760.txt line 47

Quoted 10 lines
Documentation/devicetree/bindings/hwmon/max31760.txt new file +10 -0
+ - label: String; Assigned to the hwmon fanX_label property.
+
+Temperature sub-nodes are optional.
+
+Required temp sub-node properties:
+ - reg: Temperature sensor address. Must be <0x00> or <0x01>.
+
+Optional temp sub-node properties:
+ - label: String; Assigned to the hwmon tempX_label property.
+ - ideality: For temperature node with reg 1 only: Set ideality factor for the

This too needs a maxim prefix.

Quoted 28 lines
Documentation/devicetree/bindings/hwmon/max31760.txt new file +25 -0
+   remote temperature sensor. Integer with range 0 to 63, representing a
+   multiplication factor of 0.9844 to 1.0489. Default: 24 (1.0080).
+
+Example:
+	max31760@50 {
+		compatible = "maxim,max31760";
+		reg = <0x50>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		maxim,fan-spin-up-enabled;
+
+		fan@0 {
+			reg = <0x00>;
+			label = "Left";
+		};
+		fan@1 {
+			reg = <0x01>;
+			label = "Right";
+		};
+		temp@1 {
+			reg = <0x01>;
+			label = "CPU";
+		};
+	};
Signature · 1 line
2.12.2.715.g7642488e1d-goog