162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only
262306a36Sopenharmony_ci#
362306a36Sopenharmony_ci# Platform support for Chrome OS hardware (Chromebooks and Chromeboxes)
462306a36Sopenharmony_ci#
562306a36Sopenharmony_ci
662306a36Sopenharmony_cimenuconfig CHROME_PLATFORMS
762306a36Sopenharmony_ci	bool "Platform support for Chrome hardware"
862306a36Sopenharmony_ci	depends on X86 || ARM || ARM64 || COMPILE_TEST
962306a36Sopenharmony_ci	help
1062306a36Sopenharmony_ci	  Say Y here to get to see options for platform support for
1162306a36Sopenharmony_ci	  various Chromebooks and Chromeboxes. This option alone does
1262306a36Sopenharmony_ci	  not add any kernel code.
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci	  If you say N, all options in this submenu will be skipped and disabled.
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ciif CHROME_PLATFORMS
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ciconfig CHROMEOS_ACPI
1962306a36Sopenharmony_ci	tristate "ChromeOS specific ACPI extensions"
2062306a36Sopenharmony_ci	depends on ACPI
2162306a36Sopenharmony_ci	help
2262306a36Sopenharmony_ci	  This driver provides the firmware interface for the services
2362306a36Sopenharmony_ci	  exported through the ChromeOS interfaces when using ChromeOS
2462306a36Sopenharmony_ci	  ACPI firmware.
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci	  If you have an ACPI-compatible Chromebook, say Y or M here.
2762306a36Sopenharmony_ci	  The module will be called chromeos_acpi.
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ciconfig CHROMEOS_LAPTOP
3062306a36Sopenharmony_ci	tristate "Chrome OS Laptop"
3162306a36Sopenharmony_ci	depends on I2C && DMI && X86
3262306a36Sopenharmony_ci	help
3362306a36Sopenharmony_ci	  This driver instantiates i2c and smbus devices such as
3462306a36Sopenharmony_ci	  light sensors and touchpads.
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci	  If you have a supported Chromebook, choose Y or M here.
3762306a36Sopenharmony_ci	  The module will be called chromeos_laptop.
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ciconfig CHROMEOS_PSTORE
4062306a36Sopenharmony_ci	tristate "Chrome OS pstore support"
4162306a36Sopenharmony_ci	depends on X86
4262306a36Sopenharmony_ci	help
4362306a36Sopenharmony_ci	  This module instantiates the persistent storage on x86 ChromeOS
4462306a36Sopenharmony_ci	  devices. It can be used to store away console logs and crash
4562306a36Sopenharmony_ci	  information across reboots.
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ci	  The range of memory used is 0xf00000-0x1000000, traditionally
4862306a36Sopenharmony_ci	  the memory used to back VGA controller memory.
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci	  If you have a supported Chromebook, choose Y or M here.
5162306a36Sopenharmony_ci	  The module will be called chromeos_pstore.
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ciconfig CHROMEOS_TBMC
5462306a36Sopenharmony_ci	tristate "ChromeOS Tablet Switch Controller"
5562306a36Sopenharmony_ci	depends on ACPI
5662306a36Sopenharmony_ci	depends on INPUT
5762306a36Sopenharmony_ci	help
5862306a36Sopenharmony_ci	  This option adds a driver for the tablet switch on
5962306a36Sopenharmony_ci	  select Chrome OS systems.
6062306a36Sopenharmony_ci
6162306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
6262306a36Sopenharmony_ci	  module will be called chromeos_tbmc.
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_ciconfig CROS_EC
6562306a36Sopenharmony_ci	tristate "ChromeOS Embedded Controller"
6662306a36Sopenharmony_ci	select CROS_EC_PROTO
6762306a36Sopenharmony_ci	depends on X86 || ARM || ARM64 || COMPILE_TEST
6862306a36Sopenharmony_ci	help
6962306a36Sopenharmony_ci	  If you say Y here you get support for the ChromeOS Embedded
7062306a36Sopenharmony_ci	  Controller (EC) providing keyboard, battery and power services.
7162306a36Sopenharmony_ci	  You also need to enable the driver for the bus you are using. The
7262306a36Sopenharmony_ci	  protocol for talking to the EC is defined by the bus driver.
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
7562306a36Sopenharmony_ci	  module will be called cros_ec.
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ciconfig CROS_EC_I2C
7862306a36Sopenharmony_ci	tristate "ChromeOS Embedded Controller (I2C)"
7962306a36Sopenharmony_ci	depends on CROS_EC && I2C
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ci	help
8262306a36Sopenharmony_ci	  If you say Y here, you get support for talking to the ChromeOS
8362306a36Sopenharmony_ci	  EC through an I2C bus. This uses a simple byte-level protocol with
8462306a36Sopenharmony_ci	  a checksum. Failing accesses will be retried three times to
8562306a36Sopenharmony_ci	  improve reliability.
8662306a36Sopenharmony_ci
8762306a36Sopenharmony_ciconfig CROS_EC_RPMSG
8862306a36Sopenharmony_ci	tristate "ChromeOS Embedded Controller (rpmsg)"
8962306a36Sopenharmony_ci	depends on CROS_EC && RPMSG && OF
9062306a36Sopenharmony_ci	help
9162306a36Sopenharmony_ci	  If you say Y here, you get support for talking to the ChromeOS EC
9262306a36Sopenharmony_ci	  through rpmsg. This uses a simple byte-level protocol with a
9362306a36Sopenharmony_ci	  checksum. Also since there's no addition EC-to-host interrupt, this
9462306a36Sopenharmony_ci	  use a byte in message to distinguish host event from host command.
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
9762306a36Sopenharmony_ci	  module will be called cros_ec_rpmsg.
9862306a36Sopenharmony_ci
9962306a36Sopenharmony_ciconfig CROS_EC_ISHTP
10062306a36Sopenharmony_ci	tristate "ChromeOS Embedded Controller (ISHTP)"
10162306a36Sopenharmony_ci	depends on CROS_EC
10262306a36Sopenharmony_ci	depends on INTEL_ISH_HID
10362306a36Sopenharmony_ci	help
10462306a36Sopenharmony_ci	  If you say Y here, you get support for talking to the ChromeOS EC
10562306a36Sopenharmony_ci	  firmware running on Intel Integrated Sensor Hub (ISH), using the
10662306a36Sopenharmony_ci	  ISH Transport protocol (ISH-TP). This uses a simple byte-level
10762306a36Sopenharmony_ci	  protocol with a checksum.
10862306a36Sopenharmony_ci
10962306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
11062306a36Sopenharmony_ci	  module will be called cros_ec_ishtp.
11162306a36Sopenharmony_ci
11262306a36Sopenharmony_ciconfig CROS_EC_SPI
11362306a36Sopenharmony_ci	tristate "ChromeOS Embedded Controller (SPI)"
11462306a36Sopenharmony_ci	depends on CROS_EC && SPI
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_ci	help
11762306a36Sopenharmony_ci	  If you say Y here, you get support for talking to the ChromeOS EC
11862306a36Sopenharmony_ci	  through a SPI bus, using a byte-level protocol. Since the EC's
11962306a36Sopenharmony_ci	  response time cannot be guaranteed, we support ignoring
12062306a36Sopenharmony_ci	  'pre-amble' bytes before the response actually starts.
12162306a36Sopenharmony_ci
12262306a36Sopenharmony_ciconfig CROS_EC_UART
12362306a36Sopenharmony_ci	tristate "ChromeOS Embedded Controller (UART)"
12462306a36Sopenharmony_ci	depends on CROS_EC && ACPI && SERIAL_DEV_BUS
12562306a36Sopenharmony_ci	help
12662306a36Sopenharmony_ci	  If you say Y here, you get support for talking to the ChromeOS EC
12762306a36Sopenharmony_ci	  through a UART, using a byte-level protocol.
12862306a36Sopenharmony_ci
12962306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
13062306a36Sopenharmony_ci	  module will be called cros_ec_uart.
13162306a36Sopenharmony_ci
13262306a36Sopenharmony_ciconfig CROS_EC_LPC
13362306a36Sopenharmony_ci	tristate "ChromeOS Embedded Controller (LPC)"
13462306a36Sopenharmony_ci	depends on CROS_EC && ACPI && (X86 || COMPILE_TEST)
13562306a36Sopenharmony_ci	help
13662306a36Sopenharmony_ci	  If you say Y here, you get support for talking to the ChromeOS EC
13762306a36Sopenharmony_ci	  over an LPC bus, including the LPC Microchip EC (MEC) variant.
13862306a36Sopenharmony_ci	  This uses a simple byte-level protocol with a checksum. This is
13962306a36Sopenharmony_ci	  used for userspace access only. The kernel typically has its own
14062306a36Sopenharmony_ci	  communication methods.
14162306a36Sopenharmony_ci
14262306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
14362306a36Sopenharmony_ci	  module will be called cros_ec_lpcs.
14462306a36Sopenharmony_ci
14562306a36Sopenharmony_ciconfig CROS_EC_PROTO
14662306a36Sopenharmony_ci	bool
14762306a36Sopenharmony_ci	help
14862306a36Sopenharmony_ci	  ChromeOS EC communication protocol helpers.
14962306a36Sopenharmony_ci
15062306a36Sopenharmony_ciconfig CROS_KBD_LED_BACKLIGHT
15162306a36Sopenharmony_ci	tristate "Backlight LED support for Chrome OS keyboards"
15262306a36Sopenharmony_ci	depends on LEDS_CLASS && (ACPI || CROS_EC)
15362306a36Sopenharmony_ci	help
15462306a36Sopenharmony_ci	  This option enables support for the keyboard backlight LEDs on
15562306a36Sopenharmony_ci	  select Chrome OS systems.
15662306a36Sopenharmony_ci
15762306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
15862306a36Sopenharmony_ci	  module will be called cros_kbd_led_backlight.
15962306a36Sopenharmony_ci
16062306a36Sopenharmony_ciconfig CROS_EC_CHARDEV
16162306a36Sopenharmony_ci	tristate "ChromeOS EC miscdevice"
16262306a36Sopenharmony_ci	depends on MFD_CROS_EC_DEV
16362306a36Sopenharmony_ci	default MFD_CROS_EC_DEV
16462306a36Sopenharmony_ci	help
16562306a36Sopenharmony_ci	  This driver adds file operations support to talk with the
16662306a36Sopenharmony_ci	  ChromeOS EC from userspace via a character device.
16762306a36Sopenharmony_ci
16862306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
16962306a36Sopenharmony_ci	  module will be called cros_ec_chardev.
17062306a36Sopenharmony_ci
17162306a36Sopenharmony_ciconfig CROS_EC_LIGHTBAR
17262306a36Sopenharmony_ci	tristate "Chromebook Pixel's lightbar support"
17362306a36Sopenharmony_ci	depends on MFD_CROS_EC_DEV
17462306a36Sopenharmony_ci	default MFD_CROS_EC_DEV
17562306a36Sopenharmony_ci	help
17662306a36Sopenharmony_ci	  This option exposes the Chromebook Pixel's lightbar to
17762306a36Sopenharmony_ci	  userspace.
17862306a36Sopenharmony_ci
17962306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
18062306a36Sopenharmony_ci	  module will be called cros_ec_lightbar.
18162306a36Sopenharmony_ci
18262306a36Sopenharmony_ciconfig CROS_EC_VBC
18362306a36Sopenharmony_ci	tristate "ChromeOS EC vboot context support"
18462306a36Sopenharmony_ci	depends on MFD_CROS_EC_DEV && OF
18562306a36Sopenharmony_ci	default MFD_CROS_EC_DEV
18662306a36Sopenharmony_ci	help
18762306a36Sopenharmony_ci	  This option exposes the ChromeOS EC vboot context nvram to
18862306a36Sopenharmony_ci	  userspace.
18962306a36Sopenharmony_ci
19062306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
19162306a36Sopenharmony_ci	  module will be called cros_ec_vbc.
19262306a36Sopenharmony_ci
19362306a36Sopenharmony_ciconfig CROS_EC_DEBUGFS
19462306a36Sopenharmony_ci	tristate "Export ChromeOS EC internals in DebugFS"
19562306a36Sopenharmony_ci	depends on MFD_CROS_EC_DEV && DEBUG_FS
19662306a36Sopenharmony_ci	default MFD_CROS_EC_DEV
19762306a36Sopenharmony_ci	help
19862306a36Sopenharmony_ci	  This option exposes the ChromeOS EC device internals to
19962306a36Sopenharmony_ci	  userspace.
20062306a36Sopenharmony_ci
20162306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
20262306a36Sopenharmony_ci	  module will be called cros_ec_debugfs.
20362306a36Sopenharmony_ci
20462306a36Sopenharmony_ciconfig CROS_EC_SENSORHUB
20562306a36Sopenharmony_ci	tristate "ChromeOS EC MEMS Sensor Hub"
20662306a36Sopenharmony_ci	depends on MFD_CROS_EC_DEV
20762306a36Sopenharmony_ci	default MFD_CROS_EC_DEV
20862306a36Sopenharmony_ci	help
20962306a36Sopenharmony_ci	  Allow loading IIO sensors. This driver is loaded by MFD and will in
21062306a36Sopenharmony_ci	  turn query the EC and register the sensors.
21162306a36Sopenharmony_ci	  It also spreads the sensor data coming from the EC to the IIO sensor
21262306a36Sopenharmony_ci	  object.
21362306a36Sopenharmony_ci
21462306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
21562306a36Sopenharmony_ci	  module will be called cros_ec_sensorhub.
21662306a36Sopenharmony_ci
21762306a36Sopenharmony_ciconfig CROS_EC_SYSFS
21862306a36Sopenharmony_ci	tristate "ChromeOS EC control and information through sysfs"
21962306a36Sopenharmony_ci	depends on MFD_CROS_EC_DEV && SYSFS
22062306a36Sopenharmony_ci	default MFD_CROS_EC_DEV
22162306a36Sopenharmony_ci	help
22262306a36Sopenharmony_ci	  This option exposes some sysfs attributes to control and get
22362306a36Sopenharmony_ci	  information from ChromeOS EC.
22462306a36Sopenharmony_ci
22562306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
22662306a36Sopenharmony_ci	  module will be called cros_ec_sysfs.
22762306a36Sopenharmony_ci
22862306a36Sopenharmony_ciconfig CROS_EC_TYPEC
22962306a36Sopenharmony_ci	tristate "ChromeOS EC Type-C Connector Control"
23062306a36Sopenharmony_ci	depends on MFD_CROS_EC_DEV && TYPEC
23162306a36Sopenharmony_ci	depends on CROS_USBPD_NOTIFY
23262306a36Sopenharmony_ci	depends on USB_ROLE_SWITCH
23362306a36Sopenharmony_ci	default MFD_CROS_EC_DEV
23462306a36Sopenharmony_ci	help
23562306a36Sopenharmony_ci	  If you say Y here, you get support for accessing Type C connector
23662306a36Sopenharmony_ci	  information from the Chrome OS EC.
23762306a36Sopenharmony_ci
23862306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the module will be
23962306a36Sopenharmony_ci	  called cros-ec-typec.
24062306a36Sopenharmony_ci
24162306a36Sopenharmony_ciconfig CROS_HPS_I2C
24262306a36Sopenharmony_ci	tristate "ChromeOS HPS device"
24362306a36Sopenharmony_ci	depends on HID && I2C && PM
24462306a36Sopenharmony_ci	help
24562306a36Sopenharmony_ci	  Say Y here if you want to enable support for the ChromeOS
24662306a36Sopenharmony_ci	  human presence sensor (HPS), attached via I2C. The driver supports a
24762306a36Sopenharmony_ci	  sensor connected to the I2C bus and exposes it as a character device.
24862306a36Sopenharmony_ci	  To save power, the sensor is automatically powered down when no
24962306a36Sopenharmony_ci	  clients are accessing it.
25062306a36Sopenharmony_ci
25162306a36Sopenharmony_ciconfig CROS_USBPD_LOGGER
25262306a36Sopenharmony_ci	tristate "Logging driver for USB PD charger"
25362306a36Sopenharmony_ci	depends on CHARGER_CROS_USBPD
25462306a36Sopenharmony_ci	default y
25562306a36Sopenharmony_ci	select RTC_LIB
25662306a36Sopenharmony_ci	help
25762306a36Sopenharmony_ci	  This option enables support for logging event data for the USB PD charger
25862306a36Sopenharmony_ci	  available in the Embedded Controller on ChromeOS systems.
25962306a36Sopenharmony_ci
26062306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
26162306a36Sopenharmony_ci	  module will be called cros_usbpd_logger.
26262306a36Sopenharmony_ci
26362306a36Sopenharmony_ciconfig CROS_USBPD_NOTIFY
26462306a36Sopenharmony_ci	tristate "ChromeOS Type-C power delivery event notifier"
26562306a36Sopenharmony_ci	depends on MFD_CROS_EC_DEV
26662306a36Sopenharmony_ci	default MFD_CROS_EC_DEV
26762306a36Sopenharmony_ci	help
26862306a36Sopenharmony_ci	  If you say Y here, you get support for Type-C PD event notifications
26962306a36Sopenharmony_ci	  from the ChromeOS EC. On ACPI platorms this driver will bind to the
27062306a36Sopenharmony_ci	  GOOG0003 ACPI device, and on platforms which don't have this device it
27162306a36Sopenharmony_ci	  will get initialized on ECs which support the feature
27262306a36Sopenharmony_ci	  EC_FEATURE_USB_PD.
27362306a36Sopenharmony_ci
27462306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the
27562306a36Sopenharmony_ci	  module will be called cros_usbpd_notify.
27662306a36Sopenharmony_ci
27762306a36Sopenharmony_ciconfig CHROMEOS_PRIVACY_SCREEN
27862306a36Sopenharmony_ci	tristate "ChromeOS Privacy Screen support"
27962306a36Sopenharmony_ci	depends on ACPI
28062306a36Sopenharmony_ci	depends on DRM
28162306a36Sopenharmony_ci	select DRM_PRIVACY_SCREEN
28262306a36Sopenharmony_ci	help
28362306a36Sopenharmony_ci	  This driver provides the support needed for the in-built electronic
28462306a36Sopenharmony_ci	  privacy screen that is present on some ChromeOS devices. When enabled,
28562306a36Sopenharmony_ci	  this should probably always be built into the kernel to avoid or
28662306a36Sopenharmony_ci	  minimize drm probe deferral.
28762306a36Sopenharmony_ci
28862306a36Sopenharmony_ciconfig CROS_TYPEC_SWITCH
28962306a36Sopenharmony_ci	tristate "ChromeOS EC Type-C Switch Control"
29062306a36Sopenharmony_ci	depends on MFD_CROS_EC_DEV && TYPEC && ACPI
29162306a36Sopenharmony_ci	default MFD_CROS_EC_DEV
29262306a36Sopenharmony_ci	help
29362306a36Sopenharmony_ci	  If you say Y here, you get support for configuring the ChromeOS EC Type-C
29462306a36Sopenharmony_ci	  muxes and retimers.
29562306a36Sopenharmony_ci
29662306a36Sopenharmony_ci	  To compile this driver as a module, choose M here: the module will be
29762306a36Sopenharmony_ci	  called cros_typec_switch.
29862306a36Sopenharmony_ci
29962306a36Sopenharmony_cisource "drivers/platform/chrome/wilco_ec/Kconfig"
30062306a36Sopenharmony_ci
30162306a36Sopenharmony_ci# Kunit test cases
30262306a36Sopenharmony_ciconfig CROS_KUNIT
30362306a36Sopenharmony_ci	tristate "Kunit tests for ChromeOS" if !KUNIT_ALL_TESTS
30462306a36Sopenharmony_ci	depends on KUNIT && CROS_EC
30562306a36Sopenharmony_ci	default KUNIT_ALL_TESTS
30662306a36Sopenharmony_ci	select CROS_EC_PROTO
30762306a36Sopenharmony_ci	help
30862306a36Sopenharmony_ci	  ChromeOS Kunit tests.
30962306a36Sopenharmony_ci
31062306a36Sopenharmony_ciendif # CHROMEOS_PLATFORMS
311