diff options
author | Rajesh Kumar <rajesh3.kumar@intel.com> | 2021-12-28 15:09:22 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-01-10 19:43:51 +0000 |
commit | 229252b3e2e575c100f61dd0333f07f6c42790c3 (patch) | |
tree | 4ff8b574c95ffb1149d520c679d4809350fe822f | |
parent | 27f962e3c1df309e149454c884987798f29c0a51 (diff) | |
download | chrome-ec-229252b3e2e575c100f61dd0333f07f6c42790c3.tar.gz |
zephyr: brya: Enable fan
Enable zephyr configuration for fan.
BUG=b:212388053
BRANCH=none
TEST=EC console command "faninfo","fanduty"
Signed-off-by: Rajesh Kumar <rajesh3.kumar@intel.com>
Change-Id: Iafb91807342f2ca2fb32965ae94768b4da3dcb59
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3360079
Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r-- | zephyr/projects/brya/brya/BUILD.py | 1 | ||||
-rw-r--r-- | zephyr/projects/brya/brya/fan.dts | 29 | ||||
-rw-r--r-- | zephyr/projects/brya/brya/gpio.dts | 4 | ||||
-rw-r--r-- | zephyr/projects/brya/brya/prj.conf | 6 |
4 files changed, 40 insertions, 0 deletions
diff --git a/zephyr/projects/brya/brya/BUILD.py b/zephyr/projects/brya/brya/BUILD.py index cf11180942..45d6dca977 100644 --- a/zephyr/projects/brya/brya/BUILD.py +++ b/zephyr/projects/brya/brya/BUILD.py @@ -7,6 +7,7 @@ register_npcx_project( zephyr_board="brya", dts_overlays=[ "cbi_eeprom.dts", + "fan.dts", "gpio.dts", "motionsense.dts", "pwm.dts", diff --git a/zephyr/projects/brya/brya/fan.dts b/zephyr/projects/brya/brya/fan.dts new file mode 100644 index 0000000000..cccd6315bf --- /dev/null +++ b/zephyr/projects/brya/brya/fan.dts @@ -0,0 +1,29 @@ +/* Copyright 2022 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/ { + named-fans { + compatible = "named-fans"; + + fan_0 { + label = "FAN_0"; + pwm = <&pwm_fan>; + rpm_min = <2200>; + rpm_start = <2200>; + rpm_max = <4200>; + tach = <&tach1>; + enable_gpio = <&gpio_en_pp5000_fan>; + }; + }; +}; + +/* Tachemeter for fan speed measurement */ +&tach1 { + status = "okay"; + pinctrl-0 = <&alt3_ta1_sl1>; /* Use TA1 as input pin */ + port = <NPCX_TACH_PORT_A>; /* port-A is selected */ + sample-clk = <NPCX_TACH_FREQ_LFCLK>; /* Use LFCLK as sampling clock */ + pulses-per-round = <2>; /* number of pulses per round of encoder */ +}; diff --git a/zephyr/projects/brya/brya/gpio.dts b/zephyr/projects/brya/brya/gpio.dts index 5c9e30af55..68549c7b68 100644 --- a/zephyr/projects/brya/brya/gpio.dts +++ b/zephyr/projects/brya/brya/gpio.dts @@ -137,6 +137,10 @@ gpios = <&gpiof 0 GPIO_INPUT>; enum-name = "GPIO_EC_PROCHOT_IN_L"; }; + gpio_en_pp5000_fan: en_pp5000_fan { + gpios = <&gpio6 1 GPIO_OUT_HIGH>; + enum-name = "GPIO_EN_PP5000_FAN"; + }; }; hibernate-wake-pins { diff --git a/zephyr/projects/brya/brya/prj.conf b/zephyr/projects/brya/brya/prj.conf index c851600e22..1bfd3ce95b 100644 --- a/zephyr/projects/brya/brya/prj.conf +++ b/zephyr/projects/brya/brya/prj.conf @@ -68,6 +68,12 @@ CONFIG_PLATFORM_EC_ACCEL_LIS2DW12=y CONFIG_PLATFORM_EC_ACCEL_LIS2DW12_AS_BASE=y CONFIG_PLATFORM_EC_ALS_TCS3400=y +# Fan +CONFIG_PLATFORM_EC_FAN=y +CONFIG_SENSOR=y +CONFIG_SENSOR_SHELL=n +CONFIG_TACH_NPCX=y + # Temperature sensors CONFIG_PLATFORM_EC_TEMP_SENSOR=y CONFIG_PLATFORM_EC_THERMISTOR=y |