From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: Shikhar Dogra <shidogra@cisco.com>,
andriy.shevchenko@linux.intel.com,
mika.westerberg@linux.intel.com, wsa@the-dreams.de
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
xe-linux-external@cisco.com
Subject: Re: [PATCH] i2c: designware: make *CNT values configurable
Date: Thu, 26 Oct 2017 17:16:07 +0300 [thread overview]
Message-ID: <4ddeadd3-aa31-87f4-cd8d-ddf2132edb49@linux.intel.com> (raw)
In-Reply-To: <20171025185022.GA25920@sjc-ads-4188.cisco.com>
Hi
On 10/25/2017 09:50 PM, Shikhar Dogra wrote:
> The values are already configurable from ACPI.
>
> This patch makes the high count (HCNT) and low count (LCNT)
> register values configurable through device tree.
>
> Cc: xe-linux-external@cisco.com
> Signed-off-by: Shikhar Dogra <shidogra@cisco.com>
> ---
> Documentation/devicetree/bindings/i2c/i2c-designware.txt | 16 ++++++++++++++++
> drivers/i2c/busses/i2c-designware-platdrv.c | 12 ++++++++++++
> 2 files changed, 28 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-designware.txt b/Documentation/devicetree/bindings/i2c/i2c-designware.txt
> index fee26dc..2b9ddca 100644
> --- a/Documentation/devicetree/bindings/i2c/i2c-designware.txt
> +++ b/Documentation/devicetree/bindings/i2c/i2c-designware.txt
> @@ -20,6 +20,18 @@ Optional properties :
> - i2c-sda-falling-time-ns : should contain the SDA falling time in nanoseconds.
> This value which is by default 300ns is used to compute the tHIGH period.
>
> + - i2c-ss-hcnt : should contain the I2C controller standard speed HCNT value.
> + If this is not set we use the calculated and more conservative values.
> +
> + - i2c-ss-lcnt : should contain the I2C controller standard speed LCNT value.
> + If this is not set we use the calculated and more conservative values.
> +
> + - i2c-fs-hcnt : should contain the I2C controller fast speed HCNT value.
> + If this is not set we use the calculated and more conservative values.
> +
> + - i2c-fs-lcnt : should contain the I2C controller fast speed LCNT value.
> + If this is not set we use the calculated and more conservative values.
> +
Worth to add also properties for high-speed while at it.
Out of curiosity, are calculated values by using
"i2c-sda-falling-time-ns" and "i2c-scl-falling-time-ns" properties
non-optimal on your platform and controller clock?
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> index 6b00061c..25c3b0c 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -177,6 +177,18 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
> of_property_read_u32(pdev->dev.of_node, "clock-frequency",
> &clk_freq);
>
> + of_property_read_u16(pdev->dev.of_node,
> + "i2c-ss-hcnt", &dev->ss_hcnt);
> +
This patch is against old kernel. These were converted near 2 years ago
by the commit 4c5301abbf81 ("i2c: designware: Convert to use unified
device property API")
--
Jarkko
next prev parent reply other threads:[~2017-10-26 14:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-25 18:50 [PATCH] i2c: designware: make *CNT values configurable Shikhar Dogra
2017-10-26 14:16 ` Jarkko Nikula [this message]
2017-11-03 17:23 ` Shikhar Dogra (shidogra)
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=4ddeadd3-aa31-87f4-cd8d-ddf2132edb49@linux.intel.com \
--to=jarkko.nikula@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=shidogra@cisco.com \
--cc=wsa@the-dreams.de \
--cc=xe-linux-external@cisco.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;
as well as URLs for NNTP newsgroup(s).