Path: blob/master/sound/hda/codecs/side-codecs/tas2781_hda.h
26481 views
/* SPDX-License-Identifier: GPL-2.0-only1*2* HDA audio driver for Texas Instruments TAS2781 smart amp3*4* Copyright (C) 2025 Texas Instruments, Inc.5*/6#ifndef __TAS2781_HDA_H__7#define __TAS2781_HDA_H__89#include <sound/asound.h>1011/* Flag of calibration registers address. */12#define TASDEV_UEFI_CALI_REG_ADDR_FLG BIT(7)1314#define TASDEV_CALIB_N 51516/*17* No standard control callbacks for SNDRV_CTL_ELEM_IFACE_CARD18* Define two controls, one is Volume control callbacks, the other is19* flag setting control callbacks.20*/2122/* Volume control callbacks for tas2781 */23#define ACARD_SINGLE_RANGE_EXT_TLV(xname, xreg, xshift, xmin, xmax, xinvert, \24xhandler_get, xhandler_put, tlv_array) { \25.iface = SNDRV_CTL_ELEM_IFACE_CARD, .name = (xname), \26.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \27SNDRV_CTL_ELEM_ACCESS_READWRITE, \28.tlv.p = (tlv_array), \29.info = snd_soc_info_volsw, \30.get = xhandler_get, .put = xhandler_put, \31.private_value = (unsigned long)&(struct soc_mixer_control) { \32.reg = xreg, .rreg = xreg, \33.shift = xshift, .rshift = xshift,\34.min = xmin, .max = xmax, .invert = xinvert, \35} \36}3738/* Flag control callbacks for tas2781 */39#define ACARD_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) { \40.iface = SNDRV_CTL_ELEM_IFACE_CARD, \41.name = xname, \42.info = snd_ctl_boolean_mono_info, \43.get = xhandler_get, \44.put = xhandler_put, \45.private_value = xdata, \46}4748enum device_catlog_id {49DELL = 0,50HP,51LENOVO,52OTHERS53};5455struct tas2781_hda {56struct device *dev;57struct tasdevice_priv *priv;58struct snd_kcontrol *dsp_prog_ctl;59struct snd_kcontrol *dsp_conf_ctl;60struct snd_kcontrol *prof_ctl;61enum device_catlog_id catlog_id;62void *hda_priv;63};6465extern const efi_guid_t tasdev_fct_efi_guid[];6667int tas2781_save_calibration(struct tas2781_hda *p);68void tas2781_hda_remove(struct device *dev,69const struct component_ops *ops);70int tasdevice_info_profile(struct snd_kcontrol *kctl,71struct snd_ctl_elem_info *uctl);72int tasdevice_info_programs(struct snd_kcontrol *kctl,73struct snd_ctl_elem_info *uctl);74int tasdevice_info_config(struct snd_kcontrol *kctl,75struct snd_ctl_elem_info *uctl);76int tasdevice_set_profile_id(struct snd_kcontrol *kctl,77struct snd_ctl_elem_value *uctl);78int tasdevice_get_profile_id(struct snd_kcontrol *kctl,79struct snd_ctl_elem_value *uctl);80int tasdevice_program_get(struct snd_kcontrol *kctl,81struct snd_ctl_elem_value *uctl);82int tasdevice_program_put(struct snd_kcontrol *kctl,83struct snd_ctl_elem_value *uctl);84int tasdevice_config_put(struct snd_kcontrol *kctl,85struct snd_ctl_elem_value *uctl);86int tasdevice_config_get(struct snd_kcontrol *kctl,87struct snd_ctl_elem_value *uctl);8889#endif909192