mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yixun Lan <dlan@gentoo.org>
To: Jesse T <mr.bossman075@gmail.com>
Cc: Troy Mitchell <troy.mitchell@linux.spacemit.com>,
	Andi Shyti <andi.shyti@kernel.org>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-riscv@lists.infradead.org, spacemit@lists.linux.dev
Subject: Re: [PATCH v2] i2c: spacemit: configure ILCR for accurate SCL frequency
Date: Sun, 28 Sep 2025 19:13:21 +0800	[thread overview]
Message-ID: <20250928111321-GYB1346428@gentoo.org> (raw)
In-Reply-To: <CAJFTR8RGT0JFcsSODEgyWgJYKj6QhWa7=5Tm9_6U4Pkv56X=-g@mail.gmail.com>

Hi Jesse,

On 23:37 Thu 17 Jul     , Jesse T wrote:
> On Thu, Jul 17, 2025 at 9:08 PM Troy Mitchell
> <troy.mitchell@linux.spacemit.com> wrote:
> >
> > The SpacemiT I2C controller's SCL (Serial Clock Line) frequency for
> > master mode operations is determined by the ILCR (I2C Load Count Register).
> > Previously, the driver relied on the hardware's reset default
> > values for this register.
> >
> > The hardware's default ILCR values (SLV=0x156, FLV=0x5d) yield SCL
> > frequencies lower than intended. For example, with the default
> > 31.5 MHz input clock, these default settings result in an SCL
> > frequency of approximately 93 kHz (standard mode) when targeting 100 kHz,
> > and approximately 338 kHz (fast mode) when targeting 400 kHz.
> > These frequencies are below the 100 kHz/400 kHz nominal speeds.
> >
> > This patch integrates the SCL frequency management into
> > the Common Clock Framework (CCF). Specifically, the ILCR register,
> > which acts as a frequency divider for the SCL clock, is now registered
> > as a managed clock (scl_clk) within the CCF.
> >
> > This patch also cleans up unnecessary whitespace
> > in the included header files.
> >
> > Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
> > ---

..[snip]
> >
> > +static struct clk *spacemit_i2c_register_scl_clk(struct spacemit_i2c_dev *i2c,
> > +                                                struct clk *parent)
> > +{
> > +       struct clk_init_data init;
> > +       char name[32];
> > +
> > +       snprintf(name, sizeof(name), "%s_scl_clk", dev_name(i2c->dev));
> > +
> > +       init.name = name;
> > +       init.ops = &spacemit_i2c_clk_ops;
> > +       init.parent_data = (struct clk_parent_data[]) {
> > +               { .fw_name = "func" },
> 
> Is "func" a placeholder? Can we name it i2c_scl_clk?
> 
no, it's the parent clk of scl that need to request, which correspond to
the DT node 

      clocks = <&syscon_apbc CLK_TWSI8>,
                ..
      clock-names = "func", ..

-- 
Yixun Lan (dlan)

      reply	other threads:[~2025-09-28 11:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-18  1:05 Troy Mitchell
2025-07-18  3:37 ` Jesse T
2025-09-28 11:13   ` Yixun Lan [this message]

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=20250928111321-GYB1346428@gentoo.org \
    --to=dlan@gentoo.org \
    --cc=andi.shyti@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mr.bossman075@gmail.com \
    --cc=spacemit@lists.linux.dev \
    --cc=troy.mitchell@linux.spacemit.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

all inboxes | Powered by JetHome®