From patchwork Wed May 31 03:21:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yanteng Si X-Patchwork-Id: 13264211 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 87C46C77B7E for ; Thu, 1 Jun 2023 16:07:07 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4A0A2AEA; Thu, 1 Jun 2023 18:06:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4A0A2AEA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1685635625; bh=8nRoXaWFPu77bkgKjYBYyRvVKjsXJr8vMJcTsgsvIvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=THE4ROcr50SAOmJQS3Od1KGoisx8fChunBMVilRPUBBrwipX7IscdPVPaLP7EbsIJ eja0Qx4A9+hiZQxM/kvo9YCfLnynNemgBq+zKDJmZd3XtFAYYJJiuI0RfKxLsIKoUB qP1tK7VI5T6W7mO279oVVx8xRFSBHgig1+0N0LTM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 10BF0F805FF; Thu, 1 Jun 2023 18:03:00 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 4B4C2F80606; Thu, 1 Jun 2023 18:03:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0E9FDF804FC; Wed, 31 May 2023 05:21:53 +0200 (CEST) Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by alsa1.perex.cz (Postfix) with ESMTP id ADB62F80510 for ; Wed, 31 May 2023 05:21:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz ADB62F80510 Received: from loongson.cn (unknown [223.106.25.146]) by gateway (Coremail) with SMTP id _____8Axm+pGvXZk3dMCAA--.1895S3; Wed, 31 May 2023 11:21:42 +0800 (CST) Received: from localhost.localdomain (unknown [223.106.25.146]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cx77M_vXZkqrWBAA--.14943S6; Wed, 31 May 2023 11:21:42 +0800 (CST) From: Yanteng Si To: tiwai@suse.com Cc: Yanteng Si , perex@perex.cz, chenhuacai@loongson.cn, alsa-devel@alsa-project.org, loongarch@lists.linux.dev, loongson-kernel@lists.loongnix.cn, Yingkun Meng Subject: [PATCH 4/4] ALSA: hda/intel: Workaround for WALLCLK register for loongson controller Date: Wed, 31 May 2023 11:21:34 +0800 Message-Id: <608f104f2ad373d60b39f876793c63f265dda8dc.1685501806.git.siyanteng@loongson.cn> X-Mailer: git-send-email 2.31.4 In-Reply-To: References: MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Cx77M_vXZkqrWBAA--.14943S6 X-CM-SenderInfo: pvl1t0pwhqwqxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBjvdXoWruFy8ury7XFWxAw17ZFW5Jrb_yoWfAFgEgr sFvrykWa45Jrs3Kr1furnrXr45ta4kAFWxWrs7tr47Ja93KFWFq34kurnxCFyxuw18XFn0 krnFqr1F9r1rKjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8wcxFpf9Il3svdxBIdaVrn0 xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUY 87kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3w AFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK 6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j6F4UM28EF7 xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr1j6F4UJwAS 0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI0UMc02F40EFcxC0V AKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUtVWrXwAv7VC2z280aVAFwI0_Gr0_Cr1l Ox8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7VAKI48JMxC20s 026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_ JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14 v26ryj6F1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xva j40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8JV W8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU84xRDUUUUU== X-MailFrom: siyanteng@loongson.cn X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: WAOKKF7IVYRM6XDASJ2SOMDARAXOOFBD X-Message-ID-Hash: WAOKKF7IVYRM6XDASJ2SOMDARAXOOFBD X-Mailman-Approved-At: Thu, 01 Jun 2023 16:02:27 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On loongson controller, the value of WALLCLK register is always 0, which is meaningless, so we return directly. Signed-off-by: Yanteng Si Signed-off-by: Yingkun Meng --- sound/pci/hda/hda_intel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index f28806b3e308..6df9ec999e88 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -655,6 +655,9 @@ static int azx_position_ok(struct azx *chip, struct azx_dev *azx_dev) unsigned int pos; snd_pcm_uframes_t hwptr, target; + if (chip->driver_caps & AZX_DCAPS_LOONGSON_WORKAROUND) + return 1; + wallclk = azx_readl(chip, WALLCLK) - azx_dev->core.start_wallclk; if (wallclk < (azx_dev->core.period_wallclk * 2) / 3) return -1; /* bogus (too early) interrupt */