aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/aspeed-pwm-tacho.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-01-02hwmon: (aspeed-pwm-tacho) Deassert reset in probeJoel1-0/+22
The ASPEED SoC must deassert a reset in order to use the PWM/tach peripheral. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-11-04hwmon: (aspeed-pwm-tacho) Sort headersJoel1-3/+3
Sort the headers in preperation for future changes. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-29hwmon: (aspeed-pwm-tacho) increase fan tach periodPatrick Venture1-1/+1
The previous value reduced the time required to determine the fan value, however, it's also used as the final timeout mechanism. The prevous value would work for any fan speed greater than around 3k RPM. This increased value, lets the fan speeds return quickly but will wait longer to handle speeds below 3k RPM. Testing: this value was determined through experimentation on the ast2400 on the Quanta-q71l. This configurations runs 8 fans attached to the controller. Signed-off-by: Patrick Venture <venture@google.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-08-13hwmon: (aspeed-pwm-tacho) cooling device support.Mykola Kostenok1-2/+114
Add support in aspeed-pwm-tacho driver for cooling device creation. This cooling device could be bound to a thermal zone for the thermal control. Device will appear in /sys/class/thermal folder as cooling_deviceX. Then it could be bound to particular thermal zones. Allow specification of the cooling levels vector - PWM duty cycle values in a range from 0 to 255 which correspond to thermal cooling states. Signed-off-by: Mykola Kostenok <c_mykolak@mellanox.com> Reviewed-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-06-24hwmon: (aspeed-pwm-tacho) Poll with short sleeps.Patrick Venture1-6/+18
The reference driver polled but mentioned it was possible to sleep for a computed period to know when it's ready to read. However, polling with minimal sleeps is quick and works. This also improves responsiveness from the driver. Testing: tested on ast2400 on quanta-q71l Signed-off-by: Patrick Venture <venture@google.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-06-24hwmon: (aspeed-pwm-tacho) reduce fan_tach periodPatrick Venture1-1/+1
Reduce the fan_tach period such that the fan controller uses a shorter period to measure the rpm. The original period of 0x1000 was chosen as a conversative value from the reference implementation. Through experimentation on the quanta-q71l board, I was able to drive the number down which ultimately reduced the time the controller would use to determine the fan_tach. This value was recently tested and accepted downstream on the IBM Zaius board which uses the ast2500. Future work: It may be worthwhile as this is a tunable parameter to the system, to allow overriding it through the device tree. Testing: Tested on an ast2400 sitting on a quanta-q71l and ast2500 on power9. Signed-off-by: Patrick Venture <venture@google.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-06-11hwmon: (aspeed-pwm-tacho) Enable both edge measurement.Patrick Venture1-3/+21
The aspeed-pwm-tacho controller supports measuring the fan tach by using leading, falling, or both edges. This change allows the driver to support either of the three configurations and will appropriately modify the returned tach data. If the controller is measuring with both edges it can return a value more quickly to the requestor. This version of the driver should still take ~1s to return with an RPM value per fan, however, it can be tuned faster with double edge counting enabled than without. I tested this and found the number returned matched what I expected. Signed-off-by: Patrick Venture <venture@google.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-06-03hwmon: (aspeed-pwm-tacho) make fan/pwm names start with index 1Stefan Schaeckeler1-26/+26
Make fan and pwm names in sysfs start with index 1 in accordance to Documentation/hwmon/sysfs-interface conventions. Current implementation starts with index 0, making tools such as sensors(1) skip the first fan. Signed-off-by: Stefan Schaeckeler <sschaeck@cisco.com> Fixes: 2d7a548a3eff ("drivers: hwmon: Support for ASPEED PWM/Fan tach") Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-06-03hwmon: (aspeed-pwm-tacho) Call of_node_put() on a node not claimedStefan Schaeckeler1-1/+0
Call of_node_put() on a node claimed with of_node_get() or by any other means such as for_each_child_of_node(). Signed-off-by: Stefan Schaeckeler <sschaeck@cisco.com> Fixes: 2d7a548a3eff ("drivers: hwmon: Support for ASPEED PWM/Fan tach") Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-05-30hwmon: (aspeed-pwm-tacho) On read failure return -ETIMEDOUTPatrick Venture1-3/+9
When the controller fails to provide an RPM reading within the alloted time; the driver returns -ETIMEDOUT and no file contents. Signed-off-by: Patrick Venture <venture@google.com> Fixes: 2d7a548a3eff ("drivers: hwmon: Support for ASPEED PWM/Fan tach") Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-04-10drivers: hwmon: Support for ASPEED PWM/Fan tachJaghathiswari Rankappagounder Natarajan1-0/+835
The ASPEED AST2400/2500 PWM controller supports 8 PWM output ports. The ASPEED AST2400/2500 Fan tach controller supports 16 tachometer inputs. The device driver matches on the device tree node. The configuration values are read from the device tree and written to the respective registers. The driver provides a sysfs entries through which the user can configure the duty-cycle value (ranging from 0 to 100 percent) and read the fan tach rpm value. Signed-off-by: Jaghathiswari Rankappagounder Natarajan <jaghu@google.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>