From patchwork Thu Mar 3 13:50:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Green X-Patchwork-Id: 298 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:41:32 -0000 Delivered-To: patches@linaro.org Received: by 10.224.19.208 with SMTP id c16cs243594qab; Thu, 3 Mar 2011 05:50:37 -0800 (PST) Received: by 10.227.155.15 with SMTP id q15mr962245wbw.133.1299160236622; Thu, 03 Mar 2011 05:50:36 -0800 (PST) Received: from mail-wy0-f178.google.com (mail-wy0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id j7si2106667wbc.19.2011.03.03.05.50.35 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 03 Mar 2011 05:50:36 -0800 (PST) Received-SPF: pass (google.com: domain of andy.warmcat.com@googlemail.com designates 74.125.82.178 as permitted sender) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=pass (google.com: domain of andy.warmcat.com@googlemail.com designates 74.125.82.178 as permitted sender) smtp.mail=andy.warmcat.com@googlemail.com; dkim=pass (test mode) header.i=@googlemail.com Received: by mail-wy0-f178.google.com with SMTP id 28so1247412wyf.37 for ; Thu, 03 Mar 2011 05:50:35 -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=0So+t4QeKSXk94OCJTsdEeZgOBNfYZuNel8I9YGM/60=; b=j0djTdzwNHJQDhoIwgfvaxKNXsSINKDH6m76b7Qv4EUxpP6kjHW03flZ/b0URprt82 I7rtBa9Ru1TbFpCuTGcjkoq100xnuIjYsbvbwlvGQpbqm/JZwaZ/czOhRNFdzThbF9jF S2mTOZKWWIGYRiypFEThP268RM6GdDPkXt/to= 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=WbNJLo3gqKwaBU/V7WxCpifCbHrcCZyw5OUqpdNf8cKVhvyDBLcYMLOigTkmBITZCl ZLtO9UdFq7TF68c3rf9TIh8SbsnVeVZHErWbKi0nZS2H/QyBLc39PVWIsuKMwz+nMITR f+vm6otLlgT9+Lxn2VYlLYQ3apNYiq4YdfMlk= Received: by 10.216.178.138 with SMTP id f10mr846224wem.98.1299160232251; Thu, 03 Mar 2011 05:50:32 -0800 (PST) Received: from otae.warmcat.com (s15404224.onlinehome-server.info [87.106.134.80]) by mx.google.com with ESMTPS id h39sm585286wes.29.2011.03.03.05.50.31 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 03 Mar 2011 05:50:31 -0800 (PST) Sender: Andy Green From: Andy Green Subject: [PATCH 2/4] OMAP3 I2C document why cpu type and not peripheral unit ID used to probe To: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org Cc: patches@linaro.org, Andy Green Date: Thu, 03 Mar 2011 13:50:30 +0000 Message-ID: <20110303135030.30648.14923.stgit@otae.warmcat.com> In-Reply-To: <20110303134744.30648.91218.stgit@otae.warmcat.com> References: <20110303134744.30648.91218.stgit@otae.warmcat.com> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Describe why we can't simply probe the peripheral unit ID to make the decision about what register map to use Cc: patches@linaro.org Signed-off-by: Andy Green --- drivers/i2c/busses/i2c-omap.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index b605ff3..d6500ec 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -1032,6 +1032,17 @@ omap_i2c_probe(struct platform_device *pdev) else dev->reg_shift = 2; + dev->regs = (u8 *)reg_map; + + /* + * this is a bit tricky, implementation on 4430 has the active + * part of its ID register moved to +4 instead of +0 as + * previously. So, we can't probe just using the ID register + * Complicating matters the older implementation using the + * simpler register set on 3530 also reports its revision as + * 0x40, same as the 4430 newer implementation. + */ + if (cpu_is_omap44xx()) dev->regs = (u8 *) omap4_reg_map; else