linux/sound/soc/sof/intel/hda.c

// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
//
// This file is provided under a dual BSD/GPLv2 license.  When using or
// redistributing this file, you may do so under either license.
//
// Copyright(c) 2018 Intel Corporation
//
// Authors: Liam Girdwood <[email protected]>
//	    Ranjani Sridharan <[email protected]>
//	    Rander Wang <[email protected]>
//          Keyon Jie <[email protected]>
//

/*
 * Hardware interface for generic Intel audio DSP HDA IP
 */

#include <sound/hdaudio_ext.h>
#include <sound/hda_register.h>

#include <linux/acpi.h>
#include <linux/debugfs.h>
#include <linux/module.h>
#include <linux/soundwire/sdw.h>
#include <linux/soundwire/sdw_intel.h>
#include <sound/intel-dsp-config.h>
#include <sound/intel-nhlt.h>
#include <sound/soc-acpi-intel-ssp-common.h>
#include <sound/sof.h>
#include <sound/sof/xtensa.h>
#include <sound/hda-mlink.h>
#include "../sof-audio.h"
#include "../sof-pci-dev.h"
#include "../ops.h"
#include "../ipc4-topology.h"
#include "hda.h"

#include <trace/events/sof_intel.h>

#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
#include <sound/soc-acpi-intel-match.h>
#endif

/* platform specific devices */
#include "shim.h"

#if IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE)

/*
 * The default for SoundWire clock stop quirks is to power gate the IP
 * and do a Bus Reset, this will need to be modified when the DSP
 * needs to remain in D0i3 so that the Master does not lose context
 * and enumeration is not required on clock restart
 */
static int sdw_clock_stop_quirks =;
module_param(sdw_clock_stop_quirks, int, 0444);
MODULE_PARM_DESC();

static int sdw_params_stream(struct device *dev,
			     struct sdw_intel_stream_params_data *params_data)
{}

static int sdw_params_free(struct device *dev, struct sdw_intel_stream_free_data *free_data)
{}

struct sdw_intel_ops sdw_callback =;

static int sdw_ace2x_params_stream(struct device *dev,
				   struct sdw_intel_stream_params_data *params_data)
{}

static int sdw_ace2x_free_stream(struct device *dev,
				 struct sdw_intel_stream_free_data *free_data)
{}

static int sdw_ace2x_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai)
{}

static struct sdw_intel_ops sdw_ace2x_callback =;

static int hda_sdw_acpi_scan(struct snd_sof_dev *sdev)
{}

static int hda_sdw_probe(struct snd_sof_dev *sdev)
{}

int hda_sdw_startup(struct snd_sof_dev *sdev)
{}
EXPORT_SYMBOL_NS();

static int hda_sdw_exit(struct snd_sof_dev *sdev)
{}

bool hda_common_check_sdw_irq(struct snd_sof_dev *sdev)
{}
EXPORT_SYMBOL_NS();

static bool hda_dsp_check_sdw_irq(struct snd_sof_dev *sdev)
{}

static irqreturn_t hda_dsp_sdw_thread(int irq, void *context)
{}

bool hda_sdw_check_wakeen_irq_common(struct snd_sof_dev *sdev)
{}
EXPORT_SYMBOL_NS();

static bool hda_sdw_check_wakeen_irq(struct snd_sof_dev *sdev)
{}

void hda_sdw_process_wakeen_common(struct snd_sof_dev *sdev)
{}
EXPORT_SYMBOL_NS();

#else /* IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE) */
static inline int hda_sdw_acpi_scan(struct snd_sof_dev *sdev)
{
	return 0;
}

static inline int hda_sdw_probe(struct snd_sof_dev *sdev)
{
	return 0;
}

static inline int hda_sdw_exit(struct snd_sof_dev *sdev)
{
	return 0;
}

static inline bool hda_dsp_check_sdw_irq(struct snd_sof_dev *sdev)
{
	return false;
}

static inline irqreturn_t hda_dsp_sdw_thread(int irq, void *context)
{
	return IRQ_HANDLED;
}

static inline bool hda_sdw_check_wakeen_irq(struct snd_sof_dev *sdev)
{
	return false;
}

#endif /* IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE) */

/* pre fw run operations */
int hda_dsp_pre_fw_run(struct snd_sof_dev *sdev)
{}

/* post fw run operations */
int hda_dsp_post_fw_run(struct snd_sof_dev *sdev)
{}
EXPORT_SYMBOL_NS();

/*
 * Debug
 */

#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG)
static bool hda_use_msi =;
module_param_named(use_msi, hda_use_msi, bool, 0444);
MODULE_PARM_DESC();
#else
#define hda_use_msi
#endif

static char *hda_model;
module_param(hda_model, charp, 0444);
MODULE_PARM_DESC();

static int dmic_num_override =;
module_param_named(dmic_num, dmic_num_override, int, 0444);
MODULE_PARM_DESC();

static int mclk_id_override =;
module_param_named(mclk_id, mclk_id_override, int, 0444);
MODULE_PARM_DESC();

static int bt_link_mask_override;
module_param_named(bt_link_mask, bt_link_mask_override, int, 0444);
MODULE_PARM_DESC();

static int hda_init(struct snd_sof_dev *sdev)
{}

static int check_dmic_num(struct snd_sof_dev *sdev)
{}

static int check_nhlt_ssp_mask(struct snd_sof_dev *sdev, u8 device_type)
{}

static int check_nhlt_ssp_mclk_mask(struct snd_sof_dev *sdev, int ssp_num)
{}

static int hda_init_caps(struct snd_sof_dev *sdev)
{}

static irqreturn_t hda_dsp_interrupt_handler(int irq, void *context)
{}

static irqreturn_t hda_dsp_interrupt_thread(int irq, void *context)
{}

int hda_dsp_probe_early(struct snd_sof_dev *sdev)
{}
EXPORT_SYMBOL_NS();

int hda_dsp_probe(struct snd_sof_dev *sdev)
{}
EXPORT_SYMBOL_NS();

void hda_dsp_remove(struct snd_sof_dev *sdev)
{}
EXPORT_SYMBOL_NS();

void hda_dsp_remove_late(struct snd_sof_dev *sdev)
{}

int hda_power_down_dsp(struct snd_sof_dev *sdev)
{}
EXPORT_SYMBOL_NS();

#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC)
static void hda_generic_machine_select(struct snd_sof_dev *sdev,
				       struct snd_soc_acpi_mach **mach)
{}
#else
static void hda_generic_machine_select(struct snd_sof_dev *sdev,
				       struct snd_soc_acpi_mach **mach)
{
}
#endif

#if IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE)

static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev)
{}
#else
static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev)
{
	return NULL;
}
#endif

void hda_set_mach_params(struct snd_soc_acpi_mach *mach,
			 struct snd_sof_dev *sdev)
{}

static int check_tplg_quirk_mask(struct snd_soc_acpi_mach *mach)
{}

static char *remove_file_ext(const char *tplg_filename)
{}

struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev)
{}

int hda_pci_intel_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
{}
EXPORT_SYMBOL_NS();

int hda_register_clients(struct snd_sof_dev *sdev)
{}

void hda_unregister_clients(struct snd_sof_dev *sdev)
{}

MODULE_LICENSE();
MODULE_DESCRIPTION();
MODULE_IMPORT_NS();
MODULE_IMPORT_NS();
MODULE_IMPORT_NS();
MODULE_IMPORT_NS();
MODULE_IMPORT_NS();
MODULE_IMPORT_NS();
MODULE_IMPORT_NS();
MODULE_IMPORT_NS();
MODULE_IMPORT_NS();
MODULE_IMPORT_NS();