Commit 2e81e1ff authored by Vitaly Rodionov's avatar Vitaly Rodionov Committed by Takashi Iwai

ALSA: hda: cs35l41: Add initial DSP support and firmware loading

This patch adds support for the CS35L41 DSP.
The DSP allows for extra features, such as running
speaker protection algorithms and hibernations.

To utilize these features, the driver must load
firmware into the DSP, as well as various tuning
files which allow for customization for specific
models.

[ Slightly simplified Kconfig changes by tiwai ]
Signed-off-by: default avatarVitaly Rodionov <vitaly.rodionov@cirrus.com>
Signed-off-by: default avatarVitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220630002335.366545-5-vitalyr@opensource.cirrus.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 22d5cbd2
......@@ -665,6 +665,10 @@
#define CS35L41_BST_EN_DEFAULT 0x2
#define CS35L41_AMP_EN_SHIFT 0
#define CS35L41_AMP_EN_MASK 1
#define CS35L41_VMON_EN_MASK 0x1000
#define CS35L41_VMON_EN_SHIFT 12
#define CS35L41_IMON_EN_MASK 0x2000
#define CS35L41_IMON_EN_SHIFT 13
#define CS35L41_PDN_DONE_MASK 0x00800000
#define CS35L41_PDN_DONE_SHIFT 23
......
......@@ -107,6 +107,7 @@ config SND_HDA_SCODEC_CS35L41_I2C
depends on SND_SOC
select SND_SOC_CS35L41_LIB
select SND_HDA_SCODEC_CS35L41
select SND_HDA_CS_DSP_CONTROLS
help
Say Y or M here to include CS35L41 I2C HD-audio side codec support
in snd-hda-intel driver, such as ALC287.
......@@ -121,6 +122,7 @@ config SND_HDA_SCODEC_CS35L41_SPI
depends on SND_SOC
select SND_SOC_CS35L41_LIB
select SND_HDA_SCODEC_CS35L41
select SND_HDA_CS_DSP_CONTROLS
help
Say Y or M here to include CS35L41 SPI HD-audio side codec support
in snd-hda-intel driver, such as ALC287.
......
This diff is collapsed.
......@@ -15,6 +15,9 @@
#include <linux/device.h>
#include <sound/cs35l41.h>
#include <linux/firmware/cirrus/cs_dsp.h>
#include <linux/firmware/cirrus/wmfw.h>
enum cs35l41_hda_spk_pos {
CS35l41_LEFT,
CS35l41_RIGHT,
......@@ -39,7 +42,17 @@ struct cs35l41_hda {
int channel_index;
unsigned volatile long irq_errors;
const char *amp_name;
struct mutex fw_mutex;
struct regmap_irq_chip_data *irq_data;
bool firmware_running;
bool halo_initialized;
struct cs_dsp cs_dsp;
};
enum halo_state {
HALO_STATE_CODE_INIT_DOWNLOAD = 0,
HALO_STATE_CODE_START,
HALO_STATE_CODE_RUN
};
int cs35l41_hda_probe(struct device *dev, const char *device_name, int id, int irq,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment