Loading...
1# SPDX-License-Identifier: GPL-2.0-only
2#
3# Platform support for Chrome OS hardware (Chromebooks and Chromeboxes)
4#
5
6menuconfig CHROME_PLATFORMS
7 bool "Platform support for Chrome hardware"
8 depends on X86 || ARM || ARM64 || COMPILE_TEST
9 help
10 Say Y here to get to see options for platform support for
11 various Chromebooks and Chromeboxes. This option alone does
12 not add any kernel code.
13
14 If you say N, all options in this submenu will be skipped and disabled.
15
16if CHROME_PLATFORMS
17
18config CHROMEOS_ACPI
19 tristate "ChromeOS specific ACPI extensions"
20 depends on ACPI
21 help
22 This driver provides the firmware interface for the services
23 exported through the ChromeOS interfaces when using ChromeOS
24 ACPI firmware.
25
26 If you have an ACPI-compatible Chromebook, say Y or M here.
27 The module will be called chromeos_acpi.
28
29config CHROMEOS_LAPTOP
30 tristate "Chrome OS Laptop"
31 depends on I2C && DMI && X86
32 help
33 This driver instantiates i2c and smbus devices such as
34 light sensors and touchpads.
35
36 If you have a supported Chromebook, choose Y or M here.
37 The module will be called chromeos_laptop.
38
39config CHROMEOS_PSTORE
40 tristate "Chrome OS pstore support"
41 depends on X86
42 help
43 This module instantiates the persistent storage on x86 ChromeOS
44 devices. It can be used to store away console logs and crash
45 information across reboots.
46
47 The range of memory used is 0xf00000-0x1000000, traditionally
48 the memory used to back VGA controller memory.
49
50 If you have a supported Chromebook, choose Y or M here.
51 The module will be called chromeos_pstore.
52
53config CHROMEOS_TBMC
54 tristate "ChromeOS Tablet Switch Controller"
55 depends on ACPI
56 depends on INPUT
57 help
58 This option adds a driver for the tablet switch on
59 select Chrome OS systems.
60
61 To compile this driver as a module, choose M here: the
62 module will be called chromeos_tbmc.
63
64config CROS_EC
65 tristate "ChromeOS Embedded Controller"
66 select CROS_EC_PROTO
67 depends on X86 || ARM || ARM64 || COMPILE_TEST
68 help
69 If you say Y here you get support for the ChromeOS Embedded
70 Controller (EC) providing keyboard, battery and power services.
71 You also need to enable the driver for the bus you are using. The
72 protocol for talking to the EC is defined by the bus driver.
73
74 To compile this driver as a module, choose M here: the
75 module will be called cros_ec.
76
77config CROS_EC_I2C
78 tristate "ChromeOS Embedded Controller (I2C)"
79 depends on CROS_EC && I2C
80
81 help
82 If you say Y here, you get support for talking to the ChromeOS
83 EC through an I2C bus. This uses a simple byte-level protocol with
84 a checksum. Failing accesses will be retried three times to
85 improve reliability.
86
87config CROS_EC_RPMSG
88 tristate "ChromeOS Embedded Controller (rpmsg)"
89 depends on CROS_EC && RPMSG && OF
90 help
91 If you say Y here, you get support for talking to the ChromeOS EC
92 through rpmsg. This uses a simple byte-level protocol with a
93 checksum. Also since there's no addition EC-to-host interrupt, this
94 use a byte in message to distinguish host event from host command.
95
96 To compile this driver as a module, choose M here: the
97 module will be called cros_ec_rpmsg.
98
99config CROS_EC_ISHTP
100 tristate "ChromeOS Embedded Controller (ISHTP)"
101 depends on CROS_EC
102 depends on INTEL_ISH_HID
103 help
104 If you say Y here, you get support for talking to the ChromeOS EC
105 firmware running on Intel Integrated Sensor Hub (ISH), using the
106 ISH Transport protocol (ISH-TP). This uses a simple byte-level
107 protocol with a checksum.
108
109 To compile this driver as a module, choose M here: the
110 module will be called cros_ec_ishtp.
111
112config CROS_EC_SPI
113 tristate "ChromeOS Embedded Controller (SPI)"
114 depends on CROS_EC && SPI
115
116 help
117 If you say Y here, you get support for talking to the ChromeOS EC
118 through a SPI bus, using a byte-level protocol. Since the EC's
119 response time cannot be guaranteed, we support ignoring
120 'pre-amble' bytes before the response actually starts.
121
122config CROS_EC_UART
123 tristate "ChromeOS Embedded Controller (UART)"
124 depends on CROS_EC && ACPI && SERIAL_DEV_BUS
125 help
126 If you say Y here, you get support for talking to the ChromeOS EC
127 through a UART, using a byte-level protocol.
128
129 To compile this driver as a module, choose M here: the
130 module will be called cros_ec_uart.
131
132config CROS_EC_LPC
133 tristate "ChromeOS Embedded Controller (LPC)"
134 depends on CROS_EC && ACPI && (X86 || COMPILE_TEST)
135 help
136 If you say Y here, you get support for talking to the ChromeOS EC
137 over an LPC bus, including the LPC Microchip EC (MEC) variant.
138 This uses a simple byte-level protocol with a checksum. This is
139 used for userspace access only. The kernel typically has its own
140 communication methods.
141
142 To compile this driver as a module, choose M here: the
143 module will be called cros_ec_lpcs.
144
145config CROS_EC_PROTO
146 bool
147 help
148 ChromeOS EC communication protocol helpers.
149
150config CROS_KBD_LED_BACKLIGHT
151 tristate "Backlight LED support for Chrome OS keyboards"
152 depends on LEDS_CLASS && (ACPI || CROS_EC)
153 help
154 This option enables support for the keyboard backlight LEDs on
155 select Chrome OS systems.
156
157 To compile this driver as a module, choose M here: the
158 module will be called cros_kbd_led_backlight.
159
160config CROS_EC_CHARDEV
161 tristate "ChromeOS EC miscdevice"
162 depends on MFD_CROS_EC_DEV
163 default MFD_CROS_EC_DEV
164 help
165 This driver adds file operations support to talk with the
166 ChromeOS EC from userspace via a character device.
167
168 To compile this driver as a module, choose M here: the
169 module will be called cros_ec_chardev.
170
171config CROS_EC_LIGHTBAR
172 tristate "Chromebook Pixel's lightbar support"
173 depends on MFD_CROS_EC_DEV
174 default MFD_CROS_EC_DEV
175 help
176 This option exposes the Chromebook Pixel's lightbar to
177 userspace.
178
179 To compile this driver as a module, choose M here: the
180 module will be called cros_ec_lightbar.
181
182config CROS_EC_VBC
183 tristate "ChromeOS EC vboot context support"
184 depends on MFD_CROS_EC_DEV && OF
185 default MFD_CROS_EC_DEV
186 help
187 This option exposes the ChromeOS EC vboot context nvram to
188 userspace.
189
190 To compile this driver as a module, choose M here: the
191 module will be called cros_ec_vbc.
192
193config CROS_EC_DEBUGFS
194 tristate "Export ChromeOS EC internals in DebugFS"
195 depends on MFD_CROS_EC_DEV && DEBUG_FS
196 default MFD_CROS_EC_DEV
197 help
198 This option exposes the ChromeOS EC device internals to
199 userspace.
200
201 To compile this driver as a module, choose M here: the
202 module will be called cros_ec_debugfs.
203
204config CROS_EC_SENSORHUB
205 tristate "ChromeOS EC MEMS Sensor Hub"
206 depends on MFD_CROS_EC_DEV
207 default MFD_CROS_EC_DEV
208 help
209 Allow loading IIO sensors. This driver is loaded by MFD and will in
210 turn query the EC and register the sensors.
211 It also spreads the sensor data coming from the EC to the IIO sensor
212 object.
213
214 To compile this driver as a module, choose M here: the
215 module will be called cros_ec_sensorhub.
216
217config CROS_EC_SYSFS
218 tristate "ChromeOS EC control and information through sysfs"
219 depends on MFD_CROS_EC_DEV && SYSFS
220 default MFD_CROS_EC_DEV
221 help
222 This option exposes some sysfs attributes to control and get
223 information from ChromeOS EC.
224
225 To compile this driver as a module, choose M here: the
226 module will be called cros_ec_sysfs.
227
228config CROS_EC_TYPEC
229 tristate "ChromeOS EC Type-C Connector Control"
230 depends on MFD_CROS_EC_DEV && TYPEC
231 depends on CROS_USBPD_NOTIFY
232 depends on USB_ROLE_SWITCH
233 default MFD_CROS_EC_DEV
234 help
235 If you say Y here, you get support for accessing Type C connector
236 information from the Chrome OS EC.
237
238 To compile this driver as a module, choose M here: the module will be
239 called cros-ec-typec.
240
241config CROS_HPS_I2C
242 tristate "ChromeOS HPS device"
243 depends on HID && I2C && PM
244 help
245 Say Y here if you want to enable support for the ChromeOS
246 human presence sensor (HPS), attached via I2C. The driver supports a
247 sensor connected to the I2C bus and exposes it as a character device.
248 To save power, the sensor is automatically powered down when no
249 clients are accessing it.
250
251config CROS_USBPD_LOGGER
252 tristate "Logging driver for USB PD charger"
253 depends on CHARGER_CROS_USBPD
254 default y
255 select RTC_LIB
256 help
257 This option enables support for logging event data for the USB PD charger
258 available in the Embedded Controller on ChromeOS systems.
259
260 To compile this driver as a module, choose M here: the
261 module will be called cros_usbpd_logger.
262
263config CROS_USBPD_NOTIFY
264 tristate "ChromeOS Type-C power delivery event notifier"
265 depends on MFD_CROS_EC_DEV
266 default MFD_CROS_EC_DEV
267 help
268 If you say Y here, you get support for Type-C PD event notifications
269 from the ChromeOS EC. On ACPI platorms this driver will bind to the
270 GOOG0003 ACPI device, and on platforms which don't have this device it
271 will get initialized on ECs which support the feature
272 EC_FEATURE_USB_PD.
273
274 To compile this driver as a module, choose M here: the
275 module will be called cros_usbpd_notify.
276
277config CHROMEOS_PRIVACY_SCREEN
278 tristate "ChromeOS Privacy Screen support"
279 depends on ACPI
280 depends on DRM
281 select DRM_PRIVACY_SCREEN
282 help
283 This driver provides the support needed for the in-built electronic
284 privacy screen that is present on some ChromeOS devices. When enabled,
285 this should probably always be built into the kernel to avoid or
286 minimize drm probe deferral.
287
288config CROS_TYPEC_SWITCH
289 tristate "ChromeOS EC Type-C Switch Control"
290 depends on MFD_CROS_EC_DEV && TYPEC && ACPI
291 default MFD_CROS_EC_DEV
292 help
293 If you say Y here, you get support for configuring the ChromeOS EC Type-C
294 muxes and retimers.
295
296 To compile this driver as a module, choose M here: the module will be
297 called cros_typec_switch.
298
299source "drivers/platform/chrome/wilco_ec/Kconfig"
300
301# Kunit test cases
302config CROS_KUNIT_EC_PROTO_TEST
303 tristate "Kunit tests for ChromeOS EC protocol" if !KUNIT_ALL_TESTS
304 depends on KUNIT && CROS_EC
305 default KUNIT_ALL_TESTS
306 select CROS_EC_PROTO
307 help
308 Kunit tests for ChromeOS EC protocol.
309
310endif # CHROMEOS_PLATFORMS
1# SPDX-License-Identifier: GPL-2.0-only
2#
3# Platform support for Chrome OS hardware (Chromebooks and Chromeboxes)
4#
5
6menuconfig CHROME_PLATFORMS
7 bool "Platform support for Chrome hardware"
8 depends on X86 || ARM || ARM64 || COMPILE_TEST
9 help
10 Say Y here to get to see options for platform support for
11 various Chromebooks and Chromeboxes. This option alone does
12 not add any kernel code.
13
14 If you say N, all options in this submenu will be skipped and disabled.
15
16if CHROME_PLATFORMS
17
18config CHROMEOS_ACPI
19 tristate "ChromeOS specific ACPI extensions"
20 depends on ACPI
21 help
22 This driver provides the firmware interface for the services
23 exported through the ChromeOS interfaces when using ChromeOS
24 ACPI firmware.
25
26 If you have an ACPI-compatible Chromebook, say Y or M here.
27 The module will be called chromeos_acpi.
28
29config CHROMEOS_LAPTOP
30 tristate "Chrome OS Laptop"
31 depends on I2C && DMI && X86
32 help
33 This driver instantiates i2c and smbus devices such as
34 light sensors and touchpads.
35
36 If you have a supported Chromebook, choose Y or M here.
37 The module will be called chromeos_laptop.
38
39config CHROMEOS_PSTORE
40 tristate "Chrome OS pstore support"
41 depends on X86
42 help
43 This module instantiates the persistent storage on x86 ChromeOS
44 devices. It can be used to store away console logs and crash
45 information across reboots.
46
47 The range of memory used is 0xf00000-0x1000000, traditionally
48 the memory used to back VGA controller memory.
49
50 If you have a supported Chromebook, choose Y or M here.
51 The module will be called chromeos_pstore.
52
53config CHROMEOS_TBMC
54 tristate "ChromeOS Tablet Switch Controller"
55 depends on ACPI
56 depends on INPUT
57 help
58 This option adds a driver for the tablet switch on
59 select Chrome OS systems.
60
61 To compile this driver as a module, choose M here: the
62 module will be called chromeos_tbmc.
63
64config CHROMEOS_OF_HW_PROBER
65 tristate "ChromeOS Device Tree Hardware Prober"
66 depends on OF
67 depends on I2C
68 select OF_DYNAMIC
69 default OF
70 help
71 This option enables the device tree hardware prober for ChromeOS
72 devices. The driver will probe the correct component variant in
73 devices that have multiple drop-in options for one component.
74
75config CROS_EC
76 tristate "ChromeOS Embedded Controller"
77 select CROS_EC_PROTO
78 depends on X86 || ARM || ARM64 || COMPILE_TEST
79 help
80 If you say Y here you get support for the ChromeOS Embedded
81 Controller (EC) providing keyboard, battery and power services.
82 You also need to enable the driver for the bus you are using. The
83 protocol for talking to the EC is defined by the bus driver.
84
85 To compile this driver as a module, choose M here: the
86 module will be called cros_ec.
87
88config CROS_EC_I2C
89 tristate "ChromeOS Embedded Controller (I2C)"
90 depends on CROS_EC && I2C
91
92 help
93 If you say Y here, you get support for talking to the ChromeOS
94 EC through an I2C bus. This uses a simple byte-level protocol with
95 a checksum. Failing accesses will be retried three times to
96 improve reliability.
97
98config CROS_EC_RPMSG
99 tristate "ChromeOS Embedded Controller (rpmsg)"
100 depends on CROS_EC && RPMSG && OF
101 help
102 If you say Y here, you get support for talking to the ChromeOS EC
103 through rpmsg. This uses a simple byte-level protocol with a
104 checksum. Also since there's no addition EC-to-host interrupt, this
105 use a byte in message to distinguish host event from host command.
106
107 To compile this driver as a module, choose M here: the
108 module will be called cros_ec_rpmsg.
109
110config CROS_EC_ISHTP
111 tristate "ChromeOS Embedded Controller (ISHTP)"
112 depends on CROS_EC
113 depends on INTEL_ISH_HID
114 help
115 If you say Y here, you get support for talking to the ChromeOS EC
116 firmware running on Intel Integrated Sensor Hub (ISH), using the
117 ISH Transport protocol (ISH-TP). This uses a simple byte-level
118 protocol with a checksum.
119
120 To compile this driver as a module, choose M here: the
121 module will be called cros_ec_ishtp.
122
123config CROS_EC_SPI
124 tristate "ChromeOS Embedded Controller (SPI)"
125 depends on CROS_EC && SPI
126
127 help
128 If you say Y here, you get support for talking to the ChromeOS EC
129 through a SPI bus, using a byte-level protocol. Since the EC's
130 response time cannot be guaranteed, we support ignoring
131 'pre-amble' bytes before the response actually starts.
132
133config CROS_EC_UART
134 tristate "ChromeOS Embedded Controller (UART)"
135 depends on CROS_EC && ACPI && SERIAL_DEV_BUS
136 help
137 If you say Y here, you get support for talking to the ChromeOS EC
138 through a UART, using a byte-level protocol.
139
140 To compile this driver as a module, choose M here: the
141 module will be called cros_ec_uart.
142
143config CROS_EC_LPC
144 tristate "ChromeOS Embedded Controller (LPC)"
145 depends on CROS_EC && ACPI && (X86 || COMPILE_TEST)
146 depends on HAS_IOPORT
147 help
148 If you say Y here, you get support for talking to the ChromeOS EC
149 over an LPC bus, including the LPC Microchip EC (MEC) variant.
150 This uses a simple byte-level protocol with a checksum. This is
151 used for userspace access only. The kernel typically has its own
152 communication methods.
153
154 To compile this driver as a module, choose M here: the
155 module will be called cros_ec_lpcs.
156
157config CROS_EC_PROTO
158 bool
159 help
160 ChromeOS EC communication protocol helpers.
161
162config CROS_KBD_LED_BACKLIGHT
163 tristate "Backlight LED support for Chrome OS keyboards"
164 depends on LEDS_CLASS && (ACPI || CROS_EC || MFD_CROS_EC_DEV)
165 help
166 This option enables support for the keyboard backlight LEDs on
167 select Chrome OS systems.
168
169 To compile this driver as a module, choose M here: the
170 module will be called cros_kbd_led_backlight.
171
172config CROS_EC_CHARDEV
173 tristate "ChromeOS EC miscdevice"
174 depends on MFD_CROS_EC_DEV
175 default MFD_CROS_EC_DEV
176 help
177 This driver adds file operations support to talk with the
178 ChromeOS EC from userspace via a character device.
179
180 To compile this driver as a module, choose M here: the
181 module will be called cros_ec_chardev.
182
183config CROS_EC_LIGHTBAR
184 tristate "Chromebook Pixel's lightbar support"
185 depends on MFD_CROS_EC_DEV
186 default MFD_CROS_EC_DEV
187 help
188 This option exposes the Chromebook Pixel's lightbar to
189 userspace.
190
191 To compile this driver as a module, choose M here: the
192 module will be called cros_ec_lightbar.
193
194config CROS_EC_VBC
195 tristate "ChromeOS EC vboot context support"
196 depends on MFD_CROS_EC_DEV && OF
197 default MFD_CROS_EC_DEV
198 help
199 This option exposes the ChromeOS EC vboot context nvram to
200 userspace.
201
202 To compile this driver as a module, choose M here: the
203 module will be called cros_ec_vbc.
204
205config CROS_EC_DEBUGFS
206 tristate "Export ChromeOS EC internals in DebugFS"
207 depends on MFD_CROS_EC_DEV && DEBUG_FS
208 default MFD_CROS_EC_DEV
209 help
210 This option exposes the ChromeOS EC device internals to
211 userspace.
212
213 To compile this driver as a module, choose M here: the
214 module will be called cros_ec_debugfs.
215
216config CROS_EC_SENSORHUB
217 tristate "ChromeOS EC MEMS Sensor Hub"
218 depends on MFD_CROS_EC_DEV
219 default MFD_CROS_EC_DEV
220 help
221 Allow loading IIO sensors. This driver is loaded by MFD and will in
222 turn query the EC and register the sensors.
223 It also spreads the sensor data coming from the EC to the IIO sensor
224 object.
225
226 To compile this driver as a module, choose M here: the
227 module will be called cros_ec_sensorhub.
228
229config CROS_EC_SYSFS
230 tristate "ChromeOS EC control and information through sysfs"
231 depends on MFD_CROS_EC_DEV && SYSFS
232 default MFD_CROS_EC_DEV
233 help
234 This option exposes some sysfs attributes to control and get
235 information from ChromeOS EC.
236
237 To compile this driver as a module, choose M here: the
238 module will be called cros_ec_sysfs.
239
240config CROS_EC_TYPEC
241 tristate "ChromeOS EC Type-C Connector Control"
242 depends on MFD_CROS_EC_DEV && TYPEC
243 depends on CROS_USBPD_NOTIFY
244 depends on USB_ROLE_SWITCH
245 default MFD_CROS_EC_DEV
246 help
247 If you say Y here, you get support for accessing Type C connector
248 information from the Chrome OS EC.
249
250 To compile this driver as a module, choose M here: the module will be
251 called cros-ec-typec.
252
253config CROS_HPS_I2C
254 tristate "ChromeOS HPS device"
255 depends on HID && I2C && PM
256 help
257 Say Y here if you want to enable support for the ChromeOS
258 human presence sensor (HPS), attached via I2C. The driver supports a
259 sensor connected to the I2C bus and exposes it as a character device.
260 To save power, the sensor is automatically powered down when no
261 clients are accessing it.
262
263config CROS_USBPD_LOGGER
264 tristate "Logging driver for USB PD charger"
265 depends on CHARGER_CROS_USBPD
266 default y
267 select RTC_LIB
268 help
269 This option enables support for logging event data for the USB PD charger
270 available in the Embedded Controller on ChromeOS systems.
271
272 To compile this driver as a module, choose M here: the
273 module will be called cros_usbpd_logger.
274
275config CROS_USBPD_NOTIFY
276 tristate "ChromeOS Type-C power delivery event notifier"
277 depends on MFD_CROS_EC_DEV
278 default MFD_CROS_EC_DEV
279 help
280 If you say Y here, you get support for Type-C PD event notifications
281 from the ChromeOS EC. On ACPI platorms this driver will bind to the
282 GOOG0003 ACPI device, and on platforms which don't have this device it
283 will get initialized on ECs which support the feature
284 EC_FEATURE_USB_PD.
285
286 To compile this driver as a module, choose M here: the
287 module will be called cros_usbpd_notify.
288
289config CHROMEOS_PRIVACY_SCREEN
290 tristate "ChromeOS Privacy Screen support"
291 depends on ACPI
292 depends on DRM
293 select DRM_PRIVACY_SCREEN
294 help
295 This driver provides the support needed for the in-built electronic
296 privacy screen that is present on some ChromeOS devices. When enabled,
297 this should probably always be built into the kernel to avoid or
298 minimize drm probe deferral.
299
300config CROS_TYPEC_SWITCH
301 tristate "ChromeOS EC Type-C Switch Control"
302 depends on MFD_CROS_EC_DEV && TYPEC && ACPI
303 default MFD_CROS_EC_DEV
304 help
305 If you say Y here, you get support for configuring the ChromeOS EC Type-C
306 muxes and retimers.
307
308 To compile this driver as a module, choose M here: the module will be
309 called cros_typec_switch.
310
311source "drivers/platform/chrome/wilco_ec/Kconfig"
312
313# Kunit test cases
314config CROS_KUNIT_EC_PROTO_TEST
315 tristate "Kunit tests for ChromeOS EC protocol" if !KUNIT_ALL_TESTS
316 depends on KUNIT && CROS_EC
317 default KUNIT_ALL_TESTS
318 select CROS_EC_PROTO
319 help
320 Kunit tests for ChromeOS EC protocol.
321
322endif # CHROMEOS_PLATFORMS