From nobody Fri May 15 10:50:02 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F592C433EF for ; Wed, 11 May 2022 10:03:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234689AbiEKKDG (ORCPT ); Wed, 11 May 2022 06:03:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233237AbiEKKCu (ORCPT ); Wed, 11 May 2022 06:02:50 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAA93496AD for ; Wed, 11 May 2022 03:02:26 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24B4xHqN029588; Wed, 11 May 2022 05:02:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=QOowDymuoE5isrlzSz64tadHGsP3EKcEW5g/m3Fkrnc=; b=brMeggz9EtCElv4xgAPVJItPoLE+ezflt37E2eyDl/UhJhGc8WIpN4tv7ZUM0JxClkGJ Kl7LZd7iSbcn4F5qNWKpp1GdLcGHfI4jlbiQlJLakUUYOwWe6OnaCUl+H4n810M4w1Rt 7qm/KV+1hWvZfKUd5cFs8G2Ifs/opnzixgpR06wRlb9TxiiZk13cL0O5wjgBICaU8jiC LxdqYcQan6GqymkwPFq9nP7VVbMi5hVBHN2yAJZS1wGvw0U16zy94cZXXTQEEkLIGoSP KjFOw+6qYhD3YEzaeZFV4dC+uYndHxfrFDTwLK7rJLdclDxapcJNoGddD2fsc7uy0vsO Kw== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3fwn6nwt0g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 11 May 2022 05:02:14 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 11 May 2022 11:02:13 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.2375.24 via Frontend Transport; Wed, 11 May 2022 11:02:13 +0100 Received: from sbinding-cirrus-dsktp.ad.cirrus.com (unknown [198.90.238.24]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id C955FB10; Wed, 11 May 2022 10:02:12 +0000 (UTC) From: Stefan Binding To: Jaroslav Kysela , Takashi Iwai CC: , , , Stefan Binding Subject: [PATCH v2 1/3] ALSA: hda/cs8409: Support new Odin Variants Date: Wed, 11 May 2022 11:02:05 +0100 Message-ID: <20220511100207.1268321-2-sbinding@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220511100207.1268321-1-sbinding@opensource.cirrus.com> References: <20220511100207.1268321-1-sbinding@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: V0AXwz_KPgBenLCIe8ez0lL_WGfvafc8 X-Proofpoint-GUID: V0AXwz_KPgBenLCIe8ez0lL_WGfvafc8 X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Odin Variants have the internal mic connected directly to the CPU rather than codec. Signed-off-by: Stefan Binding --- sound/pci/hda/patch_cs8409-tables.c | 19 +++++++++++++++++++ sound/pci/hda/patch_cs8409.c | 12 +++++++++--- sound/pci/hda/patch_cs8409.h | 1 + 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/sound/pci/hda/patch_cs8409-tables.c b/sound/pci/hda/patch_cs84= 09-tables.c index 0d11b24a1317..4f4cc8215917 100644 --- a/sound/pci/hda/patch_cs8409-tables.c +++ b/sound/pci/hda/patch_cs8409-tables.c @@ -76,6 +76,13 @@ const struct hda_pintbl cs8409_cs42l42_pincfgs[] =3D { {} /* terminator */ }; =20 +const struct hda_pintbl cs8409_cs42l42_pincfgs_no_dmic[] =3D { + { CS8409_PIN_ASP1_TRANSMITTER_A, 0x042120f0 }, /* ASP-1-TX */ + { CS8409_PIN_ASP1_RECEIVER_A, 0x04a12050 }, /* ASP-1-RX */ + { CS8409_PIN_ASP2_TRANSMITTER_A, 0x901000f0 }, /* ASP-2-TX */ + {} /* terminator */ +}; + /* Vendor specific HW configuration for CS42L42 */ static const struct cs8409_i2c_param cs42l42_init_reg_seq[] =3D { { CS42L42_I2C_TIMEOUT, 0xB0 }, @@ -518,6 +525,11 @@ const struct snd_pci_quirk cs8409_fixup_tbl[] =3D { SND_PCI_QUIRK(0x1028, 0x0B95, "Warlock MLK Dual Mic", CS8409_WARLOCK_MLK_= DUAL_MIC), SND_PCI_QUIRK(0x1028, 0x0B96, "Warlock MLK", CS8409_WARLOCK_MLK), SND_PCI_QUIRK(0x1028, 0x0B97, "Warlock MLK Dual Mic", CS8409_WARLOCK_MLK_= DUAL_MIC), + SND_PCI_QUIRK(0x1028, 0x0BA5, "Odin", CS8409_ODIN), + SND_PCI_QUIRK(0x1028, 0x0BA6, "Odin", CS8409_ODIN), + SND_PCI_QUIRK(0x1028, 0x0BA8, "Odin", CS8409_ODIN), + SND_PCI_QUIRK(0x1028, 0x0BAA, "Odin", CS8409_ODIN), + SND_PCI_QUIRK(0x1028, 0x0BAE, "Odin", CS8409_ODIN), SND_PCI_QUIRK(0x1028, 0x0BB2, "Warlock MLK", CS8409_WARLOCK_MLK), SND_PCI_QUIRK(0x1028, 0x0BB3, "Warlock MLK", CS8409_WARLOCK_MLK), SND_PCI_QUIRK(0x1028, 0x0BB4, "Warlock MLK", CS8409_WARLOCK_MLK), @@ -545,6 +557,7 @@ const struct hda_model_fixup cs8409_models[] =3D { { .id =3D CS8409_WARLOCK_MLK_DUAL_MIC, .name =3D "warlock mlk dual mic" }, { .id =3D CS8409_CYBORG, .name =3D "cyborg" }, { .id =3D CS8409_DOLPHIN, .name =3D "dolphin" }, + { .id =3D CS8409_ODIN, .name =3D "odin" }, {} }; =20 @@ -593,4 +606,10 @@ const struct hda_fixup cs8409_fixups[] =3D { .type =3D HDA_FIXUP_FUNC, .v.func =3D dolphin_fixups, }, + [CS8409_ODIN] =3D { + .type =3D HDA_FIXUP_PINS, + .v.pins =3D cs8409_cs42l42_pincfgs_no_dmic, + .chained =3D true, + .chain_id =3D CS8409_FIXUPS, + }, }; diff --git a/sound/pci/hda/patch_cs8409.c b/sound/pci/hda/patch_cs8409.c index c3a8b04c71d8..91571e82d148 100644 --- a/sound/pci/hda/patch_cs8409.c +++ b/sound/pci/hda/patch_cs8409.c @@ -1027,6 +1027,10 @@ static void cs8409_cs42l42_hw_init(struct hda_codec = *codec) /* DMIC1_MO=3D00b, DMIC1/2_SR=3D1 */ cs8409_vendor_coef_set(codec, CS8409_DMIC_CFG, 0x0003); break; + case CS8409_ODIN: + /* ASP1/2_xxx_EN=3D1, ASP1/2_MCLK_EN=3D0, DMIC1_SCL_EN=3D0 */ + cs8409_vendor_coef_set(codec, CS8409_PAD_CFG_SLW_RATE_CTRL, 0xfc00); + break; default: break; } @@ -1116,6 +1120,7 @@ void cs8409_cs42l42_fixups(struct hda_codec *codec, c= onst struct hda_fixup *fix, =20 /* Set HSBIAS_SENSE_EN and Full Scale volume for some variants. */ switch (codec->fixup_id) { + case CS8409_ODIN: case CS8409_WARLOCK_MLK: case CS8409_WARLOCK_MLK_DUAL_MIC: spec->scodecs[CS8409_CODEC0]->hsbias_hiz =3D 0x0020; @@ -1136,9 +1141,10 @@ void cs8409_cs42l42_fixups(struct hda_codec *codec, = const struct hda_fixup *fix, /* add hooks */ spec->gen.pcm_playback_hook =3D cs42l42_playback_pcm_hook; spec->gen.pcm_capture_hook =3D cs42l42_capture_pcm_hook; - /* Set initial DMIC volume to -26 dB */ - snd_hda_codec_amp_init_stereo(codec, CS8409_CS42L42_DMIC_ADC_PIN_NID, - HDA_INPUT, 0, 0xff, 0x19); + if (codec->fixup_id !=3D CS8409_ODIN) + /* Set initial DMIC volume to -26 dB */ + snd_hda_codec_amp_init_stereo(codec, CS8409_CS42L42_DMIC_ADC_PIN_NID, + HDA_INPUT, 0, 0xff, 0x19); snd_hda_gen_add_kctl(&spec->gen, "Headphone Playback Volume", &cs42l42_dac_volume_mixer); snd_hda_gen_add_kctl(&spec->gen, "Mic Capture Volume", diff --git a/sound/pci/hda/patch_cs8409.h b/sound/pci/hda/patch_cs8409.h index ebf473a3f109..9852dc4234b4 100644 --- a/sound/pci/hda/patch_cs8409.h +++ b/sound/pci/hda/patch_cs8409.h @@ -267,6 +267,7 @@ enum { CS8409_FIXUPS, CS8409_DOLPHIN, CS8409_DOLPHIN_FIXUPS, + CS8409_ODIN, }; =20 enum { --=20 2.25.1 From nobody Fri May 15 10:50:02 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF343C433EF for ; Wed, 11 May 2022 10:03:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234274AbiEKKDU (ORCPT ); Wed, 11 May 2022 06:03:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239646AbiEKKCu (ORCPT ); Wed, 11 May 2022 06:02:50 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D85134990D for ; Wed, 11 May 2022 03:02:26 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24B4xHqO029588; Wed, 11 May 2022 05:02:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=0BenE2DZMjLw5FK0pp3118UKTC0GOs7ew9wsLz0PhJg=; b=Oa3bMDpDmKGtQi9ZMx5W16Ntw/GRmrIqCIPdP0J4q0AKvMj2gzYc75kCrohSkfG9y3zz Pf/bjd9SlDqa3snkDxTDvD253/L1Z2q7HyTpqq5H0LKeKOPPUErDGllOKDne8TxQecME 5xv7iMavkjmrigjZAv8Bep2BLWmgaq3+h9bkbGGtd0b7gNUp6S2+p01NjLbm+7V4XM0v LXiT/ib0I6NA80NrwNe79OpyCt47DF7Glnbwr9ljSKDDdXRX4Swb0PgvTK0piv7Q3p0r 1WybJmlUWhJZ7ujg5vSDBPCV1+WZIjgOHF3z9LgDUE65LFhrTMogGgInhrFV3+GdvAy1 7w== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3fwn6nwt0g-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 11 May 2022 05:02:15 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 11 May 2022 11:02:13 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.2375.24 via Frontend Transport; Wed, 11 May 2022 11:02:13 +0100 Received: from sbinding-cirrus-dsktp.ad.cirrus.com (unknown [198.90.238.24]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 2038C11D3; Wed, 11 May 2022 10:02:13 +0000 (UTC) From: Stefan Binding To: Jaroslav Kysela , Takashi Iwai CC: , , , Stefan Binding Subject: [PATCH v2 2/3] ALSA: hda/cs8409: Add Speaker Playback Switch for Cyborg Date: Wed, 11 May 2022 11:02:06 +0100 Message-ID: <20220511100207.1268321-3-sbinding@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220511100207.1268321-1-sbinding@opensource.cirrus.com> References: <20220511100207.1268321-1-sbinding@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: bSnWiKLlc5zxNO4UpXwYmXN8cMvI-fLR X-Proofpoint-GUID: bSnWiKLlc5zxNO4UpXwYmXN8cMvI-fLR X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add support for a Speaker Playback Switch, which disables the Amp connected to cs8409. The Switch is not added automatically because cs8409 does not have an output amp for the speaker NID. Signed-off-by: Stefan Binding --- sound/pci/hda/patch_cs8409.c | 72 ++++++++++++++++++++++++++++++------ sound/pci/hda/patch_cs8409.h | 3 ++ 2 files changed, 64 insertions(+), 11 deletions(-) diff --git a/sound/pci/hda/patch_cs8409.c b/sound/pci/hda/patch_cs8409.c index 91571e82d148..e9b9273dbfd9 100644 --- a/sound/pci/hda/patch_cs8409.c +++ b/sound/pci/hda/patch_cs8409.c @@ -419,6 +419,39 @@ static void cs8409_fix_caps(struct hda_codec *codec, u= nsigned int nid) snd_hda_override_wcaps(codec, nid, (get_wcaps(codec, nid) | AC_WCAP_UNSOL= _CAP)); } =20 +static int cs8409_spk_sw_gpio_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct hda_codec *codec =3D snd_kcontrol_chip(kcontrol); + struct cs8409_spec *spec =3D codec->spec; + + ucontrol->value.integer.value[0] =3D !!(spec->gpio_data & spec->speaker_p= dn_gpio); + return 0; +} + +static int cs8409_spk_sw_gpio_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct hda_codec *codec =3D snd_kcontrol_chip(kcontrol); + struct cs8409_spec *spec =3D codec->spec; + unsigned int gpio_data; + + gpio_data =3D (spec->gpio_data & ~spec->speaker_pdn_gpio) | + (ucontrol->value.integer.value[0] ? spec->speaker_pdn_gpio : 0); + if (gpio_data =3D=3D spec->gpio_data) + return 0; + spec->gpio_data =3D gpio_data; + snd_hda_codec_write(codec, CS8409_PIN_AFG, 0, AC_VERB_SET_GPIO_DATA, spec= ->gpio_data); + return 1; +} + +static const struct snd_kcontrol_new cs8409_spk_sw_ctrl =3D { + .iface =3D SNDRV_CTL_ELEM_IFACE_MIXER, + .info =3D snd_ctl_boolean_mono_info, + .get =3D cs8409_spk_sw_gpio_get, + .put =3D cs8409_spk_sw_gpio_put, +}; + /*************************************************************************= ***** * CS42L42 Specific Functions *************************************************************************= *****/ @@ -836,7 +869,7 @@ static int cs42l42_jack_unsol_event(struct sub_codec *c= s42l42) static void cs42l42_resume(struct sub_codec *cs42l42) { struct hda_codec *codec =3D cs42l42->codec; - unsigned int gpio_data; + struct cs8409_spec *spec =3D codec->spec; struct cs8409_i2c_param irq_regs[] =3D { { CS42L42_CODEC_STATUS, 0x00 }, { CS42L42_DET_INT_STATUS1, 0x00 }, @@ -846,9 +879,9 @@ static void cs42l42_resume(struct sub_codec *cs42l42) int fsv_old, fsv_new; =20 /* Bring CS42L42 out of Reset */ - gpio_data =3D snd_hda_codec_read(codec, CS8409_PIN_AFG, 0, AC_VERB_GET_GP= IO_DATA, 0); - gpio_data |=3D cs42l42->reset_gpio; - snd_hda_codec_write(codec, CS8409_PIN_AFG, 0, AC_VERB_SET_GPIO_DATA, gpio= _data); + spec->gpio_data =3D snd_hda_codec_read(codec, CS8409_PIN_AFG, 0, AC_VERB_= GET_GPIO_DATA, 0); + spec->gpio_data |=3D cs42l42->reset_gpio; + snd_hda_codec_write(codec, CS8409_PIN_AFG, 0, AC_VERB_SET_GPIO_DATA, spec= ->gpio_data); usleep_range(10000, 15000); =20 cs42l42->suspended =3D 0; @@ -880,7 +913,7 @@ static void cs42l42_resume(struct sub_codec *cs42l42) static void cs42l42_suspend(struct sub_codec *cs42l42) { struct hda_codec *codec =3D cs42l42->codec; - unsigned int gpio_data; + struct cs8409_spec *spec =3D codec->spec; int reg_cdc_status =3D 0; const struct cs8409_i2c_param cs42l42_pwr_down_seq[] =3D { { CS42L42_DAC_CTL2, 0x02 }, @@ -911,9 +944,9 @@ static void cs42l42_suspend(struct sub_codec *cs42l42) cs42l42->mic_jack_in =3D 0; =20 /* Put CS42L42 into Reset */ - gpio_data =3D snd_hda_codec_read(codec, CS8409_PIN_AFG, 0, AC_VERB_GET_GP= IO_DATA, 0); - gpio_data &=3D ~cs42l42->reset_gpio; - snd_hda_codec_write(codec, CS8409_PIN_AFG, 0, AC_VERB_SET_GPIO_DATA, gpio= _data); + spec->gpio_data =3D snd_hda_codec_read(codec, CS8409_PIN_AFG, 0, AC_VERB_= GET_GPIO_DATA, 0); + spec->gpio_data &=3D ~cs42l42->reset_gpio; + snd_hda_codec_write(codec, CS8409_PIN_AFG, 0, AC_VERB_SET_GPIO_DATA, spec= ->gpio_data); } #endif =20 @@ -1107,6 +1140,8 @@ void cs8409_cs42l42_fixups(struct hda_codec *codec, c= onst struct hda_fixup *fix, spec->gen.no_primary_hp =3D 1; spec->gen.suppress_vmaster =3D 1; =20 + spec->speaker_pdn_gpio =3D 0; + /* GPIO 5 out, 3,4 in */ spec->gpio_dir =3D spec->scodecs[CS8409_CODEC0]->reset_gpio; spec->gpio_data =3D 0; @@ -1118,21 +1153,33 @@ void cs8409_cs42l42_fixups(struct hda_codec *codec,= const struct hda_fixup *fix, cs8409_fix_caps(codec, CS8409_CS42L42_HP_PIN_NID); cs8409_fix_caps(codec, CS8409_CS42L42_AMIC_PIN_NID); =20 - /* Set HSBIAS_SENSE_EN and Full Scale volume for some variants. */ + spec->scodecs[CS8409_CODEC0]->hsbias_hiz =3D 0x0020; + switch (codec->fixup_id) { + case CS8409_CYBORG: + spec->scodecs[CS8409_CODEC0]->full_scale_vol =3D + CS42L42_FULL_SCALE_VOL_MINUS6DB; + spec->speaker_pdn_gpio =3D CS8409_CYBORG_SPEAKER_PDN; + break; case CS8409_ODIN: + spec->scodecs[CS8409_CODEC0]->full_scale_vol =3D CS42L42_FULL_SCALE_VOL= _0DB; + spec->speaker_pdn_gpio =3D CS8409_CYBORG_SPEAKER_PDN; + break; case CS8409_WARLOCK_MLK: case CS8409_WARLOCK_MLK_DUAL_MIC: - spec->scodecs[CS8409_CODEC0]->hsbias_hiz =3D 0x0020; spec->scodecs[CS8409_CODEC0]->full_scale_vol =3D CS42L42_FULL_SCALE_VOL= _0DB; break; default: - spec->scodecs[CS8409_CODEC0]->hsbias_hiz =3D 0x0020; spec->scodecs[CS8409_CODEC0]->full_scale_vol =3D CS42L42_FULL_SCALE_VOL_MINUS6DB; break; } =20 + if (spec->speaker_pdn_gpio > 0) { + spec->gpio_dir |=3D spec->speaker_pdn_gpio; + spec->gpio_data |=3D spec->speaker_pdn_gpio; + } + break; case HDA_FIXUP_ACT_PROBE: /* Fix Sample Rate to 48kHz */ @@ -1149,6 +1196,9 @@ void cs8409_cs42l42_fixups(struct hda_codec *codec, c= onst struct hda_fixup *fix, &cs42l42_dac_volume_mixer); snd_hda_gen_add_kctl(&spec->gen, "Mic Capture Volume", &cs42l42_adc_volume_mixer); + if (spec->speaker_pdn_gpio > 0) + snd_hda_gen_add_kctl(&spec->gen, "Speaker Playback Switch", + &cs8409_spk_sw_ctrl); /* Disable Unsolicited Response during boot */ cs8409_enable_ur(codec, 0); snd_hda_codec_set_name(codec, "CS8409/CS42L42"); diff --git a/sound/pci/hda/patch_cs8409.h b/sound/pci/hda/patch_cs8409.h index 9852dc4234b4..630a7a2de51f 100644 --- a/sound/pci/hda/patch_cs8409.h +++ b/sound/pci/hda/patch_cs8409.h @@ -238,6 +238,7 @@ enum cs8409_coefficient_index_registers { #define CS42L42_I2C_ADDR (0x48 << 1) #define CS8409_CS42L42_RESET GENMASK(5, 5) /* CS8409_GPIO5 */ #define CS8409_CS42L42_INT GENMASK(4, 4) /* CS8409_GPIO4 */ +#define CS8409_CYBORG_SPEAKER_PDN GENMASK(2, 2) /* CS8409_GPIO2 */ #define CS8409_CS42L42_HP_PIN_NID CS8409_PIN_ASP1_TRANSMITTER_A #define CS8409_CS42L42_SPK_PIN_NID CS8409_PIN_ASP2_TRANSMITTER_A #define CS8409_CS42L42_AMIC_PIN_NID CS8409_PIN_ASP1_RECEIVER_A @@ -326,6 +327,8 @@ struct cs8409_spec { unsigned int gpio_dir; unsigned int gpio_data; =20 + int speaker_pdn_gpio; + struct mutex i2c_mux; unsigned int i2c_clck_enabled; unsigned int dev_addr; --=20 2.25.1 From nobody Fri May 15 10:50:02 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38F78C433F5 for ; Wed, 11 May 2022 10:03:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237227AbiEKKD3 (ORCPT ); Wed, 11 May 2022 06:03:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239500AbiEKKCu (ORCPT ); Wed, 11 May 2022 06:02:50 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4475849F88 for ; Wed, 11 May 2022 03:02:27 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24B4xHqP029588; Wed, 11 May 2022 05:02:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=uD8g4n5cPT9hscvEkoP6sTC3o6MpJbq8d1DTDJAD3Uo=; b=njAivVw22o46BW5YZC8cPBJspRsIP2mSYwy4gpDQj5yRwu6itp3Uq8xs5VH9UQlUeP8b PQxMMsPeX4MeiKifHzEFiuFIRf3Waklgf0kQv3VVdwZIqKr+UOU754XiveUBgdx4gDPb LKkLTjemEUKv7zbp48HiRu8JjDfhZ8SV53/n2DQIF7hYhO3RHvL/6NiYtxlYl+fiZASv v1LCYkNsMCCrrygaVhQ+GcC+V4ZtnzjUG5VXpITlUMqiTvodl10nNdul0yQDZ7DkueXm iSiR7nmwaQ1APWaqDBva/fr9yh/l7qdbmeErNFu/x20+dn1zvXXmp5RYvLJuOhOPRfBu qg== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3fwn6nwt0g-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 11 May 2022 05:02:16 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 11 May 2022 11:02:13 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.2375.24 via Frontend Transport; Wed, 11 May 2022 11:02:13 +0100 Received: from sbinding-cirrus-dsktp.ad.cirrus.com (unknown [198.90.238.24]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 6ABF2468; Wed, 11 May 2022 10:02:13 +0000 (UTC) From: Stefan Binding To: Jaroslav Kysela , Takashi Iwai CC: , , , Stefan Binding Subject: [PATCH v2 3/3] ALSA: hda/cs8409: Add Speaker Playback Switch for Warlock Date: Wed, 11 May 2022 11:02:07 +0100 Message-ID: <20220511100207.1268321-4-sbinding@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220511100207.1268321-1-sbinding@opensource.cirrus.com> References: <20220511100207.1268321-1-sbinding@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: r04KqkmNxpTNbo34xHp9hDwFCSnyHDNQ X-Proofpoint-GUID: r04KqkmNxpTNbo34xHp9hDwFCSnyHDNQ X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add support for a Speaker Playback Switch, which disables the Amp connected to cs8409. The Switch is not added automatically because cs8409 does not have an output amp for the speaker NID. Note: This switch uses a different GPIO to Cyborg/Odin variants Signed-off-by: Stefan Binding --- sound/pci/hda/patch_cs8409.c | 2 ++ sound/pci/hda/patch_cs8409.h | 1 + 2 files changed, 3 insertions(+) diff --git a/sound/pci/hda/patch_cs8409.c b/sound/pci/hda/patch_cs8409.c index e9b9273dbfd9..754aa8ddd2e4 100644 --- a/sound/pci/hda/patch_cs8409.c +++ b/sound/pci/hda/patch_cs8409.c @@ -1168,10 +1168,12 @@ void cs8409_cs42l42_fixups(struct hda_codec *codec,= const struct hda_fixup *fix, case CS8409_WARLOCK_MLK: case CS8409_WARLOCK_MLK_DUAL_MIC: spec->scodecs[CS8409_CODEC0]->full_scale_vol =3D CS42L42_FULL_SCALE_VOL= _0DB; + spec->speaker_pdn_gpio =3D CS8409_WARLOCK_SPEAKER_PDN; break; default: spec->scodecs[CS8409_CODEC0]->full_scale_vol =3D CS42L42_FULL_SCALE_VOL_MINUS6DB; + spec->speaker_pdn_gpio =3D CS8409_WARLOCK_SPEAKER_PDN; break; } =20 diff --git a/sound/pci/hda/patch_cs8409.h b/sound/pci/hda/patch_cs8409.h index 630a7a2de51f..260388a6256c 100644 --- a/sound/pci/hda/patch_cs8409.h +++ b/sound/pci/hda/patch_cs8409.h @@ -239,6 +239,7 @@ enum cs8409_coefficient_index_registers { #define CS8409_CS42L42_RESET GENMASK(5, 5) /* CS8409_GPIO5 */ #define CS8409_CS42L42_INT GENMASK(4, 4) /* CS8409_GPIO4 */ #define CS8409_CYBORG_SPEAKER_PDN GENMASK(2, 2) /* CS8409_GPIO2 */ +#define CS8409_WARLOCK_SPEAKER_PDN GENMASK(1, 1) /* CS8409_GPIO1 */ #define CS8409_CS42L42_HP_PIN_NID CS8409_PIN_ASP1_TRANSMITTER_A #define CS8409_CS42L42_SPK_PIN_NID CS8409_PIN_ASP2_TRANSMITTER_A #define CS8409_CS42L42_AMIC_PIN_NID CS8409_PIN_ASP1_RECEIVER_A --=20 2.25.1