Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2158260rwb; Mon, 7 Nov 2022 09:49:16 -0800 (PST) X-Google-Smtp-Source: AMsMyM67IevAGd8E1LkN+Ms4S9uWI/D1Vnj/q7EVh4SEbrirwAUgmtQTMHjFA79sS7autxyGgIJ5 X-Received: by 2002:a17:90a:8a16:b0:213:bc0c:74cd with SMTP id w22-20020a17090a8a1600b00213bc0c74cdmr47133090pjn.28.1667843355877; Mon, 07 Nov 2022 09:49:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667843355; cv=none; d=google.com; s=arc-20160816; b=DdOKF73Un8zaKI/+nKkjmra5VXVfnew9wk49EyPej38l48+USi9xgN6bWOYCj4Ldtc 7UL0c4Fs391M983KgmsRF77IBVkFbJx4x+M8azCZ6cTMRIlKfJvVVcepwt/uRkbzHVGZ mvxAxPWLxEWfuizCh+h0N8lbqfm1n5YqYaRai9CeTehcgmhffXgzK0oCqlXK0Ae5hIzP Xz2OgC3sN5iT2RWJaWdBv7qNtkZMmcebn1sw9pU0+jbY6daJmKCA4LVPhyEggsV8EbIO 8ubLbvWqcXH3uKM7kGqCu7I8pedjeCHPPUy5gEKerzv9J85wC1b0PStU/NYVmxg2KpQu zWzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=p+eCEeThla+b4uTuciPDMRP8spV9/PJTDahapO0VQiA=; b=RCcggx6bdr57LYwiFetFtBHhZleBVkh40ZSEHgNCMc2mJ3QW99dCGXBjC3uSK4TgCj YVkhtsJFsKmqQkQG02S6FxmhjnJoWSadeHQCTNVhzvrhEr9nEd4BpCDD91f+APmsn6Jz /fyMe3OebFgl5muKiV8NIQ53JujxP2YFQHUES6oVA2IsjPLhx2NPRd4Dbm1Etab+icyF IlMdvBcRHzPuLbUJ1uetObJjksCsb5B6m80m4aQx0a8bRTq2qhRyuZU82g9AEMiY/JpR 3j36LD2vSiNPaAE3fDa2mchs6H5FAVyQPrlngeO03S796uvlivSX1R2YpVUAxjm55NM3 mZTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dWdJgtWF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lw14-20020a17090b180e00b0020d887ded6esi11941135pjb.120.2022.11.07.09.49.03; Mon, 07 Nov 2022 09:49:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dWdJgtWF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232495AbiKGRco (ORCPT + 93 others); Mon, 7 Nov 2022 12:32:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231974AbiKGRcm (ORCPT ); Mon, 7 Nov 2022 12:32:42 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6622B20BE0; Mon, 7 Nov 2022 09:32:41 -0800 (PST) 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 01383611E6; Mon, 7 Nov 2022 17:32:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FB79C433D6; Mon, 7 Nov 2022 17:32:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667842360; bh=/3vHnyI/NFM87j4khRS7iy63kuMqTNYgGJWlOGjO70M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dWdJgtWFFoNViSs2nnifF4/6516vsYT/nm+j7zSHE1kypGk6qUkoNdAPW6u69a43/ V1QzAk5vzuKko5bVVfvSXw33ztBmss+Rg6yoH2tT0jG2tAQLSa8Fy0mBk8FmzT6dYD sVNZnwm9W4ledoX9ADTBFi3QHDvGBWkLdwWhncACLg2W77pGb5G9sqQlE1DeY0T8Z0 CXooTNUy8o18xcINj162/zwP2qxLaxbzoU9ZMZ1XYwUvdIYrF28bGPxqcg86qksA1x UekNO/swFKXD0Dxa5RB9NxLbEe2QuBy8GBL81uLWbOr5L7lsFC2t7yJMR3i+Ph2sPl 8RfD7rB0UPfCg== Date: Mon, 7 Nov 2022 11:32:37 -0600 From: Bjorn Andersson To: Melody Olvera Cc: Andy Gross , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Thomas Gleixner , Marc Zyngier , Taniya Das , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 3/5] clk: qcom: Add QDU1000 and QRU1000 GCC support Message-ID: <20221107173237.xkeigtihoes3vsux@builder.lan> References: <20221026190441.4002212-1-quic_molvera@quicinc.com> <20221026190441.4002212-4-quic_molvera@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221026190441.4002212-4-quic_molvera@quicinc.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 26, 2022 at 12:04:39PM -0700, Melody Olvera wrote: > diff --git a/drivers/clk/qcom/gcc-qdu1000.c b/drivers/clk/qcom/gcc-qdu1000.c > new file mode 100644 > index 000000000000..7bd8ebf0ddb5 > --- /dev/null > +++ b/drivers/clk/qcom/gcc-qdu1000.c > @@ -0,0 +1,2645 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved. > + */ > + > +#include > +#include > +#include > +#include > + > +#include > + > +#include "clk-alpha-pll.h" > +#include "clk-branch.h" > +#include "clk-rcg.h" > +#include "clk-regmap.h" > +#include "clk-regmap-divider.h" > +#include "clk-regmap-mux.h" > +#include "clk-regmap-phy-mux.h" > +#include "reset.h" > + > +enum { > + P_BI_TCXO, > + P_GCC_GPLL0_OUT_EVEN, > + P_GCC_GPLL0_OUT_MAIN, > + P_GCC_GPLL1_OUT_MAIN, > + P_GCC_GPLL2_OUT_MAIN, > + P_GCC_GPLL3_OUT_MAIN, > + P_GCC_GPLL4_OUT_MAIN, > + P_GCC_GPLL5_OUT_MAIN, > + P_GCC_GPLL6_OUT_MAIN, > + P_GCC_GPLL7_OUT_MAIN, > + P_GCC_GPLL8_OUT_MAIN, > + P_PCIE_0_PHY_AUX_CLK, > + P_PCIE_0_PIPE_CLK, > + P_SLEEP_CLK, > + P_USB3_PHY_WRAPPER_GCC_USB30_PIPE_CLK, > +}; [..] > +static const struct clk_parent_data gcc_parent_data_1[] = { > + { .index = P_BI_TCXO }, > + { .hw = &gcc_gpll0.clkr.hw }, > + { .index = P_SLEEP_CLK }, .index here refers to the index in the clocks property in DT. I think it's okay to reuse the parent-enum, but the entries within must then match the order defined in the DT binding. So you need to ensure that the first N entires in the enum matches the binding. Perhaps it's cleaner to just carry a separate enum for the clocks order, as we've done in the other drivers? If nothing else it makes it clear that one number space is arbitrary and internal to the driver and the other is ABI. > + { .hw = &gcc_gpll0_out_even.clkr.hw }, > +}; > + [..] > +static struct clk_regmap_mux gcc_pcie_0_phy_aux_clk_src = { > + .reg = 0x9d080, > + .shift = 0, > + .width = 2, > + .parent_map = gcc_parent_map_6, > + .clkr = { > + .hw.init = &(const struct clk_init_data){ Sorry for being picky, but I do like when there's a space between the ')' and '{' in these lines... > + .name = "gcc_pcie_0_phy_aux_clk_src", > + .parent_data = gcc_parent_data_6, > + .num_parents = ARRAY_SIZE(gcc_parent_data_6), > + .ops = &clk_regmap_mux_closest_ops, > + }, > + }, > +}; Regards, Bjorn