From: Andi Shyti <andi.shyti@kernel.org>
To: Zi-Yu Chen <zychennvt@gmail.com>
Cc: linux-i2c@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Jacky Huang <ychuang3@nuvoton.com>,
Shan-Chun Hung <schung@nuvoton.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Andrew Jeffery <andrew@codeconstruct.com.au>
Subject: Re: [PATCH RESEND v12 2/3] i2c: ma35d1: Add Nuvoton MA35D1 I2C driver support
Date: Wed, 2 Dec 2026 16:09:25 +0100 [thread overview]
Message-ID: <axAxYeQGI5HEZ-yi@zenone.zhora.eu> (raw)
In-Reply-To: <20261130032346.1720769-3-zychennvt@gmail.com>
Hi Zi-Yu,
...
> + if (!device_property_read_u32(dev, "clock-frequency", &val)) {
> + if (val != 0 && val <= MEGA)
> + busfreq = val;
> + }
> + /* Calculate divider based on the current peripheral clock rate */
> + clkdiv = DIV_ROUND_CLOSEST(clk_get_rate(i2c->clk), busfreq * 4) - 1;
I would use DIV_ROUND_UP() here: rounding the divisor to the
nearest integer can make SCL exceed the requested bus frequency.
Andi
> + if (clkdiv < 0 || clkdiv > 0x3ff)
> + return dev_err_probe(dev, -EINVAL, "invalid clkdiv value: %d\n",
> + clkdiv);
next prev parent reply other threads:[~2026-12-02 17:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 3:23 [PATCH RESEND v12 0/3] i2c: ma35d1: Add support for MA35D1 I2C controller Zi-Yu Chen
2026-11-30 3:23 ` [PATCH RESEND v12 1/3] dt-bindings: i2c: nuvoton,ma35d1-i2c: Add " Zi-Yu Chen
2026-11-30 3:23 ` [PATCH RESEND v12 2/3] i2c: ma35d1: Add Nuvoton MA35D1 I2C driver support Zi-Yu Chen
2026-12-01 10:25 ` Philipp Zabel
2026-12-02 3:05 ` zychen
2026-12-02 15:09 ` Andi Shyti [this message]
2026-11-30 3:23 ` [PATCH RESEND v12 3/3] arm64: dts: nuvoton: Add I2C nodes for MA35D1 SoC Zi-Yu Chen
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=axAxYeQGI5HEZ-yi@zenone.zhora.eu \
--to=andi.shyti@kernel.org \
--cc=andrew@codeconstruct.com.au \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=schung@nuvoton.com \
--cc=ychuang3@nuvoton.com \
--cc=zychennvt@gmail.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