Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6860154rdb; Tue, 2 Jan 2024 16:51:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IEm489nxPtIsnopopC/QYyaVhDo0IsWWdH5szsI33pUQp+RutzlrP8zJavyrT07RdrJiMfV X-Received: by 2002:a05:6512:3d0a:b0:50e:757c:9628 with SMTP id d10-20020a0565123d0a00b0050e757c9628mr7669000lfv.77.1704243094739; Tue, 02 Jan 2024 16:51:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704243094; cv=none; d=google.com; s=arc-20160816; b=XiMP8B4z7DWUOkOiO2hrKhuM+nQv5z8AnCz1rE3HOVS07faZmzV1o5kvH5ZZARQCnp yA8mYdQLNiSq43gMrLpfOtis3V4o+l5XTgv4fvSw299Buov4pGLu3DqzkF5BfkP7kwED t1jfiLsd8NjTF7GlZYCHnZ7Un9bMQHLT65AnR7Ugzzrb+q9jBahI2hi16MTyel1sdTRj E0rhUenWYAvKOcfxo259Yf4wdTvvtozZBP1/yjrKN3CN07jkazw6FO1xxKBiLqjS2fwY HwLHwu2V26PgE2nNFBhlb/69Q420BUxAKbLvIUwDcmKUVfWFqjcfTwLOT4bpIBdYo5X9 M87Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:date:to:cc:from:subject:references:in-reply-to :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:dkim-signature; bh=qTgi2mL/qWUSdzTq7Jk2j3SyyOnbKCA4XnZYuMo2fk4=; fh=T6AUCZeFgkJwP4WBqp2J7aiCKc8yqVMiUcfYOOpwLzU=; b=G2v3/d2UuF+LMY5BMtN40X5WrdnO+5CwHrRjjmciK9DlDJ4GnywN142yaptWlVC/70 7F+yoWZEiTxehTHcx3djL6rUN2FLOF6KsWhA1HbTpPuOfHD7+3hKoRFVWEjyvGP3STYA whzyDl4CetCsHgFYHWNLT0Iy2+Xyx9a12MA5fd/CZbkybq1GY/skRgs8d5Ie7rImCNGQ y5wNSrJ1atYBq23VqH7aMhnTW/x7AMOeWbZtAkqcQVSNfX+22lzD+EAhSC4uX1KMQ+L0 MaBmJdgUvs1ai+J4WjzlFkI3AJEZqnSG0Sz3jB1euiKd3h6bVsXNaIKGufffsVZvWk3l HrJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WxVaI969; spf=pass (google.com: domain of linux-kernel+bounces-15008-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15008-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ge24-20020a170907909800b00a2343c54387si10305432ejb.380.2024.01.02.16.51.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 16:51:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15008-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WxVaI969; spf=pass (google.com: domain of linux-kernel+bounces-15008-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15008-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 731F81F224FC for ; Wed, 3 Jan 2024 00:51:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3391B7EB; Wed, 3 Jan 2024 00:51:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WxVaI969" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 675487F1; Wed, 3 Jan 2024 00:51:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C851DC433C8; Wed, 3 Jan 2024 00:51:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704243084; bh=LWs+wtOQwJE2KAvg5du9NptcRU9govH4f+98sicou70=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=WxVaI9694aQvo58unwJTq2noH7ZFX0/naboe8Y0fEDYRJ5cFrH5OcfVD5EugMdpVz cZjjygm2a49RIB7BSTOdyvCoUlxvvotFFLH7ZpVmu/Jo2zg3t6tlkVC1zSJeavIM2t l2T5YbZ3Qi2ONbciE753zohKOsDnfOrfgb8sXZfDiUg0tOpbbPQgopdIzSJYLaB1xH jGuCcV1U3eSPFoUvIK8KkKmYOWNsebz95wOPBhR5sJdBMOVN+HWbYptkdcLFTQyUnz bypp6ZsI+eEmAiPViaiCRYYi6r52hIC+XLWVdn5rwHlbna/pWGh7AJ0L5vS0KW5IRH uwk74UZBvwJzA== Message-ID: <616e957ebb9d6606ccfdccb822aa0c42.sboyd@kernel.org> Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20231103102533.69280-2-angelogioacchino.delregno@collabora.com> References: <20231103102533.69280-1-angelogioacchino.delregno@collabora.com> <20231103102533.69280-2-angelogioacchino.delregno@collabora.com> Subject: Re: [PATCH v3 1/3] clk: mediatek: clk-mux: Support custom parent indices for muxes From: Stephen Boyd Cc: mturquette@baylibre.com, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, wenst@chromium.org, msp@baylibre.com, amergnat@baylibre.com, yangyingliang@huawei.com, u.kleine-koenig@pengutronix.de, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com To: AngeloGioacchino Del Regno Date: Tue, 02 Jan 2024 16:51:22 -0800 User-Agent: alot/0.10 Quoting AngeloGioacchino Del Regno (2023-11-03 03:25:31) > Add support for customized parent indices for MediaTek muxes: this is > necessary for the case in which we want to exclude some clocks from > a mux's parent clocks list, where the exclusions are not from the > very bottom of the list but either in the middle or the beginning. >=20 > Example: > - MUX1 (all parents) > - parent1; idx=3D0 > - parent2; idx=3D1 > - parent3; idx=3D2 >=20 > - MUX1 (wanted parents) > - parent1; idx=3D0 > - parent3; idx=3D2 >=20 > To achieve that add a `parent_index` array pointer to struct mtk_mux, > then in .set_parent(), .get_parent() callbacks check if this array > was populated and eventually get the index from that. >=20 > Also, to avoid updating all clock drivers for all SoCs, rename the > "main" macro to __GATE_CLR_SET_UPD_FLAGS (so, `__` was added) and > add the new member to it; furthermore, GATE_CLK_SET_UPD_FLAGS has > been reintroduced as being fully compatible with the older version. >=20 > The new parent_index can be specified with the new `_INDEXED` > variants of the MUX_GATE_CLR_SET_UPD_xxxx macros. >=20 > Reviewed-by: Alexandre Mergnat > Reviewed-by: Chen-Yu Tsai > Signed-off-by: AngeloGioacchino Del Regno > --- Applied to clk-next