xref: /linux/sound/pci/hda/hda_cs_dsp_ctl.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1 /* SPDX-License-Identifier: GPL-2.0
2  *
3  * HDA DSP ALSA Control Driver
4  *
5  * Copyright 2022 Cirrus Logic, Inc.
6  *
7  * Author: Stefan Binding <sbinding@opensource.cirrus.com>
8  */
9 
10 #ifndef __HDA_CS_DSP_CTL_H__
11 #define __HDA_CS_DSP_CTL_H__
12 
13 #include <sound/soc.h>
14 #include <linux/firmware/cirrus/cs_dsp.h>
15 
16 enum hda_cs_dsp_fw_id {
17 	HDA_CS_DSP_FW_SPK_PROT,
18 	HDA_CS_DSP_FW_SPK_CALI,
19 	HDA_CS_DSP_FW_SPK_DIAG,
20 	HDA_CS_DSP_FW_MISC,
21 	HDA_CS_DSP_NUM_FW
22 };
23 
24 struct hda_cs_dsp_ctl_info {
25 	struct snd_card *card;
26 	enum hda_cs_dsp_fw_id fw_type;
27 	const char *device_name;
28 };
29 
30 extern const char * const hda_cs_dsp_fw_ids[HDA_CS_DSP_NUM_FW];
31 
32 void hda_cs_dsp_add_controls(struct cs_dsp *dsp, const struct hda_cs_dsp_ctl_info *info);
33 void hda_cs_dsp_control_remove(struct cs_dsp_coeff_ctl *cs_ctl);
34 int hda_cs_dsp_write_ctl(struct cs_dsp *dsp, const char *name, int type,
35 			 unsigned int alg, const void *buf, size_t len);
36 int hda_cs_dsp_read_ctl(struct cs_dsp *dsp, const char *name, int type,
37 			unsigned int alg, void *buf, size_t len);
38 
39 #endif /*__HDA_CS_DSP_CTL_H__*/
40