Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Rewrite fan control #495

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions src/board/system76/addw1/board.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-3.0-only

board-y += board.c
board-y += fan.c
board-y += gpio.c

EC=ite
Expand Down Expand Up @@ -42,22 +43,7 @@ CFLAGS += -DI2C_DGPU=I2C_1

# Fan configs
CFLAGS += -DFAN1_PWM=DCR2
CFLAGS += -DBOARD_FAN1_POINTS="\
FAN_POINT(60, 40), \
FAN_POINT(65, 60), \
FAN_POINT(70, 75), \
FAN_POINT(75, 90), \
FAN_POINT(80, 100), \
"

CFLAGS += -DFAN2_PWM=DCR4
CFLAGS += -DBOARD_FAN2_POINTS="\
FAN_POINT(60, 40), \
FAN_POINT(65, 60), \
FAN_POINT(70, 75), \
FAN_POINT(75, 90), \
FAN_POINT(80, 100), \
"

# Add system76 common code
include src/board/system76/common/common.mk
30 changes: 30 additions & 0 deletions src/board/system76/addw1/fan.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// SPDX-License-Identifier: GPL-3.0-only

#include <board/fan.h>
#include <common/macro.h>

static const struct FanPoint __code FAN1_POINTS[] = {
FAN_POINT(60, 40),
FAN_POINT(65, 60),
FAN_POINT(70, 75),
FAN_POINT(75, 90),
FAN_POINT(80, 100),
};

const struct Fan __code FAN1 = {
.points = FAN1_POINTS,
.points_size = ARRAY_SIZE(FAN1_POINTS),
};

static const struct FanPoint __code FAN2_POINTS[] = {
FAN_POINT(60, 40),
FAN_POINT(65, 60),
FAN_POINT(70, 75),
FAN_POINT(75, 90),
FAN_POINT(80, 100),
};

const struct Fan __code FAN2 = {
.points = FAN2_POINTS,
.points_size = ARRAY_SIZE(FAN2_POINTS),
};
16 changes: 1 addition & 15 deletions src/board/system76/addw2/board.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-3.0-only

board-y += board.c
board-y += fan.c
board-y += gpio.c

EC=ite
Expand Down Expand Up @@ -42,22 +43,7 @@ CFLAGS += -DI2C_DGPU=I2C_1

# Fan configs
CFLAGS += -DFAN1_PWM=DCR2
CFLAGS += -DBOARD_FAN1_POINTS="\
FAN_POINT(60, 40), \
FAN_POINT(65, 60), \
FAN_POINT(70, 75), \
FAN_POINT(75, 90), \
FAN_POINT(80, 100), \
"

CFLAGS += -DFAN2_PWM=DCR4
CFLAGS += -DBOARD_FAN2_POINTS="\
FAN_POINT(60, 40), \
FAN_POINT(65, 60), \
FAN_POINT(70, 75), \
FAN_POINT(75, 90), \
FAN_POINT(80, 100), \
"

# Add system76 common code
include src/board/system76/common/common.mk
30 changes: 30 additions & 0 deletions src/board/system76/addw2/fan.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// SPDX-License-Identifier: GPL-3.0-only

#include <board/fan.h>
#include <common/macro.h>

static const struct FanPoint __code FAN1_POINTS[] = {
FAN_POINT(60, 40),
FAN_POINT(65, 60),
FAN_POINT(70, 75),
FAN_POINT(75, 90),
FAN_POINT(80, 100),
};

const struct Fan __code FAN1 = {
.points = FAN1_POINTS,
.points_size = ARRAY_SIZE(FAN1_POINTS),
};

static const struct FanPoint __code FAN2_POINTS[] = {
FAN_POINT(60, 40),
FAN_POINT(65, 60),
FAN_POINT(70, 75),
FAN_POINT(75, 90),
FAN_POINT(80, 100),
};

const struct Fan __code FAN2 = {
.points = FAN2_POINTS,
.points_size = ARRAY_SIZE(FAN2_POINTS),
};
20 changes: 1 addition & 19 deletions src/board/system76/addw3/board.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-3.0-only

board-y += board.c
board-y += fan.c
board-y += gpio.c

EC=ite
Expand Down Expand Up @@ -49,26 +50,7 @@ CFLAGS += -DI2C_DGPU=I2C_1

# Fan configs
CFLAGS += -DFAN1_PWM=DCR2
CFLAGS += -DBOARD_FAN1_HEATUP=5
CFLAGS += -DBOARD_FAN1_COOLDOWN=20
CFLAGS += -DBOARD_FAN1_POINTS="\
FAN_POINT(60, 40), \
FAN_POINT(65, 60), \
FAN_POINT(70, 75), \
FAN_POINT(75, 90), \
FAN_POINT(80, 100), \
"

CFLAGS += -DFAN2_PWM=DCR4
CFLAGS += -DBOARD_FAN2_HEATUP=5
CFLAGS += -DBOARD_FAN2_COOLDOWN=20
CFLAGS += -DBOARD_FAN2_POINTS="\
FAN_POINT(60, 40), \
FAN_POINT(65, 60), \
FAN_POINT(70, 75), \
FAN_POINT(75, 90), \
FAN_POINT(80, 100), \
"

# Add system76 common code
include src/board/system76/common/common.mk
30 changes: 30 additions & 0 deletions src/board/system76/addw3/fan.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// SPDX-License-Identifier: GPL-3.0-only

#include <board/fan.h>
#include <common/macro.h>

static const struct FanPoint __code FAN1_POINTS[] = {
FAN_POINT(60, 40),
FAN_POINT(65, 60),
FAN_POINT(70, 75),
FAN_POINT(75, 90),
FAN_POINT(80, 100),
};

const struct Fan __code FAN1 = {
.points = FAN1_POINTS,
.points_size = ARRAY_SIZE(FAN1_POINTS),
};

static const struct FanPoint __code FAN2_POINTS[] = {
FAN_POINT(60, 40),
FAN_POINT(65, 60),
FAN_POINT(70, 75),
FAN_POINT(75, 90),
FAN_POINT(80, 100),
};

const struct Fan __code FAN2 = {
.points = FAN2_POINTS,
.points_size = ARRAY_SIZE(FAN2_POINTS),
};
24 changes: 1 addition & 23 deletions src/board/system76/addw4/board.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-3.0-only

board-y += board.c
board-y += fan.c
board-y += gpio.c

EC = ite
Expand Down Expand Up @@ -45,30 +46,7 @@ CFLAGS += -DI2C_DGPU=I2C_1

# Fan configs
CFLAGS += -DFAN1_PWM=DCR2
CFLAGS += -DBOARD_FAN1_HEATUP=5
CFLAGS += -DBOARD_FAN1_COOLDOWN=20
CFLAGS += -DBOARD_FAN1_POINTS="\
FAN_POINT(60, 28), \
FAN_POINT(65, 28), \
FAN_POINT(70, 40), \
FAN_POINT(75, 60), \
FAN_POINT(80, 75), \
FAN_POINT(85, 90), \
FAN_POINT(90, 100), \
"

CFLAGS += -DFAN2_PWM=DCR4
CFLAGS += -DBOARD_FAN2_HEATUP=5
CFLAGS += -DBOARD_FAN2_COOLDOWN=20
CFLAGS += -DBOARD_FAN2_POINTS="\
FAN_POINT(60, 28), \
FAN_POINT(65, 28), \
FAN_POINT(70, 40), \
FAN_POINT(75, 60), \
FAN_POINT(80, 75), \
FAN_POINT(85, 90), \
FAN_POINT(90, 100), \
"

# Add system76 common code
include src/board/system76/common/common.mk
34 changes: 34 additions & 0 deletions src/board/system76/addw4/fan.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// SPDX-License-Identifier: GPL-3.0-only

#include <board/fan.h>
#include <common/macro.h>

static const struct FanPoint __code FAN1_POINTS[] = {
FAN_POINT(60, 28),
FAN_POINT(65, 28),
FAN_POINT(70, 40),
FAN_POINT(75, 60),
FAN_POINT(80, 75),
FAN_POINT(85, 90),
FAN_POINT(90, 100),
};

const struct Fan __code FAN1 = {
.points = FAN1_POINTS,
.points_size = ARRAY_SIZE(FAN1_POINTS),
};

static const struct FanPoint __code FAN2_POINTS[] = {
FAN_POINT(60, 28),
FAN_POINT(65, 28),
FAN_POINT(70, 40),
FAN_POINT(75, 60),
FAN_POINT(80, 75),
FAN_POINT(85, 90),
FAN_POINT(90, 100),
};

const struct Fan __code FAN2 = {
.points = FAN2_POINTS,
.points_size = ARRAY_SIZE(FAN2_POINTS),
};
16 changes: 1 addition & 15 deletions src/board/system76/bonw14/board.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-3.0-only

board-y += board.c
board-y += fan.c
board-y += gpio.c

EC=ite
Expand Down Expand Up @@ -42,22 +43,7 @@ CFLAGS += -DI2C_DGPU=I2C_1

# Fan configs
CFLAGS += -DFAN1_PWM=DCR2
CFLAGS += -DBOARD_FAN1_POINTS="\
FAN_POINT(60, 40), \
FAN_POINT(65, 60), \
FAN_POINT(70, 75), \
FAN_POINT(75, 90), \
FAN_POINT(80, 100), \
"

CFLAGS += -DFAN2_PWM=DCR4
CFLAGS += -DBOARD_FAN2_POINTS="\
FAN_POINT(60, 40), \
FAN_POINT(65, 60), \
FAN_POINT(70, 75), \
FAN_POINT(75, 90), \
FAN_POINT(80, 100), \
"

# Add system76 common code
include src/board/system76/common/common.mk
30 changes: 30 additions & 0 deletions src/board/system76/bonw14/fan.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// SPDX-License-Identifier: GPL-3.0-only

#include <board/fan.h>
#include <common/macro.h>

static const struct FanPoint __code FAN1_POINTS[] = {
FAN_POINT(60, 40),
FAN_POINT(65, 60),
FAN_POINT(70, 75),
FAN_POINT(75, 90),
FAN_POINT(80, 100),
};

const struct Fan __code FAN1 = {
.points = FAN1_POINTS,
.points_size = ARRAY_SIZE(FAN1_POINTS),
};

static const struct FanPoint __code FAN2_POINTS[] = {
FAN_POINT(60, 40),
FAN_POINT(65, 60),
FAN_POINT(70, 75),
FAN_POINT(75, 90),
FAN_POINT(80, 100),
};

const struct Fan __code FAN2 = {
.points = FAN2_POINTS,
.points_size = ARRAY_SIZE(FAN2_POINTS),
};
20 changes: 1 addition & 19 deletions src/board/system76/bonw15/board.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-3.0-only

board-y += board.c
board-y += fan.c
board-y += gpio.c

EC=ite
Expand Down Expand Up @@ -54,26 +55,7 @@ CFLAGS += -DI2C_DGPU=I2C_1

# Fan configs
CFLAGS += -DFAN1_PWM=DCR2
CFLAGS += -DBOARD_FAN1_HEATUP=5
CFLAGS += -DBOARD_FAN1_COOLDOWN=20
CFLAGS += -DBOARD_FAN1_POINTS="\
FAN_POINT(60, 40), \
FAN_POINT(65, 60), \
FAN_POINT(70, 75), \
FAN_POINT(75, 90), \
FAN_POINT(80, 100), \
"

CFLAGS += -DFAN2_PWM=DCR4
CFLAGS += -DBOARD_FAN2_HEATUP=5
CFLAGS += -DBOARD_FAN2_COOLDOWN=20
CFLAGS += -DBOARD_FAN2_POINTS="\
FAN_POINT(60, 40), \
FAN_POINT(65, 60), \
FAN_POINT(70, 75), \
FAN_POINT(75, 90), \
FAN_POINT(80, 100), \
"

# Add system76 common code
include src/board/system76/common/common.mk
30 changes: 30 additions & 0 deletions src/board/system76/bonw15/fan.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// SPDX-License-Identifier: GPL-3.0-only

#include <board/fan.h>
#include <common/macro.h>

static const struct FanPoint __code FAN1_POINTS[] = {
FAN_POINT(60, 40),
FAN_POINT(65, 60),
FAN_POINT(70, 75),
FAN_POINT(75, 90),
FAN_POINT(80, 100),
};

const struct Fan __code FAN1 = {
.points = FAN1_POINTS,
.points_size = ARRAY_SIZE(FAN1_POINTS),
};

static const struct FanPoint __code FAN2_POINTS[] = {
FAN_POINT(60, 40),
FAN_POINT(65, 60),
FAN_POINT(70, 75),
FAN_POINT(75, 90),
FAN_POINT(80, 100),
};

const struct Fan __code FAN2 = {
.points = FAN2_POINTS,
.points_size = ARRAY_SIZE(FAN2_POINTS),
};
Loading
Loading