All of lore.kernel.org
 help / color / mirror / Atom feed
From: Connor McAdams <conmanx360@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Connor McAdams <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 02/11] ALSA: hda/ca0132 - Clean up ca0132_init function.
Date: Wed,  8 Aug 2018 13:34:13 -0400	[thread overview]
Message-ID: <1533749663-8200-3-git-send-email-conmanx360@gmail.com> (raw)
In-Reply-To: <1533749663-8200-1-git-send-email-conmanx360@gmail.com>

This patch cleans up ca0132_init by removing unnecessary commands and
ordering things better.

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

diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index 9a92a64..b3c2cae 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -7250,14 +7250,12 @@ static int ca0132_init(struct hda_codec *codec)
 
 	ca0132_refresh_widget_caps(codec);
 
-	if (spec->quirk == QUIRK_SBZ)
-		ca0132_mmio_gpio_set(codec, 7, true);
-
 	switch (spec->quirk) {
 	case QUIRK_R3DI:
 		r3di_setup_defaults(codec);
 		break;
 	case QUIRK_SBZ:
+		sbz_setup_defaults(codec);
 		break;
 	default:
 		ca0132_setup_defaults(codec);
@@ -7288,20 +7286,12 @@ static int ca0132_init(struct hda_codec *codec)
 		ca0132_gpio_setup(codec);
 
 	snd_hda_sequence_write(codec, spec->spec_init_verbs);
-	switch (spec->quirk) {
-	case QUIRK_SBZ:
-		sbz_setup_defaults(codec);
-		ca0132_alt_select_out(codec);
-		ca0132_alt_select_in(codec);
-		break;
-	case QUIRK_R3DI:
+	if (spec->use_alt_functions) {
 		ca0132_alt_select_out(codec);
 		ca0132_alt_select_in(codec);
-		break;
-	default:
+	} else {
 		ca0132_select_out(codec);
 		ca0132_select_mic(codec);
-		break;
 	}
 
 	snd_hda_jack_report_sync(codec);
-- 
2.7.4


WARNING: multiple messages have this Message-ID (diff)
From: Connor McAdams <conmanx360@gmail.com>
Cc: Connor McAdams <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 02/11] ALSA: hda/ca0132 - Clean up ca0132_init function.
Date: Wed,  8 Aug 2018 13:34:13 -0400	[thread overview]
Message-ID: <1533749663-8200-3-git-send-email-conmanx360@gmail.com> (raw)
In-Reply-To: <1533749663-8200-1-git-send-email-conmanx360@gmail.com>

This patch cleans up ca0132_init by removing unnecessary commands and
ordering things better.

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

diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index 9a92a64..b3c2cae 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -7250,14 +7250,12 @@ static int ca0132_init(struct hda_codec *codec)
 
 	ca0132_refresh_widget_caps(codec);
 
-	if (spec->quirk == QUIRK_SBZ)
-		ca0132_mmio_gpio_set(codec, 7, true);
-
 	switch (spec->quirk) {
 	case QUIRK_R3DI:
 		r3di_setup_defaults(codec);
 		break;
 	case QUIRK_SBZ:
+		sbz_setup_defaults(codec);
 		break;
 	default:
 		ca0132_setup_defaults(codec);
@@ -7288,20 +7286,12 @@ static int ca0132_init(struct hda_codec *codec)
 		ca0132_gpio_setup(codec);
 
 	snd_hda_sequence_write(codec, spec->spec_init_verbs);
-	switch (spec->quirk) {
-	case QUIRK_SBZ:
-		sbz_setup_defaults(codec);
-		ca0132_alt_select_out(codec);
-		ca0132_alt_select_in(codec);
-		break;
-	case QUIRK_R3DI:
+	if (spec->use_alt_functions) {
 		ca0132_alt_select_out(codec);
 		ca0132_alt_select_in(codec);
-		break;
-	default:
+	} else {
 		ca0132_select_out(codec);
 		ca0132_select_mic(codec);
-		break;
 	}
 
 	snd_hda_jack_report_sync(codec);
-- 
2.7.4

  parent reply	other threads:[~2018-08-08 17:35 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08 17:34 [PATCH 00/11] Add Recon3D support + Driver cleanup Connor McAdams
2018-08-08 17:34 ` Connor McAdams
2018-08-08 17:34 ` [PATCH 01/11] ALSA: hda/ca0132 - Create mmio gpio function to make code clearer Connor McAdams
2018-08-08 17:34   ` Connor McAdams
2018-08-08 17:34 ` Connor McAdams [this message]
2018-08-08 17:34   ` [PATCH 02/11] ALSA: hda/ca0132 - Clean up ca0132_init function Connor McAdams
2018-08-08 17:34 ` [PATCH 03/11] ALSA: hda/ca0132 - Add alt_functions unsolicited response Connor McAdams
2018-08-08 17:34   ` Connor McAdams
2018-08-08 17:34 ` [PATCH 04/11] ALSA: hda/ca0132 - Add quirk ID and enum for Recon3D Connor McAdams
2018-08-08 17:34   ` Connor McAdams
2018-08-08 17:34 ` [PATCH 05/11] ALSA: hda/ca0132 - Add Recon3D pincfg Connor McAdams
2018-08-08 17:34   ` Connor McAdams
2018-08-08 17:34 ` [PATCH 06/11] ALSA: hda/ca0132 - Add bool variable to enable/disable pci region2 mmio Connor McAdams
2018-08-08 17:34   ` Connor McAdams
2018-08-08 17:34 ` [PATCH 07/11] ALSA: hda/ca0132 - Add Recon3D startup functions and setup Connor McAdams
2018-08-08 17:34   ` Connor McAdams
2018-08-08 17:34 ` [PATCH 08/11] ALSA: hda/ca0132 - Add DSP setup defaults for Recon3D Connor McAdams
2018-08-08 17:34   ` Connor McAdams
2018-08-08 17:34 ` [PATCH 09/11] ALSA: hda/ca0132 - Add Recon3D input and output select commands Connor McAdams
2018-08-08 17:34   ` Connor McAdams
2018-08-08 17:34 ` [PATCH 10/11] ALSA: hda/ca0132 - Change mixer controls for Recon3D Connor McAdams
2018-08-08 17:34   ` Connor McAdams
2018-08-08 17:34 ` [PATCH 11/11] ALSA: hda/ca0132 - Add exit commands " Connor McAdams
2018-08-08 17:34   ` Connor McAdams
2018-08-08 18:43 ` [PATCH 00/11] Add Recon3D support + Driver cleanup Takashi Iwai
2018-08-08 18:43   ` Takashi Iwai

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=1533749663-8200-3-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 \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.