Create a helper function to search for a matching machine
based on HID. No functional change
Signed-off-by: Naveen M <naveen.m@intel.com>
Signed-off-by: Harsha Priya <harshapriya.n@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Add a new common routine to extract a package exposed by a
device indexed with the HID value. The functionality is
implemented without assumptions on the package type or
structure to allow for reuse. The caller is responsible for
defining the name and allocating structures to store the
results, ACPICA will complain in case of type mismatches
or buffer size issues.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
BIOS vendors sometimes declare multiple devices in the DSDT
table that all refer to the same HID. This is not very smart
but not illegal as long as only one device reports present with
the _STA method. The ACPI subsystem tracks each device with an
extension, e.g. 10EC5640:00 and 10EC5640:01
In the ASoC machine driver, the DAI codec name needs to refer to the
ACPI device that reported present, e.g. "i2c-10EC5640:01". The
extension will vary depending on how the BIOS is written and which
ACPI device is activated.
This patch adds a translation function that provides the codec
name from the ACPI HID to avoid any hard-coded values in the
machine driver.
Suggested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
BIOS vendors typically list multiple audio codecs in the DSDT
table and enable the relevant one by changing the return value
of the _STA method.
With the current code, all devices are reported by
acpi_dev_present(), regardless of the _STA return values. This
causes errors on probe with the wrong machine driver being loaded.
This patch essentially reverts 'commit 6f08cbdaac
("ASoC: Intel: Use acpi_dev_present()")' and adds code to
force the evaluation of the _STA method.
A better solution might be to make sure the ACPI subsystem only
reports devices with a _STA value of 0xf but apparently it's
problematic so dealing with this in the audio subsystem directly.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
The match module lacked module license and description, so add it
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Use shiny new acpi_dev_present() and remove all the boilerplate
to search for a particular ACPI device. No functional change.
Cf. 2d12b6b381 ("ACPI / utils: Add acpi_dev_present()").
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
This code to find the machine is common for all drivers so move
it to a separate file and header for use in other drivers
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>