Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3762608pxv; Mon, 26 Jul 2021 11:19:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwqCGus4CfRoVQlLID8gBif8UtMyhjk5vxIvuWYZcYcwb75kTU0vQIDwjrXh/09eIHchMH X-Received: by 2002:a6b:490d:: with SMTP id u13mr16013780iob.176.1627323594789; Mon, 26 Jul 2021 11:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627323594; cv=none; d=google.com; s=arc-20160816; b=ULYKlw9JOhkUUbDq8mAQgbJusj7iazRVLYrcseiusttqKK9lgMaSFEBJrY0zgdf98V fEwHwmDiVGUD9PhmHFEuCWOXuWDgAUthTJii0ooSBF0sTVe2VjC+bCbaA+5SpI8xpZGu Q2HpDajwMCqGWfgvoFMFYHiSyqt+p5Mlgpp5C9rzeqMChIftAi17vEvC2QxaVeLHlzIw QYxbN6OWK+MTyuchf/yx62FK4LruE4QQ6JMn0iTF6oHuKiIYD2YrIn3AXThDFfsM224B RI8l2lwIP+D2J42wOzfCQEUiHVYnNjTC7v5nKbHyNozg8K+FbbelBTrBXxeFhMbXnmac 7AbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=unvVYHOUQ6GYzxTxh435V4ufadT3jDq28i7dvEIfH0o=; b=rjMzBiDNvDV6nkVD7jWnDPdYxD0/ONV88YdMy9QrfFRcJnncS8O6ZgPREY0KwrlQJm c/BHP/4xC9CiswuXVQTHfk3Y5rmwlSaYr8yUzg6+g7DXVlzUFXrHhWoc7RpLQglB2l+q WIkXmhafRUaUmAxNhYi4ChwNqxiRM8iqYojlnywVQvSevRlSCPKyTtq/0ESJTguvbRu3 Mha25LvkZp+2MK2Dhy9DOaCYZD4rCOXkKbZZYBoMP3tJ3jRh63breJXH6tpzMjuCU0UT bp4RJQA7WfDFJElk0wqwjMt7eETiozZrB2NDssboExWKSLawxwOpVs4BDNPPRmCdbpZz dH7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=hGJADpYH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e6si583207ilm.61.2021.07.26.11.19.36; Mon, 26 Jul 2021 11:19:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=hGJADpYH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232631AbhGZRiN (ORCPT + 99 others); Mon, 26 Jul 2021 13:38:13 -0400 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:5708 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232474AbhGZRiA (ORCPT ); Mon, 26 Jul 2021 13:38:00 -0400 Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 16Q9Xco4002242; Mon, 26 Jul 2021 13:18:18 -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=unvVYHOUQ6GYzxTxh435V4ufadT3jDq28i7dvEIfH0o=; b=hGJADpYHHCouxwsPPV+CPQK7GzIcRVviKvxfcbOSiWMXPwDwC9ggck26Lg/K7MautDze 87mWf1dm7AJOlh9EIeNVUsHwt31gVwmwcM5t7RW6NCQ0z106gzbJVezrXzQLt//p50Oe mEfnVk9MrXBFSYRWguKu6zrYsiTsvNWx45HiuLyY4B/9EtzY1BQry+CyqNGmfVYF+8Nv l9O2zw8tgY14yhA36pjcVa3BKWT1+V9a4XbaDWKBHhtr8apJI5qOe6SFTisaZKNrX3/+ MtpLzJkrl7CEXz9im5/uzLS5oMaJTs/hO1I/2JbP2kZB7soXxwB/yzW0KGdSupNZhx7A 9w== Received: from ediex02.ad.cirrus.com ([87.246.76.36]) by mx0b-001ae601.pphosted.com with ESMTP id 3a1th2rhbh-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 26 Jul 2021 13:18:18 -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.2242.4; Mon, 26 Jul 2021 18:47:11 +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.2242.4 via Frontend Transport; Mon, 26 Jul 2021 18:47:11 +0100 Received: from vitaly-Inspiron-5415.ad.cirrus.com (unknown [198.90.238.32]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 48A022BA; Mon, 26 Jul 2021 17:47:11 +0000 (UTC) From: Vitaly Rodionov To: Jaroslav Kysela , Takashi Iwai CC: , , , Stefan Binding Subject: [PATCH 23/27] ALSA: hda/cs8409: Set fixed sample rate of 48kHz for CS42L42 Date: Mon, 26 Jul 2021 18:46:36 +0100 Message-ID: <20210726174640.6390-24-vitalyr@opensource.cirrus.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210726174640.6390-1-vitalyr@opensource.cirrus.com> References: <20210726174640.6390-1-vitalyr@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: EfBJjW-WvKKggXPYylH3zg8ie32iti_u X-Proofpoint-GUID: EfBJjW-WvKKggXPYylH3zg8ie32iti_u X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 clxscore=1015 suspectscore=0 impostorscore=0 mlxlogscore=999 lowpriorityscore=0 spamscore=0 malwarescore=0 bulkscore=0 phishscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107260105 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefan Binding CS42L42 is configured to use a fixed sample rate of 48kHz. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov --- sound/pci/hda/patch_cs8409-tables.c | 8 ++++++++ sound/pci/hda/patch_cs8409.c | 6 ++++++ sound/pci/hda/patch_cs8409.h | 2 ++ 3 files changed, 16 insertions(+) diff --git a/sound/pci/hda/patch_cs8409-tables.c b/sound/pci/hda/patch_cs8409-tables.c index a39b2c20f61c..a9a0b8e3b2a9 100644 --- a/sound/pci/hda/patch_cs8409-tables.c +++ b/sound/pci/hda/patch_cs8409-tables.c @@ -45,6 +45,14 @@ const struct snd_kcontrol_new cs42l42_adc_volume_mixer = { HDA_INPUT, CS42L42_VOL_ADC) | HDA_AMP_VAL_MIN_MUTE }; +const struct hda_pcm_stream cs42l42_48k_pcm_analog_playback = { + .rates = SNDRV_PCM_RATE_48000, /* fixed rate */ +}; + +const struct hda_pcm_stream cs42l42_48k_pcm_analog_capture = { + .rates = SNDRV_PCM_RATE_48000, /* fixed rate */ +}; + /****************************************************************************** * BULLSEYE / WARLOCK / CYBORG Specific Arrays * CS8409/CS42L42 diff --git a/sound/pci/hda/patch_cs8409.c b/sound/pci/hda/patch_cs8409.c index 566aa84dfe5b..1dd55bf66a06 100644 --- a/sound/pci/hda/patch_cs8409.c +++ b/sound/pci/hda/patch_cs8409.c @@ -873,6 +873,9 @@ void cs8409_cs42l42_fixups(struct hda_codec *codec, const struct hda_fixup *fix, break; case HDA_FIXUP_ACT_PROBE: + /* Fix Sample Rate to 48kHz */ + spec->gen.stream_analog_playback = &cs42l42_48k_pcm_analog_playback; + spec->gen.stream_analog_capture = &cs42l42_48k_pcm_analog_capture; /* 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); @@ -1066,6 +1069,9 @@ void dolphin_fixups(struct hda_codec *codec, const struct hda_fixup *fix, int ac break; case HDA_FIXUP_ACT_PROBE: + /* Fix Sample Rate to 48kHz */ + spec->gen.stream_analog_playback = &cs42l42_48k_pcm_analog_playback; + spec->gen.stream_analog_capture = &cs42l42_48k_pcm_analog_capture; snd_hda_gen_add_kctl(&spec->gen, "Headphone Playback Volume", &cs42l42_dac_volume_mixer); snd_hda_gen_add_kctl(&spec->gen, "Mic Capture Volume", &cs42l42_adc_volume_mixer); diff --git a/sound/pci/hda/patch_cs8409.h b/sound/pci/hda/patch_cs8409.h index 1b5a8d04ba0f..2208be2ffad1 100644 --- a/sound/pci/hda/patch_cs8409.h +++ b/sound/pci/hda/patch_cs8409.h @@ -335,6 +335,8 @@ int cs42l42_volume_info(struct snd_kcontrol *kctrl, struct snd_ctl_elem_info *ui int cs42l42_volume_get(struct snd_kcontrol *kctrl, struct snd_ctl_elem_value *uctrl); int cs42l42_volume_put(struct snd_kcontrol *kctrl, struct snd_ctl_elem_value *uctrl); +extern const struct hda_pcm_stream cs42l42_48k_pcm_analog_playback; +extern const struct hda_pcm_stream cs42l42_48k_pcm_analog_capture; extern const struct snd_pci_quirk cs8409_fixup_tbl[]; extern const struct hda_model_fixup cs8409_models[]; extern const struct hda_fixup cs8409_fixups[]; -- 2.25.1