linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: lp8788-buck: Remove buck[1|2]_vout_addr array
@ 2013-01-17  1:57 Axel Lin
  2013-01-17  2:10 ` Kim, Milo
  2013-01-17  7:06 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2013-01-17  1:57 UTC (permalink / raw)
  To: Mark Brown; +Cc: Milo Kim, Liam Girdwood, linux-kernel

The vout address for buck[1|2] can be easily calculated,
thus remote these arrays.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/lp8788-buck.c |   14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/regulator/lp8788-buck.c b/drivers/regulator/lp8788-buck.c
index ef845c7..97891a7 100644
--- a/drivers/regulator/lp8788-buck.c
+++ b/drivers/regulator/lp8788-buck.c
@@ -103,16 +103,6 @@ static const int lp8788_buck_vtbl[] = {
 	1950000, 2000000,
 };
 
-static const u8 buck1_vout_addr[] = {
-	LP8788_BUCK1_VOUT0, LP8788_BUCK1_VOUT1,
-	LP8788_BUCK1_VOUT2, LP8788_BUCK1_VOUT3,
-};
-
-static const u8 buck2_vout_addr[] = {
-	LP8788_BUCK2_VOUT0, LP8788_BUCK2_VOUT1,
-	LP8788_BUCK2_VOUT2, LP8788_BUCK2_VOUT3,
-};
-
 static void lp8788_buck1_set_dvs(struct lp8788_buck *buck)
 {
 	struct lp8788_buck1_dvs *dvs = (struct lp8788_buck1_dvs *)buck->dvs;
@@ -235,7 +225,7 @@ static u8 lp8788_select_buck_vout_addr(struct lp8788_buck *buck,
 			lp8788_read_byte(buck->lp, LP8788_BUCK_DVS_SEL, &val);
 			idx = (val & LP8788_BUCK1_DVS_M) >> LP8788_BUCK1_DVS_S;
 		}
-		addr = buck1_vout_addr[idx];
+		addr = LP8788_BUCK1_VOUT0 + idx;
 		break;
 	case BUCK2:
 		if (mode == EXTPIN) {
@@ -258,7 +248,7 @@ static u8 lp8788_select_buck_vout_addr(struct lp8788_buck *buck,
 			lp8788_read_byte(buck->lp, LP8788_BUCK_DVS_SEL, &val);
 			idx = (val & LP8788_BUCK2_DVS_M) >> LP8788_BUCK2_DVS_S;
 		}
-		addr = buck2_vout_addr[idx];
+		addr = LP8788_BUCK2_VOUT0 + idx;
 		break;
 	default:
 		goto err;
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] regulator: lp8788-buck: Remove buck[1|2]_vout_addr array
  2013-01-17  1:57 [PATCH] regulator: lp8788-buck: Remove buck[1|2]_vout_addr array Axel Lin
@ 2013-01-17  2:10 ` Kim, Milo
  2013-01-17  7:06 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Kim, Milo @ 2013-01-17  2:10 UTC (permalink / raw)
  To: Axel Lin; +Cc: Mark Brown, Liam Girdwood, linux-kernel@vger.kernel.org

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 336 bytes --]

> The vout address for buck[1|2] can be easily calculated,
> thus remote these arrays.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

Acked-by: Milo Kim <milo.kim@ti.com>
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] regulator: lp8788-buck: Remove buck[1|2]_vout_addr array
  2013-01-17  1:57 [PATCH] regulator: lp8788-buck: Remove buck[1|2]_vout_addr array Axel Lin
  2013-01-17  2:10 ` Kim, Milo
@ 2013-01-17  7:06 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2013-01-17  7:06 UTC (permalink / raw)
  To: Axel Lin; +Cc: Milo Kim, Liam Girdwood, linux-kernel

On Thu, Jan 17, 2013 at 09:57:46AM +0800, Axel Lin wrote:
> The vout address for buck[1|2] can be easily calculated,
> thus remote these arrays.

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-01-17  7:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-17  1:57 [PATCH] regulator: lp8788-buck: Remove buck[1|2]_vout_addr array Axel Lin
2013-01-17  2:10 ` Kim, Milo
2013-01-17  7:06 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).