Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp93619rdh; Wed, 22 Nov 2023 20:04:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IEuxF6WAjFpXTUHItg58avy8/zILuV5Fc7J2leJ4SL0AGyVqrYXhqE4qniQGYPHeqTV5a33 X-Received: by 2002:a05:6808:11ce:b0:3b5:6604:a8ba with SMTP id p14-20020a05680811ce00b003b56604a8bamr5869989oiv.36.1700712285845; Wed, 22 Nov 2023 20:04:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700712285; cv=none; d=google.com; s=arc-20160816; b=XzAS2NMvdCJyl68qL/MtIA9Ogto450HPlPWUDy9E2V8OneSyO/jfzs0+9GSqBYH2Du EamRicy3kSDKtHYWZcIMuXN+5HcJ1ygP2ptokMnDEect15Uw1kU+P9GHKVvMqxB3AMj5 E60omonzFSOfSydT7XUdoBB2keLB8/KIEV+f04LxMkADDZJB6nkisuvjL/BVcrRsH+xi H7HL9RKKpaKv+n4Qs1gX1TqLtaD7vNtMK963Od2V7Eexmxba7+sSLjSGxDsVFnw5POSt STACOjipUKZF0f24P11cTGlfpmaUj10UcmaqVM++wTNWmJ+lF2QGtz27i6tBITUUTNRo pSug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=T7qPw5ycerKBMB3jFyF+3AvRZw5Lq7E7FvIBMNy6g4I=; fh=Eyp5Opbel7Qm1PsWR+D6bCeI+uGBCu7wJJ6zJCqIHLk=; b=XBYxKKDEAQjh7YVDlASNoKJ85i6J7oukpajhdvzAb/C4XdqvDKWLiUKjR8s33ydYUz gVStShw3ArB71yjZ8hH1CI3nywxS3SVnnp7sYPTzMZoWUaWu36e4VkwDBhjdNEdN8u1p lVFjiGEeksloNI5WW1ARcpvAPiNH0naXbAQfvhGJ0zAQjfmNgqYlVuePw5x8KLsQX/wJ AlexsANezMJBBXGOYFu/v3zABvAqGZxd1mFhiA+GYzAbWQUDsNVi57KmARn+ZaHmSUTR StPs27b1rDdLKYWBkiT3ogx9dxuGvbjviIV2AVDKy0Q2GKEoqtLaZ/f/CrtKl1tHBhzu rHng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NjXH3vNJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id v4-20020a056a00148400b006c9bf737482si451795pfu.295.2023.11.22.20.04.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 20:04:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NjXH3vNJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 8057C81EE2F3; Wed, 22 Nov 2023 20:04:40 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344573AbjKWEEJ (ORCPT + 99 others); Wed, 22 Nov 2023 23:04:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232840AbjKWEDw (ORCPT ); Wed, 22 Nov 2023 23:03:52 -0500 Received: from mail-vk1-xa31.google.com (mail-vk1-xa31.google.com [IPv6:2607:f8b0:4864:20::a31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 826381B6 for ; Wed, 22 Nov 2023 20:03:57 -0800 (PST) Received: by mail-vk1-xa31.google.com with SMTP id 71dfb90a1353d-4aff11732bdso160299e0c.1 for ; Wed, 22 Nov 2023 20:03:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1700712236; x=1701317036; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=T7qPw5ycerKBMB3jFyF+3AvRZw5Lq7E7FvIBMNy6g4I=; b=NjXH3vNJvAyIh5pb2bYXB3BqaOyWf/2Oj2LEA+5dgRbG4BNHs5QBlLa8rVwJXnwbNQ vqaCZwAm5tytuM/BQ5al10sASm7UjBsu3a3/95LH5jNXM/zyMxPsMxQeWu6vm3MGf1Uy d7WiHAfLC6v4bnwAvhFvCLLw3rrHc9ukJy23w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700712236; x=1701317036; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T7qPw5ycerKBMB3jFyF+3AvRZw5Lq7E7FvIBMNy6g4I=; b=Sm560zyjzWK3ZQB9FVui2FkQamC4rZ6WfaDofvLkl5ejzs+iJdwxEIfw+C3Mp8xcBE 7q2ssCp95WyEOYHaNzejJBsuMpKVE3uXNu1Bt5PyDiLdZGeQ8wEJiz0bV2Tfh5ir48YD FvuOQNcilfLX3HqM0ykZXexfnrd/3nUx1aPLNnQUApl79+KGzRK1qG0HIgltqAh+M7MX 9vhGZDEUUemDwe1uM4mhEBVAoLRHiBBdrKTRZd0hOyJdvCfBANbvOw/AUWz3pBVJkTPp 3nBzUg1YX1fdtCIB+mMBTy8miM1q/p6haW/lE/4eL8pL+Pfgl8QA4alFNg5ovqTOkfBF ynHw== X-Gm-Message-State: AOJu0YzJCDtppLHbe2oNbwGMzvb77K8yPqKRt0NycH1sbp530+P4Rulh cARj8JBSZF+QxNUeFfk6UPBXRxRcHUgZkgPSZCePZw== X-Received: by 2002:a1f:e784:0:b0:4ac:9a8:2f29 with SMTP id e126-20020a1fe784000000b004ac09a82f29mr4770504vkh.12.1700712236519; Wed, 22 Nov 2023 20:03:56 -0800 (PST) Received: from mail-ua1-f50.google.com (mail-ua1-f50.google.com. [209.85.222.50]) by smtp.gmail.com with ESMTPSA id s45-20020a9f3670000000b007bb3e53712esm82402uad.36.2023.11.22.20.03.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Nov 2023 20:03:54 -0800 (PST) Received: by mail-ua1-f50.google.com with SMTP id a1e0cc1a2514c-7ba962d534eso144787241.3 for ; Wed, 22 Nov 2023 20:03:54 -0800 (PST) X-Received: by 2002:a67:c088:0:b0:45f:8b65:28f0 with SMTP id x8-20020a67c088000000b0045f8b6528f0mr4023922vsi.12.1700712233600; Wed, 22 Nov 2023 20:03:53 -0800 (PST) MIME-Version: 1.0 References: <20231103102533.69280-1-angelogioacchino.delregno@collabora.com> <20231103102533.69280-2-angelogioacchino.delregno@collabora.com> In-Reply-To: <20231103102533.69280-2-angelogioacchino.delregno@collabora.com> From: Fei Shao Date: Thu, 23 Nov 2023 12:03:16 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 1/3] clk: mediatek: clk-mux: Support custom parent indices for muxes To: AngeloGioacchino Del Regno Cc: sboyd@kernel.org, mturquette@baylibre.com, matthias.bgg@gmail.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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 22 Nov 2023 20:04:40 -0800 (PST) On Fri, Nov 3, 2023 at 6:25=E2=80=AFPM AngeloGioacchino Del Regno wrote: > > 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. > > Example: > - MUX1 (all parents) > - parent1; idx=3D0 > - parent2; idx=3D1 > - parent3; idx=3D2 > > - MUX1 (wanted parents) > - parent1; idx=3D0 > - parent3; idx=3D2 > > 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. > > 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. > > The new parent_index can be specified with the new `_INDEXED` > variants of the MUX_GATE_CLR_SET_UPD_xxxx macros. > > Reviewed-by: Alexandre Mergnat > Reviewed-by: Chen-Yu Tsai > Signed-off-by: AngeloGioacchino Del Regno Tested on MT8188 with a Type-C -> DP adapter to an extended display Gigabyte M32U. The DP output reacts smoothly to resolution switch and refresh rate change, and the internal eDP output also never freezes. Reviewed-by: Fei Shao Tested-by: Fei Shao