From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: chin.yew.tan@intel.com, jarkko.nikula@linux.intel.com,
mika.westerberg@linux.intel.com
Cc: linux-i2c@vger.kernel.org
Subject: Re: [PATCH] i2c: designware: Get selected speed mode sda-hold-time via ACPI
Date: Tue, 14 Feb 2017 12:05:06 +0200 [thread overview]
Message-ID: <1487066706.2133.465.camel@linux.intel.com> (raw)
In-Reply-To: <1487051641-31927-2-git-send-email-chin.yew.tan@intel.com>
On Tue, 2017-02-14 at 13:54 +0800, chin.yew.tan@intel.com wrote:
> From: Tan Chin Yew <chin.yew.tan@intel.com>
>
> Sda-hold-time is an important parameter for tuning i2c to meet the
> electrical specification especially for high speed. I2C with incorrect
> sda-hold-time may cause lost arbitration error. Now, the driver is
> able to
> get sda-hold-time for all the speed supported.
>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Tan Chin Yew <chin.yew.tan@intel.com>
> ---
> drivers/i2c/busses/i2c-designware-platdrv.c | 28
> +++++++++++++++++++++-------
> 1 file changed, 21 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c
> b/drivers/i2c/busses/i2c-designware-platdrv.c
> index 6ce4313..00c880a 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -101,14 +101,28 @@ static int dw_i2c_acpi_configure(struct
> platform_device *pdev)
> dev->rx_fifo_depth = 32;
>
> /*
> - * Try to get SDA hold time and *CNT values from an ACPI
> method if
> - * it exists for both supported speed modes.
> + * Try to get SDA hold time and *CNT values from an ACPI
> method for
> + * selected speed modes.
> */
> - dw_i2c_acpi_params(pdev, "SSCN", &dev->ss_hcnt, &dev-
> >ss_lcnt, NULL);
> - dw_i2c_acpi_params(pdev, "FMCN", &dev->fs_hcnt, &dev-
> >fs_lcnt,
> - &dev->sda_hold_time);
> - dw_i2c_acpi_params(pdev, "FPCN", &dev->fp_hcnt, &dev-
> >fp_lcnt, NULL);
> - dw_i2c_acpi_params(pdev, "HSCN", &dev->hs_hcnt, &dev-
> >hs_lcnt, NULL);
> + switch (dev->clk_freq) {
> + case 100000:
> + dw_i2c_acpi_params(pdev, "SSCN", &dev->ss_hcnt, &dev-
> >ss_lcnt,
> + &dev->sda_hold_time);
> + break;
> + case 1000000:
> + dw_i2c_acpi_params(pdev, "FPCN", &dev->fp_hcnt, &dev-
> >fp_lcnt,
> + &dev->sda_hold_time);
> + break;
> + case 3400000:
> + dw_i2c_acpi_params(pdev, "HSCN", &dev->hs_hcnt, &dev-
> >hs_lcnt,
> + &dev->sda_hold_time);
> + break;
> + case 400000:
> + default:
> + dw_i2c_acpi_params(pdev, "FMCN", &dev->fs_hcnt, &dev-
> >fs_lcnt,
> + &dev->sda_hold_time);
> + break;
> + }
>
> id = acpi_match_device(pdev->dev.driver->acpi_match_table,
> &pdev->dev);
> if (id && id->driver_data)
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
next prev parent reply other threads:[~2017-02-14 10:06 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-14 5:54 [PATCH v2] Set sda-hold-time based on ACPI *CNT value chin.yew.tan
2017-02-14 5:54 ` [PATCH] i2c: designware: Get selected speed mode sda-hold-time via ACPI chin.yew.tan
2017-02-14 7:00 ` Jarkko Nikula
2017-03-06 12:30 ` Tan, Chin Yew
2017-02-14 10:05 ` Andy Shevchenko [this message]
2017-03-23 20:58 ` Wolfram Sang
2017-03-23 21:00 ` Wolfram Sang
2017-03-27 9:43 ` Tan, Chin Yew
2017-03-27 10:07 ` Wolfram Sang
-- strict thread matches above, loose matches on Subject: below --
2017-03-28 8:48 [PATCH V3] Set sda-hold-time based on ACPI *CNT value Tan Chin Yew
2017-03-28 8:48 ` [PATCH] i2c: designware: Get selected speed mode sda-hold-time via ACPI Tan Chin Yew
2017-03-28 9:13 ` Andy Shevchenko
2017-03-31 12:12 ` Jarkko Nikula
2017-04-19 18:57 ` Wolfram Sang
2017-02-10 11:28 [PATCH] Set sda-hold-time based on ACPI *CNT value chin.yew.tan
2017-02-10 11:28 ` [PATCH] i2c: designware: Get selected speed mode sda-hold-time via ACPI chin.yew.tan
2017-02-10 12:28 ` Jarkko Nikula
2017-02-10 12:31 ` Andy Shevchenko
2017-02-13 8:41 ` Tan, Chin Yew
2017-02-13 9:33 ` Jarkko Nikula
2017-02-13 10:56 ` Andy Shevchenko
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=1487066706.2133.465.camel@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=chin.yew.tan@intel.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=linux-i2c@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.