All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND 1/4] regulator: Fix setting new voltage in s5m8767_set_voltage
@ 2012-03-19  4:22 Axel Lin
  2012-03-19  4:23 ` [PATCH RFC 2/4] regulator: Rework s5m8767_set_voltage to support both LDOs and BUCKs Axel Lin
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Axel Lin @ 2012-03-19  4:22 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sangbeom Kim, Liam Girdwood, Mark Brown

Current code does not really update the register with new value, fix it.
I rename the variable i to sel for better readability.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
Hi Sangbeom,
I make the following patchs on top of this one, so I resend this one as the
first patch of this serial.
I'd appreciate to have your feedback about the changes in this patch serial.

Thanks,
Axel
 drivers/regulator/s5m8767.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 58447db..4ca2db0 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -311,8 +311,7 @@ static int s5m8767_set_voltage(struct regulator_dev *rdev,
 	struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev);
 	const struct s5m_voltage_desc *desc;
 	int reg_id = rdev_get_id(rdev);
-	int reg, mask, ret;
-	int i;
+	int sel, reg, mask, ret;
 	u8 val;
 
 	switch (reg_id) {
@@ -333,19 +332,20 @@ static int s5m8767_set_voltage(struct regulator_dev *rdev,
 
 	desc = reg_voltage_map[reg_id];
 
-	i = s5m8767_convert_voltage_to_sel(desc, min_uV, max_uV);
-	if (i < 0)
-		return i;
+	sel = s5m8767_convert_voltage_to_sel(desc, min_uV, max_uV);
+	if (sel < 0)
+		return sel;
 
 	ret = s5m8767_get_voltage_register(rdev, &reg);
 	if (ret)
 		return ret;
 
 	s5m_reg_read(s5m8767->iodev, reg, &val);
-	val = val & mask;
+	val &= ~mask;
+	val |= sel;
 
 	ret = s5m_reg_write(s5m8767->iodev, reg, val);
-	*selector = i;
+	*selector = sel;
 
 	return ret;
 }
-- 
1.7.5.4




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

* [PATCH RFC 2/4] regulator: Rework s5m8767_set_voltage to support both LDOs and BUCKs
  2012-03-19  4:22 [PATCH RESEND 1/4] regulator: Fix setting new voltage in s5m8767_set_voltage Axel Lin
@ 2012-03-19  4:23 ` Axel Lin
  2012-04-02 23:16   ` Sangbeom Kim
  2012-04-03  5:40   ` Sangbeom Kim
  2012-03-19  4:24 ` [PATCH RFC 3/4] regulator: Use one s5m8767_ops for " Axel Lin
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 12+ messages in thread
From: Axel Lin @ 2012-03-19  4:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sangbeom Kim, Liam Girdwood, Mark Brown

s5m8767_set_voltage not only implement set_voltage callbacks for LDOs,
but also for BUCKs when s5m8767->buck_gpioindex is not set.
s5m8767_set_voltage_buck actually only for buck[2|3|4] when
s5m8767->buck_gpioindex is set.
Conditionally calling s5m8767_set_voltage in s5m8767_set_voltage_buck makes
the code hard to read.

I think merging s5m8767_set_voltage_buck and s5m8767_set_voltage actually
simplifies things. It's easy to use buck234_vol pointer to differentiate if
we need to control voltage for buck[2|3|4] by DVS GPIOs.

This patch reworks s5m8767_set_voltage to support both LDOx and BUCKx in all
cases.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/regulator/s5m8767.c |  145 +++++++++++++++----------------------------
 1 files changed, 50 insertions(+), 95 deletions(-)

diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 4ca2db0..7576134 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -305,14 +305,33 @@ static int s5m8767_convert_voltage_to_sel(
 	return selector;
 }
 
+static inline void s5m8767_set_high(struct s5m8767_info *s5m8767)
+{
+	int temp_index = s5m8767->buck_gpioindex;
+
+	gpio_set_value(s5m8767->buck_gpios[0], (temp_index >> 2) & 0x1);
+	gpio_set_value(s5m8767->buck_gpios[1], (temp_index >> 1) & 0x1);
+	gpio_set_value(s5m8767->buck_gpios[2], temp_index & 0x1);
+}
+
+static inline void s5m8767_set_low(struct s5m8767_info *s5m8767)
+{
+	int temp_index = s5m8767->buck_gpioindex;
+
+	gpio_set_value(s5m8767->buck_gpios[2], temp_index & 0x1);
+	gpio_set_value(s5m8767->buck_gpios[1], (temp_index >> 1) & 0x1);
+	gpio_set_value(s5m8767->buck_gpios[0], (temp_index >> 2) & 0x1);
+}
+
 static int s5m8767_set_voltage(struct regulator_dev *rdev,
 				int min_uV, int max_uV, unsigned *selector)
 {
 	struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev);
 	const struct s5m_voltage_desc *desc;
 	int reg_id = rdev_get_id(rdev);
-	int sel, reg, mask, ret;
+	int sel, reg, mask, ret = 0, old_index, index = 0;
 	u8 val;
+	u8 *buck234_vol = NULL;
 
 	switch (reg_id) {
 	case S5M8767_LDO1 ... S5M8767_LDO28:
@@ -320,6 +339,12 @@ static int s5m8767_set_voltage(struct regulator_dev *rdev,
 		break;
 	case S5M8767_BUCK1 ... S5M8767_BUCK6:
 		mask = 0xff;
+		if (reg_id == S5M8767_BUCK2 && s5m8767->buck2_gpiodvs)
+			buck234_vol = &s5m8767->buck2_vol[0];
+		else if (reg_id == S5M8767_BUCK3 && s5m8767->buck3_gpiodvs)
+			buck234_vol = &s5m8767->buck3_vol[0];
+		else if (reg_id == S5M8767_BUCK4 && s5m8767->buck4_gpiodvs)
+			buck234_vol = &s5m8767->buck4_vol[0];
 		break;
 	case S5M8767_BUCK7 ... S5M8767_BUCK8:
 		return -EINVAL;
@@ -336,102 +361,32 @@ static int s5m8767_set_voltage(struct regulator_dev *rdev,
 	if (sel < 0)
 		return sel;
 
-	ret = s5m8767_get_voltage_register(rdev, &reg);
-	if (ret)
-		return ret;
-
-	s5m_reg_read(s5m8767->iodev, reg, &val);
-	val &= ~mask;
-	val |= sel;
-
-	ret = s5m_reg_write(s5m8767->iodev, reg, val);
-	*selector = sel;
-
-	return ret;
-}
-
-static inline void s5m8767_set_high(struct s5m8767_info *s5m8767)
-{
-	int temp_index = s5m8767->buck_gpioindex;
-
-	gpio_set_value(s5m8767->buck_gpios[0], (temp_index >> 2) & 0x1);
-	gpio_set_value(s5m8767->buck_gpios[1], (temp_index >> 1) & 0x1);
-	gpio_set_value(s5m8767->buck_gpios[2], temp_index & 0x1);
-}
-
-static inline void s5m8767_set_low(struct s5m8767_info *s5m8767)
-{
-	int temp_index = s5m8767->buck_gpioindex;
-
-	gpio_set_value(s5m8767->buck_gpios[2], temp_index & 0x1);
-	gpio_set_value(s5m8767->buck_gpios[1], (temp_index >> 1) & 0x1);
-	gpio_set_value(s5m8767->buck_gpios[0], (temp_index >> 2) & 0x1);
-}
-
-static int s5m8767_set_voltage_buck(struct regulator_dev *rdev,
-				    int min_uV, int max_uV, unsigned *selector)
-{
-	struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev);
-	int reg_id = rdev_get_id(rdev);
-	const struct s5m_voltage_desc *desc;
-	int new_val, old_val, i = 0;
-
-	if (reg_id < S5M8767_BUCK1 || reg_id > S5M8767_BUCK6)
-		return -EINVAL;
-
-	switch (reg_id) {
-	case S5M8767_BUCK1:
-		return s5m8767_set_voltage(rdev, min_uV, max_uV, selector);
-	case S5M8767_BUCK2 ... S5M8767_BUCK4:
-		break;
-	case S5M8767_BUCK5 ... S5M8767_BUCK6:
-		return s5m8767_set_voltage(rdev, min_uV, max_uV, selector);
-	case S5M8767_BUCK9:
-		return s5m8767_set_voltage(rdev, min_uV, max_uV, selector);
-	}
+	/* buck234_vol != NULL means to control buck234 voltage via DVS GPIO */
+	if (buck234_vol) {
+		while (*buck234_vol != sel) {
+			buck234_vol++;
+			index++;
+		}
+		old_index = s5m8767->buck_gpioindex;
+		s5m8767->buck_gpioindex = index;
+
+		if (index > old_index)
+			s5m8767_set_high(s5m8767);
+		else
+			s5m8767_set_low(s5m8767);
+	} else {
+		ret = s5m8767_get_voltage_register(rdev, &reg);
+		if (ret)
+			return ret;
 
-	desc = reg_voltage_map[reg_id];
-	new_val = s5m8767_convert_voltage_to_sel(desc, min_uV, max_uV);
-	if (new_val < 0)
-		return new_val;
+		s5m_reg_read(s5m8767->iodev, reg, &val);
+		val = (val & ~mask) | sel;
 
-	switch (reg_id) {
-	case S5M8767_BUCK2:
-		if (s5m8767->buck2_gpiodvs) {
-			while (s5m8767->buck2_vol[i] != new_val)
-				i++;
-		} else
-			return s5m8767_set_voltage(rdev, min_uV,
-						   max_uV, selector);
-		break;
-	case S5M8767_BUCK3:
-		if (s5m8767->buck3_gpiodvs) {
-			while (s5m8767->buck3_vol[i] != new_val)
-				i++;
-		} else
-			return s5m8767_set_voltage(rdev, min_uV,
-						   max_uV, selector);
-		break;
-	case S5M8767_BUCK4:
-		if (s5m8767->buck3_gpiodvs) {
-			while (s5m8767->buck4_vol[i] != new_val)
-				i++;
-		} else
-			return s5m8767_set_voltage(rdev, min_uV,
-						   max_uV, selector);
-		break;
+		ret = s5m_reg_write(s5m8767->iodev, reg, val);
 	}
 
-	old_val = s5m8767->buck_gpioindex;
-	s5m8767->buck_gpioindex = i;
-
-	if (i > old_val)
-		s5m8767_set_high(s5m8767);
-	else
-		s5m8767_set_low(s5m8767);
-
-	*selector = new_val;
-	return 0;
+	*selector = sel;
+	return ret;
 }
 
 static int s5m8767_set_voltage_time_sel(struct regulator_dev *rdev,
@@ -466,7 +421,7 @@ static struct regulator_ops s5m8767_buck_ops = {
 	.enable			= s5m8767_reg_enable,
 	.disable		= s5m8767_reg_disable,
 	.get_voltage_sel	= s5m8767_get_voltage_sel,
-	.set_voltage		= s5m8767_set_voltage_buck,
+	.set_voltage		= s5m8767_set_voltage,
 	.set_voltage_time_sel	= s5m8767_set_voltage_time_sel,
 };
 
-- 
1.7.5.4




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

* [PATCH RFC 3/4] regulator: Use one s5m8767_ops for both LDOs and BUCKs
  2012-03-19  4:22 [PATCH RESEND 1/4] regulator: Fix setting new voltage in s5m8767_set_voltage Axel Lin
  2012-03-19  4:23 ` [PATCH RFC 2/4] regulator: Rework s5m8767_set_voltage to support both LDOs and BUCKs Axel Lin
@ 2012-03-19  4:24 ` Axel Lin
  2012-04-03  5:42   ` Sangbeom Kim
  2012-03-19  4:25 ` [PATCH RFC 4/4] regulator: Replace regulator_desc_[ldo|buck] by s5m8767_regulator_desc macro Axel Lin
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Axel Lin @ 2012-03-19  4:24 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sangbeom Kim, Liam Girdwood, Mark Brown

All the callback function implementation are the same for both LDOs and BUCKs.
Merge them to one s5m8767_ops.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/regulator/s5m8767.c |   16 +++-------------
 1 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 7576134..8872ee0 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -405,17 +405,7 @@ static int s5m8767_set_voltage_time_sel(struct regulator_dev *rdev,
 	return 0;
 }
 
-static struct regulator_ops s5m8767_ldo_ops = {
-	.list_voltage		= s5m8767_list_voltage,
-	.is_enabled		= s5m8767_reg_is_enabled,
-	.enable			= s5m8767_reg_enable,
-	.disable		= s5m8767_reg_disable,
-	.get_voltage_sel	= s5m8767_get_voltage_sel,
-	.set_voltage		= s5m8767_set_voltage,
-	.set_voltage_time_sel	= s5m8767_set_voltage_time_sel,
-};
-
-static struct regulator_ops s5m8767_buck_ops = {
+static struct regulator_ops s5m8767_ops = {
 	.list_voltage		= s5m8767_list_voltage,
 	.is_enabled		= s5m8767_reg_is_enabled,
 	.enable			= s5m8767_reg_enable,
@@ -428,14 +418,14 @@ static struct regulator_ops s5m8767_buck_ops = {
 #define regulator_desc_ldo(num)		{	\
 	.name		= "LDO"#num,		\
 	.id		= S5M8767_LDO##num,	\
-	.ops		= &s5m8767_ldo_ops,	\
+	.ops		= &s5m8767_ops,	\
 	.type		= REGULATOR_VOLTAGE,	\
 	.owner		= THIS_MODULE,		\
 }
 #define regulator_desc_buck(num)	{	\
 	.name		= "BUCK"#num,		\
 	.id		= S5M8767_BUCK##num,	\
-	.ops		= &s5m8767_buck_ops,	\
+	.ops		= &s5m8767_ops,	\
 	.type		= REGULATOR_VOLTAGE,	\
 	.owner		= THIS_MODULE,		\
 }
-- 
1.7.5.4




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

* [PATCH RFC 4/4] regulator: Replace regulator_desc_[ldo|buck] by s5m8767_regulator_desc macro
  2012-03-19  4:22 [PATCH RESEND 1/4] regulator: Fix setting new voltage in s5m8767_set_voltage Axel Lin
  2012-03-19  4:23 ` [PATCH RFC 2/4] regulator: Rework s5m8767_set_voltage to support both LDOs and BUCKs Axel Lin
  2012-03-19  4:24 ` [PATCH RFC 3/4] regulator: Use one s5m8767_ops for " Axel Lin
@ 2012-03-19  4:25 ` Axel Lin
  2012-04-03  5:54   ` Sangbeom Kim
  2012-03-29 12:41 ` [PATCH RESEND 1/4] regulator: Fix setting new voltage in s5m8767_set_voltage Axel Lin
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Axel Lin @ 2012-03-19  4:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sangbeom Kim, Liam Girdwood, Mark Brown

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/regulator/s5m8767.c |   89 ++++++++++++++++++++-----------------------
 1 files changed, 41 insertions(+), 48 deletions(-)

diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 8872ee0..b877df1 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -415,59 +415,52 @@ static struct regulator_ops s5m8767_ops = {
 	.set_voltage_time_sel	= s5m8767_set_voltage_time_sel,
 };
 
-#define regulator_desc_ldo(num)		{	\
-	.name		= "LDO"#num,		\
-	.id		= S5M8767_LDO##num,	\
-	.ops		= &s5m8767_ops,	\
-	.type		= REGULATOR_VOLTAGE,	\
-	.owner		= THIS_MODULE,		\
-}
-#define regulator_desc_buck(num)	{	\
-	.name		= "BUCK"#num,		\
-	.id		= S5M8767_BUCK##num,	\
-	.ops		= &s5m8767_ops,	\
+#define s5m8767_regulator_desc(_name) {		\
+	.name		= #_name,		\
+	.id		= S5M8767_##_name,	\
+	.ops		= &s5m8767_ops,		\
 	.type		= REGULATOR_VOLTAGE,	\
 	.owner		= THIS_MODULE,		\
 }
 
 static struct regulator_desc regulators[] = {
-	regulator_desc_ldo(1),
-	regulator_desc_ldo(2),
-	regulator_desc_ldo(3),
-	regulator_desc_ldo(4),
-	regulator_desc_ldo(5),
-	regulator_desc_ldo(6),
-	regulator_desc_ldo(7),
-	regulator_desc_ldo(8),
-	regulator_desc_ldo(9),
-	regulator_desc_ldo(10),
-	regulator_desc_ldo(11),
-	regulator_desc_ldo(12),
-	regulator_desc_ldo(13),
-	regulator_desc_ldo(14),
-	regulator_desc_ldo(15),
-	regulator_desc_ldo(16),
-	regulator_desc_ldo(17),
-	regulator_desc_ldo(18),
-	regulator_desc_ldo(19),
-	regulator_desc_ldo(20),
-	regulator_desc_ldo(21),
-	regulator_desc_ldo(22),
-	regulator_desc_ldo(23),
-	regulator_desc_ldo(24),
-	regulator_desc_ldo(25),
-	regulator_desc_ldo(26),
-	regulator_desc_ldo(27),
-	regulator_desc_ldo(28),
-	regulator_desc_buck(1),
-	regulator_desc_buck(2),
-	regulator_desc_buck(3),
-	regulator_desc_buck(4),
-	regulator_desc_buck(5),
-	regulator_desc_buck(6),
-	regulator_desc_buck(7),
-	regulator_desc_buck(8),
-	regulator_desc_buck(9),
+	s5m8767_regulator_desc(LDO1),
+	s5m8767_regulator_desc(LDO2),
+	s5m8767_regulator_desc(LDO3),
+	s5m8767_regulator_desc(LDO4),
+	s5m8767_regulator_desc(LDO5),
+	s5m8767_regulator_desc(LDO6),
+	s5m8767_regulator_desc(LDO7),
+	s5m8767_regulator_desc(LDO8),
+	s5m8767_regulator_desc(LDO9),
+	s5m8767_regulator_desc(LDO10),
+	s5m8767_regulator_desc(LDO11),
+	s5m8767_regulator_desc(LDO12),
+	s5m8767_regulator_desc(LDO13),
+	s5m8767_regulator_desc(LDO14),
+	s5m8767_regulator_desc(LDO15),
+	s5m8767_regulator_desc(LDO16),
+	s5m8767_regulator_desc(LDO17),
+	s5m8767_regulator_desc(LDO18),
+	s5m8767_regulator_desc(LDO19),
+	s5m8767_regulator_desc(LDO20),
+	s5m8767_regulator_desc(LDO21),
+	s5m8767_regulator_desc(LDO22),
+	s5m8767_regulator_desc(LDO23),
+	s5m8767_regulator_desc(LDO24),
+	s5m8767_regulator_desc(LDO25),
+	s5m8767_regulator_desc(LDO26),
+	s5m8767_regulator_desc(LDO27),
+	s5m8767_regulator_desc(LDO28),
+	s5m8767_regulator_desc(BUCK1),
+	s5m8767_regulator_desc(BUCK2),
+	s5m8767_regulator_desc(BUCK3),
+	s5m8767_regulator_desc(BUCK4),
+	s5m8767_regulator_desc(BUCK5),
+	s5m8767_regulator_desc(BUCK6),
+	s5m8767_regulator_desc(BUCK7),
+	s5m8767_regulator_desc(BUCK8),
+	s5m8767_regulator_desc(BUCK9),
 };
 
 static __devinit int s5m8767_pmic_probe(struct platform_device *pdev)
-- 
1.7.5.4




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

* Re: [PATCH RESEND 1/4] regulator: Fix setting new voltage in s5m8767_set_voltage
  2012-03-19  4:22 [PATCH RESEND 1/4] regulator: Fix setting new voltage in s5m8767_set_voltage Axel Lin
                   ` (2 preceding siblings ...)
  2012-03-19  4:25 ` [PATCH RFC 4/4] regulator: Replace regulator_desc_[ldo|buck] by s5m8767_regulator_desc macro Axel Lin
@ 2012-03-29 12:41 ` Axel Lin
  2012-03-30  5:56 ` Sangbeom Kim
  2012-03-31 10:33 ` Mark Brown
  5 siblings, 0 replies; 12+ messages in thread
From: Axel Lin @ 2012-03-29 12:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sangbeom Kim, Liam Girdwood, Mark Brown

2012/3/19 Axel Lin <axel.lin@gmail.com>:
> Current code does not really update the register with new value, fix it.
> I rename the variable i to sel for better readability.
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
> Hi Sangbeom,
> I make the following patchs on top of this one, so I resend this one as the
> first patch of this serial.
> I'd appreciate to have your feedback about the changes in this patch serial.
>
Hi Sangbeom,
Are you OK with this patch serial?
I think current code in s5m8767_set_voltage() does not work without this patch.

Regards,
Axel

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

* RE: [PATCH RESEND 1/4] regulator: Fix setting new voltage in s5m8767_set_voltage
  2012-03-19  4:22 [PATCH RESEND 1/4] regulator: Fix setting new voltage in s5m8767_set_voltage Axel Lin
                   ` (3 preceding siblings ...)
  2012-03-29 12:41 ` [PATCH RESEND 1/4] regulator: Fix setting new voltage in s5m8767_set_voltage Axel Lin
@ 2012-03-30  5:56 ` Sangbeom Kim
  2012-03-31 10:33 ` Mark Brown
  5 siblings, 0 replies; 12+ messages in thread
From: Sangbeom Kim @ 2012-03-30  5:56 UTC (permalink / raw)
  To: 'Axel Lin', linux-kernel
  Cc: 'Liam Girdwood', 'Mark Brown'

On Mon, Mar 19, 2012 at 1:22 AM, Axel Lin wrote:
> Current code does not really update the register with new value, fix it.
> I rename the variable i to sel for better readability.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Acked-by: Sangbeom Kim <sbkim73@samsung.com>

Thanks for your fixing patch.
Sangbeom.


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

* Re: [PATCH RESEND 1/4] regulator: Fix setting new voltage in s5m8767_set_voltage
  2012-03-19  4:22 [PATCH RESEND 1/4] regulator: Fix setting new voltage in s5m8767_set_voltage Axel Lin
                   ` (4 preceding siblings ...)
  2012-03-30  5:56 ` Sangbeom Kim
@ 2012-03-31 10:33 ` Mark Brown
  5 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2012-03-31 10:33 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Sangbeom Kim, Liam Girdwood

[-- Attachment #1: Type: text/plain, Size: 315 bytes --]

On Mon, Mar 19, 2012 at 12:22:10PM +0800, Axel Lin wrote:
> Current code does not really update the register with new value, fix it.
> I rename the variable i to sel for better readability.

Applied, thanks.  I'll apply the others after this has been merged with
Linus since there's going to be a dependency there.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* RE: [PATCH RFC 2/4] regulator: Rework s5m8767_set_voltage to support both LDOs and BUCKs
  2012-03-19  4:23 ` [PATCH RFC 2/4] regulator: Rework s5m8767_set_voltage to support both LDOs and BUCKs Axel Lin
@ 2012-04-02 23:16   ` Sangbeom Kim
  2012-04-03  0:00     ` Axel Lin
  2012-04-03  5:40   ` Sangbeom Kim
  1 sibling, 1 reply; 12+ messages in thread
From: Sangbeom Kim @ 2012-04-02 23:16 UTC (permalink / raw)
  To: 'Axel Lin', linux-kernel
  Cc: 'Liam Girdwood', 'Mark Brown'

On Sat, Mar 19, 2012 at 1:24 PM, Axel Lin wrote:
 
> s5m8767_set_voltage not only implement set_voltage callbacks for LDOs,
> but also for BUCKs when s5m8767->buck_gpioindex is not set.
> s5m8767_set_voltage_buck actually only for buck[2|3|4] when
> s5m8767->buck_gpioindex is set.
> Conditionally calling s5m8767_set_voltage in s5m8767_set_voltage_buck makes
> the code hard to read.
> 
> I think merging s5m8767_set_voltage_buck and s5m8767_set_voltage actually
> simplifies things. It's easy to use buck234_vol pointer to differentiate if
> we need to control voltage for buck[2|3|4] by DVS GPIOs.
> 
> This patch reworks s5m8767_set_voltage to support both LDOx and BUCKx in all
> cases.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
Hi, Axel
Basically, Your optimization code looks good.
But, S5M8767A support 9 Bucks. 
Please Add #9 Buck handling too.
As you know, 3.4-rc1 is released.
Please rebase your patch on 3.4-rc1.
Some feature is added on 3.4-rc1.

Thanks,
Sangbeom.



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

* Re: [PATCH RFC 2/4] regulator: Rework s5m8767_set_voltage to support both LDOs and BUCKs
  2012-04-02 23:16   ` Sangbeom Kim
@ 2012-04-03  0:00     ` Axel Lin
  0 siblings, 0 replies; 12+ messages in thread
From: Axel Lin @ 2012-04-03  0:00 UTC (permalink / raw)
  To: Sangbeom Kim; +Cc: linux-kernel, Liam Girdwood, Mark Brown

> Hi, Axel
> Basically, Your optimization code looks good.
> But, S5M8767A support 9 Bucks.
> Please Add #9 Buck handling too.
Current code does hand #9 buck in s5m8767_set_voltage().

> As you know, 3.4-rc1 is released.
> Please rebase your patch on 3.4-rc1.
> Some feature is added on 3.4-rc1.
I just try to apply the patch to Mark's for-next tree and linux-next tree.
It looks ok. So I think no need to re-generate the patch.

Regards,
Axel

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

* RE: [PATCH RFC 2/4] regulator: Rework s5m8767_set_voltage to support both LDOs and BUCKs
  2012-03-19  4:23 ` [PATCH RFC 2/4] regulator: Rework s5m8767_set_voltage to support both LDOs and BUCKs Axel Lin
  2012-04-02 23:16   ` Sangbeom Kim
@ 2012-04-03  5:40   ` Sangbeom Kim
  1 sibling, 0 replies; 12+ messages in thread
From: Sangbeom Kim @ 2012-04-03  5:40 UTC (permalink / raw)
  To: 'Axel Lin', linux-kernel
  Cc: 'Liam Girdwood', 'Mark Brown'

On Mon, Mar 19, 2012 at 1:24 PM, Axel Lin wrote:
> s5m8767_set_voltage not only implement set_voltage callbacks for LDOs,
> but also for BUCKs when s5m8767->buck_gpioindex is not set.
> s5m8767_set_voltage_buck actually only for buck[2|3|4] when
> s5m8767->buck_gpioindex is set.
> Conditionally calling s5m8767_set_voltage in s5m8767_set_voltage_buck makes
> the code hard to read.
> 
> I think merging s5m8767_set_voltage_buck and s5m8767_set_voltage actually
> simplifies things. It's easy to use buck234_vol pointer to differentiate if
> we need to control voltage for buck[2|3|4] by DVS GPIOs.
> 
> This patch reworks s5m8767_set_voltage to support both LDOx and BUCKx in all
> cases.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Acked-by: Sangbeom Kim <sbkim73@samsung.com>

Thanks,
Sangbeom.


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

* RE: [PATCH RFC 3/4] regulator: Use one s5m8767_ops for both LDOs and BUCKs
  2012-03-19  4:24 ` [PATCH RFC 3/4] regulator: Use one s5m8767_ops for " Axel Lin
@ 2012-04-03  5:42   ` Sangbeom Kim
  0 siblings, 0 replies; 12+ messages in thread
From: Sangbeom Kim @ 2012-04-03  5:42 UTC (permalink / raw)
  To: 'Axel Lin', linux-kernel
  Cc: 'Liam Girdwood', 'Mark Brown'

On Mon, Mar 19, 2012 at 1:25 PM, Axel Lin wrote:
> All the callback function implementation are the same for both LDOs and BUCKs.
> Merge them to one s5m8767_ops.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Acked-by: Sangbeom Kim <sbkim73@samsung.com>

Thanks,
Sangbeom.


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

* RE: [PATCH RFC 4/4] regulator: Replace regulator_desc_[ldo|buck] by s5m8767_regulator_desc macro
  2012-03-19  4:25 ` [PATCH RFC 4/4] regulator: Replace regulator_desc_[ldo|buck] by s5m8767_regulator_desc macro Axel Lin
@ 2012-04-03  5:54   ` Sangbeom Kim
  0 siblings, 0 replies; 12+ messages in thread
From: Sangbeom Kim @ 2012-04-03  5:54 UTC (permalink / raw)
  To: 'Axel Lin', linux-kernel
  Cc: 'Liam Girdwood', 'Mark Brown'

On Mon, Mar 19, 2012 at 1:26 PM, Axel Lin wrote:
> Subject: [PATCH RFC 4/4] regulator: Replace regulator_desc_[ldo|buck] by s5m8767_regulator_desc
> macro
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
Where is commit message?
Otherwise,

Acked-by: Sangbeom Kim <sbkim73@samsung.com>

Thanks,
Sangbeom.


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

end of thread, other threads:[~2012-04-03  5:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-19  4:22 [PATCH RESEND 1/4] regulator: Fix setting new voltage in s5m8767_set_voltage Axel Lin
2012-03-19  4:23 ` [PATCH RFC 2/4] regulator: Rework s5m8767_set_voltage to support both LDOs and BUCKs Axel Lin
2012-04-02 23:16   ` Sangbeom Kim
2012-04-03  0:00     ` Axel Lin
2012-04-03  5:40   ` Sangbeom Kim
2012-03-19  4:24 ` [PATCH RFC 3/4] regulator: Use one s5m8767_ops for " Axel Lin
2012-04-03  5:42   ` Sangbeom Kim
2012-03-19  4:25 ` [PATCH RFC 4/4] regulator: Replace regulator_desc_[ldo|buck] by s5m8767_regulator_desc macro Axel Lin
2012-04-03  5:54   ` Sangbeom Kim
2012-03-29 12:41 ` [PATCH RESEND 1/4] regulator: Fix setting new voltage in s5m8767_set_voltage Axel Lin
2012-03-30  5:56 ` Sangbeom Kim
2012-03-31 10:33 ` Mark Brown

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.