* [PATCH 1/2] regulator: lp8788-buck: Remove val array in lp8788_init_dvs
@ 2012-12-07 9:23 Axel Lin
2012-12-07 9:25 ` [PATCH 2/2] regulator: lp8788-buck: Kill _gpio_request function Axel Lin
2012-12-10 2:27 ` [PATCH 1/2] regulator: lp8788-buck: Remove val array in lp8788_init_dvs Kim, Milo
0 siblings, 2 replies; 7+ messages in thread
From: Axel Lin @ 2012-12-07 9:23 UTC (permalink / raw)
To: Mark Brown; +Cc: Milo(Woogyom) Kim, Liam Girdwood, linux-kernel
All elements of val array are zero.
Simply set data argument to be 0 in lp8788_update_bits call and remove the val
array.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/regulator/lp8788-buck.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/regulator/lp8788-buck.c b/drivers/regulator/lp8788-buck.c
index 6cc02c3..d33b81a 100644
--- a/drivers/regulator/lp8788-buck.c
+++ b/drivers/regulator/lp8788-buck.c
@@ -478,7 +478,6 @@ 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 */
@@ -496,8 +495,7 @@ static int lp8788_init_dvs(struct lp8788_buck *buck, enum lp8788_buck_id id)
if (lp8788_dvs_gpio_request(buck, id))
goto set_default_dvs_mode;
- return lp8788_update_bits(buck->lp, LP8788_BUCK_DVS_SEL, mask[id],
- val[id]);
+ return lp8788_update_bits(buck->lp, LP8788_BUCK_DVS_SEL, mask[id], 0);
set_default_dvs_mode:
return lp8788_update_bits(buck->lp, LP8788_BUCK_DVS_SEL, mask[id],
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 2/2] regulator: lp8788-buck: Kill _gpio_request function
2012-12-07 9:23 [PATCH 1/2] regulator: lp8788-buck: Remove val array in lp8788_init_dvs Axel Lin
@ 2012-12-07 9:25 ` Axel Lin
2012-12-10 2:28 ` Kim, Milo
2012-12-10 3:19 ` Mark Brown
2012-12-10 2:27 ` [PATCH 1/2] regulator: lp8788-buck: Remove val array in lp8788_init_dvs Kim, Milo
1 sibling, 2 replies; 7+ messages in thread
From: Axel Lin @ 2012-12-07 9:25 UTC (permalink / raw)
To: Mark Brown; +Cc: Milo(Woogyom) Kim, Liam Girdwood, linux-kernel
Simply use devm_gpio_request_one() instead.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/regulator/lp8788-buck.c | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/drivers/regulator/lp8788-buck.c b/drivers/regulator/lp8788-buck.c
index d33b81a..369b034 100644
--- a/drivers/regulator/lp8788-buck.c
+++ b/drivers/regulator/lp8788-buck.c
@@ -429,18 +429,6 @@ static struct regulator_desc lp8788_buck_desc[] = {
},
};
-static int _gpio_request(struct lp8788_buck *buck, int gpio, char *name)
-{
- struct device *dev = buck->lp->dev;
-
- if (!gpio_is_valid(gpio)) {
- dev_err(dev, "invalid gpio: %d\n", gpio);
- return -EINVAL;
- }
-
- return devm_gpio_request_one(dev, gpio, DVS_LOW, name);
-}
-
static int lp8788_dvs_gpio_request(struct lp8788_buck *buck,
enum lp8788_buck_id id)
{
@@ -452,7 +440,8 @@ static int lp8788_dvs_gpio_request(struct lp8788_buck *buck,
switch (id) {
case BUCK1:
gpio = pdata->buck1_dvs->gpio;
- ret = _gpio_request(buck, gpio, b1_name);
+ ret = devm_gpio_request_one(buck->lp->dev, gpio, DVS_LOW,
+ b1_name);
if (ret)
return ret;
@@ -461,7 +450,8 @@ static int lp8788_dvs_gpio_request(struct lp8788_buck *buck,
case BUCK2:
for (i = 0 ; i < LP8788_NUM_BUCK2_DVS ; i++) {
gpio = pdata->buck2_dvs->gpio[i];
- ret = _gpio_request(buck, gpio, b2_name[i]);
+ ret = devm_gpio_request_one(buck->lp->dev, gpio,
+ DVS_LOW, b2_name[i]);
if (ret)
return ret;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread* RE: [PATCH 2/2] regulator: lp8788-buck: Kill _gpio_request function
2012-12-07 9:25 ` [PATCH 2/2] regulator: lp8788-buck: Kill _gpio_request function Axel Lin
@ 2012-12-10 2:28 ` Kim, Milo
2012-12-10 3:19 ` Mark Brown
1 sibling, 0 replies; 7+ messages in thread
From: Kim, Milo @ 2012-12-10 2:28 UTC (permalink / raw)
To: Axel Lin; +Cc: Girdwood, Liam, linux-kernel@vger.kernel.org, Mark Brown
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 313 bytes --]
> Simply use devm_gpio_request_one() instead.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
Thanks!
Acked-by: Milo(Woogyom) 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] 7+ messages in thread* Re: [PATCH 2/2] regulator: lp8788-buck: Kill _gpio_request function
2012-12-07 9:25 ` [PATCH 2/2] regulator: lp8788-buck: Kill _gpio_request function Axel Lin
2012-12-10 2:28 ` Kim, Milo
@ 2012-12-10 3:19 ` Mark Brown
2012-12-10 3:27 ` Kim, Milo
1 sibling, 1 reply; 7+ messages in thread
From: Mark Brown @ 2012-12-10 3:19 UTC (permalink / raw)
To: Axel Lin; +Cc: Milo(Woogyom) Kim, Liam Girdwood, linux-kernel
On Fri, Dec 07, 2012 at 05:25:13PM +0800, Axel Lin wrote:
> Simply use devm_gpio_request_one() instead.
Applied, thanks.
Milo, you don't have a MAINTAINERS entry for this chip - would you mind
sending a patch adding one as you are reviewing patches for the driver?
This will ensure that people send you patches for review.
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH 2/2] regulator: lp8788-buck: Kill _gpio_request function
2012-12-10 3:19 ` Mark Brown
@ 2012-12-10 3:27 ` Kim, Milo
0 siblings, 0 replies; 7+ messages in thread
From: Kim, Milo @ 2012-12-10 3:27 UTC (permalink / raw)
To: Mark Brown; +Cc: Girdwood, Liam, linux-kernel@vger.kernel.org, Axel Lin
> Applied, thanks.
>
> Milo, you don't have a MAINTAINERS entry for this chip - would you mind
> sending a patch adding one as you are reviewing patches for the driver?
> This will ensure that people send you patches for review.
OK, I'll update MAINTAINERS file for lp872x and lp8788.
Thanks for your help.
Best Regards,
Milo
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH 1/2] regulator: lp8788-buck: Remove val array in lp8788_init_dvs
2012-12-07 9:23 [PATCH 1/2] regulator: lp8788-buck: Remove val array in lp8788_init_dvs Axel Lin
2012-12-07 9:25 ` [PATCH 2/2] regulator: lp8788-buck: Kill _gpio_request function Axel Lin
@ 2012-12-10 2:27 ` Kim, Milo
[not found] ` <CAFRkauAFZ-G=7R4LbBLuJaCwwgc6i+_9tNm8ozKRw7G1w07j3A@mail.gmail.com>
1 sibling, 1 reply; 7+ messages in thread
From: Kim, Milo @ 2012-12-10 2:27 UTC (permalink / raw)
To: Axel Lin; +Cc: Mark Brown, Girdwood, Liam, linux-kernel@vger.kernel.org
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 525 bytes --]
> All elements of val array are zero.
> Simply set data argument to be 0 in lp8788_update_bits call and remove
> the val
> array.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
Axel, sorry I disagree with this patch because DVS_PIN is meaningful.
In this case, explicit bit description is more important than code simplicity.
So I would keep it.
Thanks,
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] 7+ messages in thread
end of thread, other threads:[~2012-12-10 3:27 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-07 9:23 [PATCH 1/2] regulator: lp8788-buck: Remove val array in lp8788_init_dvs Axel Lin
2012-12-07 9:25 ` [PATCH 2/2] regulator: lp8788-buck: Kill _gpio_request function Axel Lin
2012-12-10 2:28 ` Kim, Milo
2012-12-10 3:19 ` Mark Brown
2012-12-10 3:27 ` Kim, Milo
2012-12-10 2:27 ` [PATCH 1/2] regulator: lp8788-buck: Remove val array in lp8788_init_dvs Kim, Milo
[not found] ` <CAFRkauAFZ-G=7R4LbBLuJaCwwgc6i+_9tNm8ozKRw7G1w07j3A@mail.gmail.com>
2012-12-10 3:22 ` Kim, Milo
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).