* [PATCH 1/2] mfd: sec: reorder params in API for regmap consistency
@ 2013-11-08 15:05 Krzysztof Kozlowski
2013-11-08 15:05 ` [PATCH 2/2] mfd: max77693: " Krzysztof Kozlowski
2013-11-08 15:52 ` [PATCH 1/2] mfd: sec: " Lee Jones
0 siblings, 2 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2013-11-08 15:05 UTC (permalink / raw)
To: linux-arm-kernel
The last two parameters of certain register access functions were in
different order than regmap API. This was confusing and error-prone.
Reorder parameters for register access API to match regmap API:
- sec_bulk_read() reorder count and buf,
- sec_bulk_write() reorder count and buf,
- sec_reg_update() reorder val and mask.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/mfd/sec-core.c | 6 +++---
drivers/regulator/s5m8767.c | 26 +++++++++++++-------------
include/linux/mfd/samsung/core.h | 6 +++---
3 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index f530e4b..039814e 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -84,7 +84,7 @@ int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest)
}
EXPORT_SYMBOL_GPL(sec_reg_read);
-int sec_bulk_read(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf)
+int sec_bulk_read(struct sec_pmic_dev *sec_pmic, u8 reg, u8 *buf, int count)
{
return regmap_bulk_read(sec_pmic->regmap, reg, buf, count);
}
@@ -96,13 +96,13 @@ int sec_reg_write(struct sec_pmic_dev *sec_pmic, u8 reg, u8 value)
}
EXPORT_SYMBOL_GPL(sec_reg_write);
-int sec_bulk_write(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf)
+int sec_bulk_write(struct sec_pmic_dev *sec_pmic, u8 reg, u8 *buf, int count)
{
return regmap_raw_write(sec_pmic->regmap, reg, buf, count);
}
EXPORT_SYMBOL_GPL(sec_bulk_write);
-int sec_reg_update(struct sec_pmic_dev *sec_pmic, u8 reg, u8 val, u8 mask)
+int sec_reg_update(struct sec_pmic_dev *sec_pmic, u8 reg, u8 mask, u8 val)
{
return regmap_update_bits(sec_pmic->regmap, reg, mask, val);
}
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index c24448b..ac10db4 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -243,7 +243,7 @@ static int s5m8767_reg_enable(struct regulator_dev *rdev)
if (ret)
return ret;
- return sec_reg_update(s5m8767->iodev, reg, enable_ctrl, mask);
+ return sec_reg_update(s5m8767->iodev, reg, mask, enable_ctrl);
}
static int s5m8767_reg_disable(struct regulator_dev *rdev)
@@ -256,7 +256,7 @@ static int s5m8767_reg_disable(struct regulator_dev *rdev)
if (ret)
return ret;
- return sec_reg_update(s5m8767->iodev, reg, ~mask, mask);
+ return sec_reg_update(s5m8767->iodev, reg, mask, ~mask);
}
static int s5m8767_get_vsel_reg(int reg_id, struct s5m8767_info *s5m8767)
@@ -820,14 +820,14 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs ||
pdata->buck4_gpiodvs) {
sec_reg_update(s5m8767->iodev, S5M8767_REG_BUCK2CTRL,
- (pdata->buck2_gpiodvs) ? (1 << 1) : (0 << 1),
- 1 << 1);
+ 1 << 1,
+ (pdata->buck2_gpiodvs) ? (1 << 1) : (0 << 1));
sec_reg_update(s5m8767->iodev, S5M8767_REG_BUCK3CTRL,
- (pdata->buck3_gpiodvs) ? (1 << 1) : (0 << 1),
- 1 << 1);
+ 1 << 1,
+ (pdata->buck3_gpiodvs) ? (1 << 1) : (0 << 1));
sec_reg_update(s5m8767->iodev, S5M8767_REG_BUCK4CTRL,
- (pdata->buck4_gpiodvs) ? (1 << 1) : (0 << 1),
- 1 << 1);
+ 1 << 1,
+ (pdata->buck4_gpiodvs) ? (1 << 1) : (0 << 1));
}
/* Initialize GPIO DVS registers */
@@ -862,19 +862,19 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
switch (s5m8767->ramp_delay) {
case 5:
sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP,
- 0x40, 0xf0);
+ 0xf0, 0x40);
break;
case 10:
sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP,
- 0x90, 0xf0);
+ 0xf0, 0x90);
break;
case 25:
sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP,
- 0xd0, 0xf0);
+ 0xf0, 0xd0);
break;
case 50:
sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP,
- 0xe0, 0xf0);
+ 0xf0, 0xe0);
break;
case 100:
sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP,
@@ -882,7 +882,7 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
break;
default:
sec_reg_update(s5m8767->iodev, S5M8767_REG_DVSRAMP,
- 0x90, 0xf0);
+ 0xf0, 0x90);
}
}
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
index 378ae8a..b04509e 100644
--- a/include/linux/mfd/samsung/core.h
+++ b/include/linux/mfd/samsung/core.h
@@ -58,10 +58,10 @@ void sec_irq_exit(struct sec_pmic_dev *sec_pmic);
int sec_irq_resume(struct sec_pmic_dev *sec_pmic);
extern int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest);
-extern int sec_bulk_read(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf);
+extern int sec_bulk_read(struct sec_pmic_dev *sec_pmic, u8 reg, u8 *buf, int count);
extern int sec_reg_write(struct sec_pmic_dev *sec_pmic, u8 reg, u8 value);
-extern int sec_bulk_write(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf);
-extern int sec_reg_update(struct sec_pmic_dev *sec_pmic, u8 reg, u8 val, u8 mask);
+extern int sec_bulk_write(struct sec_pmic_dev *sec_pmic, u8 reg, u8 *buf, int count);
+extern int sec_reg_update(struct sec_pmic_dev *sec_pmic, u8 reg, u8 mask, u8 val);
struct sec_platform_data {
struct sec_regulator_data *regulators;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] mfd: max77693: reorder params in API for regmap consistency
2013-11-08 15:05 [PATCH 1/2] mfd: sec: reorder params in API for regmap consistency Krzysztof Kozlowski
@ 2013-11-08 15:05 ` Krzysztof Kozlowski
2013-11-08 15:54 ` Lee Jones
2013-11-08 15:52 ` [PATCH 1/2] mfd: sec: " Lee Jones
1 sibling, 1 reply; 4+ messages in thread
From: Krzysztof Kozlowski @ 2013-11-08 15:05 UTC (permalink / raw)
To: linux-arm-kernel
The last two parameters of certain register access functions were in
different order than regmap API. This was confusing and error-prone.
Reorder parameters for register access API to match regmap API:
- max77693_bulk_read() reorder count and buf,
- max77693_bulk_write() reorder count and buf,
- max77693_update_reg() reorder val and mask.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/extcon/extcon-max77693.c | 14 +++++++-------
drivers/mfd/max77693-irq.c | 2 +-
drivers/mfd/max77693.c | 6 +++---
include/linux/mfd/max77693-private.h | 10 +++++-----
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index da268fb..602d948 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -257,8 +257,8 @@ static int max77693_muic_set_debounce_time(struct max77693_muic_info *info,
case ADC_DEBOUNCE_TIME_38_62MS:
ret = max77693_update_reg(info->max77693->regmap_muic,
MAX77693_MUIC_REG_CTRL3,
- time << CONTROL3_ADCDBSET_SHIFT,
- CONTROL3_ADCDBSET_MASK);
+ CONTROL3_ADCDBSET_MASK,
+ time << CONTROL3_ADCDBSET_SHIFT);
if (ret) {
dev_err(info->dev, "failed to set ADC debounce time\n");
return ret;
@@ -294,7 +294,7 @@ static int max77693_muic_set_path(struct max77693_muic_info *info,
ctrl1 = CONTROL1_SW_OPEN;
ret = max77693_update_reg(info->max77693->regmap_muic,
- MAX77693_MUIC_REG_CTRL1, ctrl1, COMP_SW_MASK);
+ MAX77693_MUIC_REG_CTRL1, COMP_SW_MASK, ctrl1);
if (ret < 0) {
dev_err(info->dev, "failed to update MUIC register\n");
return ret;
@@ -306,8 +306,8 @@ static int max77693_muic_set_path(struct max77693_muic_info *info,
ctrl2 |= CONTROL2_LOWPWR_MASK; /* LowPwr=1, CPEn=0 */
ret = max77693_update_reg(info->max77693->regmap_muic,
- MAX77693_MUIC_REG_CTRL2, ctrl2,
- CONTROL2_LOWPWR_MASK | CONTROL2_CPEN_MASK);
+ MAX77693_MUIC_REG_CTRL2,
+ CONTROL2_LOWPWR_MASK | CONTROL2_CPEN_MASK, ctrl2);
if (ret < 0) {
dev_err(info->dev, "failed to update MUIC register\n");
return ret;
@@ -970,7 +970,7 @@ static void max77693_muic_irq_work(struct work_struct *work)
irq_type = muic_irqs[i].irq;
ret = max77693_bulk_read(info->max77693->regmap_muic,
- MAX77693_MUIC_REG_STATUS1, 2, info->status);
+ MAX77693_MUIC_REG_STATUS1, info->status, 2);
if (ret) {
dev_err(info->dev, "failed to read MUIC register\n");
mutex_unlock(&info->mutex);
@@ -1043,7 +1043,7 @@ static int max77693_muic_detect_accessory(struct max77693_muic_info *info)
/* Read STATUSx register to detect accessory */
ret = max77693_bulk_read(info->max77693->regmap_muic,
- MAX77693_MUIC_REG_STATUS1, 2, info->status);
+ MAX77693_MUIC_REG_STATUS1, info->status, 2);
if (ret) {
dev_err(info->dev, "failed to read MUIC register\n");
mutex_unlock(&info->mutex);
diff --git a/drivers/mfd/max77693-irq.c b/drivers/mfd/max77693-irq.c
index 1029d01..8718927 100644
--- a/drivers/mfd/max77693-irq.c
+++ b/drivers/mfd/max77693-irq.c
@@ -207,7 +207,7 @@ static irqreturn_t max77693_irq_thread(int irq, void *data)
if (irq_src & MAX77693_IRQSRC_MUIC)
/* MUIC INT1 ~ INT3 */
max77693_bulk_read(max77693->regmap_muic, MAX77693_MUIC_REG_INT1,
- MAX77693_NUM_IRQ_MUIC_REGS, &irq_reg[MUIC_INT1]);
+ &irq_reg[MUIC_INT1], MAX77693_NUM_IRQ_MUIC_REGS);
/* Apply masking */
for (i = 0; i < MAX77693_IRQ_GROUP_NR; i++) {
diff --git a/drivers/mfd/max77693.c b/drivers/mfd/max77693.c
index c04723e..54f1a7f 100644
--- a/drivers/mfd/max77693.c
+++ b/drivers/mfd/max77693.c
@@ -60,7 +60,7 @@ int max77693_read_reg(struct regmap *map, u8 reg, u8 *dest)
}
EXPORT_SYMBOL_GPL(max77693_read_reg);
-int max77693_bulk_read(struct regmap *map, u8 reg, int count, u8 *buf)
+int max77693_bulk_read(struct regmap *map, u8 reg, u8 *buf, int count)
{
int ret;
@@ -80,7 +80,7 @@ int max77693_write_reg(struct regmap *map, u8 reg, u8 value)
}
EXPORT_SYMBOL_GPL(max77693_write_reg);
-int max77693_bulk_write(struct regmap *map, u8 reg, int count, u8 *buf)
+int max77693_bulk_write(struct regmap *map, u8 reg, u8 *buf, int count)
{
int ret;
@@ -90,7 +90,7 @@ int max77693_bulk_write(struct regmap *map, u8 reg, int count, u8 *buf)
}
EXPORT_SYMBOL_GPL(max77693_bulk_write);
-int max77693_update_reg(struct regmap *map, u8 reg, u8 val, u8 mask)
+int max77693_update_reg(struct regmap *map, u8 reg, u8 mask, u8 val)
{
int ret;
diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h
index 244fb0d..40fd954 100644
--- a/include/linux/mfd/max77693-private.h
+++ b/include/linux/mfd/max77693-private.h
@@ -334,12 +334,12 @@ enum max77693_types {
};
extern int max77693_read_reg(struct regmap *map, u8 reg, u8 *dest);
-extern int max77693_bulk_read(struct regmap *map, u8 reg, int count,
- u8 *buf);
+extern int max77693_bulk_read(struct regmap *map, u8 reg, u8 *buf,
+ int count);
extern int max77693_write_reg(struct regmap *map, u8 reg, u8 value);
-extern int max77693_bulk_write(struct regmap *map, u8 reg, int count,
- u8 *buf);
-extern int max77693_update_reg(struct regmap *map, u8 reg, u8 val, u8 mask);
+extern int max77693_bulk_write(struct regmap *map, u8 reg, u8 *buf,
+ int count);
+extern int max77693_update_reg(struct regmap *map, u8 reg, u8 mask, u8 val);
extern int max77693_irq_init(struct max77693_dev *max77686);
extern void max77693_irq_exit(struct max77693_dev *max77686);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] mfd: max77693: reorder params in API for regmap consistency
2013-11-08 15:05 ` [PATCH 2/2] mfd: max77693: " Krzysztof Kozlowski
@ 2013-11-08 15:54 ` Lee Jones
0 siblings, 0 replies; 4+ messages in thread
From: Lee Jones @ 2013-11-08 15:54 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, 08 Nov 2013, Krzysztof Kozlowski wrote:
> The last two parameters of certain register access functions were in
> different order than regmap API. This was confusing and error-prone.
>
> Reorder parameters for register access API to match regmap API:
> - max77693_bulk_read() reorder count and buf,
> - max77693_bulk_write() reorder count and buf,
> - max77693_update_reg() reorder val and mask.
>
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> drivers/extcon/extcon-max77693.c | 14 +++++++-------
> drivers/mfd/max77693-irq.c | 2 +-
> drivers/mfd/max77693.c | 6 +++---
> include/linux/mfd/max77693-private.h | 10 +++++-----
> 4 files changed, 16 insertions(+), 16 deletions(-)
Acked-by: Lee Jones <lee.jones@linaro.org>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] mfd: sec: reorder params in API for regmap consistency
2013-11-08 15:05 [PATCH 1/2] mfd: sec: reorder params in API for regmap consistency Krzysztof Kozlowski
2013-11-08 15:05 ` [PATCH 2/2] mfd: max77693: " Krzysztof Kozlowski
@ 2013-11-08 15:52 ` Lee Jones
1 sibling, 0 replies; 4+ messages in thread
From: Lee Jones @ 2013-11-08 15:52 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, 08 Nov 2013, Krzysztof Kozlowski wrote:
> The last two parameters of certain register access functions were in
> different order than regmap API. This was confusing and error-prone.
>
> Reorder parameters for register access API to match regmap API:
> - sec_bulk_read() reorder count and buf,
> - sec_bulk_write() reorder count and buf,
> - sec_reg_update() reorder val and mask.
>
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> drivers/mfd/sec-core.c | 6 +++---
> drivers/regulator/s5m8767.c | 26 +++++++++++++-------------
> include/linux/mfd/samsung/core.h | 6 +++---
> 3 files changed, 19 insertions(+), 19 deletions(-)
Seems to make sense.
For the MFD portion: Acked-by: Lee Jones <lee.jones@linaro.org>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-11-08 15:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-08 15:05 [PATCH 1/2] mfd: sec: reorder params in API for regmap consistency Krzysztof Kozlowski
2013-11-08 15:05 ` [PATCH 2/2] mfd: max77693: " Krzysztof Kozlowski
2013-11-08 15:54 ` Lee Jones
2013-11-08 15:52 ` [PATCH 1/2] mfd: sec: " Lee Jones
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).