Fansensor: Support ast26xx pwm/tach

Add new fantype for ast26xx tach driver.
Use pwm-fan driver to setup ast26xx pwm driver for easier usage.
User must define pwm-fan node in dts as below

pwm-fanX {
	compatible = "pwm-fan";
	.......
};
refer Documentation/devicetree/bindings/hwmon/pwm-fan.txt for details

and Connector in EM configuration
"Connector": {
    "Pwm": X,
    ......
}

where X is integer

Tested: On Facebook Bletchley (ast26xx) Platform with 1 fan

root@bletchley:/sys/class/leds# busctl set-property xyz.openbmc_project.FanSensor /xyz/openbmc_project/sensors/fan_pwm/Pwm_1 xyz.openbmc_project.Sensor.Value Value d 20
root@bletchley:/sys/class/leds# busctl introspect xyz.openbmc_project.FanSensor /xyz/openbmc_project/sensors/fan_tach/FAN0_TACH_IL xyz.openbmc_project.Sensor.Value
NAME                             TYPE      SIGNATURE RESULT/VALUE                             FLAGS
.MaxValue                        property  d         25000                                    emits-change
.MinValue                        property  d         0                                        emits-change
.Unit                            property  s         "xyz.openbmc_project.Sensor.Value.Uni... emits-change
.Value                           property  d         3189                                     emits-change writable
root@bletchley:/sys/class/leds# busctl introspect xyz.openbmc_project.FanSensor /xyz/openbmc_project/sensors/fan_tach/FAN0_TACH_OL xyz.openbmc_project.Sensor.Value
NAME                             TYPE      SIGNATURE RESULT/VALUE                             FLAGS
.MaxValue                        property  d         25000                                    emits-change
.MinValue                        property  d         0                                        emits-change
.Unit                            property  s         "xyz.openbmc_project.Sensor.Value.Uni... emits-change
.Value                           property  d         3006                                     emits-change writable

Signed-off-by: Howard Chiu <howard.chiu@quantatw.com>
Change-Id: Ifda89310590c9d914fa0a302df412fead807daa8
Signed-off-by: Potin Lai <potin.lai@quantatw.com>
1 file changed
tree: 23cb011d97213ef899cee81ec3201460c0c99209
  1. include/
  2. service_files/
  3. src/
  4. subprojects/
  5. tests/
  6. .clang-format
  7. .clang-ignore
  8. .clang-tidy
  9. .gitignore
  10. Jenkinsfile
  11. LICENSE
  12. MAINTAINERS
  13. meson.build
  14. meson_options.txt
  15. OWNERS
  16. README.md
README.md

dbus-sensors

dbus-sensors is a collection of sensor applications that provide the xyz.openbmc_project.Sensor collection of interfaces. They read sensor values from hwmon, d-bus, or direct driver access to provide readings. Some advance non-sensor features such as fan presence, pwm control, and automatic cpu detection (x86) are also supported.

key features

  • runtime re-configurable from d-bus (entity-manager or the like)

  • isolated: each sensor type is isolated into its own daemon, so a bug in one sensor is unlikely to affect another, and single sensor modifications are possible

  • async single-threaded: uses sdbusplus/asio bindings

  • multiple data inputs: hwmon, d-bus, direct driver access

sensor documentation