From 069e4405a6926cdacc33c0826075356da2cd9dbd Mon Sep 17 00:00:00 2001 From: Lei YU Date: Wed, 31 Jan 2018 16:47:37 +0800 Subject: Add target interface for fan control Current fan control assumes the use of the FanSpeed interface for fan targets. For fans controlled by pwm, FanPwm interface is added. This commit adds "target_interface" config parameter, so that user can specify the interface for the fan targets. E.g. - inventory: /system/chassis/motherboard/fan0 cooling_zone: 0 cooling_profile: air sensors: - fan0 target_interface: xyz.openbmc_project.Control.FanPwm The config is optional and defaults to FanSpeed, so the current code will not be affected. Tested: Use this config on Romulus, ensures the fan control sets target on FanPwm interface and works fine. Change-Id: I73adccaa770d657b5d7aaeb307917f89588524de Signed-off-by: Lei YU --- control/gen-fan-zone-defs.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'control/gen-fan-zone-defs.py') diff --git a/control/gen-fan-zone-defs.py b/control/gen-fan-zone-defs.py index 1568137..3ccab36 100755 --- a/control/gen-fan-zone-defs.py +++ b/control/gen-fan-zone-defs.py @@ -140,7 +140,8 @@ const std::vector Manager::_zoneLayouts %for sensor in fan['sensors']: "${sensor}", %endfor - } + }, + "${fan['target_interface']}" }, %endfor }, @@ -665,6 +666,9 @@ def getFansInZone(zone_num, profiles, fan_data): fan = {} fan['name'] = f['inventory'] fan['sensors'] = f['sensors'] + fan['target_interface'] = f.get( + 'target_interface', + 'xyz.openbmc_project.Control.FanSpeed') fans.append(fan) return fans -- cgit v1.2.1