public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: "Wang, Lawrence (NSB - CN/Hangzhou)" <lawrence.wang@nokia-sbell.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "jarkko.nikula@linux.intel.com" <jarkko.nikula@linux.intel.com>,
	"mika.westerberg@linux.intel.com"
	<mika.westerberg@linux.intel.com>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Wang@wrlinb193.emea.nsn-net.net"
	<Wang@wrlinb193.emea.nsn-net.net>
Subject: RE: [PATCH] i2c: designware: Get HCNT/LCNT values from dts
Date: Mon, 15 Nov 2021 10:41:06 +0000	[thread overview]
Message-ID: <587c61a76c8547d0a36dd11071bfcb2d@nokia-sbell.com> (raw)
In-Reply-To: <YZI2RnFgO0Y75KlF@smile.fi.intel.com>

Hello Shevchenko

Thanks for your quick reply.

Besides the fact it misses DT schema update, why this is needed at all? 
------> we need a interface to configure the HCNT/LCNT via dts (current we just have ACPI to config it).
What's wrong with the existing DT timings? 
--------> the HCNT/LCNT value calculated by code is not accuracy. This is similar changes as the ACPI interface.
	i2c_dw_acpi_params(device, "SSCN", &dev->ss_hcnt, &dev->ss_lcnt, &ss_ht);
	i2c_dw_acpi_params(device, "FPCN", &dev->fp_hcnt, &dev->fp_lcnt, &fp_ht);
	i2c_dw_acpi_params(device, "HSCN", &dev->hs_hcnt, &dev->hs_lcnt, &hs_ht);
	i2c_dw_acpi_params(device, "FMCN", &dev->fs_hcnt, &dev->fs_lcnt, &fs_ht);
										   
- i2c-scl-falling-time-ns
- i2c-scl-internal-delay-ns
- i2c-scl-rising-time-ns
- i2c-sda-falling-time-ns
Yeah, I know those properties. But those are common for i2c.
My changes is for the specific HW controller(designware) for configuring its two register HCNT/LCNT.
In this case, still we need one property per each value?


--
With Best Regards,
Lawrence, Wang

-----Original Message-----
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> 
Sent: 2021年11月15日 18:28
To: Wang, Lawrence (NSB - CN/Hangzhou) <lawrence.wang@nokia-sbell.com>
Cc: jarkko.nikula@linux.intel.com; mika.westerberg@linux.intel.com; linux-i2c@vger.kernel.org; linux-kernel@vger.kernel.org; Wang@wrlinb193.emea.nsn-net.net
Subject: Re: [PATCH] i2c: designware: Get HCNT/LCNT values from dts

On Mon, Nov 15, 2021 at 12:19:26PM +0200, Andy Shevchenko wrote:
> On Mon, Nov 15, 2021 at 10:35:55AM +0100, Lawrence,Wang wrote:
> > From: "Wang, Lawrence" <lawrence.wang@nokia-sbell.com>
> > 
> > Current code support config the HCNT/LCNT only via ACPI method. for 
> > those platform that not support ACPI, will get the HCNT/LCNT value 
> > based on input clock. But it is not always accuracy. for example in 
> > some platform will get lower speed(320khz) in fast mode, and get 
> > faster speed(105khz/even more) in standard mode.
> > 
> > This patch makes it possible for the non-ACPI platform to pass more 
> > optimal HCNT/LCNT values to the core driver via dts if they are known beforehand.
> > If these are not set we use the calculated values.
> 
> Besides the fact it misses DT schema update, why this is needed at all?
> What's wrong with the existing DT timings?

Just for your convenience an excerpt from Documentation/devicetree/bindings/i2c/i2c.txt

- i2c-scl-falling-time-ns
Number of nanoseconds the SCL signal takes to fall; t(f) in the I2C specification.

- i2c-scl-internal-delay-ns
Number of nanoseconds the IP core additionally needs to setup SCL.

- i2c-scl-rising-time-ns
Number of nanoseconds the SCL signal takes to rise; t(r) in the I2C specification.

- i2c-sda-falling-time-ns
Number of nanoseconds the SDA signal takes to fall; t(f) in the I2C specification.

--
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2021-11-15 10:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15  9:35 [PATCH] i2c: designware: Get HCNT/LCNT values from dts Lawrence,Wang
2021-11-15 10:19 ` Andy Shevchenko
2021-11-15 10:28   ` Andy Shevchenko
2021-11-15 10:41     ` Wang, Lawrence (NSB - CN/Hangzhou) [this message]
2021-11-15 11:01       ` Andy Shevchenko
2021-11-16  1:43         ` Wang, Lawrence (NSB - CN/Hangzhou)
2021-11-29 19:28 ` Wolfram Sang

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=587c61a76c8547d0a36dd11071bfcb2d@nokia-sbell.com \
    --to=lawrence.wang@nokia-sbell.com \
    --cc=Wang@wrlinb193.emea.nsn-net.net \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.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