From patchwork Tue Mar 26 17:28:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13604764 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 3746BC54E67 for ; Tue, 26 Mar 2024 17:28:51 +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=Kmd4Vls3CcE08AcgaOIDddsnu5BsWUhxgC0gLdJrAMw=; b=p5bflazf2e848T i88gMke0GpHy3iUFaJcsEiSW0277myS5Dk5xvZC4eUX85Q9JI60guGOXKE5Xn0Pi29QwfjwhzV3gA o3Erk/CjLoPT5h1dTU0BJJHizxVKgYYGz9IBhK64Xl0ixXe5Zp5cstOuF2yzMb+uU3ZMu6WDAmVFH +wAWgzyLiRkY1v68ERQiIlwVib0zVNs/hactSNOtIHkfcHBtX4ViH2CAD2StCL+SSfJ1PcqA65tnQ GfoPM2LTwR/CDRXNQAewCxpc6ktAmdseOTu9igKjLS3itx0azOIrmietOpb/jIZqIraHE7RdIktwP T1gbY0xMBns3Ho70OKHw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpAbA-00000005jBQ-1rRU; Tue, 26 Mar 2024 17:28:32 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpAb1-00000005j56-0YGg for linux-arm-kernel@lists.infradead.org; Tue, 26 Mar 2024 17:28:26 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-41491106419so2711115e9.2 for ; Tue, 26 Mar 2024 10:28:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711474101; x=1712078901; 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=n7lIFUT2uGkcduxNxLmUjJPBnfs9b4J3U1Pfn7bN2fY=; b=CUNPxH4Z/nLggKit0jXp5YM7l+bnxuyCvhnjbkuzBIkw99LPhYCkOdWOFPmaQXwKkH wR2bvP0NbelX4bc9daX+LSM4xvuv3EJezx9bcp3rcuVM6SK+2CFWXHPqQzJROyOnnsem p1+HxcoZQLaak8uLY2+GG4zLOpuQo2QTfVEvPmsej2hV7zV0oA4hNV/TQ5hxmPlI07Od 0gCkxP/RKdyrQUCK2QnPvoQ/R5qSbAj/HxEOn+eAyiLeaXn09p+o00BuwuARgxjALk05 xsrxn4nUzKOSw5NzhshB8rZwBk4okYkTFMxocW8Nn6mHQefU02jJiobAlC0DrsJcRyWs b8Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711474101; x=1712078901; 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=n7lIFUT2uGkcduxNxLmUjJPBnfs9b4J3U1Pfn7bN2fY=; b=nL5pXYoyeI0bEikxRzQ0C0YeWOgPsJL3oEqP6ymj90mBJsAV0hQny1ZIqNg7PteEyA bYaPBba7dckOB46+LCT34cMzfHvDSgelpyFs3mp2dpRHJoHD1tiCT3g8YUUSSWCAAFok CKj8eCxG/KoHj0Z4VLRcTDzMsX8YHOA6WpwBWlaW8VDOvPdlf6Vp8kZU/DauUjUjWLfA WqWauMSrLZFGYi+am5QaBNG3txceIDZUeifshSVeLqmet3OszUHfNpoELI32WNH8Ggix u6xQ/5scan1jMo+BIjUqJOGLHN+4gO8F7NYYKrYAgUcSJ3M9qFuT3OCKCFkm/V5KHJ/S AkZA== X-Forwarded-Encrypted: i=1; AJvYcCWiDqQOg7Y1lDLJbjbn+kGkZgG0GUpqMtZPAExmcK+n7GPUmhoewIm/Y57GPzRyf5WjrQMYkqPEM+S7JNukLqqhZsGmxDVsCCGgtULQBC7KHG8uLoc= X-Gm-Message-State: AOJu0YxO5FuMJHOS46qrA106BUejrzR+aPwj+Gx/Hedc1ap8eppqtwkO 66M6PO22u3VdQBoH2IML2datONF5mdm/SA0xRBC+3CfzNBYx7JRRKENjCD5KgCQ= X-Google-Smtp-Source: AGHT+IFXanQRS29xAVVCXFYCQE7Xeg9LKVBsEdMS/yyZP4E3p09uw5Uk19K2dwta7QRhedGmdYWogg== X-Received: by 2002:a05:600c:1c04:b0:413:2c4b:35d1 with SMTP id j4-20020a05600c1c0400b004132c4b35d1mr8100793wms.31.1711474100371; Tue, 26 Mar 2024 10:28:20 -0700 (PDT) Received: from ta2.c.googlers.com.com (158.100.79.34.bc.googleusercontent.com. [34.79.100.158]) by smtp.gmail.com with ESMTPSA id fl12-20020a05600c0b8c00b004148f9c5822sm2063281wmb.22.2024.03.26.10.28.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 10:28:20 -0700 (PDT) From: Tudor Ambarus To: peter.griffin@linaro.org, krzysztof.kozlowski@linaro.org Cc: alim.akhtar@samsung.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, andre.draszik@linaro.org, willmcvicker@google.com, kernel-team@android.com, s.nawrocki@samsung.com, cw00.choi@samsung.com, mturquette@baylibre.com, sboyd@kernel.org, semen.protsenko@linaro.org, linux-clk@vger.kernel.org, jaewon02.kim@samsung.com, Tudor Ambarus Subject: [PATCH v2 1/3] clk: samsung: introduce nMUX for MUX clks that can reparented Date: Tue, 26 Mar 2024 17:28:11 +0000 Message-ID: <20240326172813.801470-2-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.44.0.396.g6e790dbe36-goog In-Reply-To: <20240326172813.801470-1-tudor.ambarus@linaro.org> References: <20240326172813.801470-1-tudor.ambarus@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240326_102823_459275_CBFB7A9C X-CRM114-Status: GOOD ( 11.43 ) 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 All samsung MUX clocks that are defined with MUX() set the CLK_SET_RATE_NO_REPARENT flag in __MUX(), which prevents MUXes to be reparented during clk_set_rate(). Introduce nMUX() for MUX clocks that can be reparented. One user of nMUX() will be GS101. GS101 defines MUX clocks that are dedicated for each instance of an IP (see MUX USI). The reparenting of these MUX clocks will not affect other instances of the same IP or different IPs altogether. Signed-off-by: Tudor Ambarus --- drivers/clk/samsung/clk.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/clk/samsung/clk.h b/drivers/clk/samsung/clk.h index a70bd7cce39f..01f58b7686db 100644 --- a/drivers/clk/samsung/clk.h +++ b/drivers/clk/samsung/clk.h @@ -146,6 +146,26 @@ struct samsung_mux_clock { #define MUX_F(_id, cname, pnames, o, s, w, f, mf) \ __MUX(_id, cname, pnames, o, s, w, f, mf) +/* Used by MUX clocks where reparenting is allowed. */ +#define __nMUX(_id, cname, pnames, o, s, w, f, mf) \ + { \ + .id = _id, \ + .name = cname, \ + .parent_names = pnames, \ + .num_parents = ARRAY_SIZE(pnames), \ + .flags = f, \ + .offset = o, \ + .shift = s, \ + .width = w, \ + .mux_flags = mf, \ + } + +#define nMUX(_id, cname, pnames, o, s, w) \ + __nMUX(_id, cname, pnames, o, s, w, 0, 0) + +#define nMUX_F(_id, cname, pnames, o, s, w, f, mf) \ + __nMUX(_id, cname, pnames, o, s, w, f, mf) + /** * struct samsung_div_clock - information about div clock * @id: platform specific id of the clock