linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Connor McAdams <conmanx360@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: conmanx360@gmail.com, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Takashi Sakamoto <o-takashi@sakamocchi.jp>,
	Alastair Bridgewater <alastair.bridgewater@gmail.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: [PATCH 13/15] ALSA: hda/ca0132 - Add input selection commands for AE-5
Date: Tue, 18 Sep 2018 14:33:41 -0400	[thread overview]
Message-ID: <1537295625-8082-14-git-send-email-conmanx360@gmail.com> (raw)
In-Reply-To: <1537295625-8082-1-git-send-email-conmanx360@gmail.com>

This patch adds the input selection commands for the Sound BlasterX
AE-5.

Signed-off-by: Connor McAdams <conmanx360@gmail.com>
---
 sound/pci/hda/patch_ca0132.c | 35 +++++++++++++++++++++++++++++------
 1 file changed, 29 insertions(+), 6 deletions(-)

diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index 364c3fe..ff80832 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -4523,6 +4523,10 @@ static int ca0132_alt_select_in(struct hda_codec *codec)
 			r3di_gpio_mic_set(codec, R3DI_REAR_MIC);
 			tmp = FLOAT_ONE;
 			break;
+		case QUIRK_AE5:
+			ca0113_mmio_command_set(codec, 0x48, 0x28, 0x00);
+			tmp = FLOAT_THREE;
+			break;
 		default:
 			tmp = FLOAT_ONE;
 			break;
@@ -4537,10 +4541,15 @@ static int ca0132_alt_select_in(struct hda_codec *codec)
 
 		chipio_set_stream_control(codec, 0x03, 1);
 		chipio_set_stream_control(codec, 0x04, 1);
-
-		if (spec->quirk == QUIRK_SBZ) {
+		switch (spec->quirk) {
+		case QUIRK_SBZ:
 			chipio_write(codec, 0x18B098, 0x0000000C);
 			chipio_write(codec, 0x18B09C, 0x0000000C);
+			break;
+		case QUIRK_AE5:
+			chipio_write(codec, 0x18B098, 0x0000000C);
+			chipio_write(codec, 0x18B09C, 0x0000004C);
+			break;
 		}
 		ca0132_alt_mic_boost_set(codec, spec->mic_boost_enum_val);
 		break;
@@ -4554,6 +4563,9 @@ static int ca0132_alt_select_in(struct hda_codec *codec)
 		case QUIRK_R3DI:
 			r3di_gpio_mic_set(codec, R3DI_REAR_MIC);
 			break;
+		case QUIRK_AE5:
+			ca0113_mmio_command_set(codec, 0x48, 0x28, 0x00);
+			break;
 		}
 
 		chipio_set_conn_rate(codec, MEM_CONNID_MICIN1, SR_96_000);
@@ -4564,11 +4576,13 @@ static int ca0132_alt_select_in(struct hda_codec *codec)
 		tmp = FLOAT_ZERO;
 		dspio_set_uint_param(codec, 0x80, 0x00, tmp);
 
-		if (spec->quirk == QUIRK_SBZ) {
+		switch (spec->quirk) {
+		case QUIRK_SBZ:
+		case QUIRK_AE5:
 			chipio_write(codec, 0x18B098, 0x00000000);
 			chipio_write(codec, 0x18B09C, 0x00000000);
+			break;
 		}
-
 		chipio_set_stream_control(codec, 0x03, 1);
 		chipio_set_stream_control(codec, 0x04, 1);
 		break;
@@ -4584,6 +4598,10 @@ static int ca0132_alt_select_in(struct hda_codec *codec)
 			r3di_gpio_mic_set(codec, R3DI_FRONT_MIC);
 			tmp = FLOAT_ONE;
 			break;
+		case QUIRK_AE5:
+			ca0113_mmio_command_set(codec, 0x48, 0x28, 0x3f);
+			tmp = FLOAT_THREE;
+			break;
 		default:
 			tmp = FLOAT_ONE;
 			break;
@@ -4599,9 +4617,15 @@ static int ca0132_alt_select_in(struct hda_codec *codec)
 		chipio_set_stream_control(codec, 0x03, 1);
 		chipio_set_stream_control(codec, 0x04, 1);
 
-		if (spec->quirk == QUIRK_SBZ) {
+		switch (spec->quirk) {
+		case QUIRK_SBZ:
 			chipio_write(codec, 0x18B098, 0x0000000C);
 			chipio_write(codec, 0x18B09C, 0x000000CC);
+			break;
+		case QUIRK_AE5:
+			chipio_write(codec, 0x18B098, 0x0000000C);
+			chipio_write(codec, 0x18B09C, 0x0000004C);
+			break;
 		}
 		ca0132_alt_mic_boost_set(codec, spec->mic_boost_enum_val);
 		break;
@@ -4610,7 +4634,6 @@ static int ca0132_alt_select_in(struct hda_codec *codec)
 
 	snd_hda_power_down_pm(codec);
 	return 0;
-
 }
 
 /*
-- 
2.7.4


  parent reply	other threads:[~2018-09-18 18:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-18 18:33 [PATCH 00/15] Add support for Sound BlasterX AE-5 Connor McAdams
2018-09-18 18:33 ` [PATCH 01/15] ALSA: hda/ca0132 - Define new verbs and control params Connor McAdams
2018-09-18 18:33 ` [PATCH 02/15] ALSA: hda/ca0132 - Add quirk for Sound BlasterX AE-5 Connor McAdams
2018-09-18 18:33 ` [PATCH 03/15] ALSA: hda/ca0132 - Add pincfg for AE-5 Connor McAdams
2018-09-18 18:33 ` [PATCH 04/15] ALSA: hda/ca0132 - Set AE-5 bools and select mixer Connor McAdams
2018-09-18 18:33 ` [PATCH 05/15] ALSA: hda/ca0132 - Change ca0132_mmio_init for AE-5 Connor McAdams
2018-09-18 18:33 ` [PATCH 06/15] ALSA: hda/ca0132 - Add AE-5 pre-init and ca0113 functions Connor McAdams
2018-09-18 18:33 ` [PATCH 07/15] ALSA: hda/ca0132 - Add AE-5 regular init setup Connor McAdams
2018-09-18 18:33 ` [PATCH 08/15] ALSA: hda/ca0132 - Change firmware name and usage Connor McAdams
2018-09-18 18:33 ` [PATCH 09/15] ALSA: hda/ca0132 - Merge post-dsp functions + cleanup Connor McAdams
2018-09-18 18:33 ` [PATCH 10/15] ALSA: hda/ca0132 - Add DSP setup functions for AE-5 Connor McAdams
2018-09-18 18:33 ` [PATCH 11/15] ALSA: hda/ca0132 - Clean up ca0132_alt_out_select Connor McAdams
2018-09-18 18:33 ` [PATCH 12/15] ALSA: hda/ca0132 - Add output set commands for AE-5 Connor McAdams
2018-09-18 18:33 ` Connor McAdams [this message]
2018-09-18 18:33 ` [PATCH 14/15] ALSA: hda/ca0132 - Add AE-5 specific controls Connor McAdams
2018-09-18 18:33 ` [PATCH 15/15] ALSA: hda/ca0132 - Add AE-5 exit function Connor McAdams
2018-09-20  7:23 ` [PATCH 00/15] Add support for Sound BlasterX AE-5 Takashi Iwai
2018-09-20 14:15   ` Connor McAdams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1537295625-8082-14-git-send-email-conmanx360@gmail.com \
    --to=conmanx360@gmail.com \
    --cc=alastair.bridgewater@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=o-takashi@sakamocchi.jp \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --subject='Re: [PATCH 13/15] ALSA: hda/ca0132 - Add input selection commands for AE-5' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).