blob: 62be23842aa97559f8fbb4ece143029d921fbe3c [file] [log] [blame]
Prashant Malani688105b2022-04-01 20:19:20 +00001/* SPDX-License-Identifier: GPL-2.0-or-later */
2
3#include <acpi/acpigen.h>
4
5#define GOOGLE_CHROMEEC_MUX_DEVICE_HID "GOOG001A"
6#define GOOGLE_CHROMEEC_MUX_DEVICE_NAME "ECMX"
7
8static void mux_fill_ssdt(const struct device *dev)
9{
10 acpigen_write_scope(acpi_device_scope(dev));
11 acpigen_write_device(GOOGLE_CHROMEEC_MUX_DEVICE_NAME);
12 acpigen_write_name_string("_HID", GOOGLE_CHROMEEC_MUX_DEVICE_HID);
13 acpigen_write_name_string("_DDN", "ChromeOS EC Embedded Controller "
14 "Mux & Retimer control");
15
16 acpigen_write_device_end();
17 acpigen_write_scope_end();
18}
19
20static const char *mux_acpi_name(const struct device *dev)
21{
22 return GOOGLE_CHROMEEC_MUX_DEVICE_NAME;
23}
24
25static struct device_operations mux_ops = {
26 .read_resources = noop_read_resources,
27 .set_resources = noop_set_resources,
28 .acpi_name = mux_acpi_name,
29 .acpi_fill_ssdt = mux_fill_ssdt,
30 .scan_bus = scan_static_bus,
31};
32
33static void mux_enable(struct device *dev)
34{
35 dev->ops = &mux_ops;
36}
37
38struct chip_operations ec_google_chromeec_mux_ops = {
Nicholas Sudsgaardbfb11be2024-01-30 09:53:46 +090039 .name = "CrosEC Type C Mux device",
Prashant Malani688105b2022-04-01 20:19:20 +000040 .enable_dev = mux_enable
41};