From patchwork Fri Mar 22 21:33:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 230263 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 7E9F62C00C3 for ; Sat, 23 Mar 2013 08:34:31 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 86D8E4A160; Fri, 22 Mar 2013 22:34:20 +0100 (CET) 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 16dXm7RgQUTz; Fri, 22 Mar 2013 22:34:20 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 41F804A202; Fri, 22 Mar 2013 22:33:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 94E374A128 for ; Fri, 22 Mar 2013 22:33:38 +0100 (CET) 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 MUNJNWwvwvz4 for ; Fri, 22 Mar 2013 22:33:37 +0100 (CET) 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 devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by theia.denx.de (Postfix) with ESMTPS id 0A3C14A0A5 for ; Fri, 22 Mar 2013 22:33:32 +0100 (CET) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r2MLXUji008738 for ; Fri, 22 Mar 2013 16:33:30 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r2MLXUS7008994 for ; Fri, 22 Mar 2013 16:33:30 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Fri, 22 Mar 2013 16:33:30 -0500 Received: from localhost (kahuna.am.dhcp.ti.com [128.247.75.12]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r2MLXUDL017931; Fri, 22 Mar 2013 16:33:30 -0500 From: Nishanth Menon To: tom Date: Fri, 22 Mar 2013 16:33:21 -0500 Message-ID: <1363988004-25819-7-git-send-email-nm@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1363988004-25819-1-git-send-email-nm@ti.com> References: <1363988004-25819-1-git-send-email-nm@ti.com> MIME-Version: 1.0 Cc: u-boot , Ruchika Kharwar , Balaji T K Subject: [U-Boot] [PATCH V2 6/9] twl6035: make twl6030_i2c_[read|write]_u8 static 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de twl6030_i2c_[read|write]_u8 can be used else where to access multi-function device such as twl6035, we dont need to incurr an function call overhead, so use static inline. Signed-off-by: Nishanth Menon --- drivers/power/twl6035.c | 11 ----------- include/twl6035.h | 13 +++++++++++-- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/power/twl6035.c b/drivers/power/twl6035.c index d3de698..0c2cdfe 100644 --- a/drivers/power/twl6035.c +++ b/drivers/power/twl6035.c @@ -23,17 +23,6 @@ #include #include -/* Functions to read and write from TWL6030 */ -int twl6035_i2c_write_u8(u8 chip_no, u8 val, u8 reg) -{ - return i2c_write(chip_no, reg, 1, &val, 1); -} - -int twl6035_i2c_read_u8(u8 chip_no, u8 *val, u8 reg) -{ - return i2c_read(chip_no, reg, 1, val, 1); -} - /* To align with i2c mw/mr address, reg, val command syntax */ static inline int palmas_write_u8(u8 chip_no, u8 reg, u8 val) { diff --git a/include/twl6035.h b/include/twl6035.h index ce74348..89c2ab5 100644 --- a/include/twl6035.h +++ b/include/twl6035.h @@ -36,7 +36,16 @@ #define LDO_MODE_SLEEP (1 << 2) #define LDO_MODE_ACTIVE (1 << 0) -int twl6035_i2c_write_u8(u8 chip_no, u8 val, u8 reg); -int twl6035_i2c_read_u8(u8 chip_no, u8 *val, u8 reg); +/* Functions to read and write from TWL6030 */ +static inline int twl6035_i2c_write_u8(u8 chip_no, u8 val, u8 reg) +{ + return i2c_write(chip_no, reg, 1, &val, 1); +} + +static inline int twl6035_i2c_read_u8(u8 chip_no, u8 *val, u8 reg) +{ + return i2c_read(chip_no, reg, 1, val, 1); +} + void twl6035_init_settings(void); int twl6035_mmc1_poweron_ldo(void);