linux/sound/pci/hda/cs35l41_hda.c

// SPDX-License-Identifier: GPL-2.0
//
// CS35l41 ALSA HDA audio driver
//
// Copyright 2021 Cirrus Logic, Inc.
//
// Author: Lucas Tanure <[email protected]>

#include <linux/acpi.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <sound/hda_codec.h>
#include <sound/soc.h>
#include <linux/pm_runtime.h>
#include <linux/spi/spi.h>
#include <linux/vmalloc.h>
#include "hda_local.h"
#include "hda_auto_parser.h"
#include "hda_jack.h"
#include "hda_generic.h"
#include "hda_component.h"
#include "cs35l41_hda.h"
#include "hda_cs_dsp_ctl.h"
#include "cs35l41_hda_property.h"

#define CS35L41_PART

#define HALO_STATE_DSP_CTL_NAME
#define HALO_STATE_DSP_CTL_TYPE
#define HALO_STATE_DSP_CTL_ALG
#define CAL_R_DSP_CTL_NAME
#define CAL_STATUS_DSP_CTL_NAME
#define CAL_CHECKSUM_DSP_CTL_NAME
#define CAL_AMBIENT_DSP_CTL_NAME
#define CAL_DSP_CTL_TYPE
#define CAL_DSP_CTL_ALG
#define CS35L41_UUID
#define CS35L41_DSM_GET_MUTE
#define CS35L41_NOTIFY_EVENT
#define CS35L41_TUNING_SIG

enum cs35l41_tuning_param_types {};

struct cs35l41_tuning_param_hdr {} __packed;

struct cs35l41_tuning_param {} __packed;

struct cs35l41_tuning_params {} __packed;

/* Firmware calibration controls */
static const struct cirrus_amp_cal_controls cs35l41_calibration_controls =;

static bool firmware_autostart =;
module_param(firmware_autostart, bool, 0444);
MODULE_PARM_DESC();

static const struct reg_sequence cs35l41_hda_config[] =;

static const struct reg_sequence cs35l41_hda_config_dsp[] =;

static const struct reg_sequence cs35l41_hda_unmute[] =;

static const struct reg_sequence cs35l41_hda_mute[] =;

static const struct cs_dsp_client_ops client_ops =;

static int cs35l41_request_tuning_param_file(struct cs35l41_hda *cs35l41, char *tuning_filename,
					     const struct firmware **firmware, char **filename,
					     const char *ssid)
{}

static int cs35l41_request_firmware_file(struct cs35l41_hda *cs35l41,
					 const struct firmware **firmware, char **filename,
					 const char *ssid, const char *amp_name,
					 int spkid, const char *filetype)
{}

static int cs35l41_request_firmware_files_spkid(struct cs35l41_hda *cs35l41,
						const struct firmware **wmfw_firmware,
						char **wmfw_filename,
						const struct firmware **coeff_firmware,
						char **coeff_filename)
{}

static int cs35l41_fallback_firmware_file(struct cs35l41_hda *cs35l41,
					  const struct firmware **wmfw_firmware,
					  char **wmfw_filename,
					  const struct firmware **coeff_firmware,
					  char **coeff_filename)
{}

static int cs35l41_request_firmware_files(struct cs35l41_hda *cs35l41,
					  const struct firmware **wmfw_firmware,
					  char **wmfw_filename,
					  const struct firmware **coeff_firmware,
					  char **coeff_filename)
{}


static void cs35l41_hda_apply_calibration(struct cs35l41_hda *cs35l41)
{}

static int cs35l41_read_silicon_uid(struct cs35l41_hda *cs35l41, u64 *uid)
{}

static int cs35l41_get_calibration(struct cs35l41_hda *cs35l41)
{}


static void cs35l41_set_default_tuning_params(struct cs35l41_hda *cs35l41)
{}

static int cs35l41_read_tuning_params(struct cs35l41_hda *cs35l41, const struct firmware *firmware)
{}

static int cs35l41_load_tuning_params(struct cs35l41_hda *cs35l41, char *tuning_filename)
{}

static int cs35l41_init_dsp(struct cs35l41_hda *cs35l41)
{}

static void cs35l41_shutdown_dsp(struct cs35l41_hda *cs35l41)
{}

static void cs35l41_remove_dsp(struct cs35l41_hda *cs35l41)
{}

/* Protection release cycle to get the speaker out of Safe-Mode */
static void cs35l41_error_release(struct device *dev, struct regmap *regmap, unsigned int mask)
{}

/* Clear all errors to release safe mode. Global Enable must be cleared first. */
static void cs35l41_irq_release(struct cs35l41_hda *cs35l41)
{}

static void cs35l41_hda_play_start(struct device *dev)
{}

static void cs35l41_mute(struct device *dev, bool mute)
{}

static void cs35l41_hda_play_done(struct device *dev)
{}

static void cs35l41_hda_pause_start(struct device *dev)
{}

static void cs35l41_hda_pause_done(struct device *dev)
{}

static void cs35l41_hda_pre_playback_hook(struct device *dev, int action)
{}
static void cs35l41_hda_playback_hook(struct device *dev, int action)
{}

static void cs35l41_hda_post_playback_hook(struct device *dev, int action)
{}

static int cs35l41_hda_channel_map(struct device *dev, unsigned int tx_num, unsigned int *tx_slot,
				    unsigned int rx_num, unsigned int *rx_slot)
{}

static int cs35l41_verify_id(struct cs35l41_hda *cs35l41, unsigned int *regid, unsigned int *reg_revid)
{}

static int cs35l41_ready_for_reset(struct cs35l41_hda *cs35l41)
{}

static int cs35l41_system_suspend_prep(struct device *dev)
{}

static int cs35l41_system_suspend(struct device *dev)
{}

static int cs35l41_wait_boot_done(struct cs35l41_hda *cs35l41)
{}

static int cs35l41_system_resume(struct device *dev)
{}

static int cs35l41_runtime_idle(struct device *dev)
{}

static int cs35l41_runtime_suspend(struct device *dev)
{}

static int cs35l41_runtime_resume(struct device *dev)
{}

static int cs35l41_smart_amp(struct cs35l41_hda *cs35l41)
{}

static void cs35l41_load_firmware(struct cs35l41_hda *cs35l41, bool load)
{}

static int cs35l41_fw_load_ctl_get(struct snd_kcontrol *kcontrol,
				   struct snd_ctl_elem_value *ucontrol)
{}

static int cs35l41_mute_override_ctl_get(struct snd_kcontrol *kcontrol,
					 struct snd_ctl_elem_value *ucontrol)
{}

static void cs35l41_fw_load_work(struct work_struct *work)
{}

static int cs35l41_fw_load_ctl_put(struct snd_kcontrol *kcontrol,
				   struct snd_ctl_elem_value *ucontrol)
{}

static int cs35l41_fw_type_ctl_get(struct snd_kcontrol *kcontrol,
				   struct snd_ctl_elem_value *ucontrol)
{}

static int cs35l41_fw_type_ctl_put(struct snd_kcontrol *kcontrol,
				   struct snd_ctl_elem_value *ucontrol)
{}

static int cs35l41_fw_type_ctl_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{}

static int cs35l41_create_controls(struct cs35l41_hda *cs35l41)
{}

static bool cs35l41_dsm_supported(acpi_handle handle, unsigned int commands)
{}

static int cs35l41_get_acpi_mute_state(struct cs35l41_hda *cs35l41, acpi_handle handle)
{}

static void cs35l41_acpi_device_notify(acpi_handle handle, u32 event, struct device *dev)
{}

static int cs35l41_hda_bind(struct device *dev, struct device *master, void *master_data)
{}

static void cs35l41_hda_unbind(struct device *dev, struct device *master, void *master_data)
{}

static const struct component_ops cs35l41_hda_comp_ops =;

static irqreturn_t cs35l41_bst_short_err(int irq, void *data)
{}

static irqreturn_t cs35l41_bst_dcm_uvp_err(int irq, void *data)
{}

static irqreturn_t cs35l41_bst_ovp_err(int irq, void *data)
{}

static irqreturn_t cs35l41_temp_err(int irq, void *data)
{}

static irqreturn_t cs35l41_temp_warn(int irq, void *data)
{}

static irqreturn_t cs35l41_amp_short(int irq, void *data)
{}

static const struct cs35l41_irq cs35l41_irqs[] =;

static const struct regmap_irq cs35l41_reg_irqs[] =;

static struct regmap_irq_chip cs35l41_regmap_irq_chip =;

static void cs35l41_configure_interrupt(struct cs35l41_hda *cs35l41, int irq_pol)
{}

static int cs35l41_hda_apply_properties(struct cs35l41_hda *cs35l41)
{}

int cs35l41_get_speaker_id(struct device *dev, int amp_index, int num_amps, int fixed_gpio_id)
{}

int cs35l41_hda_parse_acpi(struct cs35l41_hda *cs35l41, struct device *physdev, int id)
{}

static int cs35l41_hda_read_acpi(struct cs35l41_hda *cs35l41, const char *hid, int id)
{}

int cs35l41_hda_probe(struct device *dev, const char *device_name, int id, int irq,
		      struct regmap *regmap, enum control_bus control_bus)
{}
EXPORT_SYMBOL_NS_GPL();

void cs35l41_hda_remove(struct device *dev)
{}
EXPORT_SYMBOL_NS_GPL();

const struct dev_pm_ops cs35l41_hda_pm_ops =;
EXPORT_SYMBOL_NS_GPL();

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