Skip to content

Commit d1b87bd

Browse files
JianyuWang0623xiaoxiang781216
authored andcommitted
Add thermal framework
Signed-off-by: wangjianyu3 <[email protected]>
1 parent b78c9a7 commit d1b87bd

File tree

10 files changed

+1230
-0
lines changed

10 files changed

+1230
-0
lines changed

Kconfig

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1936,6 +1936,37 @@ config DEBUG_SPI_INFO
19361936

19371937
endif # DEBUG_SPI
19381938

1939+
config DEBUG_THERMAL
1940+
bool "Thermal Debug Features"
1941+
default n
1942+
---help---
1943+
Enable thermal debug features.
1944+
1945+
if DEBUG_THERMAL
1946+
1947+
config DEBUG_THERMAL_ERROR
1948+
bool "Thermal Error Output"
1949+
default n
1950+
depends on DEBUG_ERROR
1951+
---help---
1952+
Enable thermal error output to SYSLOG.
1953+
1954+
config DEBUG_THERMAL_WARN
1955+
bool "Thermal Warnings Output"
1956+
default n
1957+
depends on DEBUG_WARN
1958+
---help---
1959+
Enable thermal warning output to SYSLOG.
1960+
1961+
config DEBUG_THERMAL_INFO
1962+
bool "Thermal Informational Output"
1963+
default n
1964+
depends on DEBUG_INFO
1965+
---help---
1966+
Enable thermal informational output to SYSLOG.
1967+
1968+
endif # DEBUG_THERMAL
1969+
19391970
config DEBUG_TIMER
19401971
bool "Timer Debug Features"
19411972
default n

drivers/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ source "drivers/rpmsg/Kconfig"
4242
source "drivers/rptun/Kconfig"
4343
source "drivers/sensors/Kconfig"
4444
source "drivers/serial/Kconfig"
45+
source "drivers/thermal/Kconfig"
4546
source "drivers/usbdev/Kconfig"
4647
source "drivers/usbhost/Kconfig"
4748
source "drivers/usbmisc/Kconfig"

drivers/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ include sensors/Make.defs
6363
include serial/Make.defs
6464
include spi/Make.defs
6565
include syslog/Make.defs
66+
include thermal/Make.defs
6667
include timers/Make.defs
6768
include usbdev/Make.defs
6869
include usbhost/Make.defs

drivers/drivers_initialize.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#include <nuttx/serial/uart_ram.h>
4747
#include <nuttx/syslog/syslog.h>
4848
#include <nuttx/syslog/syslog_console.h>
49+
#include <nuttx/thermal.h>
4950
#include <nuttx/trace.h>
5051
#include <nuttx/usrsock/usrsock_rpmsg.h>
5152
#include <nuttx/virtio/virtio.h>
@@ -271,5 +272,9 @@ void drivers_initialize(void)
271272
optee_register();
272273
#endif
273274

275+
#ifdef CONFIG_THERMAL
276+
thermal_init();
277+
#endif
278+
274279
drivers_trace_end();
275280
}

drivers/thermal/Kconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#
2+
# For a description of the syntax of this configuration file,
3+
# see the file kconfig-language.txt in the NuttX tools repository.
4+
#
5+
6+
menuconfig THERMAL
7+
bool "Thermal framework"
8+
default n
9+
---help---
10+
Enable thermal framework.
11+
12+
if THERMAL
13+
14+
config THERMAL_DEFAULT_GOVERNOR
15+
string "Thermal default governor name"
16+
default "step_wise"
17+
---help---
18+
Default governor name.
19+
20+
endif # THERMAL

drivers/thermal/Make.defs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
############################################################################
2+
# drivers/thermal/Make.defs
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one or more
5+
# contributor license agreements. See the NOTICE file distributed with
6+
# this work for additional information regarding copyright ownership. The
7+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance with the
9+
# License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
# License for the specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
############################################################################
20+
21+
# Include thermal sources
22+
23+
ifeq ($(CONFIG_THERMAL),y)
24+
25+
CSRCS += thermal_core.c
26+
27+
DEPPATH += --dep-path thermal
28+
VPATH += thermal
29+
30+
endif

0 commit comments

Comments
 (0)