public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Hongliang Wang <wanghongliang@loongson.cn>
Cc: Binbin Zhou <zhoubinbin@loongson.cn>,
	Andi Shyti <andi.shyti@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-i2c@vger.kernel.org, devicetree@vger.kernel.org,
	loongarch@lists.linux.dev
Subject: Re: [PATCH v1 1/2] dt-bindings: i2c: ls2x-i2c: Add clock- related properties
Date: Fri, 10 Apr 2026 08:42:34 +0200	[thread overview]
Message-ID: <3c57275e-0574-46e5-9893-053ae5cc22cb@kernel.org> (raw)
In-Reply-To: <0f560e80-3fbb-c24f-51f9-b4425db17867@loongson.cn>

On 10/04/2026 05:04, Hongliang Wang wrote:
> Hi, Krzysztof
> 
> On 2026/4/9 下午8:11, Krzysztof Kozlowski wrote:
>> On 09/04/2026 14:03, Hongliang Wang wrote:
>>> I have a question, the input clock of i2c controller can be described by
>>> "clocks",
>>> but there is no existing attribute can describe the divisor of the input
>>> clock,
>>> Can I define a new attribute named "clock-div" to describe it in DT
>>> bindings?
>>> or do you have any standard solutions for the divisor problem? Thank you.
>>>
>> You should determine/calculate the divisor in the driver code, depending
>> on clocks and bus frequencies. You don't need a property for that, usually.
> 
> Not only clocks and bus frequencies, but also a third property is required.
> 
> The frequency divison calculation formula of i2c is
> Prcescale = clock_a/(clock_div*clock_s)-1
> 
> There is three parameters in this formula:
> clock_a represents the input clock, which is described by "clocks",
> clock_s represents the i2c bus frequency, which is described by 
> "clock-frequency",
> but there is no existing property to describe clock_div, which has 
> different value
> on different platform (for example, it is 5 on 7a1000/7a2000, 4 on 
> 2K1000/2K2000,
> 5.5 on 2K3000.), So I need a property to describe clock_div in this formula.

So it is fixed per compatible? Then you do not need.


Best regards,
Krzysztof

  reply	other threads:[~2026-04-10  6:42 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-25  1:18 [PATCH v2 0/2] i2c: ls2x: Add clock- related properties and parsing Hongliang Wang
2026-03-25  1:18 ` [PATCH v1 1/2] dt-bindings: i2c: ls2x-i2c: Add clock- related properties Hongliang Wang
2026-03-25 11:42   ` Krzysztof Kozlowski
2026-03-25 11:43   ` Krzysztof Kozlowski
2026-03-26  2:12     ` Hongliang Wang
2026-03-26  7:02       ` Krzysztof Kozlowski
2026-03-26  7:49         ` Krzysztof Kozlowski
2026-03-26 11:48           ` Hongliang Wang
2026-03-26 12:23             ` Krzysztof Kozlowski
2026-03-27  2:06               ` Hongliang Wang
2026-03-27  3:09           ` Hongliang Wang
2026-03-27  6:39             ` Krzysztof Kozlowski
2026-03-30  7:18               ` Hongliang Wang
2026-03-30  7:23                 ` Krzysztof Kozlowski
2026-03-31  7:11                   ` Hongliang Wang
2026-04-09 12:03                     ` Hongliang Wang
2026-04-09 12:11                       ` Krzysztof Kozlowski
2026-04-10  3:04                         ` Hongliang Wang
2026-04-10  6:42                           ` Krzysztof Kozlowski [this message]
2026-04-10  8:20                             ` Hongliang Wang
2026-04-09 15:29                       ` Yao Zi
2026-04-10  3:06                         ` Hongliang Wang
2026-03-26  7:21       ` Andi Shyti
2026-03-27  2:08         ` Hongliang Wang
2026-03-25  1:18 ` [PATCH v1 2/2] i2c: ls2x: Add clock-input and clock-div properties parsing Hongliang Wang

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=3c57275e-0574-46e5-9893-053ae5cc22cb@kernel.org \
    --to=krzk@kernel.org \
    --cc=andi.shyti@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=robh@kernel.org \
    --cc=wanghongliang@loongson.cn \
    --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