summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorConnor McAdams <conmanx360@gmail.com>2020-12-10 17:06:57 +0100
committerTakashi Iwai <tiwai@suse.de>2020-12-11 09:53:11 +0100
commit19b5926b68252b36bde1cc7b26fb858bd1b9bebb (patch)
treeff9721a9767dedc0108d734af8072a32c6d03472 /sound/pci/hda
parentALSA: hda/ca0132 - Ensure DSP is properly setup post-firmware download. (diff)
downloadlinux-19b5926b68252b36bde1cc7b26fb858bd1b9bebb.tar.xz
linux-19b5926b68252b36bde1cc7b26fb858bd1b9bebb.zip
ALSA: hda/ca0132 - Remove now unnecessary DSP setup functions.
Now that the DSP's audio configuration is understood, remove previous hacky methods of trying to properly configure it. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Link: https://lore.kernel.org/r/20201210160658.461739-6-conmanx360@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/patch_ca0132.c105
1 files changed, 0 insertions, 105 deletions
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index c3ae9e4f715b..e9019e840a4d 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -2426,13 +2426,6 @@ static int dspio_set_uint_param(struct hda_codec *codec, int mod_id,
sizeof(unsigned int));
}
-static int dspio_set_uint_param_no_source(struct hda_codec *codec, int mod_id,
- int req, const unsigned int data)
-{
- return dspio_set_param(codec, mod_id, 0x00, req, &data,
- sizeof(unsigned int));
-}
-
/*
* Allocate a DSP DMA channel via an SCP message
*/
@@ -7781,24 +7774,6 @@ static void ca0132_alt_init_speaker_tuning(struct hda_codec *codec)
}
/*
- * Creates a dummy stream to bind the output to. This seems to have to be done
- * after changing the main outputs source and destination streams.
- */
-static void ca0132_alt_create_dummy_stream(struct hda_codec *codec)
-{
- struct ca0132_spec *spec = codec->spec;
- unsigned int stream_format;
-
- stream_format = snd_hdac_calc_stream_format(48000, 2,
- SNDRV_PCM_FORMAT_S32_LE, 32, 0);
-
- snd_hda_codec_setup_stream(codec, spec->dacs[0], spec->dsp_stream_id,
- 0, stream_format);
-
- snd_hda_codec_cleanup_stream(codec, spec->dacs[0]);
-}
-
-/*
* Initialize mic for non-chromebook ca0132 implementations.
*/
static void ca0132_alt_init_analog_mics(struct hda_codec *codec)
@@ -7839,9 +7814,6 @@ static void sbz_connect_streams(struct hda_codec *codec)
codec_dbg(codec, "Connect Streams entered, mutex locked and loaded.\n");
- chipio_set_stream_channels(codec, 0x0C, 6);
- chipio_set_stream_control(codec, 0x0C, 1);
-
/* This value is 0x43 for 96khz, and 0x83 for 192khz. */
chipio_write_no_mutex(codec, 0x18a020, 0x00000043);
@@ -7889,9 +7861,6 @@ static void sbz_chipio_startup_data(struct hda_codec *codec)
break;
}
- chipio_set_stream_channels(codec, 0x0c, 6);
- chipio_set_stream_control(codec, 0x0c, 1);
-
if (dsp_out_remap_data)
chipio_remap_stream(codec, dsp_out_remap_data);
@@ -7899,57 +7868,6 @@ static void sbz_chipio_startup_data(struct hda_codec *codec)
mutex_unlock(&spec->chipio_mutex);
}
-/*
- * Custom DSP SCP commands where the src value is 0x00 instead of 0x20. This is
- * done after the DSP is loaded.
- */
-static void ca0132_alt_dsp_scp_startup(struct hda_codec *codec)
-{
- struct ca0132_spec *spec = codec->spec;
- unsigned int tmp, i;
-
- /*
- * Gotta run these twice, or else mic works inconsistently. Not clear
- * why this is, but multiple tests have confirmed it.
- */
- for (i = 0; i < 2; i++) {
- switch (ca0132_quirk(spec)) {
- case QUIRK_SBZ:
- case QUIRK_AE5:
- case QUIRK_AE7:
- tmp = 0x00000003;
- dspio_set_uint_param_no_source(codec, 0x80, 0x0C, tmp);
- tmp = 0x00000000;
- dspio_set_uint_param_no_source(codec, 0x80, 0x0A, tmp);
- tmp = 0x00000001;
- dspio_set_uint_param_no_source(codec, 0x80, 0x0B, tmp);
- tmp = 0x00000004;
- dspio_set_uint_param_no_source(codec, 0x80, 0x0C, tmp);
- tmp = 0x00000005;
- dspio_set_uint_param_no_source(codec, 0x80, 0x0C, tmp);
- tmp = 0x00000000;
- dspio_set_uint_param_no_source(codec, 0x80, 0x0C, tmp);
- break;
- case QUIRK_R3D:
- case QUIRK_R3DI:
- tmp = 0x00000000;
- dspio_set_uint_param_no_source(codec, 0x80, 0x0A, tmp);
- tmp = 0x00000001;
- dspio_set_uint_param_no_source(codec, 0x80, 0x0B, tmp);
- tmp = 0x00000004;
- dspio_set_uint_param_no_source(codec, 0x80, 0x0C, tmp);
- tmp = 0x00000005;
- dspio_set_uint_param_no_source(codec, 0x80, 0x0C, tmp);
- tmp = 0x00000000;
- dspio_set_uint_param_no_source(codec, 0x80, 0x0C, tmp);
- break;
- default:
- break;
- }
- msleep(100);
- }
-}
-
static void ca0132_alt_dsp_initial_mic_setup(struct hda_codec *codec)
{
struct ca0132_spec *spec = codec->spec;
@@ -8067,9 +7985,6 @@ static void ae5_post_dsp_stream_setup(struct hda_codec *codec)
chipio_set_conn_rate_no_mutex(codec, 0x70, SR_96_000);
- chipio_set_stream_channels(codec, 0x0C, 6);
- chipio_set_stream_control(codec, 0x0C, 1);
-
chipio_set_stream_source_dest(codec, 0x5, 0x43, 0x0);
chipio_set_stream_source_dest(codec, 0x18, 0x9, 0xd0);
@@ -8127,9 +8042,6 @@ static void ae7_post_dsp_setup_ports(struct hda_codec *codec)
mutex_lock(&spec->chipio_mutex);
- chipio_set_stream_channels(codec, 0x0c, 6);
- chipio_set_stream_control(codec, 0x0c, 1);
-
/* Seems to share the same port remapping as the SBZ. */
chipio_remap_stream(codec, &stream_remap_data[1]);
@@ -8155,8 +8067,6 @@ static void ae7_post_dsp_asi_stream_setup(struct hda_codec *codec)
ca0113_mmio_command_set(codec, 0x30, 0x2b, 0x00);
chipio_set_conn_rate_no_mutex(codec, 0x70, SR_96_000);
- chipio_set_stream_channels(codec, 0x0c, 6);
- chipio_set_stream_control(codec, 0x0c, 1);
chipio_set_stream_source_dest(codec, 0x05, 0x43, 0x00);
chipio_set_stream_source_dest(codec, 0x18, 0x09, 0xd0);
@@ -8363,7 +8273,6 @@ static void r3d_setup_defaults(struct hda_codec *codec)
if (spec->dsp_state != DSP_DOWNLOADED)
return;
- ca0132_alt_dsp_scp_startup(codec);
ca0132_alt_init_analog_mics(codec);
ca0132_alt_start_dsp_audio_streams(codec);
@@ -8414,15 +8323,11 @@ static void sbz_setup_defaults(struct hda_codec *codec)
if (spec->dsp_state != DSP_DOWNLOADED)
return;
- ca0132_alt_dsp_scp_startup(codec);
ca0132_alt_init_analog_mics(codec);
ca0132_alt_start_dsp_audio_streams(codec);
sbz_connect_streams(codec);
sbz_chipio_startup_data(codec);
- chipio_set_stream_control(codec, 0x03, 1);
- chipio_set_stream_control(codec, 0x04, 1);
-
/*
* Sets internal input loopback to off, used to have a switch to
* enable input loopback, but turned out to be way too buggy.
@@ -8457,8 +8362,6 @@ static void sbz_setup_defaults(struct hda_codec *codec)
}
ca0132_alt_init_speaker_tuning(codec);
-
- ca0132_alt_create_dummy_stream(codec);
}
/*
@@ -8474,11 +8377,8 @@ static void ae5_setup_defaults(struct hda_codec *codec)
if (spec->dsp_state != DSP_DOWNLOADED)
return;
- ca0132_alt_dsp_scp_startup(codec);
ca0132_alt_init_analog_mics(codec);
ca0132_alt_start_dsp_audio_streams(codec);
- chipio_set_stream_control(codec, 0x03, 1);
- chipio_set_stream_control(codec, 0x04, 1);
/* New, unknown SCP req's */
tmp = FLOAT_ZERO;
@@ -8527,8 +8427,6 @@ static void ae5_setup_defaults(struct hda_codec *codec)
}
ca0132_alt_init_speaker_tuning(codec);
-
- ca0132_alt_create_dummy_stream(codec);
}
/*
@@ -8544,7 +8442,6 @@ static void ae7_setup_defaults(struct hda_codec *codec)
if (spec->dsp_state != DSP_DOWNLOADED)
return;
- ca0132_alt_dsp_scp_startup(codec);
ca0132_alt_init_analog_mics(codec);
ca0132_alt_start_dsp_audio_streams(codec);
ae7_post_dsp_setup_ports(codec);
@@ -8613,8 +8510,6 @@ static void ae7_setup_defaults(struct hda_codec *codec)
}
ca0132_alt_init_speaker_tuning(codec);
-
- ca0132_alt_create_dummy_stream(codec);
}
/*