* [PATCH RESEND] regulator: Remove MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros
@ 2011-05-16 10:20 Axel Lin
2011-05-16 10:22 ` Kyungmin Park
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Axel Lin @ 2011-05-16 10:20 UTC (permalink / raw)
To: linux-kernel
Cc: MyungJoo Ham, Kyungmin Park, Liam Girdwood, Mark Brown,
Samuel Ortiz
In current implementation, the original macro implementation assumes the caller
pass the parameter starting from 1 (to match the register names in datasheet).
Thus we have unneeded plus one then minus one operations
when using MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros.
This patch removes these macros to avoid unneeded plus one then minus one operations
without reducing readability.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
The (V1) original patch title was
[PATCH] regulator: Simplify MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros
I change the patch title to meet the change.
Regards,
Axel
drivers/regulator/max8997.c | 12 ++++++------
include/linux/mfd/max8997-private.h | 4 ----
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c
index b1c1444..10d5a1d 100644
--- a/drivers/regulator/max8997.c
+++ b/drivers/regulator/max8997.c
@@ -1032,11 +1032,11 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev)
/* For the safety, set max voltage before setting up */
for (i = 0; i < 8; i++) {
- max8997_update_reg(i2c, MAX8997_REG_BUCK1DVS(i + 1),
+ max8997_update_reg(i2c, MAX8997_REG_BUCK1DVS1 + i,
max_buck1, 0x3f);
- max8997_update_reg(i2c, MAX8997_REG_BUCK2DVS(i + 1),
+ max8997_update_reg(i2c, MAX8997_REG_BUCK2DVS1 + i,
max_buck2, 0x3f);
- max8997_update_reg(i2c, MAX8997_REG_BUCK5DVS(i + 1),
+ max8997_update_reg(i2c, MAX8997_REG_BUCK5DVS1 + i,
max_buck5, 0x3f);
}
@@ -1113,13 +1113,13 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev)
/* Initialize all the DVS related BUCK registers */
for (i = 0; i < 8; i++) {
- max8997_update_reg(i2c, MAX8997_REG_BUCK1DVS(i + 1),
+ max8997_update_reg(i2c, MAX8997_REG_BUCK1DVS1 + i,
max8997->buck1_vol[i],
0x3f);
- max8997_update_reg(i2c, MAX8997_REG_BUCK2DVS(i + 1),
+ max8997_update_reg(i2c, MAX8997_REG_BUCK2DVS1 + i,
max8997->buck2_vol[i],
0x3f);
- max8997_update_reg(i2c, MAX8997_REG_BUCK5DVS(i + 1),
+ max8997_update_reg(i2c, MAX8997_REG_BUCK5DVS1 + i,
max8997->buck5_vol[i],
0x3f);
}
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h
index 69d1010..5ff2400 100644
--- a/include/linux/mfd/max8997-private.h
+++ b/include/linux/mfd/max8997-private.h
@@ -311,10 +311,6 @@ enum max8997_irq {
MAX8997_IRQ_NR,
};
-#define MAX8997_REG_BUCK1DVS(x) (MAX8997_REG_BUCK1DVS1 + (x) - 1)
-#define MAX8997_REG_BUCK2DVS(x) (MAX8997_REG_BUCK2DVS1 + (x) - 1)
-#define MAX8997_REG_BUCK5DVS(x) (MAX8997_REG_BUCK5DVS1 + (x) - 1)
-
#define MAX8997_NUM_GPIO 12
struct max8997_dev {
struct device *dev;
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH RESEND] regulator: Remove MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros
2011-05-16 10:20 [PATCH RESEND] regulator: Remove MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros Axel Lin
@ 2011-05-16 10:22 ` Kyungmin Park
2011-05-16 15:59 ` Mark Brown
2011-05-16 20:19 ` Liam Girdwood
2 siblings, 0 replies; 5+ messages in thread
From: Kyungmin Park @ 2011-05-16 10:22 UTC (permalink / raw)
To: Axel Lin
Cc: linux-kernel, MyungJoo Ham, Liam Girdwood, Mark Brown,
Samuel Ortiz
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
On Mon, May 16, 2011 at 7:20 PM, Axel Lin <axel.lin@gmail.com> wrote:
> In current implementation, the original macro implementation assumes the caller
> pass the parameter starting from 1 (to match the register names in datasheet).
> Thus we have unneeded plus one then minus one operations
> when using MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros.
>
> This patch removes these macros to avoid unneeded plus one then minus one operations
> without reducing readability.
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
> The (V1) original patch title was
> [PATCH] regulator: Simplify MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros
> I change the patch title to meet the change.
>
> Regards,
> Axel
>
> drivers/regulator/max8997.c | 12 ++++++------
> include/linux/mfd/max8997-private.h | 4 ----
> 2 files changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c
> index b1c1444..10d5a1d 100644
> --- a/drivers/regulator/max8997.c
> +++ b/drivers/regulator/max8997.c
> @@ -1032,11 +1032,11 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev)
>
> /* For the safety, set max voltage before setting up */
> for (i = 0; i < 8; i++) {
> - max8997_update_reg(i2c, MAX8997_REG_BUCK1DVS(i + 1),
> + max8997_update_reg(i2c, MAX8997_REG_BUCK1DVS1 + i,
> max_buck1, 0x3f);
> - max8997_update_reg(i2c, MAX8997_REG_BUCK2DVS(i + 1),
> + max8997_update_reg(i2c, MAX8997_REG_BUCK2DVS1 + i,
> max_buck2, 0x3f);
> - max8997_update_reg(i2c, MAX8997_REG_BUCK5DVS(i + 1),
> + max8997_update_reg(i2c, MAX8997_REG_BUCK5DVS1 + i,
> max_buck5, 0x3f);
> }
>
> @@ -1113,13 +1113,13 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev)
>
> /* Initialize all the DVS related BUCK registers */
> for (i = 0; i < 8; i++) {
> - max8997_update_reg(i2c, MAX8997_REG_BUCK1DVS(i + 1),
> + max8997_update_reg(i2c, MAX8997_REG_BUCK1DVS1 + i,
> max8997->buck1_vol[i],
> 0x3f);
> - max8997_update_reg(i2c, MAX8997_REG_BUCK2DVS(i + 1),
> + max8997_update_reg(i2c, MAX8997_REG_BUCK2DVS1 + i,
> max8997->buck2_vol[i],
> 0x3f);
> - max8997_update_reg(i2c, MAX8997_REG_BUCK5DVS(i + 1),
> + max8997_update_reg(i2c, MAX8997_REG_BUCK5DVS1 + i,
> max8997->buck5_vol[i],
> 0x3f);
> }
> diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h
> index 69d1010..5ff2400 100644
> --- a/include/linux/mfd/max8997-private.h
> +++ b/include/linux/mfd/max8997-private.h
> @@ -311,10 +311,6 @@ enum max8997_irq {
> MAX8997_IRQ_NR,
> };
>
> -#define MAX8997_REG_BUCK1DVS(x) (MAX8997_REG_BUCK1DVS1 + (x) - 1)
> -#define MAX8997_REG_BUCK2DVS(x) (MAX8997_REG_BUCK2DVS1 + (x) - 1)
> -#define MAX8997_REG_BUCK5DVS(x) (MAX8997_REG_BUCK5DVS1 + (x) - 1)
> -
> #define MAX8997_NUM_GPIO 12
> struct max8997_dev {
> struct device *dev;
> --
> 1.7.1
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH RESEND] regulator: Remove MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros
2011-05-16 10:20 [PATCH RESEND] regulator: Remove MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros Axel Lin
2011-05-16 10:22 ` Kyungmin Park
@ 2011-05-16 15:59 ` Mark Brown
2011-05-16 20:19 ` Liam Girdwood
2 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2011-05-16 15:59 UTC (permalink / raw)
To: Axel Lin
Cc: linux-kernel, MyungJoo Ham, Kyungmin Park, Liam Girdwood,
Samuel Ortiz
On Mon, May 16, 2011 at 06:20:34PM +0800, Axel Lin wrote:
> In current implementation, the original macro implementation assumes the caller
> pass the parameter starting from 1 (to match the register names in datasheet).
> Thus we have unneeded plus one then minus one operations
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] regulator: Remove MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros
2011-05-16 10:20 [PATCH RESEND] regulator: Remove MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros Axel Lin
2011-05-16 10:22 ` Kyungmin Park
2011-05-16 15:59 ` Mark Brown
@ 2011-05-16 20:19 ` Liam Girdwood
2 siblings, 0 replies; 5+ messages in thread
From: Liam Girdwood @ 2011-05-16 20:19 UTC (permalink / raw)
To: Axel Lin
Cc: linux-kernel, MyungJoo Ham, Kyungmin Park, Mark Brown,
Samuel Ortiz
On Mon, 2011-05-16 at 18:20 +0800, Axel Lin wrote:
> In current implementation, the original macro implementation assumes the caller
> pass the parameter starting from 1 (to match the register names in datasheet).
> Thus we have unneeded plus one then minus one operations
> when using MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros.
>
> This patch removes these macros to avoid unneeded plus one then minus one operations
> without reducing readability.
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
Applied.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] regulator: Remove MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros
@ 2011-05-16 11:02 MyungJoo Ham
0 siblings, 0 replies; 5+ messages in thread
From: MyungJoo Ham @ 2011-05-16 11:02 UTC (permalink / raw)
To: Axel Lin, linux-kernel@vger.kernel.org
Cc: 박경민, Liam Girdwood, Mark Brown, Samuel Ortiz
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=euc-kr, Size: 1049 bytes --]
> Sender : Axel Lin<axel.lin@gmail.com>
> Date : 2011-05-16 19:20 (GMT+09:00)
> Title : [PATCH RESEND] regulator: Remove MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros
>
> In current implementation, the original macro implementation assumes the caller
> pass the parameter starting from 1 (to match the register names in datasheet).
> Thus we have unneeded plus one then minus one operations
> when using MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros.
>
> This patch removes these macros to avoid unneeded plus one then minus one operations
> without reducing readability.
>
> Signed-off-by: Axel Lin
It looks good. Thanks!
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
MyungJoo Ham
Mobile Software Platform Lab,
Digital Media and Communications (DMC) Business
Samsung Electronics
cell: +82-10-6714-2858 / office: +82-31-279-8033ÿôèº{.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] 5+ messages in thread
end of thread, other threads:[~2011-05-16 20:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-16 10:20 [PATCH RESEND] regulator: Remove MAX8997_REG_BUCK1DVS/MAX8997_REG_BUCK2DVS/MAX8997_REG_BUCK5DVS macros Axel Lin
2011-05-16 10:22 ` Kyungmin Park
2011-05-16 15:59 ` Mark Brown
2011-05-16 20:19 ` Liam Girdwood
-- strict thread matches above, loose matches on Subject: below --
2011-05-16 11:02 MyungJoo Ham
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox