From patchwork Thu Feb 29 12:20:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13577057 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 D6499C54798 for ; Thu, 29 Feb 2024 12:20:45 +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=VU+F45wmB4ITBW4f+yfyBqDFG57lC5UOC59SplPNIN4=; b=HKKDgC0yRBKcNE Oul5DoNyNHmm5qHsiMh+f9m4B2i11+UwErZiUBPFhnx0HrXopK26ZVPuMokED9xBDQDQQ70Qd9AXC 5pGt3BRUvjU/NT/JpWax6n2ioi/Z7Gjb5wg+oBqAXr92WdjcClcHiF8qrHuA33PwVUG8mGD5q1ODw jAujcLKrtneBTthLg8pmEEHmmG8xAZ5AXfOw08kor0fjw+OSrofiucVTOJMXk539uVr6u0VNoB8/6 T9xHIphz16NUE63WXkyiEjrv663fejGeT3R7eyNVPxYidYLzhmU+ASQn2kt7IL1rCUriwyfNpHx15 0FjbZagOX70MYuJiqrHw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rffOq-0000000DTxi-352P; Thu, 29 Feb 2024 12:20:32 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rffOm-0000000DTvp-3Jlc for linux-arm-kernel@lists.infradead.org; Thu, 29 Feb 2024 12:20:30 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-412b434effaso5667235e9.2 for ; Thu, 29 Feb 2024 04:20:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709209226; x=1709814026; 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=W4M9b5DpBPobgh8Mhjoui4tnMINgMrMyk8rX4fi/AOw=; b=g8quDheX3cLYCnY0SSUvO4J04yK4sGMt1dR+9NybGODTn76CITWDw22q4EUcXEW++V m6FBa7qXsp2RLkpnH3KhKxOz+wdnXoD0/gjqQcsloWdon/Se4JvSnN53mW8+Awvh7n1R b35RzvhSIaSPPuoYq1SOkyCrHwgkaK/pAoAQSYqAsHkwn+QKaOM/TT0TUvHw3V7XeSoL DtIfAiz9mIRIk4ZdIzmCy7878GE196VSOInk3EXrQVCY8mU+7pKZjjMBj7zEIAeNhQgT WYNlcH7uLrJBriZWmK1TrsK7tpb+X5KfrwAqhp0VMmzJBy0XUGvEpyb9mydI+YWldM5V JL+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709209226; x=1709814026; 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=W4M9b5DpBPobgh8Mhjoui4tnMINgMrMyk8rX4fi/AOw=; b=OrUuHQB4m0wsZYUXMK2U/SxBK6f7AkTHZFSLewgFdnZ60C6kWgSPuhgDGPCiUjfr9w EmUQan9+zYgGTYSsZorLYHzNeJz//Veb1GXlR9Sdy31leBuGp72/GX1E42O+r/rvRN9V qyZySzzp4MKceMCvYjWgyt9iabOSTw/LaLVUPic1l/yeGVXuhn0dl1yKg4bwiKhlYrty UcSHUMF19U7Xn5BnK1pNljhmZvC/uHEJPeUfJyajr5RSMoz1qemjJRYnm6p9UeNS9pNu rGsvcfAfmDwj09joUKKIpzrjajTj/UO7pjfXeFNz1XYYJ2WjZMhKy3z3nAqirv3v/do/ dP/A== X-Forwarded-Encrypted: i=1; AJvYcCWDc19lOzKXr8JwRhhd2HU1KTNuCkw8cWX4q+ggyc3AyZJu8rhkklSHDeBVg+pyD1a3F93hWcN60XvuNxo1B0b704WHfuS0ggW0M3Lg2btR8pNsRQA= X-Gm-Message-State: AOJu0Yxwoin6iR32Q9LXYVfuzTT0wIXAvIH3PkHqN28l532u+RPgccbe pjcA1cmZROJHCofzi7h8SKzbclpP3ev6JJiCGgnU4zeQeGFolaFzRxTLFvr0fhM= X-Google-Smtp-Source: AGHT+IGAJkhlBfG2CKT06QC7y4mjYnfFUhJwTLNBtPVcIKi9pc7xcY/jG0JFUbXbt+Xke0czdy+XHA== X-Received: by 2002:a05:600c:4e41:b0:412:b53f:99e4 with SMTP id e1-20020a05600c4e4100b00412b53f99e4mr1373760wmq.40.1709209225925; Thu, 29 Feb 2024 04:20:25 -0800 (PST) Received: from ta2.c.googlers.com.com (110.121.148.146.bc.googleusercontent.com. [146.148.121.110]) by smtp.gmail.com with ESMTPSA id dx14-20020a05600c63ce00b004129f28e2cdsm5009121wmb.3.2024.02.29.04.20.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 04:20:24 -0800 (PST) From: Tudor Ambarus To: krzysztof.kozlowski@linaro.org, s.nawrocki@samsung.com, cw00.choi@samsung.com, semen.protsenko@linaro.org Cc: alim.akhtar@samsung.com, mturquette@baylibre.com, sboyd@kernel.org, peter.griffin@linaro.org, andre.draszik@linaro.org, linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, willmcvicker@google.com, kernel-team@android.com, Tudor Ambarus Subject: [PATCH 1/4] clk: samsung: introduce nMUX for MUX clks that can reparented Date: Thu, 29 Feb 2024 12:20:18 +0000 Message-ID: <20240229122021.1901785-2-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog In-Reply-To: <20240229122021.1901785-1-tudor.ambarus@linaro.org> References: <20240229122021.1901785-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-20240229_042028_869466_6289970B X-CRM114-Status: GOOD ( 11.18 ) 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. GS101 SoC will use nMUX as there are MUX clocks which are dedicated per IP, thus reparenting the MUX will not affect other IPs. Exynos850 can use it too. 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 a763309e6f12..75e2fa8d7da9 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