Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp173296lqo; Tue, 7 May 2024 16:37:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW90QCUIT6q5FQXqHazIeLJlNlTQ9PWsUUvRXtA/9BRE1sWeZK+fLriROfe1NqDlryMlIcOdbmDTJMz9jwoJGaBR3athALBEKcuSVaDqQ== X-Google-Smtp-Source: AGHT+IG+IbzTiMzV+AzGtjRnpzxXbAhPp/OgGn4lhC74BgCtcg8m+NXnhDVcqc70VYz3bOBA6cwJ X-Received: by 2002:a05:6358:7201:b0:18b:1fbb:4346 with SMTP id e5c5f4694b2df-192d2c2b402mr155691455d.2.1715125069921; Tue, 07 May 2024 16:37:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715125069; cv=pass; d=google.com; s=arc-20160816; b=eqh84HxB3pLK/SWhbZCMKnSGntAz0X1ojoWRDs0GugPCyG9jK+0XtqoKN511AnmNoG Fb3NY8MTAw6cZVKFIILLHWaEs0XEZVORgb9HtugF7aav2WBPHP+R6NTTNbnmgkX/yXEs V5QCb54VOduaQjEgtly1Y3uIzWR7xcvspEw/BkgPg2aQMAVEhRCVtlm0Jq8KYl3ymqlM E+0XrqFcmmqebuQn6665RyYAEmzdOWnTQkjhnOEPiGM1PSMyhzQnQ3b6YanegvmWqZkQ 8ZbSACvO6kc6pNGxoABxurKrjZauqfxpmIMUxughKQsjT3o9VEuiaC2FW89hw1ti4V+h mF1Q== 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=98GKs9Rzt6T8j42m+8X5Fjb9o42+ZsLUxtBLOYK1Qmw=; fh=hYj16BiRXlyB0pRjVFH/fB1xEF4960w9bosjfRnN6yw=; b=HSlB544dgbQAakWYwTdQBo6B3LwTjZQjejvzplDJe4vwsFBTmobSvCh7421jHswksB 863NBTTkEXuvmtSQ4JkbOeiTWu5F/QFe06yem+ZQmfgYkutlfOWWdahd2vKMGDRaBv65 d8dETLCj83aTNuNjDsyvEhcdVffA5Ei+zGgXqIlWYK89EKOR81SveKB6t3E4lKIYqKFV NxP85NZN9sXF3VP6yh3Mrz5aKATWSli0MCcoOrTxLh6Y38Mn/iVAdkxLIzj8Mug/zGbX iVWorNRUCdoh4xoyQ3OLGDGcZzKTCE4YeCqlFcXqjeWtgLEFcVJg5CWgCf9USeGovmke gpuQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hPxhBsxF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172407-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172407-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w63-20020a638242000000b005dc927ee2fasi10726041pgd.710.2024.05.07.16.37.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 16:37:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172407-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hPxhBsxF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172407-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172407-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 868B2283454 for ; Tue, 7 May 2024 23:37:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA73D149E12; Tue, 7 May 2024 23:10:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hPxhBsxF" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E12B7149DFC; Tue, 7 May 2024 23:10:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123456; cv=none; b=ixrFEdCkH6fySV3Vwuv7eaLkZOamhX4M35bcO4ddq2Is8THznVLpOHUFl1pEu3ONTxbAx+JdT2SllhWlQaM+c/FAIJZMSO/oU9jo5FJh1b88wBUwr8PgDs0A7Lxoa14BOxRChHOixGDudkPaObNkyi/6Yc9ow39ZgyNCQBBHOAU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123456; c=relaxed/simple; bh=sAAr9VYn+hvAOzBBZthjzXP3fDcDZfnu5BuEBB9blKo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OU5XJX7nPNKXz4WSlB432Rz5vTRQMNGhXx20Oi8y0rIDnUZsHsv9F0pCJiVRCuOC9i9DCRYJQ+I2hKVS+uXI9cE4ADghpy03Kklk/DQrRZysFQtUETS8ygS1j6sVB79Irp9aGMsKnm1mbvq5eydc6s/Tffm6XGdFkFLt9yVJBPE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hPxhBsxF; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5ACD9C4AF17; Tue, 7 May 2024 23:10:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715123455; bh=sAAr9VYn+hvAOzBBZthjzXP3fDcDZfnu5BuEBB9blKo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hPxhBsxFUAjNyDVILyASJ2Zh7QUDm9FKMj2Y8lFQCawg+ZqF2B7uIQqTPgjRm7YBt WmGlJaKPuwXXnN9rdXBTelxvj4vGpd6P3mZkIYpBa4G8Wkwmbjhqo8FdyYvWpISpaS nM+J/qFm+OrR+mRnkS9+7/6uMbZOms4fmJHf9IcYnkzBWYTjIZW9OBY37uBMqc1NDy aBRxXJ14HcPYwFSV61vxqX/UTP6v4NFJ9sSp/cALtZlk3LSp81K77vBx4dApUaaQaG 63GtYANT/6Sj2daBgHCS7Riv+vc1czFplXov8JRUihbWo0JpiIggvkPsg9fiCmgWKx pqWPYqPscE6bA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Stefan Binding , Richard Fitzgerald , Mark Brown , Sasha Levin , james.schulman@cirrus.com, david.rhodes@cirrus.com, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-sound@vger.kernel.org Subject: [PATCH AUTOSEL 6.6 12/43] ASoC: cs35l41: Update DSP1RX5/6 Sources for DSP config Date: Tue, 7 May 2024 19:09:33 -0400 Message-ID: <20240507231033.393285-12-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240507231033.393285-1-sashal@kernel.org> References: <20240507231033.393285-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.30 Content-Transfer-Encoding: 8bit From: Stefan Binding [ Upstream commit eefb831d2e4dd58d58002a2ef75ff989e073230d ] Currently, all ASoC systems are set to use VPMON for DSP1RX5_SRC, however, this is required only for internal boost systems. External boost systems require VBSTMON instead of VPMON to be the input to DSP1RX5_SRC. Shared Boost Active acts like Internal boost (requires VPMON). Shared Boost Passive acts like External boost (requires VBSTMON) All systems require DSP1RX6_SRC to be set to VBSTMON. Signed-off-by: Stefan Binding Reviewed-by: Richard Fitzgerald Link: https://msgid.link/r/20240411142648.650921-1-sbinding@opensource.cirrus.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/cs35l41.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/cs35l41.c b/sound/soc/codecs/cs35l41.c index 5456e6bfa242f..bc541293089f0 100644 --- a/sound/soc/codecs/cs35l41.c +++ b/sound/soc/codecs/cs35l41.c @@ -1095,6 +1095,7 @@ static int cs35l41_handle_pdata(struct device *dev, struct cs35l41_hw_cfg *hw_cf static int cs35l41_dsp_init(struct cs35l41_private *cs35l41) { struct wm_adsp *dsp; + uint32_t dsp1rx5_src; int ret; dsp = &cs35l41->dsp; @@ -1114,16 +1115,29 @@ static int cs35l41_dsp_init(struct cs35l41_private *cs35l41) return ret; } - ret = regmap_write(cs35l41->regmap, CS35L41_DSP1_RX5_SRC, - CS35L41_INPUT_SRC_VPMON); + switch (cs35l41->hw_cfg.bst_type) { + case CS35L41_INT_BOOST: + case CS35L41_SHD_BOOST_ACTV: + dsp1rx5_src = CS35L41_INPUT_SRC_VPMON; + break; + case CS35L41_EXT_BOOST: + case CS35L41_SHD_BOOST_PASS: + dsp1rx5_src = CS35L41_INPUT_SRC_VBSTMON; + break; + default: + dev_err(cs35l41->dev, "wm_halo_init failed - Invalid Boost Type: %d\n", + cs35l41->hw_cfg.bst_type); + goto err_dsp; + } + + ret = regmap_write(cs35l41->regmap, CS35L41_DSP1_RX5_SRC, dsp1rx5_src); if (ret < 0) { - dev_err(cs35l41->dev, "Write INPUT_SRC_VPMON failed: %d\n", ret); + dev_err(cs35l41->dev, "Write DSP1RX5_SRC: %d failed: %d\n", dsp1rx5_src, ret); goto err_dsp; } - ret = regmap_write(cs35l41->regmap, CS35L41_DSP1_RX6_SRC, - CS35L41_INPUT_SRC_CLASSH); + ret = regmap_write(cs35l41->regmap, CS35L41_DSP1_RX6_SRC, CS35L41_INPUT_SRC_VBSTMON); if (ret < 0) { - dev_err(cs35l41->dev, "Write INPUT_SRC_CLASSH failed: %d\n", ret); + dev_err(cs35l41->dev, "Write CS35L41_INPUT_SRC_VBSTMON failed: %d\n", ret); goto err_dsp; } ret = regmap_write(cs35l41->regmap, CS35L41_DSP1_RX7_SRC, -- 2.43.0