Lines Matching +full:acpi +full:- +full:hid
4 * SPDX-License-Identifier: Apache-2.0
12 #include <zephyr/acpi/acpi.h>
19 shell_print(sh, "**** ACPI Device Resource Info ****"); in dump_dev_res()
23 if (!res->Length) { in dump_dev_res()
28 switch (res->Type) { in dump_dev_res()
31 ACPI_RESOURCE_IRQ *irq_res = &res->Data.Irq; in dump_dev_res()
33 shell_print(sh, "\tDescriptorLength: %x", irq_res->DescriptorLength); in dump_dev_res()
34 shell_print(sh, "\tTriggering: %x", irq_res->Triggering); in dump_dev_res()
35 shell_print(sh, "\tPolarity: %x", irq_res->Polarity); in dump_dev_res()
36 shell_print(sh, "\tShareable: %x", irq_res->Shareable); in dump_dev_res()
37 shell_print(sh, "\tInterruptCount: %d", irq_res->InterruptCount); in dump_dev_res()
38 shell_print(sh, "\tInterrupts[0]: %x", irq_res->Interrupts[0]); in dump_dev_res()
41 ACPI_RESOURCE_IO *io_res = &res->Data.Io; in dump_dev_res()
44 shell_print(sh, "\tIoDecode: %x", io_res->IoDecode); in dump_dev_res()
45 shell_print(sh, "\tAlignment: %x", io_res->Alignment); in dump_dev_res()
46 shell_print(sh, "\tAddressLength: %x", io_res->AddressLength); in dump_dev_res()
47 shell_print(sh, "\tMinimum: %x", io_res->Minimum); in dump_dev_res()
48 shell_print(sh, "\tMaximum: %x", io_res->Maximum); in dump_dev_res()
70 ACPI_RESOURCE_MEMORY32 *mem_res = &res->Data.Memory32; in dump_dev_res()
73 shell_print(sh, "\tMinimum: %x", mem_res->Minimum); in dump_dev_res()
74 shell_print(sh, "\tMaximum: %x", mem_res->Maximum); in dump_dev_res()
78 ACPI_RESOURCE_FIXED_MEMORY32 *fix_mem_res = &res->Data.FixedMemory32; in dump_dev_res()
81 shell_print(sh, "\tAddress: %x", fix_mem_res->Address); in dump_dev_res()
88 ACPI_RESOURCE_ADDRESS32 *add_res = &res->Data.Address32; in dump_dev_res()
91 shell_print(sh, "\tMinimum: %x", add_res->Address.Minimum); in dump_dev_res()
92 shell_print(sh, "\tMaximum: %x", add_res->Address.Maximum); in dump_dev_res()
96 ACPI_RESOURCE_ADDRESS64 *add_res64 = &res->Data.Address64; in dump_dev_res()
99 shell_print(sh, "\tMinimum: %llx", add_res64->Address.Minimum); in dump_dev_res()
100 shell_print(sh, "\tMaximum: %llx", add_res64->Address.Maximum); in dump_dev_res()
107 ACPI_RESOURCE_EXTENDED_IRQ *ext_irq_res = &res->Data.ExtendedIrq; in dump_dev_res()
110 shell_print(sh, "\tTriggering: %x", ext_irq_res->Triggering); in dump_dev_res()
111 shell_print(sh, "\tPolarity: %x", ext_irq_res->Polarity); in dump_dev_res()
112 shell_print(sh, "\tShareable: %s", ext_irq_res->Shareable ? "YES":"NO"); in dump_dev_res()
113 shell_print(sh, "\tInterruptCount: %d", ext_irq_res->InterruptCount); in dump_dev_res()
114 shell_print(sh, "\tInterrupts[0]: %d", ext_irq_res->Interrupts[0]); in dump_dev_res()
145 shell_error(sh, "Unknown resource type %d", res->Type); in dump_dev_res()
150 } while (res->Type != ACPI_RESOURCE_TYPE_END_TAG); in dump_dev_res()
160 return -EINVAL; in dump_dev_crs()
165 shell_error(sh, "Error on ACPI _CRS method: %d", status); in dump_dev_crs()
183 return -EINVAL; in dump_dev_prs()
188 shell_error(sh, "Error in on ACPI _PRS method: %d", status); in dump_dev_prs()
204 shell_error(sh, "invalid arguments [Eg: acpi prt <bus> <dev> <func>]"); in dump_prt()
205 return -EINVAL; in dump_prt()
232 shell_error(sh, "Invalid arguments [Eg: acpi enum PNP0103 0]"); in enum_dev()
233 return -EINVAL; in enum_dev()
237 if (!dev || !dev->res_lst) { in enum_dev()
238 shell_error(sh, "acpi get device failed for HID: %s", argv[1]); in enum_dev()
239 return -EIO; in enum_dev()
242 shell_print(sh, "Name: %s", dev->path ? dev->path : "None"); in enum_dev()
244 if (dev->path) { in enum_dev()
245 if (!acpi_current_resource_get(dev->path, &res_lst)) { in enum_dev()
261 shell_print(sh, "No more ACPI device found!"); in enum_all_dev()
265 if (!dev->dev_info) { in enum_all_dev()
269 shell_print(sh, "%d) Name: %s, HID: %s", i, dev->path ? dev->path : "None", in enum_all_dev()
270 dev->dev_info->HardwareId.String ? dev->dev_info->HardwareId.String in enum_all_dev()
286 return -EINVAL; in get_acpi_dev_resource()
291 shell_error(sh, "acpi get device failed for HID: %s", argv[1]); in get_acpi_dev_resource()
292 return -EIO; in get_acpi_dev_resource()
295 if (dev->path) { in get_acpi_dev_resource()
296 shell_print(sh, "Device Path: %s", dev->path); in get_acpi_dev_resource()
331 return -EINVAL; in read_table()
336 shell_error(sh, "ACPI get table %s failed", argv[1]); in read_table()
337 return -EIO; in read_table()
340 shell_print(sh, "ACPI Table %s:", argv[1]); in read_table()
341 shell_print(sh, "\tSignature: %.4s", table->Signature); in read_table()
342 shell_print(sh, "\tTable Length: %d", table->Length); in read_table()
343 shell_print(sh, "\tRevision: %d", table->Revision); in read_table()
344 shell_print(sh, "\tOemId: %s", table->OemId); in read_table()
352 "display device current resource settings (eg:acpi crs _SB.PC00.LPCB.RTC)",
355 "display device possible resource settings (eg:acpi crs _SB.PC00.LPCB.RTC)",
358 "display PRT details for a given bus (eg:acpi prt _SB.PC00)",
361 "enumerate device using hid (for enum HPET timer device,eg:acpi enum PNP0103)",
363 SHELL_CMD(enum_all, NULL, "enumerate all device in acpi name space (eg:acpi enum_all)",
365 SHELL_CMD(dev_res, NULL, "retrieve device resource (eg: acpi dev_res PNP0501 2)",
367 SHELL_CMD(rd_table, NULL, "read ACPI table (eg: acpi read_table APIC)",
372 SHELL_CMD_REGISTER(acpi, &sub_acpi, "Demo commands", NULL);