devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Romain Baeriswyl <Romain.Baeriswyl@abilis.com>
Cc: Wolfram Sang <wsa@the-dreams.de>,
	Rob Herring <rob.herring@calxeda.com>,
	Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Rob Landley <rob@landley.net>,
	Pierrick Hascoet <pierrick.hascoet@abilis.com>,
	Vineet Gupta <vgupta@synopsys.com>,
	Christian Ruppert <christian.ruppert@abilis.com>,
	Chiau Ee Chew <chiau.ee.chew@intel.com>,
	Shinya Kuribayashi <skuribay@pobox.com>,
	Jean Delvare <khali@linux-fr.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org,
	Romain Baeriswyl <romainba@abilis.com>
Subject: Re: [PATCH 1/2] i2c designware make SCL and SDA falling time configurable
Date: Wed, 9 Oct 2013 10:55:38 +0300	[thread overview]
Message-ID: <20131009075538.GQ3521@intel.com> (raw)
In-Reply-To: <1381244455-3836-1-git-send-email-romainba@abilis.com>

On Tue, Oct 08, 2013 at 05:00:54PM +0200, Romain Baeriswyl wrote:
>  static void __i2c_dw_enable(struct dw_i2c_dev *dev, bool enable)
> @@ -286,6 +287,7 @@ int i2c_dw_init(struct dw_i2c_dev *dev)
>  	u32 input_clock_khz;
>  	u32 hcnt, lcnt;
>  	u32 reg;
> +	u32 sda_falling_time, scl_falling_time;
>  
>  	input_clock_khz = dev->get_clk_rate_khz(dev);
>  
> @@ -307,15 +309,25 @@ int i2c_dw_init(struct dw_i2c_dev *dev)
>  
>  	/* set standard and fast speed deviders for high/low periods */
>  
> +	if (dev->sda_falling_time)
> +		sda_falling_time = dev->sda_falling_time;
> +	else
> +		sda_falling_time = 300; /* ns */

I think this looks better:

	sda_falling_time = dev->sda_falling_time ? dev->sda_falling_time : 300;

> +
> +	if (dev->scl_falling_time)
> +		scl_falling_time = dev->scl_falling_time;
> +	else
> +		scl_falling_time = 300; /* ns */

Ditto.

> +
>  	/* Standard-mode */
>  	hcnt = i2c_dw_scl_hcnt(input_clock_khz,
> -				40,	/* tHD;STA = tHIGH = 4.0 us */
> -				3,	/* tf = 0.3 us */
> +				4000,	/* tHD;STA = tHIGH = 4.0 us */
> +				sda_falling_time,
>  				0,	/* 0: DW default, 1: Ideal */
>  				0);	/* No offset */
>  	lcnt = i2c_dw_scl_lcnt(input_clock_khz,
> -				47,	/* tLOW = 4.7 us */
> -				3,	/* tf = 0.3 us */
> +				4700,	/* tLOW = 4.7 us */
> +				scl_falling_time,
>  				0);	/* No offset */
>  
>  	/* Allow platforms to specify the ideal HCNT and LCNT values */

  reply	other threads:[~2013-10-09  7:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20130828153429.GB7066@ab42.lan>
2013-10-08 15:00 ` [PATCH 1/2] i2c designware make SCL and SDA falling time configurable Romain Baeriswyl
2013-10-09  7:55   ` Mika Westerberg [this message]
2013-10-10  0:54     ` Ryan Mallon
     [not found]       ` <5255FAB5.7080803-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-10-13 11:36         ` Shinya Kuribayashi
     [not found]           ` <525A85D6.3090608-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
2014-01-16 19:43             ` Wolfram Sang
2014-01-20 16:43               ` [PATCH v2 " Romain Baeriswyl
     [not found]                 ` <1390236223-22584-1-git-send-email-romainba-ux6zf3SgZrrQT0dZR+AlfA@public.gmane.org>
2014-03-09  8:20                   ` Wolfram Sang
     [not found] ` <20130828153429.GB7066-7oYq3qWSd+k@public.gmane.org>
2013-10-08 15:00   ` [PATCH 2/2] i2c designware add support of I2C standard mode Romain Baeriswyl
2013-10-09  7:56     ` Mika Westerberg
     [not found]       ` <20131009075632.GR3521-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2013-10-13 11:46         ` Shinya Kuribayashi
2014-01-16 19:33     ` Wolfram Sang
2014-01-20 16:45       ` [PATCH v2 " Romain Baeriswyl
     [not found]         ` <1390236338-21407-1-git-send-email-romainba-ux6zf3SgZrrQT0dZR+AlfA@public.gmane.org>
2014-03-09  8:07           ` Wolfram Sang
2014-03-25 10:18             ` [PATCH V3 " Romain Baeriswyl

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=20131009075538.GQ3521@intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=Romain.Baeriswyl@abilis.com \
    --cc=chiau.ee.chew@intel.com \
    --cc=christian.ruppert@abilis.com \
    --cc=devicetree@vger.kernel.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=khali@linux-fr.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=pierrick.hascoet@abilis.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=romainba@abilis.com \
    --cc=skuribay@pobox.com \
    --cc=swarren@wwwdotorg.org \
    --cc=vgupta@synopsys.com \
    --cc=wsa@the-dreams.de \
    /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).