public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 6/9] twl6035: make twl6030_i2c_[read|write]_u8 static inline
Date: Fri, 22 Mar 2013 16:33:21 -0500	[thread overview]
Message-ID: <1363988004-25819-7-git-send-email-nm@ti.com> (raw)
In-Reply-To: <1363988004-25819-1-git-send-email-nm@ti.com>

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 <nm@ti.com>
---
 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 <config.h>
 #include <twl6035.h>
 
-/* 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);
-- 
1.7.9.5

  parent reply	other threads:[~2013-03-22 21:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-22 21:33 [U-Boot] [PATCH V2 0/9] OMAP3-5: TWL[46]03[05]: cleanup register access and misc minimal cleanups Nishanth Menon
2013-03-22 21:33 ` [U-Boot] [PATCH V2 1/9] twl4030: make twl4030_i2c_write_u8 prototype consistent Nishanth Menon
2013-03-22 21:33 ` [U-Boot] [PATCH V2 2/9] twl4030: make twl4030_i2c_read_u8 " Nishanth Menon
2013-03-22 21:33 ` [U-Boot] [PATCH V2 3/9] twl6030: twl6030_i2c_[read|write]_u8 " Nishanth Menon
2013-03-22 21:33 ` [U-Boot] [PATCH V2 4/9] twl6030: move twl6030 register access functions to common header file Nishanth Menon
2013-03-22 21:33 ` [U-Boot] [PATCH V2 5/9] twl6030: add header guard Nishanth Menon
2013-03-22 21:33 ` Nishanth Menon [this message]
2013-03-22 21:33 ` [U-Boot] [PATCH V2 7/9] twl6035: twl6035_i2c_[read|write]_u8 prototype consistent Nishanth Menon
2013-03-22 21:33 ` [U-Boot] [PATCH V2 8/9] twl6035: remove redundant palmas_[read|write]_u8 Nishanth Menon
2013-03-22 21:33 ` [U-Boot] [PATCH V2 9/9] twl6035: add header guard Nishanth Menon
2013-03-25 17:47 ` [U-Boot] [PATCH V2 0/9] OMAP3-5: TWL[46]03[05]: cleanup register access and misc minimal cleanups Sricharan R
2013-03-25 18:20   ` Nishanth Menon
2013-03-26  9:31     ` Sricharan R
2013-03-26 13:25       ` Nishanth Menon
2013-03-26 13:34         ` Sricharan R

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1363988004-25819-7-git-send-email-nm@ti.com \
    --to=nm@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox