Received: by 10.192.165.148 with SMTP id m20csp54253imm; Thu, 3 May 2018 14:45:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp7OgN9nU+X3fH52sUX5sFEDl1Vv6AKDXRiQr8wZIebhs1gYo0Qj9H0GXmPdN6Stzp+wYPr X-Received: by 2002:a63:6fce:: with SMTP id k197-v6mr20316849pgc.125.1525383936463; Thu, 03 May 2018 14:45:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525383936; cv=none; d=google.com; s=arc-20160816; b=qThS7f9w51R0agTwEzjQnq3yvYyAOx990nkR693S8XaIkN3JZDXcv5RA4mlgHD/HL9 ZvAnxhUaJFxhXVjmoySr56ky0TvNUBf538PF8ylrb+F50kRzhgDOWKu7DCFutLmsVjLm SEgQDoWQbi90Z0FlX3frzoEj/D/VrjyaEJMEOEYlcioBQ/994+TL6LeWSEJaX4bG1ZQj PQoWVmJOnRK3VcIrZAj12tCobt5wMbS5xTt0oGpDne3zomRs9hODhSbKLM0AXdEhbkTt Vp3Kc1NLToIuK6N8wR6qJf+wfOVwicxzohMGUIvdzQGQJgEydPTLFvKL0VbHdyHS4QDM sHZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:in-reply-to:message-id:date :subject:cc:from:dkim-signature:arc-authentication-results; bh=GqjNl3LmGYHJfmZ32HDqiOwRIi/ReiZyp6gMEPqDKmQ=; b=lhj9rSx88VHqp1VoD06OmyNRjnArahKOGuhrN3Udxicg9kODchnD8Gkw82qZDVSnVA OJ6O9mby7NShhB5765ZZWL9T6Nxkm0XOgYAKv4M6jgnAZsi1Nzr7x1eUiCJPbfcyvd25 Sqn/bSdXlnTICXseROkX84Qk6CL4YTygD7henI7ipKpw542kQMa4bz4KeBy+0k05iKw/ GIgemizKyTDLzlO704QlBGoTB3G3WeUC91OO1Q0GyM43LVgKnI/k68ER8zrgsKOwtAKc QsVnFJpmMV8J1GLeWtDlAcW+Gv8xlKDcr3appa7PIWH+KV+cYHU8LfnBMSmN0Ru8teXQ hz7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ASjzSF5a; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1-v6si14265207pld.424.2018.05.03.14.45.22; Thu, 03 May 2018 14:45:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ASjzSF5a; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751417AbeECVnR (ORCPT + 99 others); Thu, 3 May 2018 17:43:17 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:37033 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751195AbeECVnO (ORCPT ); Thu, 3 May 2018 17:43:14 -0400 Received: by mail-io0-f195.google.com with SMTP id e20-v6so23416319iof.4 for ; Thu, 03 May 2018 14:43:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GqjNl3LmGYHJfmZ32HDqiOwRIi/ReiZyp6gMEPqDKmQ=; b=ASjzSF5a6OEXPrL7R9gW6yKlTEXy55DR1jPahgBMRyHEhTIfTeIkITzi+aQc3AplOB Xq8S+oo4zAfCz7zWJjzYapNId6W2D78twOCpQaNrsRyUtc8biafOnadbs6zCY4sng0uq nRT3ftiHdmcBSg4Dwx0v/ue7kzl+dgqXcmrIVPBwVq9WW7HGkWQi7rIRWcxQxNI1J6f4 G4Vzys2ZI0N+DM8GR8rJp+ftM6ji8B9TN3aUzfCRCg/eVEer6zbdtJvvxKf3BtNBjgfx Tr2APcYcsjrokB2tC9OZEowMik8nLXwGaa9gNXHhbxucGeM7/jaU0AkG1oqphUlpml0n SoBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GqjNl3LmGYHJfmZ32HDqiOwRIi/ReiZyp6gMEPqDKmQ=; b=dOu5fRM3h5TEz6Q1jMZ+4VYsU7yJuXgRvcKpOafAzGYJGu7jmuIbOczhypY7nOl/Fj yo0ytyEIXJksDlJQlFlxFLY25uzdGorWjDD6v1R01ExtBDqLivqtx383wE37YTUSx4yW vnWEjtkvzxdEcLdauVr9oSF60Ts2UeKrs0QFuJj8Q6gmBBLe6pLNxkDuHC9fJ0Iw+eSm FucK8tXQ5ZKCy8yG6VNXTpd4cIXRYdTk9iJGz6OXUbd6zxn9lHJFcxMDRjLTDEmsLtFK uVkx+FwMemukd/vBJ1Cv4tAf/fJgArhjG/46OKTQRoFsz5asY4gCU/1csmDshlS9OB4o LUKA== X-Gm-Message-State: ALQs6tAqH+DpXM7EtaDf9M6qjKKDFqFvjPqY2n4r0XVKHa7hjVF3SUYm xeTK95goTzK2kLh4ABU3K1w= X-Received: by 2002:a6b:e71a:: with SMTP id b26-v6mr9620410ioh.217.1525383793969; Thu, 03 May 2018 14:43:13 -0700 (PDT) Received: from localhost.localdomain ([2605:a000:1316:4462:30e7:9a4b:7da5:3c1c]) by smtp.googlemail.com with ESMTPSA id u77-v6sm263119ita.30.2018.05.03.14.43.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 May 2018 14:43:13 -0700 (PDT) From: Connor McAdams Cc: o-takashi@sakamocchi.jp, Connor McAdams , Jaroslav Kysela , Takashi Iwai , =?UTF-8?q?J=C3=A9r=C3=A9my=20Lefaure?= , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/9] Add pincfg for SBZ + R3Di, add fp hp auto-detect Date: Thu, 3 May 2018 17:42:43 -0400 Message-Id: <1525383771-11105-2-git-send-email-conmanx360@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525383771-11105-1-git-send-email-conmanx360@gmail.com> References: <1525383771-11105-1-git-send-email-conmanx360@gmail.com> To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds an unsolicited response tag for the front headphone panel which uses the same hp_callback as the rear headphone detection. This patch also adds pincfgs for the R3Di and SBZ which were taken from the Windows driver. The pins are also defined in the function ca0132_config. Both the R3Di and SBZ are also given a max out channel value of 6 to handle 5.1 surround sound in later patches. Signed-off-by: Connor McAdams --- sound/pci/hda/patch_ca0132.c | 111 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 108 insertions(+), 3 deletions(-) diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c index 9a0286e..9347c9d 100644 --- a/sound/pci/hda/patch_ca0132.c +++ b/sound/pci/hda/patch_ca0132.c @@ -723,6 +723,7 @@ struct ca0132_spec { hda_nid_t shared_mic_nid; hda_nid_t shared_out_nid; hda_nid_t unsol_tag_hp; + hda_nid_t unsol_tag_front_hp; /* for desktop ca0132 codecs */ hda_nid_t unsol_tag_amic1; /* chip access */ @@ -785,6 +786,36 @@ static const struct hda_pintbl alienware_pincfgs[] = { {} }; +/* Sound Blaster Z pin configs taken from Windows Driver */ +static const struct hda_pintbl sbz_pincfgs[] = { + { 0x0b, 0x01017010 }, /* Port G -- Lineout FRONT L/R */ + { 0x0c, 0x014510f0 }, /* SPDIF Out 1 */ + { 0x0d, 0x014510f0 }, /* Digital Out */ + { 0x0e, 0x01c510f0 }, /* SPDIF In */ + { 0x0f, 0x0221701f }, /* Port A -- BackPanel HP */ + { 0x10, 0x01017012 }, /* Port D -- Center/LFE or FP Hp */ + { 0x11, 0x01017014 }, /* Port B -- LineMicIn2 / Rear L/R */ + { 0x12, 0x01a170f0 }, /* Port C -- LineIn1 */ + { 0x13, 0x908700f0 }, /* What U Hear In*/ + { 0x18, 0x50d000f0 }, /* N/A */ + {} +}; + +/* Recon3D integrated pin configs taken from Windows Driver */ +static const struct hda_pintbl r3di_pincfgs[] = { + { 0x0b, 0x01014110 }, /* Port G -- Lineout FRONT L/R */ + { 0x0c, 0x014510f0 }, /* SPDIF Out 1 */ + { 0x0d, 0x014510f0 }, /* Digital Out */ + { 0x0e, 0x41c520f0 }, /* SPDIF In */ + { 0x0f, 0x0221401f }, /* Port A -- BackPanel HP */ + { 0x10, 0x01016011 }, /* Port D -- Center/LFE or FP Hp */ + { 0x11, 0x01011014 }, /* Port B -- LineMicIn2 / Rear L/R */ + { 0x12, 0x02a090f0 }, /* Port C -- LineIn1 */ + { 0x13, 0x908700f0 }, /* What U Hear In*/ + { 0x18, 0x500000f0 }, /* N/A */ + {} +}; + static const struct snd_pci_quirk ca0132_quirks[] = { SND_PCI_QUIRK(0x1028, 0x0685, "Alienware 15 2015", QUIRK_ALIENWARE), SND_PCI_QUIRK(0x1028, 0x0688, "Alienware 17 2015", QUIRK_ALIENWARE), @@ -4501,6 +4532,10 @@ static void ca0132_init_unsol(struct hda_codec *codec) amic_callback); snd_hda_jack_detect_enable_callback(codec, UNSOL_TAG_DSP, ca0132_process_dsp_response); + /* Front headphone jack detection */ + if (spec->quirk == QUIRK_SBZ || spec->quirk == QUIRK_R3DI) + snd_hda_jack_detect_enable_callback(codec, + spec->unsol_tag_front_hp, hp_callback); } /* @@ -4682,9 +4717,14 @@ static void ca0132_config(struct hda_codec *codec) spec->multiout.dac_nids = spec->dacs; spec->multiout.num_dacs = 3; - spec->multiout.max_channels = 2; - if (spec->quirk == QUIRK_ALIENWARE) { + if (spec->quirk == QUIRK_NONE || spec->quirk == QUIRK_ALIENWARE) + spec->multiout.max_channels = 2; + else + spec->multiout.max_channels = 6; + + switch (spec->quirk) { + case QUIRK_ALIENWARE: codec_dbg(codec, "ca0132_config: QUIRK_ALIENWARE applied.\n"); snd_hda_apply_pincfgs(codec, alienware_pincfgs); @@ -4704,7 +4744,71 @@ static void ca0132_config(struct hda_codec *codec) spec->input_pins[2] = 0x13; spec->shared_mic_nid = 0x7; spec->unsol_tag_amic1 = 0x11; - } else { + break; + case QUIRK_SBZ: + codec_dbg(codec, "ca0132_config: QUIRK_SBZ applied.\n"); + snd_hda_apply_pincfgs(codec, sbz_pincfgs); + + spec->num_outputs = 2; + spec->out_pins[0] = 0x0B; /* Line out */ + spec->out_pins[1] = 0x0F; /* Rear headphone out */ + spec->out_pins[2] = 0x10; /* Front Headphone / Center/LFE*/ + spec->out_pins[3] = 0x11; /* Rear surround */ + spec->shared_out_nid = 0x2; + spec->unsol_tag_hp = spec->out_pins[1]; + spec->unsol_tag_front_hp = spec->out_pins[2]; + + spec->adcs[0] = 0x7; /* Rear Mic / Line-in */ + spec->adcs[1] = 0x8; /* Front Mic, but only if no DSP */ + spec->adcs[2] = 0xa; /* what u hear */ + + spec->num_inputs = 2; + spec->input_pins[0] = 0x12; /* Rear Mic / Line-in */ + spec->input_pins[1] = 0x13; /* What U Hear */ + spec->shared_mic_nid = 0x7; + spec->unsol_tag_amic1 = spec->input_pins[0]; + + /* SPDIF I/O */ + spec->dig_out = 0x05; + spec->multiout.dig_out_nid = spec->dig_out; + cfg->dig_out_pins[0] = 0x0c; + cfg->dig_outs = 1; + cfg->dig_out_type[0] = HDA_PCM_TYPE_SPDIF; + spec->dig_in = 0x09; + cfg->dig_in_pin = 0x0e; + cfg->dig_in_type = HDA_PCM_TYPE_SPDIF; + break; + case QUIRK_R3DI: + codec_dbg(codec, "ca0132_config: QUIRK_R3DI applied.\n"); + snd_hda_apply_pincfgs(codec, r3di_pincfgs); + + spec->num_outputs = 2; + spec->out_pins[0] = 0x0B; /* Line out */ + spec->out_pins[1] = 0x0F; /* Rear headphone out */ + spec->out_pins[2] = 0x10; /* Front Headphone / Center/LFE*/ + spec->out_pins[3] = 0x11; /* Rear surround */ + spec->shared_out_nid = 0x2; + spec->unsol_tag_hp = spec->out_pins[1]; + spec->unsol_tag_front_hp = spec->out_pins[2]; + + spec->adcs[0] = 0x07; /* Rear Mic / Line-in */ + spec->adcs[1] = 0x08; /* Front Mic, but only if no DSP */ + spec->adcs[2] = 0x0a; /* what u hear */ + + spec->num_inputs = 2; + spec->input_pins[0] = 0x12; /* Rear Mic / Line-in */ + spec->input_pins[1] = 0x13; /* What U Hear */ + spec->shared_mic_nid = 0x7; + spec->unsol_tag_amic1 = spec->input_pins[0]; + + /* SPDIF I/O */ + spec->dig_out = 0x05; + spec->multiout.dig_out_nid = spec->dig_out; + cfg->dig_out_pins[0] = 0x0c; + cfg->dig_outs = 1; + cfg->dig_out_type[0] = HDA_PCM_TYPE_SPDIF; + break; + default: spec->num_outputs = 2; spec->out_pins[0] = 0x0b; /* speaker out */ spec->out_pins[1] = 0x10; /* headphone out */ @@ -4731,6 +4835,7 @@ static void ca0132_config(struct hda_codec *codec) spec->dig_in = 0x09; cfg->dig_in_pin = 0x0e; cfg->dig_in_type = HDA_PCM_TYPE_SPDIF; + break; } } -- 2.7.4