mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 08:42:12 +02:00
dm: acpi: Add support for the NHLT table
The Intel Non-High-Definition-Audio Link Table (NHLT) table describes the audio codecs and connections in a system. Various devices can contribute information to produce the table. Add core support for this, based on a structure which is built up through calls to the driver. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
This commit is contained in:
@@ -31,6 +31,7 @@ enum method_t {
|
|||||||
METHOD_WRITE_TABLES,
|
METHOD_WRITE_TABLES,
|
||||||
METHOD_FILL_SSDT,
|
METHOD_FILL_SSDT,
|
||||||
METHOD_INJECT_DSDT,
|
METHOD_INJECT_DSDT,
|
||||||
|
METHOD_SETUP_NHLT,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Prototype for all methods */
|
/* Prototype for all methods */
|
||||||
@@ -248,6 +249,8 @@ acpi_method acpi_get_method(struct udevice *dev, enum method_t method)
|
|||||||
return aops->fill_ssdt;
|
return aops->fill_ssdt;
|
||||||
case METHOD_INJECT_DSDT:
|
case METHOD_INJECT_DSDT:
|
||||||
return aops->inject_dsdt;
|
return aops->inject_dsdt;
|
||||||
|
case METHOD_SETUP_NHLT:
|
||||||
|
return aops->setup_nhlt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,3 +337,15 @@ int acpi_write_dev_tables(struct acpi_ctx *ctx)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int acpi_setup_nhlt(struct acpi_ctx *ctx, struct nhlt *nhlt)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
log_debug("Setup NHLT\n");
|
||||||
|
ctx->nhlt = nhlt;
|
||||||
|
ret = acpi_recurse_method(ctx, dm_root(), METHOD_SETUP_NHLT, TYPE_NONE);
|
||||||
|
log_debug("Setup finished, err=%d\n", ret);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
@@ -27,6 +27,8 @@
|
|||||||
|
|
||||||
#if !defined(__ACPI__)
|
#if !defined(__ACPI__)
|
||||||
|
|
||||||
|
struct nhlt;
|
||||||
|
|
||||||
/** enum acpi_dump_option - selects what ACPI information to dump */
|
/** enum acpi_dump_option - selects what ACPI information to dump */
|
||||||
enum acpi_dump_option {
|
enum acpi_dump_option {
|
||||||
ACPI_DUMP_LIST, /* Just the list of items */
|
ACPI_DUMP_LIST, /* Just the list of items */
|
||||||
@@ -44,6 +46,9 @@ enum acpi_dump_option {
|
|||||||
* adding a new table. The RSDP holds pointers to the RSDT and XSDT.
|
* adding a new table. The RSDP holds pointers to the RSDT and XSDT.
|
||||||
* @rsdt: Pointer to the Root System Description Table
|
* @rsdt: Pointer to the Root System Description Table
|
||||||
* @xsdt: Pointer to the Extended System Description Table
|
* @xsdt: Pointer to the Extended System Description Table
|
||||||
|
* @nhlt: Intel Non-High-Definition-Audio Link Table (NHLT) pointer, used to
|
||||||
|
* build up information that audio codecs need to provide in the NHLT ACPI
|
||||||
|
* table
|
||||||
* @len_stack: Stack of 'length' words to fix up later
|
* @len_stack: Stack of 'length' words to fix up later
|
||||||
* @ltop: Points to current top of stack (0 = empty)
|
* @ltop: Points to current top of stack (0 = empty)
|
||||||
*/
|
*/
|
||||||
@@ -53,6 +58,7 @@ struct acpi_ctx {
|
|||||||
struct acpi_rsdp *rsdp;
|
struct acpi_rsdp *rsdp;
|
||||||
struct acpi_rsdt *rsdt;
|
struct acpi_rsdt *rsdt;
|
||||||
struct acpi_xsdt *xsdt;
|
struct acpi_xsdt *xsdt;
|
||||||
|
struct nhlt *nhlt;
|
||||||
char *len_stack[ACPIGEN_LENSTACK_SIZE];
|
char *len_stack[ACPIGEN_LENSTACK_SIZE];
|
||||||
int ltop;
|
int ltop;
|
||||||
};
|
};
|
||||||
@@ -113,6 +119,15 @@ struct acpi_ops {
|
|||||||
* @return 0 if OK, -ve on error
|
* @return 0 if OK, -ve on error
|
||||||
*/
|
*/
|
||||||
int (*inject_dsdt)(const struct udevice *dev, struct acpi_ctx *ctx);
|
int (*inject_dsdt)(const struct udevice *dev, struct acpi_ctx *ctx);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* setup_nhlt() - Set up audio information for this device
|
||||||
|
*
|
||||||
|
* The method can add information to ctx->nhlt if it likes
|
||||||
|
*
|
||||||
|
* @return 0 if OK, -ENODATA if nothing to add, -ve on error
|
||||||
|
*/
|
||||||
|
int (*setup_nhlt)(const struct udevice *dev, struct acpi_ctx *ctx);
|
||||||
};
|
};
|
||||||
|
|
||||||
#define device_get_acpi_ops(dev) ((dev)->driver->acpi_ops)
|
#define device_get_acpi_ops(dev) ((dev)->driver->acpi_ops)
|
||||||
@@ -177,6 +192,17 @@ int acpi_fill_ssdt(struct acpi_ctx *ctx);
|
|||||||
*/
|
*/
|
||||||
int acpi_inject_dsdt(struct acpi_ctx *ctx);
|
int acpi_inject_dsdt(struct acpi_ctx *ctx);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* acpi_setup_nhlt() - Set up audio information
|
||||||
|
*
|
||||||
|
* This is called to set up the nhlt information for all devices.
|
||||||
|
*
|
||||||
|
* @ctx: ACPI context to use
|
||||||
|
* @nhlt: Pointer to nhlt information to add to
|
||||||
|
* @return 0 if OK, -ve on error
|
||||||
|
*/
|
||||||
|
int acpi_setup_nhlt(struct acpi_ctx *ctx, struct nhlt *nhlt);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* acpi_dump_items() - Dump out the collected ACPI items
|
* acpi_dump_items() - Dump out the collected ACPI items
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user