Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8454313rwp; Wed, 19 Jul 2023 10:00:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlHsrwnSKkQ6Sj9rELza1F0Nc1omsDwaN1edwx6V1ahoWOJzdhuI6BZwgOPrR9W0WFAk9Q/E X-Received: by 2002:aa7:d659:0:b0:51d:d295:6741 with SMTP id v25-20020aa7d659000000b0051dd2956741mr2742960edr.6.1689786056341; Wed, 19 Jul 2023 10:00:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689786056; cv=none; d=google.com; s=arc-20160816; b=Kn3SWH+Vt73KYF3wJ0ShUUE0Vp42o0tX290Y8MuespB4fbz6CNOV9me2yAwCDo1LUf Y2fow9c3fdIehFZkZOMXfAh31oYISp/pN2P1jwz6ANTnjgYBlJ1mToafID81ollCM55/ 59ML3U8D9JbHJxI72WtSg6lXxyUeJasn1fuD5KkBStqBW3cVKSZSsMW6hS8fRcWqWX1v ZLEHIHzfSBnRPVP1+8yXVzmClJimnvSNnF1kGA1FgX9ORAbs62vY6X7mRTF68TQ8xHw+ Q07aWwdRhBsIhZWmVxcAQs/Sdc32/WXCthoMbhlLW9usyjqtALnUVVUuuRWFCNeZKB6t Amtw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=ezYh9TdYf9SPGlHOq/YkmRIkBcOvB6bLPP8t0cvosPU=; fh=Bj9oO364zlLsM4OCKBpzbkQEBf2cg5VvBDZwj08Jo7Y=; b=Ilf/t6fI2AfsxfmcSKtFbllxh8b/tXXT0H2ipwQJHwVmZwwOCCA8C+7GIsoqRu+4PR syCb8nM+3ZMMskNkxh2k1DeFKPAhBvkshNbvNhJaDRl3Y8t4NEVpa07stU/dP+JoHeOv DmkLvFf4CPeWJj8tZ+FzYBLs9gD0spqWXbyZE6Ski50jeinnlQNA8vdh+hcEfNmG904y LddTJp3HOIMLcJ/WVwM6ho4gWcI+6EwdpGLH9fEAtHDBZuYiOOaXeXAPyCOY2XsoK+br VZ1qyC3VCZd+RLNPPYXGdloPK1TZvMWrVfzDFkDLmX9fiNWASvKAxtHZMgzJ4oCj/pIp vXCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Ai77xjd4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h14-20020aa7c60e000000b0051fef304630si3384854edq.390.2023.07.19.10.00.27; Wed, 19 Jul 2023 10:00:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Ai77xjd4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229528AbjGSQdD (ORCPT + 99 others); Wed, 19 Jul 2023 12:33:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229874AbjGSQc4 (ORCPT ); Wed, 19 Jul 2023 12:32:56 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FF08172E for ; Wed, 19 Jul 2023 09:32:55 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-9926623e367so996875666b.0 for ; Wed, 19 Jul 2023 09:32:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689784374; x=1692376374; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ezYh9TdYf9SPGlHOq/YkmRIkBcOvB6bLPP8t0cvosPU=; b=Ai77xjd4Papa7mIdUTLLLOt0HjEVd4UaRKKLVWju83yIoffIwGYoOAGpHNGPTBkW7R xzjBMM3CdMTo9T4RB9oSbJ75u9EW9fTtiCbZN8tfdNpmmrilnk8lNUNQTUFeECk61y56 jkeI/OeVa4PUEAV7qe9J6W64tzVgBxb/uOUch8GEPWxL83j9+7RYdDFueAzwh9u3s9ET JrqViZoYcaeJku2l6lKHWbFdDFIwVlXGoDaG72e33Rrlz9B097nXYrVup6zSuA9iomFI yhl7MOnt+FU3nyXRgZWaikNNV3lKagEaqODe+zmbirKNVvfNK+S8rUpIgAFCDfSRXVdo 3Fpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689784374; x=1692376374; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ezYh9TdYf9SPGlHOq/YkmRIkBcOvB6bLPP8t0cvosPU=; b=G2FDUrT13dI0wT8Tyro4usVzF9yvXFTWhR72xSwpwd3wNZlAKpMEsH62WZbrgOqf9B KcPkV0P8wisnwy/byl7MOkORvq4oKyvXuzz5eqjsURHwYzz6vT8cioqXmlYQLjLQXi7g PIR9CDE6sjy2GzXdYBAtgLV8kARjGes6gWz0ZP0lLhMqHQbVMk1J1hkFubQlFD6sO5ng pZXjXcHAev+Ou1RXc5pxk2UbbEwqul+7j046RtilRzzUnSuj6yWJf251IUrez4ZxMVQB q16ZoJbh8dOzrTw9G5zmzvPdbOGkte4WZZiEG8ErhR3bSb413b6AUuzVB8AL/39VQwBI bWSg== X-Gm-Message-State: ABy/qLb1U+0DINwD+zfEiOtTwZ011otBqI8Bbd0v/fVp3by2RaR/22VD YE2+1aAYX8L8dHa2TzFS578= X-Received: by 2002:a17:906:290:b0:999:37ff:be94 with SMTP id 16-20020a170906029000b0099937ffbe94mr2432672ejf.71.1689784373757; Wed, 19 Jul 2023 09:32:53 -0700 (PDT) Received: from localhost.localdomain ([2a01:c844:242b:b300:215:5dff:fe9c:4c81]) by smtp.gmail.com with ESMTPSA id o21-20020a17090637d500b0098e025cda3bsm2571044ejc.141.2023.07.19.09.32.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 09:32:53 -0700 (PDT) From: Matus Gajdos To: Shengjiu Wang , Xiubo Li , Fabio Estevam , Nicolin Chen , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: Matus Gajdos , alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: fsl_spdif: Add support for 22.05 kHz sample rate Date: Wed, 19 Jul 2023 18:31:53 +0200 Message-Id: <20230719163154.19492-1-matuszpd@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for 22.05 kHz sample rate for TX. Signed-off-by: Matus Gajdos --- sound/soc/fsl/fsl_spdif.c | 8 ++++++-- sound/soc/fsl/fsl_spdif.h | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index 015c3708aa04..95e639711eba 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -514,6 +514,10 @@ static int spdif_set_sample_rate(struct snd_pcm_substream *substream, int ret; switch (sample_rate) { + case 22050: + rate = SPDIF_TXRATE_22050; + csfs = IEC958_AES3_CON_FS_22050; + break; case 32000: rate = SPDIF_TXRATE_32000; csfs = IEC958_AES3_CON_FS_32000; @@ -1422,7 +1426,7 @@ static u32 fsl_spdif_txclk_caldiv(struct fsl_spdif_priv *spdif_priv, struct clk *clk, u64 savesub, enum spdif_txrate index, bool round) { - static const u32 rate[] = { 32000, 44100, 48000, 88200, 96000, 176400, + static const u32 rate[] = { 22050, 32000, 44100, 48000, 88200, 96000, 176400, 192000, }; bool is_sysclk = clk_is_match(clk, spdif_priv->sysclk); u64 rate_ideal, rate_actual, sub; @@ -1483,7 +1487,7 @@ static u32 fsl_spdif_txclk_caldiv(struct fsl_spdif_priv *spdif_priv, static int fsl_spdif_probe_txclk(struct fsl_spdif_priv *spdif_priv, enum spdif_txrate index) { - static const u32 rate[] = { 32000, 44100, 48000, 88200, 96000, 176400, + static const u32 rate[] = { 22050, 32000, 44100, 48000, 88200, 96000, 176400, 192000, }; struct platform_device *pdev = spdif_priv->pdev; struct device *dev = &pdev->dev; diff --git a/sound/soc/fsl/fsl_spdif.h b/sound/soc/fsl/fsl_spdif.h index 75b42a692c90..2bc1b10c17d4 100644 --- a/sound/soc/fsl/fsl_spdif.h +++ b/sound/soc/fsl/fsl_spdif.h @@ -175,7 +175,8 @@ enum spdif_gainsel { /* SPDIF tx rate */ enum spdif_txrate { - SPDIF_TXRATE_32000 = 0, + SPDIF_TXRATE_22050 = 0, + SPDIF_TXRATE_32000, SPDIF_TXRATE_44100, SPDIF_TXRATE_48000, SPDIF_TXRATE_88200, @@ -191,7 +192,8 @@ enum spdif_txrate { #define SPDIF_QSUB_SIZE (SPDIF_UBITS_SIZE / 8) -#define FSL_SPDIF_RATES_PLAYBACK (SNDRV_PCM_RATE_32000 | \ +#define FSL_SPDIF_RATES_PLAYBACK (SNDRV_PCM_RATE_22050 | \ + SNDRV_PCM_RATE_32000 | \ SNDRV_PCM_RATE_44100 | \ SNDRV_PCM_RATE_48000 | \ SNDRV_PCM_RATE_88200 | \ -- 2.25.1