From patchwork Fri Jun 22 04:12:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 166487 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 CB970B6F77 for ; Fri, 22 Jun 2012 14:15:00 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 302F8280AA; Fri, 22 Jun 2012 06:14:12 +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 7U9UqOsrustN; Fri, 22 Jun 2012 06:14:11 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D6D60280F8; Fri, 22 Jun 2012 06:13:12 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8DFF528085 for ; Fri, 22 Jun 2012 06:12:34 +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 JSJgk9YHFpso for ; Fri, 22 Jun 2012 06:12:32 +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 mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by theia.denx.de (Postfix) with ESMTPS id DDC1928090 for ; Fri, 22 Jun 2012 06:12:29 +0200 (CEST) Received: by pbcwy7 with SMTP id wy7so2919154pbc.3 for ; Thu, 21 Jun 2012 21:12:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=n3KkmMuS7iHeYajknUTPlJxEb3X4bkUegRLzzDkDln4=; b=brP8Jx9Nc3Hsji+M/kVhGFNrlnPonHWCjNos/+doHvDdw4r9ONh2ETIHz5sPkWd4rp HXTXPVz6muo1nqTvLGEtAQcSQOP/zrNZ8E4VTBx21v8Ifq7owh4b9NIeveukz9yTUSz3 HQl2V7dMMKdG3zA5u2h/8O+EJIAZjLIeOMoS3AZMkFD9WwhYGKgFrqEVwrV5281sJ1nI lWNiSUAx9wqBnP+jCgg6vamFn08UzaVBseY1A2irOsO+WwCG3kzhTKFgUMULe5MyPFxS xkaijAwLcxw/xD5ddQjAMYxQvidZCK00z1DyKDmgCV8yz6LveWZVhf7ZMkiBBJHvkzaf PETA== Received: by 10.68.223.138 with SMTP id qu10mr5984941pbc.50.1340338347948; Thu, 21 Jun 2012 21:12:27 -0700 (PDT) Received: from officeserver-2 ([70.96.116.236]) by mx.google.com with ESMTPS id jw3sm37661529pbc.65.2012.06.21.21.12.23 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Jun 2012 21:12:24 -0700 (PDT) Received: from tkisky by officeserver-2 with local (Exim 4.76) (envelope-from ) id 1ShvEL-00032j-SO; Thu, 21 Jun 2012 21:12:21 -0700 From: Troy Kisky To: hs@denx.de, sbabic@denx.de Date: Thu, 21 Jun 2012 21:12:05 -0700 Message-Id: <1340338339-11626-10-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1340338339-11626-1-git-send-email-troy.kisky@boundarydevices.com> References: <1340338339-11626-1-git-send-email-troy.kisky@boundarydevices.com> X-Gm-Message-State: ALoCoQmEETxLhm4EcP2rReEpl4UtFfskXEqfezEi9k6a1FP3fRhYrZPrZpLoR76ay4VlqTSdveqA Cc: u-boot@lists.denx.de, r49496@freescale.com, jason.hui@linaro.org Subject: [U-Boot] [PATCH 10/24] mxc_i2c: place i2c_reset code inline 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 imx_reset is only referenced once so move to that location. Signed-off-by: Troy Kisky Acked-by: Marek Vasut --- drivers/i2c/mxc_i2c.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c index ac91872..2ef7b92 100644 --- a/drivers/i2c/mxc_i2c.c +++ b/drivers/i2c/mxc_i2c.c @@ -113,17 +113,6 @@ static uint8_t i2c_imx_get_clk(unsigned int rate) } /* - * Reset I2C Controller - */ -void i2c_reset(void) -{ - struct mxc_i2c_regs *i2c_regs = (struct mxc_i2c_regs *)I2C_BASE; - - writeb(0, &i2c_regs->i2cr); /* Reset module */ - writeb(0, &i2c_regs->i2sr); -} - -/* * Init I2C Bus */ void i2c_init(int speed, int unused) @@ -135,7 +124,9 @@ void i2c_init(int speed, int unused) /* Store divider value */ writeb(idx, &i2c_regs->ifdr); - i2c_reset(); + /* Reset module */ + writeb(0, &i2c_regs->i2cr); + writeb(0, &i2c_regs->i2sr); } /*