linux/sound/pci/hda/tas2781_hda_i2c.c

// SPDX-License-Identifier: GPL-2.0
//
// TAS2781 HDA I2C driver
//
// Copyright 2023 Texas Instruments, Inc.
//
// Author: Shenghao Ding <[email protected]>

#include <linux/acpi.h>
#include <linux/crc8.h>
#include <linux/crc32.h>
#include <linux/efi.h>
#include <linux/firmware.h>
#include <linux/i2c.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <sound/hda_codec.h>
#include <sound/soc.h>
#include <sound/tas2781.h>
#include <sound/tlv.h>
#include <sound/tas2781-tlv.h>

#include "hda_local.h"
#include "hda_auto_parser.h"
#include "hda_component.h"
#include "hda_jack.h"
#include "hda_generic.h"

#define TASDEVICE_SPEAKER_CALIBRATION_SIZE

/* No standard control callbacks for SNDRV_CTL_ELEM_IFACE_CARD
 * Define two controls, one is Volume control callbacks, the other is
 * flag setting control callbacks.
 */

/* Volume control callbacks for tas2781 */
#define ACARD_SINGLE_RANGE_EXT_TLV(xname, xreg, xshift, xmin, xmax, xinvert, \
	xhandler_get, xhandler_put, tlv_array)

/* Flag control callbacks for tas2781 */
#define ACARD_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put)

enum calib_data {};

#define TAS2563_MAX_CHANNELS

#define TAS2563_CAL_POWER
#define TAS2563_CAL_R0
#define TAS2563_CAL_INVR0
#define TAS2563_CAL_R0_LOW
#define TAS2563_CAL_TLIM
#define TAS2563_CAL_N
#define TAS2563_CAL_DATA_SIZE
#define TAS2563_CAL_CH_SIZE
#define TAS2563_CAL_ARRAY_SIZE

static unsigned int cal_regs[TAS2563_CAL_N] =;


struct tas2781_hda {};

static int tas2781_get_i2c_res(struct acpi_resource *ares, void *data)
{}

static int tas2781_read_acpi(struct tasdevice_priv *p, const char *hid)
{}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

static const struct snd_kcontrol_new tas2781_snd_controls[] =;

static const struct snd_kcontrol_new tas2781_prof_ctrl =;

static const struct snd_kcontrol_new tas2781_dsp_prog_ctrl =;

static const struct snd_kcontrol_new tas2781_dsp_conf_ctrl =;

static void tas2563_apply_calib(struct tasdevice_priv *tas_priv)
{}

static int tas2563_save_calibration(struct tasdevice_priv *tas_priv)
{}

static void tas2781_apply_calib(struct tasdevice_priv *tas_priv)
{}

/* Update the calibration data, including speaker impedance, f0, etc, into algo.
 * Calibrate data is done by manufacturer in the factory. These data are used
 * by Algo for calculating the speaker temperature, speaker membrane excursion
 * and f0 in real time during playback.
 */
static int tas2781_save_calibration(struct tasdevice_priv *tas_priv)
{}

static void tas2781_hda_remove_controls(struct tas2781_hda *tas_hda)
{}

static void tasdev_fw_ready(const struct firmware *fmw, void *context)
{}

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

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

static const struct component_ops tas2781_hda_comp_ops =;

static void tas2781_hda_remove(struct device *dev)
{}

static int tas2781_hda_i2c_probe(struct i2c_client *clt)
{}

static void tas2781_hda_i2c_remove(struct i2c_client *clt)
{}

static int tas2781_runtime_suspend(struct device *dev)
{}

static int tas2781_runtime_resume(struct device *dev)
{}

static int tas2781_system_suspend(struct device *dev)
{}

static int tas2781_system_resume(struct device *dev)
{}

static const struct dev_pm_ops tas2781_hda_pm_ops =;

static const struct i2c_device_id tas2781_hda_i2c_id[] =;

static const struct acpi_device_id tas2781_acpi_hda_match[] =;
MODULE_DEVICE_TABLE(acpi, tas2781_acpi_hda_match);

static struct i2c_driver tas2781_hda_i2c_driver =;
module_i2c_driver();

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