linux/include/sound/intel-nhlt.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 *  intel-nhlt.h - Intel HDA Platform NHLT header
 *
 *  Copyright (c) 2015-2019 Intel Corporation
 */

#ifndef __INTEL_NHLT_H__
#define __INTEL_NHLT_H__

#include <linux/acpi.h>

enum nhlt_link_type {};

enum nhlt_device_type {};

struct wav_fmt {} __packed;

struct wav_fmt_ext {} __packed;

struct nhlt_specific_cfg {} __packed;

struct nhlt_fmt_cfg {} __packed;

struct nhlt_fmt {} __packed;

struct nhlt_endpoint {} __packed;

struct nhlt_acpi_table {} __packed;

struct nhlt_resource_desc  {} __packed;

#define MIC_ARRAY_2CH
#define MIC_ARRAY_4CH

struct nhlt_device_specific_config {} __packed;

struct nhlt_dmic_array_config {} __packed;

struct nhlt_vendor_dmic_array_config {} __packed;

enum {};

enum {};

#if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_SND_INTEL_NHLT)

struct nhlt_acpi_table *intel_nhlt_init(struct device *dev);

void intel_nhlt_free(struct nhlt_acpi_table *addr);

int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt);

bool intel_nhlt_has_endpoint_type(struct nhlt_acpi_table *nhlt, u8 link_type);

int intel_nhlt_ssp_endpoint_mask(struct nhlt_acpi_table *nhlt, u8 device_type);

int intel_nhlt_ssp_mclk_mask(struct nhlt_acpi_table *nhlt, int ssp_num);

struct nhlt_specific_cfg *
intel_nhlt_get_endpoint_blob(struct device *dev, struct nhlt_acpi_table *nhlt,
			     u32 bus_id, u8 link_type, u8 vbps, u8 bps,
			     u8 num_ch, u32 rate, u8 dir, u8 dev_type);

int intel_nhlt_ssp_device_type(struct device *dev, struct nhlt_acpi_table *nhlt,
			       u8 virtual_bus_id);

#else

static inline struct nhlt_acpi_table *intel_nhlt_init(struct device *dev)
{
	return NULL;
}

static inline void intel_nhlt_free(struct nhlt_acpi_table *addr)
{
}

static inline int intel_nhlt_get_dmic_geo(struct device *dev,
					  struct nhlt_acpi_table *nhlt)
{
	return 0;
}

static inline bool intel_nhlt_has_endpoint_type(struct nhlt_acpi_table *nhlt,
						u8 link_type)
{
	return false;
}

static inline int intel_nhlt_ssp_endpoint_mask(struct nhlt_acpi_table *nhlt, u8 device_type)
{
	return 0;
}

static inline int intel_nhlt_ssp_mclk_mask(struct nhlt_acpi_table *nhlt, int ssp_num)
{
	return 0;
}

static inline struct nhlt_specific_cfg *
intel_nhlt_get_endpoint_blob(struct device *dev, struct nhlt_acpi_table *nhlt,
			     u32 bus_id, u8 link_type, u8 vbps, u8 bps,
			     u8 num_ch, u32 rate, u8 dir, u8 dev_type)
{
	return NULL;
}

static inline int intel_nhlt_ssp_device_type(struct device *dev,
					     struct nhlt_acpi_table *nhlt,
					     u8 virtual_bus_id)
{
	return -EINVAL;
}

#endif

#endif