All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] power: twl6035: cleanup register access API
Date: Tue, 12 Mar 2013 15:39:00 -0500	[thread overview]
Message-ID: <1363120740-13775-1-git-send-email-nm@ti.com> (raw)

commit 21144298 (power: twl6035: add palmas PMIC support)
introduced twl6035_i2c_[read|write]_u8
Then, commit dd23e59d (omap5: pbias ldo9 turn on)
introduced palmas_[read|write]_u8
for precisely the same access function. TWL6035 belongs to
the palmas family, so instead of having an palmas API,
we could use twl6035 API instead (which is used elsewhere
as well).

Account for the parameter change while doing the change and
remove palmas register accessors.

Cc: Balaji T K <balajitk@ti.com>
Cc: Sricharan R <r.sricharan@ti.com>
Reported-by: Ruchika Kharwar <ruchika@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
 drivers/power/twl6035.c |   15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/power/twl6035.c b/drivers/power/twl6035.c
index d3de698..b0b2406 100644
--- a/drivers/power/twl6035.c
+++ b/drivers/power/twl6035.c
@@ -34,17 +34,6 @@ 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)
-{
-	return i2c_write(chip_no, reg, 1, &val, 1);
-}
-
-static inline int palmas_read_u8(u8 chip_no, u8 reg, u8 *val)
-{
-	return i2c_read(chip_no, reg, 1, val, 1);
-}
-
 void twl6035_init_settings(void)
 {
 	return;
@@ -57,7 +46,7 @@ int twl6035_mmc1_poweron_ldo(void)
 	/* set LDO9 TWL6035 to 3V */
 	val = 0x2b; /* (3 -.9)*28 +1 */
 
-	if (palmas_write_u8(0x48, LDO9_VOLTAGE, val)) {
+	if (twl6035_i2c_write_u8(0x48, val, LDO9_VOLTAGE)) {
 		printf("twl6035: could not set LDO9 voltage.\n");
 		return 1;
 	}
@@ -65,7 +54,7 @@ int twl6035_mmc1_poweron_ldo(void)
 	/* TURN ON LDO9 */
 	val = LDO_ON | LDO_MODE_SLEEP | LDO_MODE_ACTIVE;
 
-	if (palmas_write_u8(0x48, LDO9_CTRL, val)) {
+	if (twl6035_i2c_write_u8(0x48, val, LDO9_CTRL)) {
 		printf("twl6035: could not turn on LDO9.\n");
 		return 1;
 	}
-- 
1.7.9.5

             reply	other threads:[~2013-03-12 20:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-12 20:39 Nishanth Menon [this message]
2013-03-13  5:23 ` [U-Boot] [PATCH] power: twl6035: cleanup register access API Sricharan R
2013-03-13  6:54 ` Balaji T K
2013-03-13 13:05   ` Nishanth Menon

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=1363120740-13775-1-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.