aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/skylake/nhlt/nhlt.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2016-06-28 15:00:30 -0500
committerAaron Durbin <adurbin@chromium.org>2016-06-29 23:15:29 +0200
commite9657bc8dc6dc94216fcbbc9b83c12b210c32be9 (patch)
treebfdd123492d1f2287299e0542ab80bb97e624998 /src/soc/intel/skylake/nhlt/nhlt.c
parent5e0a9c7436f77a4e488d77c80fba38cd00b67e67 (diff)
soc/intel/skylake: refactor nhlt support
Utilize the new NHLT helper functions by driving the NHLT endpoints through data descriptors. Change-Id: I80838214d3615b83d4939ec2d96a4fd7050d5920 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/15488 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/soc/intel/skylake/nhlt/nhlt.c')
-rw-r--r--src/soc/intel/skylake/nhlt/nhlt.c70
1 files changed, 1 insertions, 69 deletions
diff --git a/src/soc/intel/skylake/nhlt/nhlt.c b/src/soc/intel/skylake/nhlt/nhlt.c
index 6ef906a00e..d498152406 100644
--- a/src/soc/intel/skylake/nhlt/nhlt.c
+++ b/src/soc/intel/skylake/nhlt/nhlt.c
@@ -14,76 +14,8 @@
*/
#include <cbmem.h>
+#include <nhlt.h>
#include <soc/acpi.h>
-#include <soc/nhlt.h>
-
-#define NHLT_VID 0x8086
-#define NHLT_DID_DMIC 0xae20
-#define NHLT_DID_BT 0xae30
-#define NHLT_DID_SSP 0xae34
-
-struct nhlt_endpoint *nhlt_soc_add_endpoint(struct nhlt *nhlt, int soc_hwintf,
- int soc_devtype, int dir)
-{
- int nhlt_link_type;
- int nhlt_dev_type;
- uint16_t did;
- struct nhlt_endpoint *endp;
-
- /* Check link type and device type. */
- switch (soc_hwintf) {
- case AUDIO_LINK_SSP0:
- case AUDIO_LINK_SSP1:
- /* Only I2S devices on SSP0 and SSP1. */
- if (soc_devtype != AUDIO_DEV_I2S)
- return NULL;
- nhlt_link_type = NHLT_LINK_SSP;
- break;
- case AUDIO_LINK_SSP2:
- /* Only Bluetooth devices on SSP2. */
- if (soc_devtype != AUDIO_DEV_BT)
- return NULL;
- nhlt_link_type = NHLT_LINK_SSP;
- break;
- case AUDIO_LINK_DMIC:
- /* Only DMIC devices on DMIC links. */
- if (soc_devtype != AUDIO_DEV_DMIC)
- return NULL;
- nhlt_link_type = NHLT_LINK_PDM;
- break;
- default:
- return NULL;
- }
-
- switch (soc_devtype) {
- case AUDIO_DEV_I2S:
- nhlt_dev_type = NHLT_SSP_DEV_I2S;
- did = NHLT_DID_SSP;
- break;
- case AUDIO_DEV_DMIC:
- nhlt_dev_type = NHLT_PDM_DEV;
- did = NHLT_DID_DMIC;
- break;
- case AUDIO_DEV_BT:
- nhlt_dev_type = NHLT_SSP_DEV_BT;
- did = NHLT_DID_BT;
- break;
- default:
- return NULL;
- }
-
- endp = nhlt_add_endpoint(nhlt, nhlt_link_type, nhlt_dev_type, dir,
- NHLT_VID, did);
-
- if (endp == NULL)
- return NULL;
-
- /* Virtual bus id of SSP links are the hardware port ids proper. */
- if (nhlt_link_type == NHLT_LINK_SSP)
- endp->virtual_bus_id = soc_hwintf;
-
- return endp;
-}
uintptr_t nhlt_soc_serialize(struct nhlt *nhlt, uintptr_t acpi_addr)
{