On Mon, Mar 11, 2024 at 11:15 AM Cezary Rojewski <cezary.rojewski@xxxxxxxxx> wrote: > > The table is composed of a range of endpoints with each describing > audio formats they support. Most of the operations involve iterating > over elements of the table and filtering them. Simplify the process by > implementing range of getters. > > While the acpi_nhlt_endpoint_mic_count() stands out a bit, it is a > critical component for any AudioDSP driver to know how many digital > microphones it is dealing with. > > Signed-off-by: Cezary Rojewski <cezary.rojewski@xxxxxxxxx> > --- > drivers/acpi/Kconfig | 3 + > drivers/acpi/Makefile | 1 + > drivers/acpi/nhlt.c | 289 ++++++++++++++++++++++++++++++++++++++++++ > include/acpi/nhlt.h | 181 ++++++++++++++++++++++++++ > 4 files changed, 474 insertions(+) > create mode 100644 drivers/acpi/nhlt.c > create mode 100644 include/acpi/nhlt.h > > diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig > index 3c3f8037ebed..c45a4238c5fd 100644 > --- a/drivers/acpi/Kconfig > +++ b/drivers/acpi/Kconfig > @@ -484,6 +484,9 @@ config ACPI_REDUCED_HARDWARE_ONLY > > If you are unsure what to do, do not enable this option. > > +config ACPI_NHLT > + bool > + > source "drivers/acpi/nfit/Kconfig" > source "drivers/acpi/numa/Kconfig" > source "drivers/acpi/apei/Kconfig" > diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile > index 12ef8180d272..197e1e7154cb 100644 > --- a/drivers/acpi/Makefile > +++ b/drivers/acpi/Makefile > @@ -93,6 +93,7 @@ obj-$(CONFIG_ACPI_THERMAL_LIB) += thermal_lib.o > obj-$(CONFIG_ACPI_THERMAL) += thermal.o > obj-$(CONFIG_ACPI_PLATFORM_PROFILE) += platform_profile.o > obj-$(CONFIG_ACPI_NFIT) += nfit/ > +obj-$(CONFIG_ACPI_NHLT) += nhlt.o > obj-$(CONFIG_ACPI_NUMA) += numa/ > obj-$(CONFIG_ACPI) += acpi_memhotplug.o > obj-$(CONFIG_ACPI_HOTPLUG_IOAPIC) += ioapic.o > diff --git a/drivers/acpi/nhlt.c b/drivers/acpi/nhlt.c > new file mode 100644 > index 000000000000..599dce778334 > --- /dev/null > +++ b/drivers/acpi/nhlt.c > @@ -0,0 +1,289 @@ > +// SPDX-License-Identifier: GPL-2.0-only The part below should be a C-style comment as per the kernel coding style. > +// > +// Copyright(c) 2023-2024 Intel Corporation. All rights reserved. And please drop the "All rights reserved" part. The license is GPL (v2), so some rights are in fact not reserved. > +// > +// Authors: Cezary Rojewski <cezary.rojewski@xxxxxxxxx> > +// Amadeusz Slawinski <amadeuszx.slawinski@xxxxxxxxxxxxxxx> > +// > + The rest of the patch LGTM.