Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp3960rbb; Fri, 23 Feb 2024 09:52:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVJpMHRqHyLhGku3b8Ttf+LSFUQ7oGiiLXx4yb+B8HINmjFM7bEntK42qfSWBaXPHib279AspCTovyY4t6y4fkrNcqZkYj0ZW5xeW3VEA== X-Google-Smtp-Source: AGHT+IGoW1F1Fixv1s+hPTWsygbK2Wm/tSPR/Rzo4vTnQaowHscPHN1Tmr4xhw2EYBngtgSxqt7m X-Received: by 2002:a17:90a:af93:b0:299:d96f:9145 with SMTP id w19-20020a17090aaf9300b00299d96f9145mr685198pjq.0.1708710764168; Fri, 23 Feb 2024 09:52:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708710764; cv=pass; d=google.com; s=arc-20160816; b=BfYdgIF5y5kWImG3ttxzjUbmNga7ukomrx9ALs5FlosbiZo/C66FmaC7fFcUeTQsVl KJ4RHz60i/KzAGzZZ2nQj0FzFRk7A1oLMY/Iy7PqUSb9NEmhlNCvE6vvlqeCxSywn/U/ NLBEXV3Rs4PJvyUWcuPvjabaAw0c/o4N9xoj24qqQSNxPMIh6Uo98EUUPxBBGcoFFi/r qrWJLytHFO0amPBvkW2LE6I8CCjH57JSkOARqixhh3m/BSG5OBCApqm1E66MbY82hmxN aSMHT++tbKxSSVWtPKqvAda+j9GX52PaZzbQnT/xkrQC2CZhZjQiJz6hsDGvY6pt4+bD xyuQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=E5onlIQPMa8EU8sK1NqJS82W4yBogcW0MtBFux+iSL0=; fh=HIbqmdECzflL964mWTLOWeAZlNmj43OPovobtlShXhM=; b=mupa8iZ305dHfUJCGpkQr4p5JaoMmuvCByVlNIGDI6yK0ufEU1QigURDWQraiddpmY WyzuzMmM3y757lqaHqkGMpzlQStsyd5G7bJCmpPWeV494btir7XmjUr6XR4mlPq/m0zz LpcnV0L7xtB6rmbzQaFaZI39PiwQHQrKxBNrgeeQZXC+Wqk/Wl4kYlN7wYl5m8jnGH2v BLl5eQ7avJUglafyvGoHxBWB3RTgQDFCV4aJxaxMW7jIIQkzpbOy3E/cVjyAxHep/5F9 dMiwxiw5K6gnmsKzMjhEJLM53MUl5wkHEt6fCq/zfH2cOeX0hY/Dd2jn6cF6wamFa4q6 kI/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b="d1Ob/D6L"; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-78922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78922-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id sy5-20020a17090b2d0500b0029898ed5732si1582503pjb.86.2024.02.23.09.52.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 09:52:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b="d1Ob/D6L"; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-78922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78922-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 309A9288CD1 for ; Fri, 23 Feb 2024 17:52:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9EC90143C56; Fri, 23 Feb 2024 17:51:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="d1Ob/D6L" Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96B6B133985 for ; Fri, 23 Feb 2024 17:51:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708710688; cv=none; b=u32U/WlEfpnQKdMG8nl6gWSyGrFUpgHQT/WAYoQO/GeZMD9b6AhmaXOOLK9wclcdbYY4LxyksLMnGjUPC8i+PhqijRqvglq0uLFDbP+sdkMLvXHCVprD8wNh/jwJvEKJRe08n0Kscr+sFyQqxGw4gkdKt8EUmFq8K7bBCHQ8xds= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708710688; c=relaxed/simple; bh=YbwFPjo6ccRVq4UzuSvS6LZFtetWcxbtqaMWTpTxTyE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D5i9+Kr09I0qir3DyfCWFwNYgxX9G41JLhLrbXHntI7fkja9T2wT4sxdOaYFYMApmuzVqrOmVSa2/pSXJY/QaDAUlCDw0C1IuMy6Wrb9Jfbi1/MJy2sdYNfQf/GCKsy9nut0/sC2bhw57EmYP433r+rkaFhoRJ55hOgIKZGVPFw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=d1Ob/D6L; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-33d7b04f7e9so662202f8f.1 for ; Fri, 23 Feb 2024 09:51:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1708710685; x=1709315485; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=E5onlIQPMa8EU8sK1NqJS82W4yBogcW0MtBFux+iSL0=; b=d1Ob/D6L0zsjyvH79I6uKqqoxs7Udses5ujcA88eE77p35fIILwi+EbFV31NqUnyGB 6snux43U6CMRS8t83JAtNMM9iXLAp3bKM9HMt30M1ZPQp2QEMg6Kgq2diLZkcd8ASMot cHaEBNK4nAeT9C5802b0Lk22bcdZjy71j1YASLfujo9x3rvlqBJIRd+4D9vjO/iE9ekF y3fZIFqvEOXydRHE0zRHEQ3sD9ccRgQgCXdhFUGrEcj/f/nBzDKeiaRk3ZBjZxzYMTv5 sZyX23TEfcRES5/BBn2OGsG90Gpf91w3rZLan0dYV1qlU/3CpjpzRLfIVvIdSmcBJpC9 s5Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708710685; x=1709315485; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E5onlIQPMa8EU8sK1NqJS82W4yBogcW0MtBFux+iSL0=; b=w5VVRCXHL2m1ncZij8+Hiaesx8hXAgTebeJZHW4HsVhtrnlPT8tGwQCjHITSiKY2W9 TsiOoXTOuGz6I7KzpSnoMOs4r5Tk8+IAfkDoJ1utYIYrk2NvKx7KgyJCdJsPpCB6q39B f3XmoQLqC/gONok8NBMkQ1Zu9mYgl44uWwBfET753Nlhpish/PMv0MMcziwge3J7H2tf 96WMuL6XuzVyb0m1diS6w5veBc8XTd4+1MjIaeCYCQJ/CzTFH5pMa+stsC5gKYiyh19O CstypNK43XeRL99wtv6sJrBt7LS/fv9h5eJDatk7lLn/vyxyU3IIOcRVWMvmvBn6l/jN ecGw== X-Forwarded-Encrypted: i=1; AJvYcCWWN0Vs4zBnxytgZ6ql9sOTMi95WoWkPMMg/OCQ9EpaFQ3nFhykACwVAiaFMMDQpjTSY3/UuvXBV4BPPrR4HUotX77GEann6lLUod35 X-Gm-Message-State: AOJu0YwdSbqtK/gQbKtWRzhiqcbyyN3kx/LTq9qgO4zlWly8bNkMwUao VW4tsAzm+RxrxYghM9+xl+q1j+5tHoqxa6ThcxTBd0ADhri8B2HQzpOLQU0jrls= X-Received: by 2002:adf:fcc6:0:b0:33d:9283:93b with SMTP id f6-20020adffcc6000000b0033d9283093bmr329883wrs.47.1708710684884; Fri, 23 Feb 2024 09:51:24 -0800 (PST) Received: from toaster.lan ([2a01:e0a:3c5:5fb1:e8a0:25a6:d4ec:a7ff]) by smtp.googlemail.com with ESMTPSA id bo10-20020a056000068a00b0033cddadde6esm3711524wrb.80.2024.02.23.09.51.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 09:51:24 -0800 (PST) From: Jerome Brunet To: Mark Brown , Liam Girdwood Cc: Jerome Brunet , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org Subject: [PATCH 4/6] ASoC: meson: axg-spdifin: use max width for rate detection Date: Fri, 23 Feb 2024 18:51:10 +0100 Message-ID: <20240223175116.2005407-5-jbrunet@baylibre.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240223175116.2005407-1-jbrunet@baylibre.com> References: <20240223175116.2005407-1-jbrunet@baylibre.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Use maximum width between 2 edges to setup spdifin thresholds and detect the input sample rate. This comes from Amlogic SDK and seems to be marginally more reliable than minimum width. This is done to align with a future eARC support. No issue was reported with minimum width so far, this is considered to be an update so no Fixes tag is set. Signed-off-by: Jerome Brunet --- sound/soc/meson/axg-spdifin.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/meson/axg-spdifin.c b/sound/soc/meson/axg-spdifin.c index bc2f2849ecfb..e721f579321e 100644 --- a/sound/soc/meson/axg-spdifin.c +++ b/sound/soc/meson/axg-spdifin.c @@ -179,9 +179,9 @@ static int axg_spdifin_sample_mode_config(struct snd_soc_dai *dai, SPDIFIN_CTRL1_BASE_TIMER, FIELD_PREP(SPDIFIN_CTRL1_BASE_TIMER, rate / 1000)); - /* Threshold based on the minimum width between two edges */ + /* Threshold based on the maximum width between two edges */ regmap_update_bits(priv->map, SPDIFIN_CTRL0, - SPDIFIN_CTRL0_WIDTH_SEL, SPDIFIN_CTRL0_WIDTH_SEL); + SPDIFIN_CTRL0_WIDTH_SEL, 0); /* Calculate the last timer which has no threshold */ t_next = axg_spdifin_mode_timer(priv, i, rate); @@ -199,7 +199,7 @@ static int axg_spdifin_sample_mode_config(struct snd_soc_dai *dai, axg_spdifin_write_timer(priv->map, i, t); /* Set the threshold value */ - axg_spdifin_write_threshold(priv->map, i, t + t_next); + axg_spdifin_write_threshold(priv->map, i, 3 * (t + t_next)); /* Save the current timer for the next threshold calculation */ t_next = t; -- 2.43.0