| 1 |
|
| 2 |
|
| 3 |
#include <acpi/acpigen.h> |
| 4 |
|
| 5 |
#define GOOGLE_CHROMEEC_MUX_DEVICE_HID "GOOG001A" |
| 6 |
#define GOOGLE_CHROMEEC_MUX_DEVICE_NAME "ECMX" |
| 7 |
|
| 8 |
static 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 |
|
| 20 |
static const char *mux_acpi_name(const struct device *dev) |
| 21 |
{ |
| 22 |
return GOOGLE_CHROMEEC_MUX_DEVICE_NAME; |
| 23 |
} |
| 24 |
|
| 25 |
static 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 |
|
| 33 |
static void mux_enable(struct device *dev) |
| 34 |
{ |
| 35 |
dev->ops = &mux_ops; |
| 36 |
} |
| 37 |
|
| 38 |
struct chip_operations ec_google_chromeec_mux_ops = { |
| 39 |
.name = "CrosEC Type C Mux device", |
| 40 |
.enable_dev = mux_enable |
| 41 |
}; |