Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2944607lqp; Mon, 25 Mar 2024 14:02:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUExLyOcwvcCseBdPFkS6Fm+tGITol5qDCw6LuPn8WyubfuI8W/iQ/qU2idJVZYZXXAjtdrFeKSDhfTdbcV4QvnVphc3ZIkinS3NxU3OQ== X-Google-Smtp-Source: AGHT+IG3u9LnRGYRQyX3ARpiiqBiOHWDHztvO2IwdVnqNBSHFZ4fLTTfUcK1oTyw3xD1Kj2s3DX5 X-Received: by 2002:a05:6870:5b0d:b0:22a:5629:acd with SMTP id ds13-20020a0568705b0d00b0022a56290acdmr1502765oab.8.1711400531068; Mon, 25 Mar 2024 14:02:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711400531; cv=pass; d=google.com; s=arc-20160816; b=S6tI6nmYryy8pU/VG9+K21aahZX+BDoIlwu5MW7J3GrMQP/MjZFve+AvG2lpLTxMUJ sWAEQZe1PC4L6u74jxL3Cr+i38m2b8+R9Wh0xLRc0aSvQypex3a2oAdQFejwHzWQ7py0 V3warn3dQ1LITp/4vGFIOewQZQym6F/XTOZgyqBwtVQzKyodMKSgbRbq8HelMAYgK37P v0vtL7J0QPOdSwr2uB6P1ekCmM0fXPpMZuVmzjPWsyJhkyec4zTXTSQ96s7SZK8MySFi 4gSMKKvTvFXCeN58aXJ2AafnE1trPxXNuDlR8rzmUWq9JcVXl+ZK7R+QbwDEd0DRLyV4 7sqA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=dz3inoGjyJFeCMSc47IfUGvePH781nim4nd5ON8nu18=; fh=mWEa8kD57fMXkUdPHBEJD6cIWPe6iYGLhbK4K2UH3fw=; b=evDibQzOgO55IMt82Z3ey7iEdwAglCtNzPB8bf5BeIK3tuhq6A3OEpKdJD0IEjOpDY tbSHJH6YDMsJyYYARce71z5/I9LcLlk42kaFNNP03/ZBn1JvTnCIvq2vJyp6jMgPv0bO Tht9Z1HiDH28mZlgaHFkw2l/PcXSUQcPnuYbreqWPYOLU52+/hO2NHkP8yXrkvW6DKak ClKqeH0Kemi9pdMitKl1h9t88DhauAckrZ2T8ps0r2Oqd4UHOUlew6C1mE4BGS+q32Dc 17hEpR0M0AKf7JReNe4PjXVZYO2N7GD1wAjKjBVhKoNF08XsPl48CjD2QipxNYxciTV3 OeyQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-118003-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118003-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h2-20020a625302000000b006e69296296fsi5917735pfb.400.2024.03.25.14.02.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 14:02:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118003-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-118003-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118003-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B76032E1ED9 for ; Mon, 25 Mar 2024 21:02:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6B99470CB4; Mon, 25 Mar 2024 21:01:00 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 919916F085; Mon, 25 Mar 2024 21:00:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711400459; cv=none; b=nAeoFjgG8YSl62mWnv+vZ4gReJUyHQ0S+Tt2rrhGLXp0CD+yXmgToTtLee2E6sUSNWmyxgr8aQKSVeS5WC9MD3yqtg6bmJmGF9H/SteVkqVDB1HFyDRlhjDP0fIcuHSbo1IRIJkWycpbmJiarqPcl/nZC3Z675b0wiQLmZh6eTI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711400459; c=relaxed/simple; bh=4SiRoeD6bB8DFgQrOsAZsx4BXqwPKBOWJLo8r/Mu7Y4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nPBifP2YAf9JHdn9gPNEL1PizsC7n8prGpvG/kyJNi48j6jlZ1cFsyE1yZ5aAV15FRqY/e+vx41eQ1FH6BY74V5feXAMU2WDd0neMMoMrmiom55pwCHfMHXdFzBcYdPj/RbeZaBmixz+DXoTaQs7NSfWcvzc98pgiqCkVeddP/E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9D8D21595; Mon, 25 Mar 2024 14:01:31 -0700 (PDT) Received: from pluto.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 003D53F694; Mon, 25 Mar 2024 14:00:55 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org Cc: sudeep.holla@arm.com, james.quinlan@broadcom.com, f.fainelli@gmail.com, vincent.guittot@linaro.org, peng.fan@oss.nxp.com, michal.simek@amd.com, quic_sibis@quicinc.com, quic_nkela@quicinc.com, souvik.chakravarty@arm.com, mturquette@baylibre.com, sboyd@kernel.org, Cristian Marussi Subject: [PATCH v2 4/5] clk: scmi: Add support for re-parenting restricted clocks Date: Mon, 25 Mar 2024 21:00:24 +0000 Message-ID: <20240325210025.1448717-5-cristian.marussi@arm.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240325210025.1448717-1-cristian.marussi@arm.com> References: <20240325210025.1448717-1-cristian.marussi@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Some exposed SCMI Clocks could be marked as non-supporting re-parenting changes. Configure a clk_ops descriptor which does not provide the re-parenting callbacks for such clocks when registering with CLK framework. CC: Michael Turquette CC: Stephen Boyd CC: linux-clk@vger.kernel.org Signed-off-by: Cristian Marussi --- drivers/clk/clk-scmi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c index d20dcc60f9d1..87e968b6c095 100644 --- a/drivers/clk/clk-scmi.c +++ b/drivers/clk/clk-scmi.c @@ -20,6 +20,7 @@ enum scmi_clk_feats { SCMI_CLK_ATOMIC_SUPPORTED, SCMI_CLK_STATE_CTRL_FORBIDDEN, SCMI_CLK_RATE_CTRL_FORBIDDEN, + SCMI_CLK_PARENT_CTRL_FORBIDDEN, SCMI_CLK_MAX_FEATS }; @@ -254,7 +255,8 @@ scmi_clk_ops_alloc(struct device *dev, unsigned long feats_key) /* Parent ops */ ops->get_parent = scmi_clk_get_parent; - ops->set_parent = scmi_clk_set_parent; + if (!(feats_key & BIT(SCMI_CLK_PARENT_CTRL_FORBIDDEN))) + ops->set_parent = scmi_clk_set_parent; return ops; } @@ -301,6 +303,9 @@ scmi_clk_ops_select(struct scmi_clk *sclk, bool atomic_capable, if (ci->rate_ctrl_forbidden) feats_key |= BIT(SCMI_CLK_RATE_CTRL_FORBIDDEN); + if (ci->parent_ctrl_forbidden) + feats_key |= BIT(SCMI_CLK_PARENT_CTRL_FORBIDDEN); + /* Lookup previously allocated ops */ ops = clk_ops_db[feats_key]; if (!ops) { -- 2.44.0