From mboxrd@z Thu Jan 1 00:00:00 1970 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 8F7B4C43334 for ; Thu, 16 Jun 2022 01:54:09 +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:Message-Id:Date:To:Cc:From: Subject:References:In-Reply-To:Content-Transfer-Encoding:MIME-Version: Content-Type:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=t4F8zle1QasTt6jTe8ejdkJSkeSTOn7v/nnJQxSxHeU=; b=RYmdPdq5BmiRQlKyEue9m0ICCW keZRitL/uiB2WOsRGcISONsj9bxhfphporVakDPyHJIDdP+qnD1w81WUVdjYc1DCArKqrdSV+W/Ez 7w7YcWBPo9WXTnLVPoRIdhCQZBlKEeXpCsyNbRvKXDE4VOp4OAKoxGvKdJYeRw1UXq1U/LOrsuacG SiArBg2SaGBd0qhMd2Sc8Pg4sQHUojOwbiJT5QFYGE7bRKaV9Lq1FjVYqjsGUbfTFhXNHwfE+UTfm 3VE7rDHUBzoeIaKwF/BFzcJf6M/W/5n/Ja7qEff0AdDnN6yDMwIJm0soXTuxTf69jTlxm3qGQ5bz5 HlBglp2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1ehw-00HTl6-Fm; Thu, 16 Jun 2022 01:54:04 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1efz-00HSfJ-Bp; Thu, 16 Jun 2022 01:52:04 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7BD9861D08; Thu, 16 Jun 2022 01:52:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D848C3411A; Thu, 16 Jun 2022 01:52:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655344321; bh=ZQlXfWBwZAIW0M0J/Ta2fa4yf9T1gSiqLgOx2grAz5o=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=YAp1KkJmSKaUZOIEvme9BA/aSAJknRdJKEeYLm3Rm/0qsS4dz8OA3s3VxVfvi5rta jfchTVu/QjmG2Gm56h3pw1LsaL86NzySYW98iuy429HMv/IT4ppzfg3icoWjkQl/tS rnjmQl634ql39EoMFIwWAnu7s5lL/mc9ZocP2jexk1VAs4A1Fw57UyVX+rfzX0a4sE Pgouatq20eiKsWvb2+MC26JBI1XBKQDp96852ukkGiyGmVAPPzJXH7JHibr2vwcuRx a/nF3CMpz3+dHMIf4sg1G6bw6WP2V/Lsj9n/17w0m73UyBXTg0EGeI+ViqCF1CD7UM YBAatEb9mdGDg== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20220523093346.28493-9-rex-bc.chen@mediatek.com> References: <20220523093346.28493-1-rex-bc.chen@mediatek.com> <20220523093346.28493-9-rex-bc.chen@mediatek.com> Subject: Re: [RESEND v8 08/19] clk: mediatek: reset: Support inuput argument index mode From: Stephen Boyd Cc: p.zabel@pengutronix.de, angelogioacchino.delregno@collabora.com, nfraprado@collabora.com, chun-jie.chen@mediatek.com, wenst@chromium.org, runyang.chen@mediatek.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Project_Global_Chrome_Upstream_Group@mediatek.com, Rex-BC Chen To: Rex-BC Chen , krzysztof.kozlowski+dt@linaro.org, matthias.bgg@gmail.com, mturquette@baylibre.com, robh+dt@kernel.org Date: Wed, 15 Jun 2022 18:51:59 -0700 User-Agent: alot/0.10 Message-Id: <20220616015201.6D848C3411A@smtp.kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220615_185203_542267_443599B2 X-CRM114-Status: GOOD ( 13.49 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Quoting Rex-BC Chen (2022-05-23 02:33:35) > There is a large number of mediatek infra reset bits, but we do not use > all of them. In addition, the proper input argement of reset controller > soulde be index. > Therefore, to be compatible with previous drivers and usage, we add > description variables to store the ids which can mapping to index. >=20 > To use this mode, we need to put the id in rst_idx_map to map from > index to ids. For example, if we want to input index 1 (this index > is used to set bank 1 bit 14) for svs, we need to declare the reset > controller like this: >=20 > In drivers: > static u16 rst_ofs[] =3D { > 0x120, 0x130, 0x140, 0x150, 0x730, > }; >=20 > static u16 rst_idx_map[] =3D { > 0 * 32 + 0, > 1 * 32 + 14, > .... > }; >=20 > static const struct mtk_clk_rst_desc clk_rst_desc =3D { > .version =3D MTK_RST_SET_CLR, > .rst_bank_ofs =3D rst_ofs, > .rst_bank_nr =3D ARRAY_SIZE(rst_ofs), > .rst_idx_map =3D rst_idx_map, > .rst_idx_map_nr =3D ARRAY_SIZE(rst_idx_map), > }; >=20 > In dts: > svs: { > ... > resets =3D <&infra 1>; > ... > }; >=20 > Signed-off-by: Rex-BC Chen > Reviewed-by: AngeloGioacchino Del Regno > Reviewed-by: N=C3=ADcolas F. R. A. Prado > Tested-by: N=C3=ADcolas F. R. A. Prado > --- Applied to clk-next