From: Hongliang Wang <wanghongliang@loongson.cn>
To: Binbin Zhou <zhoubinbin@loongson.cn>
Cc: Andi Shyti <andi.shyti@kernel.org>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
loongarch@lists.linux.dev
Subject: Subject: Re:Re: [PATCH v1] LoongArch: add i2c clocks and clock-div parameter parsing.
Date: Tue, 24 Mar 2026 11:27:45 +0800 [thread overview]
Message-ID: <6a88588c-5ec3-84b8-6bd7-be107e36e529@loongson.cn> (raw)
Hi, Binbin:
Sorry, due to email reason, I did not see your reply in a timely.
For your suggestion, I will make the changes as soon as possible.
Thanks,
Hongliang Wang
From: Binbin Zhou <zhoubb.aaron@gmail.com>
To: Hongliang Wang <wanghongliang@loongson.cn>
Cc: Binbin Zhou <zhoubinbin@loongson.cn>,
Andi Shyti <andi.shyti@kernel.org>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
loongarch@lists.linux.dev
Subject: Re: [PATCH v1] LoongArch: add i2c clocks and clock-div
parameter parsing.
Date: Wed, 11 Feb 2026 12:23:45 +0800 [thread overview]
Message-ID:
<CAMpQs4LeFNEXyg-fVDiSDpEVdbPAY5Z5gL7-5s5uZ52BWmXP5w@mail.gmail.com> (raw)
In-Reply-To: <20260211025057.29746-1-wanghongliang@loongson.cn>
Hi Hongliang:
Bad commit subject, it should start with:
i2c: ls2x:
On Wed, Feb 11, 2026 at 10:51 AM Hongliang Wang
<wanghongliang@loongson.cn> wrote:
>
> On 3A/7A/2K platform, i2c ref clocks and clock divisor maybe
> different, through firmware parameter passing, "clocks" and
> "clock-div" are used to describe i2c ref clocks and divisor.
I feel it's necessary to specify which platforms are different in the
commit message.
>
> Signed-off-by: Hongliang Wang <wanghongliang@loongson.cn>
> ---
> drivers/i2c/busses/i2c-ls2x.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-ls2x.c
b/drivers/i2c/busses/i2c-ls2x.c
> index b475dd27b7af..562bf32a9d6c 100644
> --- a/drivers/i2c/busses/i2c-ls2x.c
> +++ b/drivers/i2c/busses/i2c-ls2x.c
> @@ -96,6 +96,8 @@ static irqreturn_t ls2x_i2c_isr(int this_irq, void
*dev_id)
> static void ls2x_i2c_adjust_bus_speed(struct ls2x_i2c_priv *priv)
> {
> u16 val;
> + u32 pclk;
> + u32 div;
Place them in a single line.
> struct i2c_timings *t = &priv->i2c_t;
> struct device *dev = priv->adapter.dev.parent;
> u32 acpi_speed = i2c_acpi_find_bus_speed(dev);
> @@ -107,12 +109,16 @@ static void ls2x_i2c_adjust_bus_speed(struct
ls2x_i2c_priv *priv)
> else
> t->bus_freq_hz = LS2X_I2C_FREQ_STD;
>
> + if (!device_property_read_u32(dev, "clocks", &pclk) &&
> + !device_property_read_u32(dev, "clock-div", &div) &&
div != 0)
> + val = (pclk * 10) / (div * t->bus_freq_hz) - 1;
I think you should update dt-binding synchronously and verify whether
the existing i2c node in DTS{i} requires updating.
> + else
> + val = LS2X_I2C_PCLK_FREQ / (5 * t->bus_freq_hz) - 1;
> /*
> * According to the chip manual, we can only access the
registers as bytes,
> * otherwise the high bits will be truncated.
> * So set the I2C frequency with a sequential writeb()
instead of writew().
> */
> - val = LS2X_I2C_PCLK_FREQ / (5 * t->bus_freq_hz) - 1;
> writeb(FIELD_GET(GENMASK(7, 0), val), priv->base +
I2C_LS2X_PRER_LO);
> writeb(FIELD_GET(GENMASK(15, 8), val), priv->base +
I2C_LS2X_PRER_HI);
> }
> --
> 2.47.2
>
>
--
Thanks.
Binbin
reply other threads:[~2026-03-24 3:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=6a88588c-5ec3-84b8-6bd7-be107e36e529@loongson.cn \
--to=wanghongliang@loongson.cn \
--cc=andi.shyti@kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=zhoubinbin@loongson.cn \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).