From patchwork Tue Mar 8 11:07:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Green X-Patchwork-Id: 422 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:42:35 -0000 Delivered-To: patches@linaro.org Received: by 10.224.60.68 with SMTP id o4cs23913qah; Tue, 8 Mar 2011 03:07:46 -0800 (PST) Received: by 10.227.197.21 with SMTP id ei21mr4438128wbb.107.1299582465500; Tue, 08 Mar 2011 03:07:45 -0800 (PST) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id j3si809987wbc.21.2011.03.08.03.07.44 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Mar 2011 03:07:45 -0800 (PST) Received-SPF: pass (google.com: domain of andy.warmcat.com@googlemail.com designates 74.125.82.50 as permitted sender) client-ip=74.125.82.50; Authentication-Results: mx.google.com; spf=pass (google.com: domain of andy.warmcat.com@googlemail.com designates 74.125.82.50 as permitted sender) smtp.mail=andy.warmcat.com@googlemail.com; dkim=pass (test mode) header.i=@googlemail.com Received: by mail-ww0-f50.google.com with SMTP id 33so899432wwc.31 for ; Tue, 08 Mar 2011 03:07:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:sender:from:subject:to:cc:date:message-id :in-reply-to:references:user-agent:mime-version:content-type :content-transfer-encoding; bh=clvqktnitUEibLjgRCYqwVFOp0Z8jXgHIqdUhGYl6Es=; b=jyvXnm+j4rxeaPYcNEreImDR98woUd3ElPqT90uVDdbCKejGgFsTau53JH0JH53CVU Y4p+Zj2rkH9QuHrTlLf3luZTt5zh/wwcpqaXq4gp5zK8eSrUpDwVHz2oEC/WWXsLHSkN zkixtBVhC/5T9NsBlrq6zsg9xmdf0X0RT4bsA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=sender:from:subject:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; b=UQFDWPL4uOZetkesdhk1d83YeFHWmPAnvHnI4U5w+A9acx9w9dGEV/0B2urB9vl34D CSnhKXUcCl7BmjQ8sTTj4Ks/yQtHKUiWz6/u/HKTo99OwDtEBLFLuvNUcrgVqqaEoay+ l5arJU7ndPSGhj62T3tPVeQvy3UjngBkXEb0g= Received: by 10.216.35.82 with SMTP id t60mr3333221wea.46.1299582464748; Tue, 08 Mar 2011 03:07:44 -0800 (PST) Received: from otae.warmcat.com (s15404224.onlinehome-server.info [87.106.134.80]) by mx.google.com with ESMTPS id r80sm249502wei.39.2011.03.08.03.07.43 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Mar 2011 03:07:44 -0800 (PST) Sender: Andy Green From: Andy Green Subject: [PATCH 2 03/18] I2C: OMAP2+: Introduce I2C IP versioning constants To: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org Cc: patches@linaro.org, Ben Dooks , Andy Green Date: Tue, 08 Mar 2011 11:07:42 +0000 Message-ID: <20110308110742.23531.82979.stgit@otae.warmcat.com> In-Reply-To: <20110308105934.23531.83540.stgit@otae.warmcat.com> References: <20110308105934.23531.83540.stgit@otae.warmcat.com> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 These represent the two kinds of (incompatible) OMAP I2C peripheral unit in use so far. The constants are in linux/i2c-omap.h so the omap i2c driver can have them too. Cc: patches@linaro.org Cc: Ben Dooks Reported-by: Peter Maydell Signed-off-by: Andy Green --- arch/arm/plat-omap/include/plat/i2c.h | 1 + include/linux/i2c-omap.h | 12 ++++++++++++ 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/arch/arm/plat-omap/include/plat/i2c.h b/arch/arm/plat-omap/include/plat/i2c.h index 878d632..a1d3d06 100644 --- a/arch/arm/plat-omap/include/plat/i2c.h +++ b/arch/arm/plat-omap/include/plat/i2c.h @@ -22,6 +22,7 @@ #define __ASM__ARCH_OMAP_I2C_H #include +#include #if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE) extern int omap_register_i2c_bus(int bus_id, u32 clkrate, diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h index 7472449..701886d 100644 --- a/include/linux/i2c-omap.h +++ b/include/linux/i2c-omap.h @@ -3,6 +3,18 @@ #include +/* + * Version 2 of the I2C peripheral unit has a different register + * layout and extra registers. The ID register in the V2 peripheral + * unit on the OMAP4430 reports the same ID as the V1 peripheral + * unit on the OMAP3530, so we must inform the driver which IP + * version we know it is running on from platform / cpu-specific + * code using these constants in the hwmod class definition. + */ + +#define OMAP_I2C_IP_VERSION_1 1 +#define OMAP_I2C_IP_VERSION_2 2 + struct omap_i2c_bus_platform_data { u32 clkrate; void (*set_mpu_wkup_lat)(struct device *dev, long set);