From patchwork Mon Jul 7 04:17:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengzhou Liu X-Patchwork-Id: 367420 X-Patchwork-Delegate: hs@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 14DAE1400E0 for ; Mon, 7 Jul 2014 15:03:47 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C978E4B639; Mon, 7 Jul 2014 07:03:40 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Jpe1+IOb3LRt; Mon, 7 Jul 2014 07:03:40 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DD4E24B585; Mon, 7 Jul 2014 07:03:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C82744A033 for ; Mon, 7 Jul 2014 07:03:29 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3boFFKL28hYd for ; Mon, 7 Jul 2014 07:03:26 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1lp0145.outbound.protection.outlook.com [207.46.163.145]) by theia.denx.de (Postfix) with ESMTPS id 1CC374B372 for ; Mon, 7 Jul 2014 07:03:21 +0200 (CEST) Received: from BLUPR03MB149.namprd03.prod.outlook.com (10.255.212.17) by BLUPR03MB261.namprd03.prod.outlook.com (10.255.213.12) with Microsoft SMTP Server (TLS) id 15.0.974.11; Mon, 7 Jul 2014 05:03:18 +0000 Received: from BLUPR03CA030.namprd03.prod.outlook.com (10.141.30.23) by BLUPR03MB149.namprd03.prod.outlook.com (10.255.212.17) with Microsoft SMTP Server (TLS) id 15.0.974.11; Mon, 7 Jul 2014 05:03:17 +0000 Received: from BY2FFO11FD056.protection.gbl (2a01:111:f400:7c0c::122) by BLUPR03CA030.outlook.office365.com (2a01:111:e400:879::23) with Microsoft SMTP Server (TLS) id 15.0.985.8 via Frontend Transport; Mon, 7 Jul 2014 05:03:17 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD056.mail.protection.outlook.com (10.1.15.193) with Microsoft SMTP Server (TLS) id 15.0.980.11 via Frontend Transport; Mon, 7 Jul 2014 05:03:17 +0000 Received: from rock.ap.freescale.net (rock.ap.freescale.net [10.193.20.106]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s6753B24014793; Sun, 6 Jul 2014 22:03:15 -0700 From: Shengzhou Liu To: , Date: Mon, 7 Jul 2014 12:17:48 +0800 Message-ID: <1404706668-16303-2-git-send-email-Shengzhou.Liu@freescale.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1404706668-16303-1-git-send-email-Shengzhou.Liu@freescale.com> References: <1404706668-16303-1-git-send-email-Shengzhou.Liu@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(199002)(189002)(36756003)(50466002)(93916002)(102836001)(47776003)(19580395003)(83322001)(19580405001)(92566001)(92726001)(86362001)(69596002)(68736004)(84676001)(74662001)(62966002)(74502001)(81542001)(48376002)(77156001)(31966008)(26826002)(64706001)(20776003)(80022001)(46102001)(99396002)(76482001)(104016002)(95666004)(4396001)(88136002)(104166001)(44976005)(21056001)(87286001)(81342001)(50226001)(105606002)(87936001)(6806004)(85306003)(50986999)(107046002)(85852003)(89996001)(79102001)(76176999)(97736001)(83072002)(229853001)(106466001)(81156004)(77982001); DIR:OUT; SFP:; SCL:1; SRVR:BLUPR03MB149; H:az84smr01.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-Forefront-PRVS: 02652BD10A Received-SPF: Fail (: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=Shengzhou.Liu@freescale.com; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-OriginatorOrg: freescale.com Subject: [U-Boot] [PATCH] fsl_i2c: add support for 3rd and 4th I2C X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Add support for 3rd and 4th I2C. Signed-off-by: Shengzhou Liu --- drivers/i2c/fsl_i2c.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c index aa159f8..811033b 100644 --- a/drivers/i2c/fsl_i2c.c +++ b/drivers/i2c/fsl_i2c.c @@ -46,10 +46,16 @@ DECLARE_GLOBAL_DATA_PTR; -static const struct fsl_i2c *i2c_dev[2] = { +static const struct fsl_i2c *i2c_dev[4] = { (struct fsl_i2c *)(CONFIG_SYS_IMMR + CONFIG_SYS_FSL_I2C_OFFSET), #ifdef CONFIG_SYS_FSL_I2C2_OFFSET - (struct fsl_i2c *)(CONFIG_SYS_IMMR + CONFIG_SYS_FSL_I2C2_OFFSET) + (struct fsl_i2c *)(CONFIG_SYS_IMMR + CONFIG_SYS_FSL_I2C2_OFFSET), +#endif +#ifdef CONFIG_SYS_FSL_I2C3_OFFSET + (struct fsl_i2c *)(CONFIG_SYS_IMMR + CONFIG_SYS_FSL_I2C3_OFFSET), +#endif +#ifdef CONFIG_SYS_FSL_I2C4_OFFSET + (struct fsl_i2c *)(CONFIG_SYS_IMMR + CONFIG_SYS_FSL_I2C4_OFFSET) #endif }; @@ -539,3 +545,15 @@ U_BOOT_I2C_ADAP_COMPLETE(fsl_1, fsl_i2c_init, fsl_i2c_probe, fsl_i2c_read, CONFIG_SYS_FSL_I2C2_SPEED, CONFIG_SYS_FSL_I2C2_SLAVE, 1) #endif +#ifdef CONFIG_SYS_FSL_I2C3_OFFSET +U_BOOT_I2C_ADAP_COMPLETE(fsl_2, fsl_i2c_init, fsl_i2c_probe, fsl_i2c_read, + fsl_i2c_write, fsl_i2c_set_bus_speed, + CONFIG_SYS_FSL_I2C3_SPEED, CONFIG_SYS_FSL_I2C3_SLAVE, + 2) +#endif +#ifdef CONFIG_SYS_FSL_I2C4_OFFSET +U_BOOT_I2C_ADAP_COMPLETE(fsl_3, fsl_i2c_init, fsl_i2c_probe, fsl_i2c_read, + fsl_i2c_write, fsl_i2c_set_bus_speed, + CONFIG_SYS_FSL_I2C4_SPEED, CONFIG_SYS_FSL_I2C4_SLAVE, + 3) +#endif