* [PATCH] regulator: lp8788-buck: Remove lp8788_set_default_dvs_ctrl_mode function
@ 2012-07-20 14:22 Axel Lin
2012-07-23 0:59 ` Kim, Milo
2012-08-01 20:01 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2012-07-20 14:22 UTC (permalink / raw)
To: Mark Brown; +Cc: Milo(Woogyom) Kim, Liam Girdwood, linux-kernel
We already know the mask in lp8788_init_dvs() function, and we can update
the corresponding bit for default_dvs_mode in lp8788_init_dvs() function.
This function looks not necessary to me.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/lp8788-buck.c | 25 +++----------------------
1 file changed, 3 insertions(+), 22 deletions(-)
diff --git a/drivers/regulator/lp8788-buck.c b/drivers/regulator/lp8788-buck.c
index 6356e82..0c93a6a 100644
--- a/drivers/regulator/lp8788-buck.c
+++ b/drivers/regulator/lp8788-buck.c
@@ -459,27 +459,6 @@ static struct regulator_desc lp8788_buck_desc[] = {
},
};
-static int lp8788_set_default_dvs_ctrl_mode(struct lp8788 *lp,
- enum lp8788_buck_id id)
-{
- u8 mask, val;
-
- switch (id) {
- case BUCK1:
- mask = LP8788_BUCK1_DVS_SEL_M;
- val = LP8788_BUCK1_DVS_I2C;
- break;
- case BUCK2:
- mask = LP8788_BUCK2_DVS_SEL_M;
- val = LP8788_BUCK2_DVS_I2C;
- break;
- default:
- return 0;
- }
-
- return lp8788_update_bits(lp, LP8788_BUCK_DVS_SEL, mask, val);
-}
-
static int _gpio_request(struct lp8788_buck *buck, int gpio, char *name)
{
struct device *dev = buck->lp->dev;
@@ -530,6 +509,7 @@ static int lp8788_init_dvs(struct lp8788_buck *buck, enum lp8788_buck_id id)
struct lp8788_platform_data *pdata = buck->lp->pdata;
u8 mask[] = { LP8788_BUCK1_DVS_SEL_M, LP8788_BUCK2_DVS_SEL_M };
u8 val[] = { LP8788_BUCK1_DVS_PIN, LP8788_BUCK2_DVS_PIN };
+ u8 default_dvs_mode[] = { LP8788_BUCK1_DVS_I2C, LP8788_BUCK2_DVS_I2C };
/* no dvs for buck3, 4 */
if (id == BUCK3 || id == BUCK4)
@@ -550,7 +530,8 @@ static int lp8788_init_dvs(struct lp8788_buck *buck, enum lp8788_buck_id id)
val[id]);
set_default_dvs_mode:
- return lp8788_set_default_dvs_ctrl_mode(buck->lp, id);
+ return lp8788_update_bits(buck->lp, LP8788_BUCK_DVS_SEL, mask[id],
+ default_dvs_mode[id]);
}
static __devinit int lp8788_buck_probe(struct platform_device *pdev)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH] regulator: lp8788-buck: Remove lp8788_set_default_dvs_ctrl_mode function
2012-07-20 14:22 [PATCH] regulator: lp8788-buck: Remove lp8788_set_default_dvs_ctrl_mode function Axel Lin
@ 2012-07-23 0:59 ` Kim, Milo
2012-08-01 20:01 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Kim, Milo @ 2012-07-23 0:59 UTC (permalink / raw)
To: Axel Lin; +Cc: Mark Brown, Girdwood, Liam, linux-kernel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 551 bytes --]
> We already know the mask in lp8788_init_dvs() function, and we can
> update
> the corresponding bit for default_dvs_mode in lp8788_init_dvs()
> function.
> This function looks not necessary to me.
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Tested-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Thanks for catching this !
Best Regards,
Milo
ÿôèº{.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 lp8788_set_default_dvs_ctrl_mode function
2012-07-20 14:22 [PATCH] regulator: lp8788-buck: Remove lp8788_set_default_dvs_ctrl_mode function Axel Lin
2012-07-23 0:59 ` Kim, Milo
@ 2012-08-01 20:01 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2012-08-01 20:01 UTC (permalink / raw)
To: Axel Lin; +Cc: Milo(Woogyom) Kim, Liam Girdwood, linux-kernel
On Fri, Jul 20, 2012 at 10:22:20PM +0800, Axel Lin wrote:
> We already know the mask in lp8788_init_dvs() function, and we can update
> the corresponding bit for default_dvs_mode in lp8788_init_dvs() function.
> This function looks not necessary to me.
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-01 20:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-20 14:22 [PATCH] regulator: lp8788-buck: Remove lp8788_set_default_dvs_ctrl_mode function Axel Lin
2012-07-23 0:59 ` Kim, Milo
2012-08-01 20:01 ` 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).