From patchwork Fri Jul 19 09:39:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 13737085 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 A274EC3DA59 for ; Fri, 19 Jul 2024 09:40:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iLPESRr1i/N2UK9LlPcRIrz972IND79k8XaNNQ98t7o=; b=G/N5alRXY4oaSp D2kQ8vceALMMqIXYZgkEEIhg/hii0bEBEO5XOS/DwCUq/N/sJN0S+Ocow9kYKtE2kAFuFSjtSTk/u muC/uQRSipnYd51fADDttShuAkAU2/YeSUD5ZMC6sDtbRBQHXOu+uWc2eGkJCXs47Z1yhDUjLiH7B 7HcSL3m9MiZaHrXRtJ21aShv0Dy+LTnpggn+QmpEDuvXz122fmunToKGP0Tqq31lyWzba1nFY3bkm U9Goak+FfI/p8dyMyhv5xnCItGhGf2lTBaTWXwLjxLfj8cDdnduTh8AtQ97TwcyYFtCpAZ6w9b36C 9Fyn9IhPZkFNYKRGqpoQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sUk5g-00000002Gex-3F9l; Fri, 19 Jul 2024 09:39:52 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sUk5c-00000002Gbl-0ref for linux-amlogic@lists.infradead.org; Fri, 19 Jul 2024 09:39:50 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-42122ac2f38so7454455e9.1 for ; Fri, 19 Jul 2024 02:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1721381986; x=1721986786; darn=lists.infradead.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=Ok8qT5sg/ukyA77onQiJddqngdYN/iGCzJwgTQrvtPQ=; b=yfh3lTQLAfIf457+linquTsO7UI6GpSYC/Cs8Dc8oF4ABw7ejYZIHx9WowsTb9N1C4 EVge9oiTb118AIvTEpE8jcH0Ik6BinKeb/t5cHo05sY0BMWitVkEExRYXf2tqfGn31WF 1m8tXVxOBpeAcJfg+J77TS9KjPeiWLELk+Oz0Uxb1MBaoA2xD4Ddx9eTyXSRwW1lESU2 rYkbCdX6QI4qAmGLYBIU2pJqeDomkF49fe/XhzlJFnzvcJyZmGweIss1ItDN3QWk6SbC NqGSqpY7q5Ny9I1l1Eh/XOJ256rrXftk0DAFUcZt6+jiVasnVlK3R77Irkmnet16E6IW lC9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721381986; x=1721986786; 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=Ok8qT5sg/ukyA77onQiJddqngdYN/iGCzJwgTQrvtPQ=; b=WIPVxu3RZK3oBFbbv1gw1MifCSyRtIs2OQO4yKxR2QFNf3W+McviGz8HcXyvj0mORc mJE4FucXEefy4JiTSZFjwfxQTM2O2Rfyh5+Vv1U8lAIFwWU+x3adhR8/xQ9pXOXZNvpV iHkRAR1qvR53z2j0auqyB1/IYwEMUMHI2B/FSGoN2yeLZqgt1Vt5fm9x89ZbZBsmYOc8 cEoUTV9kRxJQe5YVVdZ+cfQ7/DdAa014pcV0mXjQkDEYjSqhq2K3K6QuP144wAVrV4X/ 1j3JhJc2BDUVUr9JPBL7cVSjVn4+B4Z0DGIHZVeVEnDG40e+f4q2//CYmMfEhNJueTfb cYxA== X-Forwarded-Encrypted: i=1; AJvYcCWRCQJUbUYA7ZpRL2oNnrvVQtorLpNUYmmZPkUBgHweghxhroh0LOI/EudUbPNVUkME6bLN/xH5yRqZbAMD2v93aq5oHYlcGRLbnEnTxQT0hMc= X-Gm-Message-State: AOJu0YxssZNRWqV4ZVboOssLOb55LBTPQ/2mrovefgwKRJkE8LvSlCje XZSjpxJ8xt39myCDsXca3eCUdERTDbz54VpXzjAA1XzrqADMxxorC2hzljgSpYI= X-Google-Smtp-Source: AGHT+IFRBg62WuWS0T4N15ozxDHT5px+Wx0AGbkCxcIEYMBTBgmOQqIY2DCIWNCIKkRjdhVXnuc1yg== X-Received: by 2002:a05:600c:3110:b0:424:71f7:77f2 with SMTP id 5b1f17b1804b1-427d2ad9f96mr23848925e9.16.1721381986549; Fri, 19 Jul 2024 02:39:46 -0700 (PDT) Received: from toaster.lan ([2a01:e0a:3c5:5fb1:5ac4:5655:4dfe:ce97]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-3687868bc91sm1100956f8f.45.2024.07.19.02.39.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jul 2024 02:39:46 -0700 (PDT) From: Jerome Brunet To: Stephen Boyd , Neil Armstrong Cc: Jerome Brunet , linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley Subject: [PATCH 1/3] dt-bindings: clock: axg-audio: add earcrx clock ids Date: Fri, 19 Jul 2024 11:39:30 +0200 Message-ID: <20240719093934.3985139-2-jbrunet@baylibre.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240719093934.3985139-1-jbrunet@baylibre.com> References: <20240719093934.3985139-1-jbrunet@baylibre.com> MIME-Version: 1.0 X-Patchwork-Bot: notify X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240719_023948_261540_9AA98BD8 X-CRM114-Status: UNSURE ( 8.19 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Add clock IDs for the eARC Rx device found on sm1 SoCs Signed-off-by: Jerome Brunet Acked-by: Conor Dooley --- include/dt-bindings/clock/axg-audio-clkc.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/dt-bindings/clock/axg-audio-clkc.h b/include/dt-bindings/clock/axg-audio-clkc.h index 08c82c22fa5f..607f23b83fa7 100644 --- a/include/dt-bindings/clock/axg-audio-clkc.h +++ b/include/dt-bindings/clock/axg-audio-clkc.h @@ -155,5 +155,12 @@ #define AUD_CLKID_SYSCLK_B_DIV 175 #define AUD_CLKID_SYSCLK_A_EN 176 #define AUD_CLKID_SYSCLK_B_EN 177 +#define AUD_CLKID_EARCRX 178 +#define AUD_CLKID_EARCRX_CMDC_SEL 179 +#define AUD_CLKID_EARCRX_CMDC_DIV 180 +#define AUD_CLKID_EARCRX_CMDC 181 +#define AUD_CLKID_EARCRX_DMAC_SEL 182 +#define AUD_CLKID_EARCRX_DMAC_DIV 183 +#define AUD_CLKID_EARCRX_DMAC 184 #endif /* __AXG_AUDIO_CLKC_BINDINGS_H */ From patchwork Fri Jul 19 09:39:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 13737176 X-Patchwork-Delegate: neil.armstrong@linaro.org 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 19833C3DA64 for ; Fri, 19 Jul 2024 10:46:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TlXYWy6800QzvBQ3XyaxKxYLu0FjcoNsurSJaNw6zqU=; b=dj26YIl6W0wEL0 pyA9TBlouIm+HkdKm1Kc1GvCudIRCVNc0wx8IciuDTCerc2uTnw1sKA/65T1/6la87RpTmzbjHk4f r2Uju81RWQLyu57zuC148cJcir1jARoDCdzFDOOzDLiRZHQnKO3sypB9bXJKy/LMyVI5uvcXmW0zd BJTTqXxpo6jKjChlmsQWXnS/LkqyzXfPICewjnOnj/RkzjUgv1+ej3ES8mQc42RWigWGJrDFWzHMt rtXiQgz79egm7+F+UDWIVUkQuzRqpoJWamv/85fPOl/LedvQnGwq8IK77QbH/PucGA5oZnZrkUEO9 apaL7784dKyL9mTluJGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sUl7a-00000002QWA-2gBG; Fri, 19 Jul 2024 10:45:54 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sUk5c-00000002Gc1-3H2t for linux-amlogic@lists.infradead.org; Fri, 19 Jul 2024 09:39:50 +0000 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-367ab76d5e1so380787f8f.3 for ; Fri, 19 Jul 2024 02:39:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1721381987; x=1721986787; darn=lists.infradead.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=4Jh83wOtVueGX1PE60SDgHxPA51mTtiJu8dK1JiG1H8=; b=NqOKgKD/qJFlWoxvsAZG0ATW472fC5GQsJ35dYztiBu5P1Id1UJm+VZmpzliNhuUVg YZwJlVyD84JDqPHhByTMyD3ashH4z1SSNqykXKuDPr0xmFqUIm5aUOU2c2Pc6TsbiuLd RaMYQ5QA4RG8sLn7n9cBaZ9T3A/5Aj27EDthkI9yk73dQCTfyivJhRjX3p4rWzztKJl5 gt4ibbah9gpAKehkTP7pM8zYkg0PbhHTUSJCc9hYZ3SrhY2UjhD+XLfRSb4RZL6EJ8YW ToK2wZ29ozLJBSwn9IvwV/wwP92hzmQiHs7jboR2VaMj+2cUMLyR1MNhUmT1YAD2FBYs xexA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721381987; x=1721986787; 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=4Jh83wOtVueGX1PE60SDgHxPA51mTtiJu8dK1JiG1H8=; b=L5MAEPPy2ev+D59Y/oUG5gTvuoAavZvX76Jj/DbZH935R0qt3AutZEJ2zWeXSA13Go SaXodusEHlkoL4kF9vKLTm2aSKGS4kYSemPfDM7kTWakIJ1tt/jt/WJ7Jl10dkYbWzna rFswjj5KlC4WbB1fBVLO9nq8o6Gvbr0iaEJy4ncHYGyD6Lyofkqab5hoFj7ZekJSvLgj gggKJavtfsNrdEm0PR0/sigjTqX4JcF3semUO2zL3gYsdp6Z0lzRlDZHGsKNZDDlrQdD HRDKee87srgiw0MhZCI1F2cE6pCSOmw5lXIAB1l9z2gg3Q1rN0w6k/rfm7v/MIT23NUL +Jyw== X-Forwarded-Encrypted: i=1; AJvYcCXjlpq/PJ9gUMfBzQlT3gpBRy+KNUGRYLUEZNHi+r+TJBfHPEQQAp600DBjA1JJTpyYpN6uLdIAL+Nzk1/LD9UZACm9jjn2jEnBZdXJ4c7I+co= X-Gm-Message-State: AOJu0Yx/Gjz5bpvWmS/FqLhGhuCWyRxjhoH/4nJxkRtY/opmOwIgtlSs X7zbaO6UIAl8PnZUcdcbKBkBRIEIMnh6mzG3wRsE+nkRx0/hQVWB0teS35cRcwNygvNktjR21yF wugc= X-Google-Smtp-Source: AGHT+IGoIHykh7qghcwtZ6qPH84GebsqiBiwyg8/MutBl/iiTMSTkOqe8DvSeJARQHPKgBnAI06U+w== X-Received: by 2002:a5d:6485:0:b0:368:31c7:19dd with SMTP id ffacd0b85a97d-36831c72ab3mr5458249f8f.5.1721381987400; Fri, 19 Jul 2024 02:39:47 -0700 (PDT) Received: from toaster.lan ([2a01:e0a:3c5:5fb1:5ac4:5655:4dfe:ce97]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-3687868bc91sm1100956f8f.45.2024.07.19.02.39.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jul 2024 02:39:47 -0700 (PDT) From: Jerome Brunet To: Stephen Boyd , Neil Armstrong Cc: Jerome Brunet , linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley Subject: [PATCH 2/3] clk: meson: axg-audio: setup regmap max_register based on the SoC Date: Fri, 19 Jul 2024 11:39:31 +0200 Message-ID: <20240719093934.3985139-3-jbrunet@baylibre.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240719093934.3985139-1-jbrunet@baylibre.com> References: <20240719093934.3985139-1-jbrunet@baylibre.com> MIME-Version: 1.0 X-Patchwork-Bot: notify X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240719_023948_842096_4BFEF26A X-CRM114-Status: GOOD ( 14.07 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org The register region of axg-audio tends to grow with the addition of new supported SoC. Mapping slightly more has not been causing problem so far but it is not viable to continue like this long term. Setup the max register based on what is necessary on the related SoC. Signed-off-by: Jerome Brunet --- drivers/clk/meson/axg-audio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/clk/meson/axg-audio.c b/drivers/clk/meson/axg-audio.c index e03a5bf899c0..2426f3dbb7a2 100644 --- a/drivers/clk/meson/axg-audio.c +++ b/drivers/clk/meson/axg-audio.c @@ -1726,11 +1726,10 @@ static const struct reset_control_ops axg_audio_rstc_ops = { .status = axg_audio_reset_status, }; -static const struct regmap_config axg_audio_regmap_cfg = { +static struct regmap_config axg_audio_regmap_cfg = { .reg_bits = 32, .val_bits = 32, .reg_stride = 4, - .max_register = AUDIO_CLK_SPDIFOUT_B_CTRL, }; struct audioclk_data { @@ -1739,6 +1738,7 @@ struct audioclk_data { struct meson_clk_hw_data hw_clks; unsigned int reset_offset; unsigned int reset_num; + unsigned int max_register; }; static int axg_audio_clkc_probe(struct platform_device *pdev) @@ -1760,6 +1760,7 @@ static int axg_audio_clkc_probe(struct platform_device *pdev) if (IS_ERR(regs)) return PTR_ERR(regs); + axg_audio_regmap_cfg.max_register = data->max_register; map = devm_regmap_init_mmio(dev, regs, &axg_audio_regmap_cfg); if (IS_ERR(map)) { dev_err(dev, "failed to init regmap: %ld\n", PTR_ERR(map)); @@ -1828,6 +1829,7 @@ static const struct audioclk_data axg_audioclk_data = { .hws = axg_audio_hw_clks, .num = ARRAY_SIZE(axg_audio_hw_clks), }, + .max_register = AUDIO_CLK_PDMIN_CTRL1, }; static const struct audioclk_data g12a_audioclk_data = { @@ -1839,6 +1841,7 @@ static const struct audioclk_data g12a_audioclk_data = { }, .reset_offset = AUDIO_SW_RESET, .reset_num = 26, + .max_register = AUDIO_CLK_SPDIFOUT_B_CTRL, }; static const struct audioclk_data sm1_audioclk_data = { @@ -1850,6 +1853,7 @@ static const struct audioclk_data sm1_audioclk_data = { }, .reset_offset = AUDIO_SM1_SW_RESET0, .reset_num = 39, + .max_register = AUDIO_CLK_SPDIFOUT_B_CTRL, }; static const struct of_device_id clkc_match_table[] = { From patchwork Fri Jul 19 09:39:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 13737086 X-Patchwork-Delegate: neil.armstrong@linaro.org 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D9DBFC3DA5D for ; Fri, 19 Jul 2024 09:40:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=72T/YOY/a3fuvzLKOcfPZvPBLA8t3HI/rVh9K595mtA=; b=Tmq7lsjbk2o+l2 99/a6kSe6k4VoCwL91BqUt51/09mVWIZvX7b30r6ivRkjI3vwh/N0XWcytuhS4jixP1qtRlCzlFz8 cl40NQDo6TymVWnmUl2Ee9WBxM/h/0MJAyrVfoELCtPal554rtFyKURpq64P0ZhNzlUQBgPSMI1gt sbVDIAchXtgiEhFXKi7Z6pyRu0PB4WFdj8UFNyqGoRI4IQj+LXwfcolTGW3vlJpHoyqz+QSL2GLrE 8aFet8s3Lle1bC7XOD25HylMsPpM8/1S17E+HhaqXIQE0AGkxWB92LpmNWfG/Y9lUt7QcMp0HyAh/ FCyTF6eVuOxLVBaWDd3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sUk5l-00000002Gfq-10PP; Fri, 19 Jul 2024 09:39:57 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sUk5j-00000002GfJ-2X24 for linux-amlogic@bombadil.infradead.org; Fri, 19 Jul 2024 09:39:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=eMpk3y2xmBZCQPaJCy/EfgttwiP6OCjkgxpc1ntR5zI=; b=dvgaBRXwI9vpvlK8K4pQJsk87G SJ9mQ+7sfS6nLw/U8rfsajssciv3RLEpfUtATTas53KmKeIox/DtQVr5eQlFJLQ6sJ5F53rlcJHFE 1nHrzbpQENI3ZgB90Z+u8UL6+5mCniDtv1qWPeN8tIP0y6HbrgiM2vhXp1qn43on8is7/MD2KLxKh GENqHm2nK9obuX1NObCdyyRGr+cYYJQlClgHK/z+ajjUgIiZyodoEoQ6if0nN8sfttfbA+pC9QVPF aLS8wXPlGS0MWEoqlfvYd6xxvFbTCZuv4bZzP5llHguYqmJh+xUPiAIJlg7JHzqOtyrSuy42Im7K0 YQCIXsSg==; Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sUk5f-00000002m4B-3vi0 for linux-amlogic@lists.infradead.org; Fri, 19 Jul 2024 09:39:54 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4267300145eso11579905e9.3 for ; Fri, 19 Jul 2024 02:39:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1721381988; x=1721986788; darn=lists.infradead.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=eMpk3y2xmBZCQPaJCy/EfgttwiP6OCjkgxpc1ntR5zI=; b=p/ntt6whtcOommW3yC1r1IDE0wayP7lVRT7lLUymyVoS59iME/yDj9uS74riwjw8nC 1G7qqpxyP1ZbXL7hXEpCThQi/xiwW1KrRmff8GjKUHq4wrL7cNjrDfGvx8nIFOFmejny soItHY7SvbbNzXFcZ7qO7qcdieNnYPYPfyQLWwb+f1bNT+TwNt/2VVHQ00Adp9MW1LIJ X0wWLOY6qz/RVF7/gMEPkUPJAMXGWSCEjO0Zu+XpsfhH3MB9GdWobL6XVZvxPXuL94xf WfMt08oWaXz/H76L68imULM1HJ3y9iTZs8gOsyyfo4hswnkOyvEpmcEsUrpcrJmgMAC/ 8nDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721381988; x=1721986788; 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=eMpk3y2xmBZCQPaJCy/EfgttwiP6OCjkgxpc1ntR5zI=; b=DxHJ4FnWPJTgGIubTCSfFel0E+XAnK10x1hGoqg4Ymf0ephFEo2W25HOg/MFrDxMxb f7vCmVXsIW/5ZFCWNiqT6QIaQwfxiQ76fRvimd84pYU9ZMjtWjifDnWQn1OBkjjF5Dku lppuWMd0DMQvvchC0SzJgL6LOGdAp7U8cvU+DVPfUToImAIDsmAAbOpe8BBLNDy4kueQ 9nfVOjTg3rNn5rkBtIXS9ytNC4pZMgw0AQOcGruL1tDMAM50MZ2l3mZ+oMJPFzfUcFxb DgEZy9BoQrJcyGS/f102OG1HOOIfhdUcSSN0kc4409fYH9vmSYbjPr5sxBTE6NAnbYg5 X6sQ== X-Forwarded-Encrypted: i=1; AJvYcCXyJB6WyDGnYrhiKtN9O2YbA+Ug/YKY7j38XrR11MU7FsDAkmXciqjtrjKdQNgKj9efmRcrPQuK2OKY5n/FCj93I+MlB0gS5SWDw4vIjcD5T4A= X-Gm-Message-State: AOJu0Yx6/Dezcn7VADJNAJZ4ZeaXUQ8UF2Qi5jDxIFwK8N7U7B5NTJQA cNC8G6bSWn9JCQ0kQid35o/DnGZpsVsijMjNB/brPrnwYeCbHo2vP9P9HGkFo0M= X-Google-Smtp-Source: AGHT+IHkI5bQ3THfbu9n+W7E481AfDPpqx7RjnI9aZPldPP6vcT4yhD2GCn82GpZhRHfUSF7NbJPvA== X-Received: by 2002:a05:600c:4f96:b0:426:6fd2:e14b with SMTP id 5b1f17b1804b1-427c2cb87a5mr62481585e9.11.1721381988244; Fri, 19 Jul 2024 02:39:48 -0700 (PDT) Received: from toaster.lan ([2a01:e0a:3c5:5fb1:5ac4:5655:4dfe:ce97]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-3687868bc91sm1100956f8f.45.2024.07.19.02.39.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jul 2024 02:39:47 -0700 (PDT) From: Jerome Brunet To: Stephen Boyd , Neil Armstrong Cc: Jerome Brunet , linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley Subject: [PATCH 3/3] clk: meson: axg-audio: add sm1 earcrx clocks Date: Fri, 19 Jul 2024 11:39:32 +0200 Message-ID: <20240719093934.3985139-4-jbrunet@baylibre.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240719093934.3985139-1-jbrunet@baylibre.com> References: <20240719093934.3985139-1-jbrunet@baylibre.com> MIME-Version: 1.0 X-Patchwork-Bot: notify X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240719_103952_399248_83521864 X-CRM114-Status: GOOD ( 11.55 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Add CMDC, DMAC and peripheral clocks for the eARC RX device found on the sm1 SoC family Signed-off-by: Jerome Brunet Reviewed-by: Neil Armstrong --- drivers/clk/meson/axg-audio.c | 32 +++++++++++++++++++++++++++++++- drivers/clk/meson/axg-audio.h | 2 ++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/drivers/clk/meson/axg-audio.c b/drivers/clk/meson/axg-audio.c index 2426f3dbb7a2..06dc1e1f45e5 100644 --- a/drivers/clk/meson/axg-audio.c +++ b/drivers/clk/meson/axg-audio.c @@ -753,6 +753,9 @@ static struct clk_regmap toddr_d = AUD_PCLK_GATE(toddr_d, AUDIO_CLK_GATE_EN1, 1); static struct clk_regmap loopback_b = AUD_PCLK_GATE(loopback_b, AUDIO_CLK_GATE_EN1, 2); +static struct clk_regmap earcrx = + AUD_PCLK_GATE(earcrx, AUDIO_CLK_GATE_EN1, 6); + static struct clk_regmap sm1_mst_a_mclk_sel = AUD_MST_MCLK_MUX(mst_a_mclk, AUDIO_SM1_MCLK_A_CTRL); @@ -766,6 +769,10 @@ static struct clk_regmap sm1_mst_e_mclk_sel = AUD_MST_MCLK_MUX(mst_e_mclk, AUDIO_SM1_MCLK_E_CTRL); static struct clk_regmap sm1_mst_f_mclk_sel = AUD_MST_MCLK_MUX(mst_f_mclk, AUDIO_SM1_MCLK_F_CTRL); +static struct clk_regmap sm1_earcrx_cmdc_clk_sel = + AUD_MST_MCLK_MUX(earcrx_cmdc_clk, AUDIO_EARCRX_CMDC_CLK_CTRL); +static struct clk_regmap sm1_earcrx_dmac_clk_sel = + AUD_MST_MCLK_MUX(earcrx_dmac_clk, AUDIO_EARCRX_DMAC_CLK_CTRL); static struct clk_regmap sm1_mst_a_mclk_div = AUD_MST_MCLK_DIV(mst_a_mclk, AUDIO_SM1_MCLK_A_CTRL); @@ -779,6 +786,11 @@ static struct clk_regmap sm1_mst_e_mclk_div = AUD_MST_MCLK_DIV(mst_e_mclk, AUDIO_SM1_MCLK_E_CTRL); static struct clk_regmap sm1_mst_f_mclk_div = AUD_MST_MCLK_DIV(mst_f_mclk, AUDIO_SM1_MCLK_F_CTRL); +static struct clk_regmap sm1_earcrx_cmdc_clk_div = + AUD_MST_MCLK_DIV(earcrx_cmdc_clk, AUDIO_EARCRX_CMDC_CLK_CTRL); +static struct clk_regmap sm1_earcrx_dmac_clk_div = + AUD_MST_MCLK_DIV(earcrx_dmac_clk, AUDIO_EARCRX_DMAC_CLK_CTRL); + static struct clk_regmap sm1_mst_a_mclk = AUD_MST_MCLK_GATE(mst_a_mclk, AUDIO_SM1_MCLK_A_CTRL); @@ -792,6 +804,10 @@ static struct clk_regmap sm1_mst_e_mclk = AUD_MST_MCLK_GATE(mst_e_mclk, AUDIO_SM1_MCLK_E_CTRL); static struct clk_regmap sm1_mst_f_mclk = AUD_MST_MCLK_GATE(mst_f_mclk, AUDIO_SM1_MCLK_F_CTRL); +static struct clk_regmap sm1_earcrx_cmdc_clk = + AUD_MST_MCLK_GATE(earcrx_cmdc_clk, AUDIO_EARCRX_CMDC_CLK_CTRL); +static struct clk_regmap sm1_earcrx_dmac_clk = + AUD_MST_MCLK_GATE(earcrx_dmac_clk, AUDIO_EARCRX_DMAC_CLK_CTRL); static struct clk_regmap sm1_tdm_mclk_pad_0 = AUD_TDM_PAD_CTRL( tdm_mclk_pad_0, AUDIO_SM1_MST_PAD_CTRL0, 0, mclk_pad_ctrl_parent_data); @@ -1232,6 +1248,13 @@ static struct clk_hw *sm1_audio_hw_clks[] = { [AUD_CLKID_SYSCLK_A_EN] = &sm1_sysclk_a_en.hw, [AUD_CLKID_SYSCLK_B_DIV] = &sm1_sysclk_b_div.hw, [AUD_CLKID_SYSCLK_B_EN] = &sm1_sysclk_b_en.hw, + [AUD_CLKID_EARCRX] = &earcrx.hw, + [AUD_CLKID_EARCRX_CMDC_SEL] = &sm1_earcrx_cmdc_clk_sel.hw, + [AUD_CLKID_EARCRX_CMDC_DIV] = &sm1_earcrx_cmdc_clk_div.hw, + [AUD_CLKID_EARCRX_CMDC] = &sm1_earcrx_cmdc_clk.hw, + [AUD_CLKID_EARCRX_DMAC_SEL] = &sm1_earcrx_dmac_clk_sel.hw, + [AUD_CLKID_EARCRX_DMAC_DIV] = &sm1_earcrx_dmac_clk_div.hw, + [AUD_CLKID_EARCRX_DMAC] = &sm1_earcrx_dmac_clk.hw, }; @@ -1646,6 +1669,13 @@ static struct clk_regmap *const sm1_clk_regmaps[] = { &sm1_sysclk_a_en, &sm1_sysclk_b_div, &sm1_sysclk_b_en, + &earcrx, + &sm1_earcrx_cmdc_clk_sel, + &sm1_earcrx_cmdc_clk_div, + &sm1_earcrx_cmdc_clk, + &sm1_earcrx_dmac_clk_sel, + &sm1_earcrx_dmac_clk_div, + &sm1_earcrx_dmac_clk, }; struct axg_audio_reset_data { @@ -1853,7 +1883,7 @@ static const struct audioclk_data sm1_audioclk_data = { }, .reset_offset = AUDIO_SM1_SW_RESET0, .reset_num = 39, - .max_register = AUDIO_CLK_SPDIFOUT_B_CTRL, + .max_register = AUDIO_EARCRX_DMAC_CLK_CTRL, }; static const struct of_device_id clkc_match_table[] = { diff --git a/drivers/clk/meson/axg-audio.h b/drivers/clk/meson/axg-audio.h index 01a3da19933e..9e7765b630c9 100644 --- a/drivers/clk/meson/axg-audio.h +++ b/drivers/clk/meson/axg-audio.h @@ -64,5 +64,7 @@ #define AUDIO_SM1_SW_RESET1 0x02C #define AUDIO_CLK81_CTRL 0x030 #define AUDIO_CLK81_EN 0x034 +#define AUDIO_EARCRX_CMDC_CLK_CTRL 0x0D0 +#define AUDIO_EARCRX_DMAC_CLK_CTRL 0x0D4 #endif /*__AXG_AUDIO_CLKC_H */