2012-05-24 08:56:39

by Axel Lin

[permalink] [raw]
Subject: [PATCH 1/2] mfd: select REGMAP_I2C for config MFD_MAX77693

max77693 driver uses regmap api, thus need to select REGMAP_I2C.
This fixes below build error when CONFIG_REGMAP=y && CONFIG_REGMAP_I2C=m:

LD init/built-in.o
drivers/built-in.o: In function `max77693_i2c_probe':
clk-fixed-factor.c:(.text+0x541f8): undefined reference to `devm_regmap_init_i2c'
make: *** [vmlinux] Error 1

Signed-off-by: Axel Lin <[email protected]>
---
drivers/mfd/Kconfig | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 4db63b1..e129c82 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -426,6 +426,7 @@ config MFD_MAX77693
bool "Maxim Semiconductor MAX77693 PMIC Support"
depends on I2C=y && GENERIC_HARDIRQS
select MFD_CORE
+ select REGMAP_I2C
help
Say yes here to support for Maxim Semiconductor MAX77693.
This is a companion Power Management IC with Flash, Haptic, Charger,
--
1.7.5.4



2012-05-24 08:57:54

by Axel Lin

[permalink] [raw]
Subject: [PATCH 2/2] mfd: max77693: Remove unused iolock mutex

Now this driver is using regmap APIs, the iolock mutex is not used and can be
removed.

Signed-off-by: Axel Lin <[email protected]>
---
drivers/mfd/max77693.c | 2 --
include/linux/mfd/max77693-private.h | 1 -
2 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/max77693.c b/drivers/mfd/max77693.c
index e9e4278..4055bc2 100644
--- a/drivers/mfd/max77693.c
+++ b/drivers/mfd/max77693.c
@@ -138,8 +138,6 @@ static int max77693_i2c_probe(struct i2c_client *i2c,

max77693->wakeup = pdata->wakeup;

- mutex_init(&max77693->iolock);
-
if (max77693_read_reg(max77693->regmap,
MAX77693_PMIC_REG_PMIC_ID2, &reg_data) < 0) {
dev_err(max77693->dev, "device not found on this channel\n");
diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h
index 68263c5..1eeae5c 100644
--- a/include/linux/mfd/max77693-private.h
+++ b/include/linux/mfd/max77693-private.h
@@ -190,7 +190,6 @@ struct max77693_dev {
struct i2c_client *i2c; /* 0xCC , PMIC, Charger, Flash LED */
struct i2c_client *muic; /* 0x4A , MUIC */
struct i2c_client *haptic; /* 0x90 , Haptic */
- struct mutex iolock;

int type;

--
1.7.5.4


2012-05-24 23:21:49

by Chanwoo Choi

[permalink] [raw]
Subject: Re: [PATCH 1/2] mfd: select REGMAP_I2C for config MFD_MAX77693

Hi Axel Lin,

On 05/24/2012 05:56 PM, Axel Lin wrote:

> max77693 driver uses regmap api, thus need to select REGMAP_I2C.
> This fixes below build error when CONFIG_REGMAP=y && CONFIG_REGMAP_I2C=m:
>
> LD init/built-in.o
> drivers/built-in.o: In function `max77693_i2c_probe':
> clk-fixed-factor.c:(.text+0x541f8): undefined reference to `devm_regmap_init_i2c'
> make: *** [vmlinux] Error 1
>
> Signed-off-by: Axel Lin <[email protected]>
> ---
> drivers/mfd/Kconfig | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 4db63b1..e129c82 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -426,6 +426,7 @@ config MFD_MAX77693
> bool "Maxim Semiconductor MAX77693 PMIC Support"
> depends on I2C=y && GENERIC_HARDIRQS
> select MFD_CORE
> + select REGMAP_I2C
> help
> Say yes here to support for Maxim Semiconductor MAX77693.
> This is a companion Power Management IC with Flash, Haptic, Charger,


I sent this patch yesterday due to same issue and it was applied to
mfd-2.6.git
by Samuel Ortiz. You can check it on below URL.
http://www.spinics.net/lists/kernel/msg1346801.html

Thank you,
Chanwoo Choi

2012-06-29 11:11:34

by Samuel Ortiz

[permalink] [raw]
Subject: Re: [PATCH 2/2] mfd: max77693: Remove unused iolock mutex

Hi Axel,

On Thu, May 24, 2012 at 04:57:46PM +0800, Axel Lin wrote:
> Now this driver is using regmap APIs, the iolock mutex is not used and can be
> removed.
>
> Signed-off-by: Axel Lin <[email protected]>
> ---
> drivers/mfd/max77693.c | 2 --
> include/linux/mfd/max77693-private.h | 1 -
> 2 files changed, 0 insertions(+), 3 deletions(-)
Patch applied, thanks.

Cheers,
Samuel.

--
Intel Open Source Technology Centre
http://oss.intel.com/