From patchwork Mon Apr 26 03:54:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1470197 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FT9y51GTdz9sXG; Mon, 26 Apr 2021 13:54:36 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lasKP-0005pA-DD; Mon, 26 Apr 2021 03:54:33 +0000 Received: from mail-pg1-f172.google.com ([209.85.215.172]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lasKG-0005oT-OF for kernel-team@lists.ubuntu.com; Mon, 26 Apr 2021 03:54:24 +0000 Received: by mail-pg1-f172.google.com with SMTP id w10so1798566pgh.5 for ; Sun, 25 Apr 2021 20:54:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mZguYG4y5mbmsu/PKHahKGrRuoIUWMwOIBOxD3NM7ko=; b=RnS1000RmxcNQp7B3V8/ZLLbko/jJs3xlqgBe1seFBfmGOJRL4l680+hEbh85+hePI OxOOsn9LBjoxGlCgaHYziFII7e2c8h71cKZf6Zd4wFaGn0UcU3Zx4qatGkisrGF2/Ti1 Qfvt2qaAyfNy4lx8s8anm2lzQK3y98anwoESv/9PWpNmUWKQps2BATxWO/fMeZmLH1t3 LdQcOKZIV7Fy8U5OvcHLeZ9QmjB+NOA77uQAJUdmFfX0q2245QCYo+JAKhuJgqjRLLh0 vru8rhx93K98UNUMXXQd8Ei4KlzIJXpB2mjvP8j3nIsGEgf0ez+1+AKmqX1Kx1g5y/PW lLMg== X-Gm-Message-State: AOAM530vrENUDbYoOmdnxozwgCh2Ac8cR9PezDahTj42mI3zoBpY2aAL gdBEROMpOsaVuA574MwaPsto7CN2Rcg= X-Google-Smtp-Source: ABdhPJx2t6TzAfNtQUUq/ljVIhSqLb7yIWvvGdkpZ/95H+dO7anA6PQLfENrIOVCxDclI+CcY71nTg== X-Received: by 2002:a63:6f81:: with SMTP id k123mr14807542pgc.230.1619409262515; Sun, 25 Apr 2021 20:54:22 -0700 (PDT) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id x26sm9706089pfm.134.2021.04.25.20.54.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Apr 2021 20:54:22 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/1][SRU][OEM-5.10/H/U] UBUNTU: SAUCE: ALSA: hda/cirrus: Use CS8409 Equalizer to fix abnormal sounds on Bullseye Date: Mon, 26 Apr 2021 11:54:18 +0800 Message-Id: <20210426035418.2006578-2-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210426035418.2006578-1-vicamo.yang@canonical.com> References: <20210426035418.2006578-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.215.172; envelope-from=vicamo@gmail.com; helo=mail-pg1-f172.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Stefan Binding BugLink: https://bugs.launchpad.net/bugs/1924997 Tested on DELL Inspiron-3505, DELL Inspiron-3501, DELL Inspiron-3500 Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1924997 Reported-and-tested-by: You-Sheng Yang (backported from https://patchwork.kernel.org/project/alsa-devel/patch/20210424143244.639125-3-vitalyr@opensource.cirrus.com/) Signed-off-by: You-Sheng Yang Acked-by: Stefan Bader --- sound/pci/hda/patch_cirrus.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index 5e938ab2bde3..c304e03c49e5 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c @@ -1493,6 +1493,34 @@ static const struct cs8409_cir_param cs8409_cs42l42_hw_cfg[] = { {} /* Terminator */ }; +static const struct cs8409_cir_param cs8409_cs42l42_bullseye_atn[] = { + { 0x47, 0x65, 0x4000 }, /* EQ_SEL=1, EQ1/2_EN=0 */ + { 0x47, 0x64, 0x4000 }, /* +EQ_ACC */ + { 0x47, 0x65, 0x4010 }, /* +EQ2_EN */ + { 0x47, 0x63, 0x0647 }, /* EQ_DATA_HI=0x0647 */ + { 0x47, 0x64, 0xc0c7 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=0, EQ_DATA_LO=0x67 */ + { 0x47, 0x63, 0x0647 }, /* EQ_DATA_HI=0x0647 */ + { 0x47, 0x64, 0xc1c7 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=1, EQ_DATA_LO=0x67 */ + { 0x47, 0x63, 0xf370 }, /* EQ_DATA_HI=0xf370 */ + { 0x47, 0x64, 0xc271 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=2, EQ_DATA_LO=0x71 */ + { 0x47, 0x63, 0x1ef8 }, /* EQ_DATA_HI=0x1ef8 */ + { 0x47, 0x64, 0xc348 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=3, EQ_DATA_LO=0x48 */ + { 0x47, 0x63, 0xc110 }, /* EQ_DATA_HI=0xc110 */ + { 0x47, 0x64, 0xc45a }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=4, EQ_DATA_LO=0x5a */ + { 0x47, 0x63, 0x1f29 }, /* EQ_DATA_HI=0x1f29 */ + { 0x47, 0x64, 0xc574 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=5, EQ_DATA_LO=0x74 */ + { 0x47, 0x63, 0x1d7a }, /* EQ_DATA_HI=0x1d7a */ + { 0x47, 0x64, 0xc653 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=6, EQ_DATA_LO=0x53 */ + { 0x47, 0x63, 0xc38c }, /* EQ_DATA_HI=0xc38c */ + { 0x47, 0x64, 0xc714 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=7, EQ_DATA_LO=0x14 */ + { 0x47, 0x63, 0x1ca3 }, /* EQ_DATA_HI=0x1ca3 */ + { 0x47, 0x64, 0xc8c7 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=8, EQ_DATA_LO=0xc7 */ + { 0x47, 0x63, 0xc38c }, /* EQ_DATA_HI=0xc38c */ + { 0x47, 0x64, 0xc914 }, /* +EQ_WRT, +EQ_ACC, EQ_ADR=9, EQ_DATA_LO=0x14 */ + { 0x47, 0x64, 0x0000 }, /* -EQ_ACC, -EQ_WRT */ + {} /* Terminator */ +}; + /* Enable I2C clocks */ static void cs8409_enable_i2c_clock(struct hda_codec *codec, unsigned int flag) { @@ -2040,6 +2068,7 @@ static void cs8409_enable_ur(struct hda_codec *codec, int flag) static int cs8409_cs42l42_hw_init(struct hda_codec *codec) { const struct cs8409_cir_param *seq = cs8409_cs42l42_hw_cfg; + const struct cs8409_cir_param *seq_bullseye = cs8409_cs42l42_bullseye_atn; struct cs_spec *spec = codec->spec; if (spec->gpio_mask) { @@ -2054,6 +2083,10 @@ static int cs8409_cs42l42_hw_init(struct hda_codec *codec) for (; seq->nid; seq++) cs_vendor_coef_set(codec, seq->cir, seq->coeff); + if (codec->fixup_id == CS8409_BULLSEYE) + for (; seq_bullseye->nid; seq_bullseye++) + cs_vendor_coef_set(codec, seq_bullseye->cir, seq_bullseye->coeff); + /* Disable Unsolicited Response during boot */ cs8409_enable_ur(codec, 0);