1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
From 9e74101196da1ee94be39e68b37ce7ede665529d Mon Sep 17 00:00:00 2001
From: Matt DeVillier <matt.devillier@gmail.com>
Date: Fri, 11 Jul 2025 16:07:29 -0500
Subject: [PATCH 35/43] ec/lenovo/h8: Add CFR objects for existing options
Add a header with CFR objects for existing configuration options,
so that supported boards can make use of them without duplication.
TEST=build/boot lenovo/t480 w/edk2 payload
Change-Id: I198f569e69abd42071df4d5354cd2bb258749257
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
---
src/ec/lenovo/h8/cfr.h | 156 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 156 insertions(+)
create mode 100644 src/ec/lenovo/h8/cfr.h
diff --git a/src/ec/lenovo/h8/cfr.h b/src/ec/lenovo/h8/cfr.h
new file mode 100644
index 0000000000..934a3e866b
--- /dev/null
+++ b/src/ec/lenovo/h8/cfr.h
@@ -0,0 +1,156 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+/*
+ * CFR enums and structs for Lenovo H8 EC
+ */
+
+#ifndef _LENOVO_H8_CFR_H_
+#define _LENOVO_H8_CFR_H_
+
+#include <drivers/option/cfr_frontend.h>
+
+/* Bluetooth */
+static const struct sm_object bluetooth = SM_DECLARE_ENUM({
+ .opt_name = "bluetooth",
+ .ui_name = "Bluetooth",
+ .ui_helptext = "Enable or disable the bluetooth module",
+ .default_value = 1,
+ .values = (const struct sm_enum_value[]) {
+ { "Disabled", 0 },
+ { "Enabled", 1 },
+ SM_ENUM_VALUE_END },
+});
+
+/* Keyboard Backlight */
+static const struct sm_object backlight = SM_DECLARE_ENUM({
+ .opt_name = "backlight",
+ .ui_name = "Keyboard Backlight",
+ .ui_helptext = "Enable or disable the keyboard backlight",
+ .default_value = 0,
+ .values = (const struct sm_enum_value[]) {
+ { "Disabled", 0 },
+ { "Enabled", 1 },
+ SM_ENUM_VALUE_END },
+});
+
+/* USB Always-On */
+static const struct sm_object usb_always_on = SM_DECLARE_ENUM({
+ .opt_name = "usb_always_on",
+ .ui_name = "USB Always-on",
+ .ui_helptext = "Always keep USB ports powered",
+ .default_value = 0,
+ .values = (const struct sm_enum_value[]) {
+ { "Disabled", 0 },
+ { "Enabled", 1 },
+ SM_ENUM_VALUE_END },
+});
+
+/* Ultrawideband */
+static const struct sm_object uwb = SM_DECLARE_ENUM({
+ .opt_name = "uwb",
+ .ui_name = "Ultrawideband",
+ .ui_helptext = "TBD",
+ .default_value = 1,
+ .values = (const struct sm_enum_value[]) {
+ { "Disabled", 0 },
+ { "Enabled", 1 },
+ SM_ENUM_VALUE_END },
+});
+
+/* Volume control */
+static const struct sm_object volume = SM_DECLARE_ENUM({
+ .opt_name = "volume",
+ .ui_name = "Volume",
+ .ui_helptext = "TBD",
+ .default_value = 0,
+ .values = (const struct sm_enum_value[]) {
+ { "Disabled", 0 },
+ { "Enabled", 1 },
+ SM_ENUM_VALUE_END },
+});
+
+/* WLAN */
+static const struct sm_object wlan = SM_DECLARE_ENUM({
+ .opt_name = "wlan",
+ .ui_name = "WLAN",
+ .ui_helptext = "Enable or disable the WLAN module",
+ .default_value = 1,
+ .values = (const struct sm_enum_value[]) {
+ { "Disabled", 0 },
+ { "Enabled", 1 },
+ SM_ENUM_VALUE_END },
+});
+
+/* WWAN */
+static const struct sm_object wwan = SM_DECLARE_ENUM({
+ .opt_name = "wwan",
+ .ui_name = "WWAN",
+ .ui_helptext = "Enable or disable the WWAN module",
+ .default_value = 1,
+ .values = (const struct sm_enum_value[]) {
+ { "Disabled", 0 },
+ { "Enabled", 1 },
+ SM_ENUM_VALUE_END },
+});
+
+/* Power Management Beeps */
+static const struct sm_object pm_beeps = SM_DECLARE_ENUM({
+ .opt_name = "power_management_beeps",
+ .ui_name = "Power Management Beeps",
+ .ui_helptext = "Enable or disable power management beeps",
+ .default_value = 1,
+ .values = (const struct sm_enum_value[]) {
+ { "Disabled", 0 },
+ { "Enabled", 1 },
+ SM_ENUM_VALUE_END },
+});
+
+/* Low Battery Beep */
+static const struct sm_object battery_beep = SM_DECLARE_ENUM({
+ .opt_name = "low_battery_beep",
+ .ui_name = "Low Battery Beep",
+ .ui_helptext = "Enable or disable low battery beep",
+ .default_value = 1,
+ .values = (const struct sm_enum_value[]) {
+ { "Disabled", 0 },
+ { "Enabled", 1 },
+ SM_ENUM_VALUE_END },
+});
+
+/* Fn-CTRL Swap */
+static const struct sm_object fn_ctrl_swap = SM_DECLARE_ENUM({
+ .opt_name = "fn_ctrl_swap",
+ .ui_name = "Swap Fn and CTRL",
+ .ui_helptext = "Swap the left Fn and CTRL keys",
+ .default_value = CONFIG(H8_FN_CTRL_SWAP),
+ .values = (const struct sm_enum_value[]) {
+ { "Disabled", 0 },
+ { "Enabled", 1 },
+ SM_ENUM_VALUE_END },
+});
+
+/* Fn Lock */
+static const struct sm_object sticky_fn = SM_DECLARE_ENUM({
+ .opt_name = "sticky_fn",
+ .ui_name = "Sticky Fn key",
+ .ui_helptext = "Function key acts as a toggle",
+ .default_value = 0,
+ .values = (const struct sm_enum_value[]) {
+ { "Disabled", 0 },
+ { "Enabled", 1 },
+ SM_ENUM_VALUE_END },
+});
+
+/* Function keys primary */
+static const struct sm_object f1_to_f12_as_primary = SM_DECLARE_ENUM({
+ .opt_name = "f1_to_f12_as_primary",
+ .ui_name = "Primary Function keys",
+ .ui_helptext = "F1-F12 default act as function keys",
+ .default_value = 1,
+ .values = (const struct sm_enum_value[]) {
+ { "Disabled", 0 },
+ { "Enabled", 1 },
+ SM_ENUM_VALUE_END },
+});
+
+#endif /* _LENOVO_H8_CFR_H_ */
--
2.39.5
|