|
@@ -25,11 +25,12 @@ static u8 OSC_UUID[16] = {0x6E, 0x88, 0x9F, 0xA6, 0xEB, 0x6C, 0x94, 0x45,
|
|
|
|
|
|
#define DSDT_NHLT_PATH "\\_SB.PCI0.HDAS"
|
|
|
|
|
|
-void *skl_nhlt_init(struct device *dev)
|
|
|
+struct nhlt_acpi_table *skl_nhlt_init(struct device *dev)
|
|
|
{
|
|
|
acpi_handle handle;
|
|
|
union acpi_object *obj;
|
|
|
struct nhlt_resource_desc *nhlt_ptr = NULL;
|
|
|
+ struct nhlt_acpi_table *nhlt_table = NULL;
|
|
|
|
|
|
if (ACPI_FAILURE(acpi_get_handle(NULL, DSDT_NHLT_PATH, &handle))) {
|
|
|
dev_err(dev, "Requested NHLT device not found\n");
|
|
@@ -39,18 +40,20 @@ void *skl_nhlt_init(struct device *dev)
|
|
|
obj = acpi_evaluate_dsm(handle, OSC_UUID, 1, 1, NULL);
|
|
|
if (obj && obj->type == ACPI_TYPE_BUFFER) {
|
|
|
nhlt_ptr = (struct nhlt_resource_desc *)obj->buffer.pointer;
|
|
|
-
|
|
|
- return memremap(nhlt_ptr->min_addr, nhlt_ptr->length,
|
|
|
+ nhlt_table = (struct nhlt_acpi_table *)
|
|
|
+ memremap(nhlt_ptr->min_addr, nhlt_ptr->length,
|
|
|
MEMREMAP_WB);
|
|
|
+ ACPI_FREE(obj);
|
|
|
+ return nhlt_table;
|
|
|
}
|
|
|
|
|
|
dev_err(dev, "device specific method to extract NHLT blob failed\n");
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
-void skl_nhlt_free(void *addr)
|
|
|
+void skl_nhlt_free(struct nhlt_acpi_table *nhlt)
|
|
|
{
|
|
|
- memunmap(addr);
|
|
|
+ memunmap((void *) nhlt);
|
|
|
}
|
|
|
|
|
|
static struct nhlt_specific_cfg *skl_get_specific_cfg(
|
|
@@ -120,7 +123,7 @@ struct nhlt_specific_cfg
|
|
|
struct hdac_bus *bus = ebus_to_hbus(&skl->ebus);
|
|
|
struct device *dev = bus->dev;
|
|
|
struct nhlt_specific_cfg *sp_config;
|
|
|
- struct nhlt_acpi_table *nhlt = (struct nhlt_acpi_table *)skl->nhlt;
|
|
|
+ struct nhlt_acpi_table *nhlt = skl->nhlt;
|
|
|
u16 bps = (s_fmt == 16) ? 16 : 32;
|
|
|
u8 j;
|
|
|
|