linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 02/11] i2c: OMAP: Add DT support for i2c controller
Date: Tue, 20 Dec 2011 10:42:43 -0600	[thread overview]
Message-ID: <4EF0BB03.6040906@gmail.com> (raw)
In-Reply-To: <1324398444-23296-3-git-send-email-b-cousson@ti.com>

On 12/20/2011 10:27 AM, Benoit Cousson wrote:
> Add initial DT support to retrieve the frequency using a
> DT attribute instead of the pdata pointer if of_node exist.
> 
> Add documentation for omap i2c controller binding.
> 
> Based on original patches from Manju and Grant.
> 
> Signed-off-by: Benoit Cousson <b-cousson@ti.com>
> Cc: Ben Dooks <ben-linux@fluff.org>
> Cc: Kevin Hilman <khilman@ti.com>

One issue below, otherwise:

Reviewed-by: Rob Herring <rob.herring@calxeda.com>


> @@ -1001,15 +1019,24 @@ omap_i2c_probe(struct platform_device *pdev)
>  		goto err_release_region;
>  	}
>  
> -	if (pdata != NULL) {
> -		speed = pdata->clkrate;
> +	match = of_match_device(omap_i2c_of_match, &pdev->dev);
> +	if (match) {
> +		u32 freq = 100000; /* default to 100000 Hz */
> +
> +		pdata = match->data;
> +		dev->dtrev = pdata->rev;
> +		dev->flags = pdata->flags;
> +
> +		of_property_read_u32(node, "clock-frequency", &freq);
> +		/* convert DT freq value in Hz into kHz for speed */
> +		dev->speed = freq / 1000;
> +	} else if (pdata != NULL) {
> +		dev->speed = pdata->clkrate;
> +		dev->flags = pdata->flags;
>  		dev->set_mpu_wkup_lat = pdata->set_mpu_wkup_lat;
> -	} else {
> -		speed = 100;	/* Default speed */
> -		dev->set_mpu_wkup_lat = NULL;
> +		dev->dtrev = pdata->rev;

If you get here, pdata is NULL.

Rob

  reply	other threads:[~2011-12-20 16:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-20 16:27 [PATCH v3 00/11] OMAP4: Add DT support for i2c and twl6030 Benoit Cousson
2011-12-20 16:27 ` [PATCH v3 01/11] ARM: OMAP2+: pm: Do not init statically the SR and voltage layer with DT Benoit Cousson
2011-12-20 16:27 ` [PATCH v3 02/11] i2c: OMAP: Add DT support for i2c controller Benoit Cousson
2011-12-20 16:42   ` Rob Herring [this message]
2011-12-22  8:55     ` Cousson, Benoit
2011-12-20 21:24   ` Olof Johansson
2011-12-22 14:01     ` Cousson, Benoit
2011-12-20 16:27 ` [PATCH v3 03/11] rtc: rtc-twl: Add DT support for RTC inside twl4030/twl6030 Benoit Cousson
2011-12-20 16:27 ` [PATCH v3 04/11] arm/dts: OMAP4: Add i2c controller nodes Benoit Cousson
2011-12-20 16:27 ` [PATCH v3 05/11] arm/dts: OMAP3: " Benoit Cousson
2011-12-20 16:27 ` [PATCH v3 06/11] arm/dts: twl6030: Add DTS file for twl6030 PMIC Benoit Cousson
2011-12-20 16:27 ` [PATCH v3 07/11] arm/dts: twl4030: Add DTS file for twl4030 PM + Audio IC Benoit Cousson
2011-12-20 16:47   ` Rob Herring
2011-12-20 16:51     ` Rob Herring
2011-12-20 16:27 ` [PATCH v3 08/11] arm/dts: omap4-panda: Add twl6030 and i2c EEPROM Benoit Cousson
2011-12-20 16:27 ` [PATCH v3 09/11] arm/dts: omap4-sdp: Add twl6030, i2c3 and i2c4 devices Benoit Cousson
2011-12-20 16:27 ` [PATCH v3 10/11] arm/dts: omap3-beagle: Add twl4030 and i2c EEPROM Benoit Cousson
2011-12-20 16:27 ` [PATCH v3 11/11] ARM: OMAP2+: board-generic: Remove i2c static init Benoit Cousson
2011-12-22 15:07 ` [PATCH v3 00/11] OMAP4: Add DT support for i2c and twl6030 Rob Herring
2011-12-23  9:18   ` Cousson, Benoit

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=4EF0BB03.6040906@gmail.com \
    --to=robherring2@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).