public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: "Yu-Chun Lin [林祐君]" <eleanor.lin@realtek.com>
To: "Stephen Boyd" <sboyd@kernel.org>,
	"afaerber@suse.com" <afaerber@suse.com>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"Edgar Lee [李承諭]" <cylee12@realtek.com>,
	"Jyan Chou [周芷安]" <jyanchou@realtek.com>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"mturquette@baylibre.com" <mturquette@baylibre.com>,
	"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	"robh@kernel.org" <robh@kernel.org>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-realtek-soc@lists.infradead.org"
	<linux-realtek-soc@lists.infradead.org>,
	"James Tai [戴志峰]" <james.tai@realtek.com>,
	"CY_Huang[黃鉦晏]" <cy.huang@realtek.com>,
	"Stanley Chang[昌育德]" <stanley_chang@realtek.com>
Subject: RE: [PATCH v5 08/10] clk: realtek: Add support for MMC-tuned PLL clocks
Date: Mon, 30 Mar 2026 03:00:54 +0000	[thread overview]
Message-ID: <85ccff0f13504501a9b4efda4661ee1b@realtek.com> (raw)
In-Reply-To: <177440366488.5403.14385693004290004608@localhost.localdomain>

> Quoting Yu-Chun Lin (2026-03-23 19:53:29)
> > diff --git a/drivers/clk/realtek/clk-pll-mmc.c
> > b/drivers/clk/realtek/clk-pll-mmc.c
> > new file mode 100644
> > index 000000000000..017663738c1f
> > --- /dev/null
> > +++ b/drivers/clk/realtek/clk-pll-mmc.c
> > @@ -0,0 +1,399 @@
> > +// SPDX-License-Identifier: GPL-2.0-only
> > +/*
> > + * Copyright (C) 2021 Realtek Semiconductor Corporation
> > + * Author: Cheng-Yu Lee <cylee12@realtek.com>  */
> > +
> > +#include "clk-pll.h"
> 
> Include what you use in this C file, not just this header file. That makes it
> simpler to see what is used without following include trails.

Got it. I will explicitly include the required headers directly in this .c file.

> > +
> > +#define PLL_EMMC1_OFFSET           0x0
> > +#define PLL_EMMC2_OFFSET           0x4
> > +#define PLL_EMMC3_OFFSET           0x8
> > +#define PLL_EMMC4_OFFSET           0xc
> > +#define PLL_SSC_DIG_EMMC1_OFFSET   0x0
> > +#define PLL_SSC_DIG_EMMC3_OFFSET   0xc
> > +#define PLL_SSC_DIG_EMMC4_OFFSET   0x10
> > +
> > +#define PLL_MMC_SSC_DIV_N_VAL      0x1b
> > +
> > +#define PLL_PHRT0_MASK             BIT(1)
> > +#define PLL_PHSEL_MASK             GENMASK(4, 0)
> > +#define PLL_SSCPLL_RS_MASK         GENMASK(12, 10)
> > +#define PLL_SSCPLL_ICP_MASK        GENMASK(9, 5)
> > +#define PLL_SSC_DIV_EXT_F_MASK     GENMASK(25, 13)
> > +#define PLL_PI_IBSELH_MASK         GENMASK(28, 27)
> > +#define PLL_SSC_DIV_N_MASK         GENMASK(23, 16)
> > +#define PLL_NCODE_SSC_EMMC_MASK    GENMASK(20, 13)
> > +#define PLL_FCODE_SSC_EMMC_MASK    GENMASK(12, 0)
> > +#define PLL_GRAN_EST_EM_MC_MASK    GENMASK(20, 0)
> > +#define PLL_EN_SSC_EMMC_MASK       BIT(0)
> > +#define PLL_FLAG_INITAL_EMMC_MASK  BIT(1)
> [...]
> > diff --git a/drivers/clk/realtek/clk-pll.h
> > b/drivers/clk/realtek/clk-pll.h index 2d27a44a270c..9cf219871218
> > 100644
> > --- a/drivers/clk/realtek/clk-pll.h
> > +++ b/drivers/clk/realtek/clk-pll.h
> > @@ -44,4 +44,25 @@ static inline struct clk_pll *to_clk_pll(struct
> > clk_hw *hw)  extern const struct clk_ops rtk_clk_pll_ops;  extern
> > const struct clk_ops rtk_clk_pll_ro_ops;
> >
> > +struct clk_pll_mmc {
> > +       struct clk_regmap clkr;
> > +       int pll_ofs;
> > +       int ssc_dig_ofs;
> 
> These offsets should be unsigned?
>

Yes, I will fix it.

> > +       struct clk_hw phase0_hw;
> > +       struct clk_hw phase1_hw;
> > +       u32 set_rate_val_53_97_set_ipc: 1;
> 
> bool? Doubt we care about this unless we're packing structs (which we
> shouldn't be).
> 

This member is actually redundant, so I will just remove it.

> > +};
> > +
> > +#define __clk_pll_mmc_hw(_ptr)  __clk_regmap_hw(&(_ptr)->clkr)
> > +
> > +static inline struct clk_pll_mmc *to_clk_pll_mmc(struct clk_hw *hw) {
> > +       struct clk_regmap *clkr = to_clk_regmap(hw);
> > +
> > +       return container_of(clkr, struct clk_pll_mmc, clkr); }

Best regards,
Yu-Chun

  reply	other threads:[~2026-03-30  3:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24  2:53 [PATCH v5 00/10] clk: realtek: Add RTD1625 clock support Yu-Chun Lin
2026-03-24  2:53 ` [PATCH v5 01/10] dt-bindings: clock: Add Realtek RTD1625 Clock & Reset Controller Yu-Chun Lin
2026-03-24  8:47   ` Krzysztof Kozlowski
2026-03-25  1:59   ` Stephen Boyd
2026-03-30  2:48     ` Yu-Chun Lin [林祐君]
2026-03-24  2:53 ` [PATCH v5 02/10] arm64: dts: realtek: Add clock support for RTD1625 Yu-Chun Lin
2026-03-24  2:53 ` [PATCH v5 03/10] reset: Add Realtek basic reset support Yu-Chun Lin
2026-03-25 17:21   ` Philipp Zabel
2026-03-24  2:53 ` [PATCH v5 04/10] clk: realtek: Introduce a common probe() Yu-Chun Lin
2026-03-24  2:53 ` [PATCH v5 05/10] clk: realtek: Add support for phase locked loops (PLLs) Yu-Chun Lin
2026-03-24  2:53 ` [PATCH v5 06/10] clk: realtek: Add support for gate clock Yu-Chun Lin
2026-03-24  2:53 ` [PATCH v5 07/10] clk: realtek: Add support for mux clock Yu-Chun Lin
2026-03-24  2:53 ` [PATCH v5 08/10] clk: realtek: Add support for MMC-tuned PLL clocks Yu-Chun Lin
2026-03-25  1:54   ` Stephen Boyd
2026-03-30  3:00     ` Yu-Chun Lin [林祐君] [this message]
2026-03-24  2:53 ` [PATCH v5 09/10] clk: realtek: Add RTD1625-CRT clock controller driver Yu-Chun Lin
2026-03-24 23:06   ` kernel test robot
2026-03-25 17:24   ` Philipp Zabel
2026-03-24  2:53 ` [PATCH v5 10/10] clk: realtek: Add RTD1625-ISO " Yu-Chun Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85ccff0f13504501a9b4efda4661ee1b@realtek.com \
    --to=eleanor.lin@realtek.com \
    --cc=afaerber@suse.com \
    --cc=conor+dt@kernel.org \
    --cc=cy.huang@realtek.com \
    --cc=cylee12@realtek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=james.tai@realtek.com \
    --cc=jyanchou@realtek.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-realtek-soc@lists.infradead.org \
    --cc=mturquette@baylibre.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=stanley_chang@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox