From patchwork Thu Jul 3 07:28:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Eibach X-Patchwork-Id: 366591 X-Patchwork-Delegate: trini@ti.com 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 E00CA1400B9 for ; Thu, 3 Jul 2014 17:29:44 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 486374A04A; Thu, 3 Jul 2014 09:29: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 eVu+00E-cG1e; Thu, 3 Jul 2014 09:29:29 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6B2DD4B5CB; Thu, 3 Jul 2014 09:28:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E07884A058 for ; Thu, 3 Jul 2014 09:28:47 +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 ZRcvEm3JNoBA for ; Thu, 3 Jul 2014 09:28:44 +0200 (CEST) X-Greylist: delayed 86186 seconds by postgrey-1.27 at theia; Thu, 03 Jul 2014 09:28:37 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 smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [80.67.29.23]) by theia.denx.de (Postfix) with ESMTPS id 0A31A4A03B for ; Thu, 3 Jul 2014 09:28:37 +0200 (CEST) Received: from [217.7.185.210] (helo=bob3.testumgebung.local) by smtprelay01.ispgateway.de with esmtpa (Exim 4.68) (envelope-from ) id 1X2bRd-0008QQ-9W; Thu, 03 Jul 2014 09:28:37 +0200 From: dirk.eibach@gdsys.cc To: u-boot@lists.denx.de Date: Thu, 3 Jul 2014 09:28:16 +0200 Message-Id: <1404372506-15314-4-git-send-email-dirk.eibach@gdsys.cc> X-Mailer: git-send-email 1.8.3 In-Reply-To: <1404372506-15314-1-git-send-email-dirk.eibach@gdsys.cc> References: <1404372506-15314-1-git-send-email-dirk.eibach@gdsys.cc> X-Df-Sender: ZGlyay5laWJhY2hAZ2RzeXMuY2M= Cc: Stefan Roese Subject: [U-Boot] [PATCH v4 03/13] board: controlcenterd: Use new API for setting i2c bus 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Dirk Eibach Signed-off-by: Dirk Eibach --- Changes in v4: None Changes in v3: None Changes in v2: - use defines for I2C bus numbers board/gdsys/p1022/controlcenterd-id.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/board/gdsys/p1022/controlcenterd-id.c b/board/gdsys/p1022/controlcenterd-id.c index 3fca3c5..419fc2e 100644 --- a/board/gdsys/p1022/controlcenterd-id.c +++ b/board/gdsys/p1022/controlcenterd-id.c @@ -86,6 +86,11 @@ enum { ESDHC_BOOT_IMAGE_ENTRY_OFS = 0x60, }; +enum { + I2C_SOC_0 = 0, + I2C_SOC_1 = 1, +}; + struct key_program { uint32_t magic; uint32_t code_crc; @@ -1156,7 +1161,7 @@ static void ccdm_hang(void) int j; #endif - I2C_SET_BUS(0); + I2C_SET_BUS(I2C_SOC_0); pca9698_direction_output(0x22, 0, 0); /* Finder */ pca9698_direction_output(0x22, 4, 0); /* Status */ @@ -1189,8 +1194,8 @@ int startup_ccdm_id_module(void) int result = 0; unsigned int orig_i2c_bus; - orig_i2c_bus = I2C_GET_BUS(); - I2C_SET_BUS(1); + orig_i2c_bus = i2c_get_bus_num(); + i2c_set_bus_num(I2C_SOC_1); /* goto end; */ @@ -1216,7 +1221,7 @@ int startup_ccdm_id_module(void) failure: result = 1; end: - I2C_SET_BUS(orig_i2c_bus); + i2c_set_bus_num(orig_i2c_bus); if (result) ccdm_hang();