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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0056DC43334 for ; Mon, 11 Jul 2022 14:39:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231433AbiGKOjV (ORCPT ); Mon, 11 Jul 2022 10:39:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231406AbiGKOi6 (ORCPT ); Mon, 11 Jul 2022 10:38:58 -0400 Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7112A1EECC for ; Mon, 11 Jul 2022 07:38:57 -0700 (PDT) Received: by mail-qk1-x72d.google.com with SMTP id b25so3458759qkl.1 for ; Mon, 11 Jul 2022 07:38:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7XItuS7mxG3PZJmkt2lhJ3OfdyNaqBYJhSMEwOH7X7w=; b=PGyjfvKcWdQwelKW6M8EqUThfSKyzL47vHKiHrDemhJsneuC3ixvwPZpeXfEyG1cyR 8KPrFdjBv/Zo/II3/JPlKy7mGsa/Q39PbpljtC0/8lm35MvZ59axYT/uPaRIMgX9amIJ 29LaT0QCehH9Gf75ZQ8XofHL0rVkoyfgT6kbmYyLplJ+ehLCi7JEgTL1PUAkKsne9olR 57KCROb94QPPQ0c5q70I3lEHA3Bg024JIZk74fnO2fy/HCGafLSK6XsKQLJpcd84ExE3 YZKXT6W3Ajosz5UBCZitdo0YHcT8u+cFy+WCGW2YlQr9to7dOQd96GGGA54qbzgrtpXh lB/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7XItuS7mxG3PZJmkt2lhJ3OfdyNaqBYJhSMEwOH7X7w=; b=IUDDJFRvry479ZBqlVwgvyduu5HWG9R9kb4mbGDoh6G8D+rRS/TEopdaZxP32hvXb5 aYOZ7A3BTDLI37/mIf1UR7CTMZ/LsqA1gEgWzpQL9oTnZlYnwjyO6gSzyWZm+nrTl5ax cf9jBezrHkiywRViRPwwB4uohMk1pfQTdxbRHKRsGSVDIqRSGdlEDNJoRhm5tL8kpfSd 6nnWpw9snD3MO3y0/XAaWUz+o5JFnxShnvsI92DkneTx+wIFtDs3idl99+P48UiQumit q7wT07WtpE2ruU8yEUNOC+ZmoCs6NkqEiKMM/0+bYpDZxnwz0VTiyvT7CemqQInN/c6Z gYRA== X-Gm-Message-State: AJIora++s/f/LWfG9Qre9CYO/VYqgxs/zv+CS7iKlDw8OJHnN84NP1kR Hz4hLwtMwIbrM76/W97yXyE0wAMIh8MkdrBx901KBQ== X-Google-Smtp-Source: AGRyM1v7KwvPv0nm/D8OzJicPsfijYOWEzwiJQg1F3Z9hxTc1QBfSx++f0Z1WbfPChzH+yJTRZEFC3fssklptShCyNk= X-Received: by 2002:a05:620a:d5b:b0:6b5:660b:2939 with SMTP id o27-20020a05620a0d5b00b006b5660b2939mr10691619qkl.30.1657550336362; Mon, 11 Jul 2022 07:38:56 -0700 (PDT) MIME-Version: 1.0 References: <20220711104719.40939-1-robimarko@gmail.com> In-Reply-To: <20220711104719.40939-1-robimarko@gmail.com> From: Dmitry Baryshkov Date: Mon, 11 Jul 2022 17:38:45 +0300 Message-ID: Subject: Re: [PATCH 1/6] clk: qcom: clk-rcg2: add rcg2 mux ops To: Robert Marko Cc: bjorn.andersson@linaro.org, agross@kernel.org, konrad.dybcio@somainline.org, mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, sivaprak@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Christian Marangi Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Mon, 11 Jul 2022 at 14:22, Robert Marko wrote: > > From: Christian Marangi > > An RCG may act as a mux that switch between 2 parents. > This is the case on IPQ6018 and IPQ8074 where the APCS core clk that feeds > the CPU cluster clock just switches between XO and the PLL that feeds it. > > Add the required ops to add support for this special configuration and use > the generic mux function to determine the rate. > > This way we dont have to keep a essentially dummy frequency table to use > RCG2 as a mux. > > Signed-off-by: Christian Marangi > Signed-off-by: Robert Marko Reviewed-by: Dmitry Baryshkov > --- > drivers/clk/qcom/clk-rcg.h | 1 + > drivers/clk/qcom/clk-rcg2.c | 7 +++++++ > 2 files changed, 8 insertions(+) > > diff --git a/drivers/clk/qcom/clk-rcg.h b/drivers/clk/qcom/clk-rcg.h > index 012e745794fd..01581f4d2c39 100644 > --- a/drivers/clk/qcom/clk-rcg.h > +++ b/drivers/clk/qcom/clk-rcg.h > @@ -167,6 +167,7 @@ struct clk_rcg2_gfx3d { > > extern const struct clk_ops clk_rcg2_ops; > extern const struct clk_ops clk_rcg2_floor_ops; > +extern const struct clk_ops clk_rcg2_mux_closest_ops; > extern const struct clk_ops clk_edp_pixel_ops; > extern const struct clk_ops clk_byte_ops; > extern const struct clk_ops clk_byte2_ops; > diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c > index 28019edd2a50..609c10f8d0d9 100644 > --- a/drivers/clk/qcom/clk-rcg2.c > +++ b/drivers/clk/qcom/clk-rcg2.c > @@ -509,6 +509,13 @@ const struct clk_ops clk_rcg2_floor_ops = { > }; > EXPORT_SYMBOL_GPL(clk_rcg2_floor_ops); > > +const struct clk_ops clk_rcg2_mux_closest_ops = { > + .determine_rate = __clk_mux_determine_rate_closest, > + .get_parent = clk_rcg2_get_parent, > + .set_parent = clk_rcg2_set_parent, > +}; > +EXPORT_SYMBOL_GPL(clk_rcg2_mux_closest_ops); > + > struct frac_entry { > int num; > int den; > -- > 2.36.1 > -- With best wishes Dmitry