linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Jarkko Nikula <jarkko.nikula@linux.intel.com>,
	"Tan, Chin Yew" <chin.yew.tan@intel.com>,
	"mika.westerberg@linux.intel.com"
	<mika.westerberg@linux.intel.com>
Cc: "linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>
Subject: Re: [PATCH] i2c: designware: Get selected speed mode sda-hold-time via ACPI
Date: Mon, 13 Feb 2017 12:56:11 +0200	[thread overview]
Message-ID: <1486983371.2133.451.camel@linux.intel.com> (raw)
In-Reply-To: <9a3c955b-6252-bc25-4b33-8a95e03eddaf@linux.intel.com>

On Mon, 2017-02-13 at 11:33 +0200, Jarkko Nikula wrote:
> On 13.02.2017 10:41, Tan, Chin Yew wrote:
> > 
> > > On Fri, 2017-02-10 at 19:28 +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.

> > > > +	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;
> > > 
> > > Can we prepend default with
> > > 
> > > case 400000:
> > > 
> > > here?
> > > 
> > 
> > Yes, you are right, it is best not to load settings for speed mode
> > that is
> > not supported.
> > 
> 
> Andy: I guess you were looking for adding "case 400000:" for
> readability 
> rather than removing the default case?

Correct. To explicitly show that default we rather assume 400000, but if
 it's not, still go that branch.

> 
> I think it's best to keep fall back to 400 kHz speed that has been
> the 
> default in this driver in case we get some not supported speed from
> ACPI.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

  reply	other threads:[~2017-02-13 10:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
  -- strict thread matches above, loose matches on Subject: below --
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
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
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

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=1486983371.2133.451.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 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).