From patchwork Fri Aug 25 17:23:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 717265 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65C14C3DA66 for ; Fri, 25 Aug 2023 17:24:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240850AbjHYRX4 (ORCPT ); Fri, 25 Aug 2023 13:23:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239647AbjHYRX3 (ORCPT ); Fri, 25 Aug 2023 13:23:29 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AB2A2137 for ; Fri, 25 Aug 2023 10:23:24 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2bcb89b476bso17879911fa.1 for ; Fri, 25 Aug 2023 10:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692984202; x=1693589002; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=zgZvHL8hFswLYwPF8AuRbBMK7oSEIDIwPQTcWj9HdOU=; b=GLVQRR0uqz7h3mQtbUDjl9KTg9wErpM6VkLfEbYi5c6RumHoQDQau59jJOZR/a72EL RbR7Tz7YcIWnHUtdHuF/Y47W01Kz2aYojHdPM7AInofd/QaNRKuXjrLG9ZutsVUenVCE 95QiaH6WtlpdnjqMTJpl4gfQ5KpVptXQ4RtHkooUTBK64il+bYztIx5gvR1Nr7L6zl6k of9RBaLaOZYy9qWKiYn+Zeg6ql0rop5CA9J6zzbUoyI8vKePJYvr2IViClxE8TsRLbnX 0K2F4IH0BCU8cu+X6nD2nDuPODM3Tu3RQYYHf0wghvgxsm/m3c8VBqIoEuRFiGHNZlRx 47eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692984202; x=1693589002; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zgZvHL8hFswLYwPF8AuRbBMK7oSEIDIwPQTcWj9HdOU=; b=O1exzoik/Y8z587SQFC65wT1KrAX1GOU8fCt7IUnD605G6wINtecXFHefzo1oVYyeU /oMFgX4j7+uQ5shjQ852I4Pp1mb87kdYd4/2oy1+s/eX/IdU4vhwC4K7ctTVlTKTrH97 x9hdos/jRyKG69Hg6fbHUktmkwIL3U0cpnjcOh8fNoputo/eBERazYTpfJ7bcxRkk7FS kEY+FgJl8xpOje0rIxzF3P+kVZNAyBYT3aNgmyJaJAHNAi0+8b/BR2ZCjtxkfKP2dZQk l682nkGLymJLdNZYxnorvUcYbVTg4Qe69z563goBtLIt4PfZjhevhnqD+y3g2UN5a4FM Sd9A== X-Gm-Message-State: AOJu0YzHO97yPYPxIBqvDPujhWE+PnWwgB/Z+FBzMS2LYS3F/0Xr1zZU KiGGNH64z68/pdds39qbP8eWjA== X-Google-Smtp-Source: AGHT+IGEWTWl4FE5/sIMoCZYj5tNQhpLyEV1B/4/UDUeu8WyCLiRwN1y6zdZ489KTOTHVvEld8lL/g== X-Received: by 2002:a2e:6a03:0:b0:2bc:d993:b7ba with SMTP id f3-20020a2e6a03000000b002bcd993b7bamr7286415ljc.27.1692984202704; Fri, 25 Aug 2023 10:23:22 -0700 (PDT) Received: from [192.168.1.101] (abxh59.neoplus.adsl.tpnet.pl. [83.9.1.59]) by smtp.gmail.com with ESMTPSA id n11-20020a2e904b000000b002bcb1e1322asm407647ljg.63.2023.08.25.10.23.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Aug 2023 10:23:22 -0700 (PDT) From: Konrad Dybcio Date: Fri, 25 Aug 2023 19:23:13 +0200 Subject: [PATCH 2/2] ASoC: codecs: lpass-tx-macro: Add SM6115 support MIME-Version: 1.0 Message-Id: <20230825-topic-6115tx-v1-2-ebed201ad54b@linaro.org> References: <20230825-topic-6115tx-v1-0-ebed201ad54b@linaro.org> In-Reply-To: <20230825-topic-6115tx-v1-0-ebed201ad54b@linaro.org> To: Srinivas Kandagatla , Banajit Goswami , Andy Gross , Bjorn Andersson , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jaroslav Kysela , Takashi Iwai Cc: Marijn Suijten , alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1692984198; l=3082; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=+NN8XrEaFBygmo3q/e38Bu/eRF3y7vIEUdBDz81oARw=; b=PU8ItgsZg+K3RccuAVuAqM2PAzOyCQhzUKWthiWh3L6UofpAK5W3bKNmtGaPMdLJoFiUUi6zf 3rLk7uFbnPtAvqytAVbHnLiVI7gkllxNwXze/kEeL6zDIkXc/aDdDGR X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org SM6115 has a TX macro, which surprisingly doesn't host a SWR master. Conditionally skip the SWR reset sequence on this platform. Signed-off-by: Konrad Dybcio --- sound/soc/codecs/lpass-macro-common.h | 2 ++ sound/soc/codecs/lpass-tx-macro.c | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/sound/soc/codecs/lpass-macro-common.h b/sound/soc/codecs/lpass-macro-common.h index 4eb886565ea3..d3684c7ab930 100644 --- a/sound/soc/codecs/lpass-macro-common.h +++ b/sound/soc/codecs/lpass-macro-common.h @@ -8,6 +8,8 @@ /* NPL clock is expected */ #define LPASS_MACRO_FLAG_HAS_NPL_CLOCK BIT(0) +/* The soundwire block should be internally reset at probe */ +#define LPASS_MACRO_FLAG_RESET_SWR BIT(1) struct lpass_macro { struct device *macro_pd; diff --git a/sound/soc/codecs/lpass-tx-macro.c b/sound/soc/codecs/lpass-tx-macro.c index 3e33418898e8..82f9873ffada 100644 --- a/sound/soc/codecs/lpass-tx-macro.c +++ b/sound/soc/codecs/lpass-tx-macro.c @@ -2045,15 +2045,19 @@ static int tx_macro_probe(struct platform_device *pdev) if (ret) goto err_fsgen; + /* reset soundwire block */ - regmap_update_bits(tx->regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL, - CDC_TX_SWR_RESET_MASK, CDC_TX_SWR_RESET_ENABLE); + if (flags & LPASS_MACRO_FLAG_RESET_SWR) + regmap_update_bits(tx->regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL, + CDC_TX_SWR_RESET_MASK, CDC_TX_SWR_RESET_ENABLE); regmap_update_bits(tx->regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL, CDC_TX_SWR_CLK_EN_MASK, CDC_TX_SWR_CLK_ENABLE); - regmap_update_bits(tx->regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL, - CDC_TX_SWR_RESET_MASK, 0x0); + + if (flags & LPASS_MACRO_FLAG_RESET_SWR) + regmap_update_bits(tx->regmap, CDC_TX_CLK_RST_CTRL_SWR_CONTROL, + CDC_TX_SWR_RESET_MASK, 0x0); ret = devm_snd_soc_register_component(dev, &tx_macro_component_drv, tx_macro_dai, @@ -2158,18 +2162,22 @@ static const struct dev_pm_ops tx_macro_pm_ops = { static const struct of_device_id tx_macro_dt_match[] = { { .compatible = "qcom,sc7280-lpass-tx-macro", + .data = (void *)(LPASS_MACRO_FLAG_HAS_NPL_CLOCK | LPASS_MACRO_FLAG_RESET_SWR), + }, { + .compatible = "qcom,sm6115-lpass-tx-macro", .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK, }, { .compatible = "qcom,sm8250-lpass-tx-macro", - .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK, + .data = (void *)(LPASS_MACRO_FLAG_HAS_NPL_CLOCK | LPASS_MACRO_FLAG_RESET_SWR), }, { .compatible = "qcom,sm8450-lpass-tx-macro", - .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK, + .data = (void *)(LPASS_MACRO_FLAG_HAS_NPL_CLOCK | LPASS_MACRO_FLAG_RESET_SWR), }, { .compatible = "qcom,sm8550-lpass-tx-macro", + .data = (void *)LPASS_MACRO_FLAG_RESET_SWR, }, { .compatible = "qcom,sc8280xp-lpass-tx-macro", - .data = (void *)LPASS_MACRO_FLAG_HAS_NPL_CLOCK, + .data = (void *)(LPASS_MACRO_FLAG_HAS_NPL_CLOCK | LPASS_MACRO_FLAG_RESET_SWR), }, { } };