From patchwork Tue Sep 10 16:32:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 13798925 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 49F97EDE9A3 for ; Tue, 10 Sep 2024 16:41:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Yr1sayqKxsWDgBZHQ1bM3Uke54ske3bCnU2ZK9PgUEo=; b=Nt8BVBe23vrs64W8U+bX0eva8x H/TL6aU+/MmLPxa2u3xGRMvw8NXQ75sYlIeg1ErjdLRjaMhSnJt8TqMWVap5n0Gb3KLPgdSONWI6C 5/cn5QntM2VW347Wxoblsoo34kGnhtT8hBlBc5TC4a58uz7WD5c8sbPWO37nrwqHDksZbuv7KWYtz ot9fvNgMJxjT9t+RetI3qnhh3TN8hTTkedfZvMRDczXdaJa+4c7f+tU7tyI5ddC/dBbq8YNudVpip x27EKJFkEddlD24gFwqaiF7NEMYvqD/12qvYVvIrFW/mNy3DXJm79Rfir5WaGDrB8CSkH/dX4rFGb xkqJyw3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1so3vT-00000006O6N-2eJb; Tue, 10 Sep 2024 16:41:11 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1so3ng-00000006LEe-0tCc for linux-arm-kernel@lists.infradead.org; Tue, 10 Sep 2024 16:33:11 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-42cc8782869so4782275e9.2 for ; Tue, 10 Sep 2024 09:33:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1725985987; x=1726590787; darn=lists.infradead.org; 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=Yr1sayqKxsWDgBZHQ1bM3Uke54ske3bCnU2ZK9PgUEo=; b=e/Bxdt3Fhd0cux55q83hV2kvv9y5eVN73c7H/Iu/d18LE81hfNHI4b6bejMVSUGDxQ skPgkYIz2crBH0rMa8vyCdlXZ8TzYbcxsrZNlMyGJuMAkxu4t5hwZrgrDho0MCfOp1mx t2WttHH6JbZG2M8Ml6QQMRKDR2aENPOEVgA945TC2sL4xFYJYW9ichGw4vq1lA/+j0gK jRbuSZU7a7oJE+pZZKvHNpMDZSKxeQNgzdeb/YFc2GX/NqSHmKkTNvZoKHlaAkqFIhjv b4/ToFYyu8tXNN1Rqj7QL5msKXDTLcfMM38OQJN5uSTAvQ/2J5dj6tNIjPLgdOB/kvb/ 7ydw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725985987; x=1726590787; 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=Yr1sayqKxsWDgBZHQ1bM3Uke54ske3bCnU2ZK9PgUEo=; b=PngVRRPy1Oz5Lx1q+S//Vz6cOQv8T5QNGIJ3sy373IfxDAu9hAkNldZ7joXTEVgyza FCIW9h71ONZOQpoKLzNdf7OpeuMbqEJEv/8AGpER6Bgx8TvlQ2CECdcq5PAQzDqB0xwu gk30RzNViD1i7izu3WYBT601Rb9YzkDDxajcXzQxfLoWvtnXDRl4BlJ7uLaEG8STa2E1 tynWgKCQfB+4iotEjn8s2KU+yy5q77bCnLl36Hbzm1vXxmWRFr0qRF3Cq3sSr/JZzEPx vJ9/SSU3F8vX5w4GpO+zVI39tvEcWckJcJ7c9V7qz1sr+mOjf6mmdecfKgqAiiiOW8SO okyw== X-Gm-Message-State: AOJu0YxvKRiSlVZsNSAm/0woBvRuqEyQEW2sJqqgDc42jDVbbCg0yfa0 PDUSzauHu6KUwiRkcNUw1b48T+Pp85NHpz+7EYS9F/UONIymAd6FMLBFvRt94hw= X-Google-Smtp-Source: AGHT+IELeFZVXHB+dwXP0xf8ZS6Er0WzIl4bpD5+ge/OijJX97JS1vEUgvv9Z7lgj+Okf1bFaFzwGg== X-Received: by 2002:a05:600c:3505:b0:42c:b950:680b with SMTP id 5b1f17b1804b1-42ccd32def2mr1984735e9.20.1725985986626; Tue, 10 Sep 2024 09:33:06 -0700 (PDT) Received: from toaster.baylibre.com ([2a01:e0a:3c5:5fb1:8ba7:bfe4:fea9:65b]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-42cc1375189sm25076025e9.1.2024.09.10.09.33.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 09:33:05 -0700 (PDT) From: Jerome Brunet Date: Tue, 10 Sep 2024 18:32:47 +0200 Subject: [PATCH v5 5/9] reset: amlogic: use reset number instead of register count MIME-Version: 1.0 Message-Id: <20240910-meson-rst-aux-v5-5-60be62635d3e@baylibre.com> References: <20240910-meson-rst-aux-v5-0-60be62635d3e@baylibre.com> In-Reply-To: <20240910-meson-rst-aux-v5-0-60be62635d3e@baylibre.com> To: Philipp Zabel , Stephen Boyd , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Jiucheng Xu Cc: linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2112; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=iSedGQJkeoX1rk7eD0ZddgTbF2MZs7+12PeFSEIOANY=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBm4HS45Bs5y3vQPAmVRmGscavL+gV5EWCMzd7SC 9DniJBvY4OJAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCZuB0uAAKCRDm/A8cN/La hYidD/oDQlXMGcC2jMCZUcZhPtkNwrsiXGV3YnQzZ/hEtN6zIOn1pG2sP692fUaetlarc979okT 8FKOG19JZIkY3XWvjinkjjAA4r7zladAnmiUBjcIBURVH324hvQEzfvZfyM/rby29mHLZ2TYZt+ Ck8Xln43sdaOBg29bIzpPGbGFn/YrjYl9uBjpV7rFqzsb7y2mcsShZ/78n/oc1XemLRjEBO5gZM RrkCyKKjh9nDwUuP8yeAysbwIIpLDX0r4a9qjc0axe9ZWZb0Ikrw6B3sS9xsXN483JlZaCp0y2Z dT/OYZAV7R6uLFfwQztxV8kC7eKiEUQvoDKt+9TIGaJcY7DgGLC+YDW4cWEpkManE4NCyjUQQH+ 96R0YMhIiEqOK8fCbblAVxQucnVT5Ndtx0zB4SOnr1zlWrWboCVPVEdDJp9P/IyyKTddG/Y7egT GAvDOY3j5Y9phAbBuldCt/RlckHHXArWis5uvbDmS0UbqiYLDEUHLYDI7V13F+UOYOZ5xPDbK5y AVu2RffIF9oihE/UG6u1Hz7/mD5S3AolHvxIGeOMb9vqKW8RQbVwhdF8jZ7DKmU42JLOiZ3DlqN KhGydB/QWi59I0xvR53rUOvKYgVJMLt5n7W9smRox69akxsJwjy03hyqVZA+/ZL6zEXhl4lvm87 vN9FRnWbdwhxqWQ== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240910_093308_455578_AEE94A7A X-CRM114-Status: GOOD ( 13.92 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The reset driver from audio clock controller may register less reset than a register can hold. To avoid making any change while switching to auxiliary support, use the number of reset instead of the register count to define the bounds of the reset controller. Reviewed-by: Neil Armstrong Signed-off-by: Jerome Brunet --- drivers/reset/reset-meson.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/reset/reset-meson.c b/drivers/reset/reset-meson.c index 6a90613c8095..e31c1b7c9e4d 100644 --- a/drivers/reset/reset-meson.c +++ b/drivers/reset/reset-meson.c @@ -17,7 +17,7 @@ #include struct meson_reset_param { - unsigned int reg_count; + unsigned int reset_num; unsigned int reset_offset; unsigned int level_offset; bool level_low_reset; @@ -87,28 +87,28 @@ static const struct reset_control_ops meson_reset_ops = { }; static const struct meson_reset_param meson8b_param = { - .reg_count = 8, + .reset_num = 256, .reset_offset = 0x0, .level_offset = 0x7c, .level_low_reset = true, }; static const struct meson_reset_param meson_a1_param = { - .reg_count = 3, + .reset_num = 96, .reset_offset = 0x0, .level_offset = 0x40, .level_low_reset = true, }; static const struct meson_reset_param meson_s4_param = { - .reg_count = 6, + .reset_num = 192, .reset_offset = 0x0, .level_offset = 0x40, .level_low_reset = true, }; static const struct meson_reset_param t7_param = { - .reg_count = 7, + .reset_num = 224, .reset_offset = 0x0, .level_offset = 0x40, .level_low_reset = true, @@ -156,8 +156,7 @@ static int meson_reset_probe(struct platform_device *pdev) "can't init regmap mmio region\n"); data->rcdev.owner = THIS_MODULE; - data->rcdev.nr_resets = data->param->reg_count * BITS_PER_BYTE - * regmap_config.reg_stride; + data->rcdev.nr_resets = data->param->reset_num; data->rcdev.ops = &meson_reset_ops; data->rcdev.of_node = dev->of_node;