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: 13737089 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 061F5824BC for ; Fri, 19 Jul 2024 09:39:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721381990; cv=none; b=dUyNecZVhQDwVUG9qJmSAMiB0o61j/tusYAtXXvy2rYr0sE+QXt9K6SXKSgq4Oaa568gSDoN6Zr5uVhQh9v3qD4EpvCBFCxufKectuf03JCHZMRNSkTeh7he07AkN0m7e6mltGZxSwQbiTp7xEbI6TBpCvVsv4pcih079BM6xkQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721381990; c=relaxed/simple; bh=qeJlyBqsETHxFoWL51EbJtaruSa98HAkPjxf8ZXN+zc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gdUHNtBtRnHy40Yenb1Hfy3xY4BUfNgBSsQKt/2jSHG4kOOhjmXxQaBa+NP4e49AwKzrZpiyl8o+ZoywtT3xxa5p3ouC+JjJmPO/u/4NIMID58gtPrFV3E38/02Wk1yMH3BpgRdolucOaTlqI6H7cXno9I2QljY2Zrz8pyJnDXM= 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=xtQDCHUk; arc=none smtp.client-ip=209.85.128.47 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 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="xtQDCHUk" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-42122ac2f38so7454465e9.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=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=Ok8qT5sg/ukyA77onQiJddqngdYN/iGCzJwgTQrvtPQ=; b=xtQDCHUkVqUpRH3WQLKTZb2YFypk3ZEJX5tn3xtAWXJVapLpQmK5LEEuvPfVaFtVug NO7jbuitL4qmo0+a69tXAvtJfAfoKvbeq8KiDF5VfWYobdBCNsq6nKdwq753i9wuDFib Fh5TabrdFhoD6bqO9ON2cEim79FH+GmBsQ+CEGXa0eAJB5dAHhxZ+tcLODVOx6kLCZjl 6d6QQiDf8JNzOuuMER5IhlrBdmThs2bOZ45HICPDHwB+ki69TihVaFGJbpolzMPmFSY6 TbwiQ/sm+uLmruqFu2dYpCcR5P6amzqCualEAMOBcgrPOoZB9t/Gm/vBM8HA+yQVnXNP A+fA== 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=u8zuksiGbm1pM7hnKJfXXtxhSoubU1IQzj/V9OIju9yyViPtV0Cc+07v8qIUCiGd+b mgS5A5UDpRhgt0BwILWQAd8i2cluODd3ScNPrEAwq/+7ZzCd+CR0DDEj+6OBFK4fk4sq +MD+kZHhwIjXlpAbydrUgluIaJ3g6g9nu97kACpbxmOLH3kllMT+tETFH9T0Ln+NPsrz VFAP1USA6ohmWmQUGJQdPkVtglKFnjJ4VYxct2QHKAscq/P4k3f7Uklc6FoWahRuO42L mZG7KJp0jqPZkj8zPD5nd7UUYNBfJSfgfHYpsIXMHzjzl6BRovRNhhxRJJG4mSat/pWN fCVQ== X-Forwarded-Encrypted: i=1; AJvYcCWytmKm0X/cMfMzXk6Qea4fjqKEv7lFJY9e9dnY/lTUqv14Km2iyxcKi019HHKR5mwTzZR0XkMHjlSRdxuW0TvCTzm9dnxz7I0c X-Gm-Message-State: AOJu0YwUQf9eCrPV/xMDEOfqgblDxU5zBKTXoJlXy1v71o5oSyyNP7xN h80GJsxsfxRoMtvoYxXHjvZwCFDl2HNtaigvCrWWLjP0EvlhtSjwhiKKCjR/tVs= 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> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Bot: notify 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: 13737091 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 E2DD412A177 for ; Fri, 19 Jul 2024 09:39:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721381991; cv=none; b=KUujrCrkhPHEPitnyE8YY+FRfMWSTavZl1XgrSSuhpbuWk+hiVRjBboB/EVYwgWH3je7H/TaMYomZ3ZwBDj2j647cqMpqqSHadA7Fu/YvTkxLf2/apvzcpmZLO+oCWCAHrC1VLxQn5Ew0XZkVM0dv94reb2vdqG5DoMf1P6R3+g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721381991; c=relaxed/simple; bh=14KsoOKsE/lQj1HeIEntUuL6mxkwimaE3iXYynYqn68=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rIrrXcRfNOvHdgmc6Y8p4fa0R3ON+Wu+jU8pjYlqGDLi5AsgaUFJPP8uTwWF+ftfH20nYxrquQAcpUEmo/KRGxellFRDRMJ0qUnWEKNK0iNncsYj8Apme58W39TfORXhG7tOt0SDmUu5Z29TAhW5xoRauBqwWkSHhfA8p+Zq+Bg= 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=MTwxffdP; arc=none smtp.client-ip=209.85.221.51 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 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="MTwxffdP" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-3683f56b9bdso543373f8f.1 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=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=4Jh83wOtVueGX1PE60SDgHxPA51mTtiJu8dK1JiG1H8=; b=MTwxffdP8QaqqyFhHl6we88e7s8FiKSQLy2WW1uNvr5uxDvLA+SK5Rc4fu13kksMem watmq4ps1D5Wiq2w/9X1xwwqj9vj74JI5Vt6mlwucS87Zr8v3VbwGA8dYT5/o8NvLQD6 howr6HEOauyCeudKZOvS/AGJUqqAsaD1lqxvlry/1bi7eQSxQZWoHdP9c9JbJY6rB25R tUhjWvqzARDVN5R1wgFPL3ZbUHOz587bjzHNqs5hdQ8Zh2XZ/R+LlVpjxxRv5EhD26AZ qcW+HZdyMb3S0LteMQGXkAR6ncv+W8WLFzghGoWejSe1AHhpDN4goBvZjc0gCQ8DqGgX skYQ== 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=NYQIfHCyjEfqEa7qbicrP7jmLLsj6deuVaUYplfJmZIyY5OanqU7q3EwmA2m9bGJ5X BQJKVcB+j9wxgzHAmaeg2+q9USLy+4r6wpBI47gL5TCzsP8yejDnEh9YYG+O4LSRwyzf i0tQoKOe+3CUe7B4amIQsbn88Nwy851nugETDZadGwpqC0sJarqU5PnSU9S/VAFUs4l4 kkDFzdSDSzuB+Ykc+bVGXsyJuxjap/v5l0hHrBdAHDzS4OJ6467jpmw9h69Q9uwx5r4Z WAoenOqtA/wDQp1h1pANr2tL9kqS0vlNhowJks6054T67OVUPSIz6rT7hIgZT/PE6Tcn JckQ== X-Forwarded-Encrypted: i=1; AJvYcCUXfqT52il6O4x71CKBddlz8nMP1ed5Jhy9W8bxVSRyq7hC/5G6hnCBanGcX7Ya66wwr8Mip5M8Vq99SqwybDJvnkdbp80u0fHs X-Gm-Message-State: AOJu0YwFNnjZdqw9FmHlIDxkpqhfpEsuCWFk+HdJxneoftutrMhGZPCE U4Iwaneh6oyhL0Y2E1dKiNVakkxUki4qKmm1XXts+dwM2hnnnYL8815yAozx7HA= 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> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Bot: notify 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 Reviewed-by: Neil Armstrong --- 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: 13737092 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.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 D50D612D773 for ; Fri, 19 Jul 2024 09:39:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721381991; cv=none; b=ufq9b/rx5E5P7YOnkoKVO/Gby8L5WdLd/3UsJfpRzgYubmTGNrDpSHZMNx47909XLMHbkHvnJ7KLJKD1aNbgbmEVAv73s9NVQ8VKcFeS5y6ohZCCPSdhxYbcZwWKuEEZ8n6o1lSCzTcfhMvgJGpWbcKKYbatt13iNrpC8ZNUV+4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721381991; c=relaxed/simple; bh=PBjruZtx9EOHUxkdlD0klsOvpdGmBCht+2QX12HHm3E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cqkvTN8JZ1GEPZ2tNc3HQKYVJrx/Vecf4egGt7zfIhlB0R8fql/pCJfD+UqE9eftyOPi+COEw8/jNqIrPqwzTt9qYdjYhgK4+5+bDd2vw3Oqrw0TimN4Q+JYP5aVuk68Eyy0Dn2U3tCQ4MVcgmF9eQu0A2KN4x2yZejrJpuwORw= 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=gnS73A56; arc=none smtp.client-ip=209.85.128.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 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="gnS73A56" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4257d5fc9b7so11591165e9.2 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=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=eMpk3y2xmBZCQPaJCy/EfgttwiP6OCjkgxpc1ntR5zI=; b=gnS73A56f0LWkJffdeE8DuTLb4/O6PiFaDGntt3GIkmRZLsUVFGL8Elrgdlm/IAau6 +B90XzrMIwi+0vK7HHHobxTtpK3lGhESGviDVnwonYUeAS6EYLW2Eur+/rXUk05dYrcS 0w3es+rpDw34fjKVvv+ic9pzwYtI4bnBftLnGAfmGLuo+IJGRF0RByJ3CA0Q7Ts4DfBS 3tqfvObVfgBKBhLV3+L1QIKMiq7gvHnh/Dre5lbpcVgus+p7kjZFLmRoxYVEOSYwnjEx Ne/ffjTjHlUDiN+Xlg7I4kSfl1VnRNN4lMJwtJj6wNkPsSoztZjMtwd8PiQQeh3+48mE DY4Q== 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=ElvKUnxuSlJYqHs4o7sOWQdNOPnaOzeVf145Nhn5AqJvf4YI+Mn4NSG2X0yAF9eDdl 5YUH6nn47T+nKvEvLcYF3M/5YhxWhF2XXIQbmtfVitbhstL234xN0WdbOFXJRPPE6plc 0CS/wY2EwyS/cjbIYqorZRZQ60gmcT2FX0H/r6t8GuW2n3fp/6dgBUP3QsZD7udkIw5O rckMYtkwSytJRCx1/p/DQWxN8G15zH55TeLX227tbd2mxMDx3Rk1rgO0nGXXyV25S4XC XeZi8adHvl8ruZPVbTx9OMlm+rmqMST/mfglvMHy0dCwM6fyqtHJ7G9YO1nrkgxYTqAV 8IGQ== X-Forwarded-Encrypted: i=1; AJvYcCUsbJfIips9bFZdIA/aSQ7UUEzILjoKnSxFxbq9fby5294e97RvkH5E7V2VqO3mpCoIap+YD0zEmkXC/mSdGdjrEd2vaD95hgBX X-Gm-Message-State: AOJu0Yz/IlmfSg/ni67yh1/nKQFMmbzB5eaf6uJ9mtigsxtyalVRQhAP Nn0ers4s8Dh5IMqutoYM98jmvN2ZrAVB11RpwX/kzKZiugpYhOnhy+M6ayy8KNw= 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> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Bot: notify 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 */