RE: [PATCH 5/5] mfd: s2mps11: Add binding documentation for Samsung S2MPS13 PMIC

2014-11-17 Thread Sangbeom Kim
Hi,
On Monday, November 17, 2014 9:43 AM, Chanwoo Choi wrote:
> This patch adds the binding documentation for Samsung S2MPS13 PMIC
> which is similiar with existing S2MPS14 PMIC. S2MPS13 has the different number
> of regulators from S2MPS14 and RTC/Clock is the same with the S2MPS14.


Acked-by: Sangbeom Kim 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 4/5] rtc: s5m: Add the support for S2MPS13 RTC

2014-11-17 Thread Sangbeom Kim
Hi,
On Monday, November 17, 2014 9:43 AM, Chanwoo Choi wrote:
> This patch adds only the compatible string for S2MPS13 clock which is 
> identical
> with S2MPS14 clock driver.

What's the relation of S2MPS14 RTC and clock driver?

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 2/5] regulator: s2mps11: Add support S2MPS13 regulator device

2014-11-17 Thread Sangbeom Kim
Hi,
On Monday, November 17, 2014 9:43 AM, Chanwoo Choi wrote:
> This patch adds S2MPS13 regulator device to existing S2MPS11 device driver.
> The S2MPS13 has just different number of regulators from S2MPS14.
> The S2MPS13 regulator device includes LDO[1-40] and BUCK[1-10].

Acked-by: Sangbeom Kim 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 1/5] mfd: sec-core: Add support for S2MPS13 device

2014-11-17 Thread Sangbeom Kim
Hi,
On Monday, November 17, 2014 9:43 AM, Chanwoo Choi wrote:

> This patch adds the support for Samsung S2MPS13 PMIC device to the sec-core 
> MFD
> driver. The S2MPS13 is very similar with existing S2MPS14 and includes PMIC/
> RTC/CLOCK devices.

Acked-by: Sangbeom Kim 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 1/5] mfd: sec-core: Add support for S2MPS13 device

2014-11-17 Thread Sangbeom Kim
Hi,
On Monday, November 17, 2014 9:43 AM, Chanwoo Choi wrote:

 This patch adds the support for Samsung S2MPS13 PMIC device to the sec-core 
 MFD
 driver. The S2MPS13 is very similar with existing S2MPS14 and includes PMIC/
 RTC/CLOCK devices.

Acked-by: Sangbeom Kim sbki...@samsung.com

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 2/5] regulator: s2mps11: Add support S2MPS13 regulator device

2014-11-17 Thread Sangbeom Kim
Hi,
On Monday, November 17, 2014 9:43 AM, Chanwoo Choi wrote:
 This patch adds S2MPS13 regulator device to existing S2MPS11 device driver.
 The S2MPS13 has just different number of regulators from S2MPS14.
 The S2MPS13 regulator device includes LDO[1-40] and BUCK[1-10].

Acked-by: Sangbeom Kim sbki...@samsung.com

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 4/5] rtc: s5m: Add the support for S2MPS13 RTC

2014-11-17 Thread Sangbeom Kim
Hi,
On Monday, November 17, 2014 9:43 AM, Chanwoo Choi wrote:
 This patch adds only the compatible string for S2MPS13 clock which is 
 identical
 with S2MPS14 clock driver.

What's the relation of S2MPS14 RTC and clock driver?

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 5/5] mfd: s2mps11: Add binding documentation for Samsung S2MPS13 PMIC

2014-11-17 Thread Sangbeom Kim
Hi,
On Monday, November 17, 2014 9:43 AM, Chanwoo Choi wrote:
 This patch adds the binding documentation for Samsung S2MPS13 PMIC
 which is similiar with existing S2MPS14 PMIC. S2MPS13 has the different number
 of regulators from S2MPS14 and RTC/Clock is the same with the S2MPS14.


Acked-by: Sangbeom Kim sbki...@samsung.com

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 09/16] MAINTAINERS: Update Samsunt MFD drivers pattern

2014-07-03 Thread Sangbeom Kim
On Friday, July 04, 2014 7:08 AM, Joe Perches wrote:

>  F:   drivers/regulator/s2m*.c
>  F:   drivers/regulator/s5m*.c
> -F:   drivers/rtc/rtc-sec.c
>  F:   include/linux/mfd/samsung/
> 

Yes, You are right.
There is no rtc-sec.c
Instead, rtc-s5m.c was upstreamed.
I will post update patch.

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 09/16] MAINTAINERS: Update Samsunt MFD drivers pattern

2014-07-03 Thread Sangbeom Kim
On Friday, July 04, 2014 7:08 AM, Joe Perches wrote:

  F:   drivers/regulator/s2m*.c
  F:   drivers/regulator/s5m*.c
 -F:   drivers/rtc/rtc-sec.c
  F:   include/linux/mfd/samsung/
 

Yes, You are right.
There is no rtc-sec.c
Instead, rtc-s5m.c was upstreamed.
I will post update patch.

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 04/27] ARM: EXYNOS: Support secondary CPU boot of Exynos4212

2014-04-11 Thread Sangbeom Kim
Hi,
On 04/11/2014 2:14 PM, Chanwoo Choi wrote:

> >>  {
> >> -  exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0);
> >> +  if (soc_is_exynos4212())
> >> +  exynos_smc(SMC_CMD_CPU1BOOT, 0, 0, 0);
> >> +  else
> >> +  exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0);
> >
> > /*  */
> 
> It's better to ask system lsi person. We don't know it well.
> I got the guide about secondary boot from system lsi.
> But, this patch was completely tested.

exynos_smc(SMC_CMD_CPU1BOOT, ...) is cpu hotplug SMC interface.
Exynos4212 is dual core processor.
Exynos4212 only have to boot cpu1 on smp boot.
So, Second parameter of exynos_smc is fixed by 0 which means cpu1.
It don't need to boot another cpu (ex. cpu2, cpu3 for quad core processor).
But In case of quad core processor (ex. Exynos4412), 
It need to boot another cpu and specify parameter of booting core.
As I know, Exynos3250 is dual core. 
So It can be included 1st condition too.

Sangbeom,
Thanks,

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 04/27] ARM: EXYNOS: Support secondary CPU boot of Exynos4212

2014-04-11 Thread Sangbeom Kim
Hi,
On 04/11/2014 2:14 PM, Chanwoo Choi wrote:

   {
  -  exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0);
  +  if (soc_is_exynos4212())
  +  exynos_smc(SMC_CMD_CPU1BOOT, 0, 0, 0);
  +  else
  +  exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0);
 
  /* explain why you need this special case on 4212 */
 
 It's better to ask system lsi person. We don't know it well.
 I got the guide about secondary boot from system lsi.
 But, this patch was completely tested.

exynos_smc(SMC_CMD_CPU1BOOT, ...) is cpu hotplug SMC interface.
Exynos4212 is dual core processor.
Exynos4212 only have to boot cpu1 on smp boot.
So, Second parameter of exynos_smc is fixed by 0 which means cpu1.
It don't need to boot another cpu (ex. cpu2, cpu3 for quad core processor).
But In case of quad core processor (ex. Exynos4412), 
It need to boot another cpu and specify parameter of booting core.
As I know, Exynos3250 is dual core. 
So It can be included 1st condition too.

Sangbeom,
Thanks,

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v2 5/5] mfd: sec: Constify regmap configs and regmap irqs

2013-11-28 Thread Sangbeom Kim
On Friday, November 29, 2013 2:15 AM, Mark Brown wrote:
> > Add "const" to "static struct regmap_irq" and "static struct
> > regmap_config".
> 
> Reviewed-by: Mark Brown 

Acked-by: Sangbeom Kim 

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v2 4/5] rtc: s5m: Enable IRQ wake during suspend

2013-11-28 Thread Sangbeom Kim
On Thursday, November 28, 2013 5:10 PM, Krzysztof Kozlowski wrote:
> Add PM suspend/resume ops to rtc-s5m driver and enable IRQ wake during
> suspend so the RTC would act like a wake up source. This allows waking
> up from suspend to RAM on RTC alarm interrupt.
> 
> Signed-off-by: Krzysztof Kozlowski 
> Signed-off-by: Kyungmin Park 

Acked-by: Sangbeom Kim 

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v2 3/5] rtc: s5m: Limit endless loop waiting for register update

2013-11-28 Thread Sangbeom Kim
On Thursday, November 28, 2013 10:48 PM, Mark Brown wrote:
> > After setting alarm or time the driver is waiting for UDR register to be
> > cleared indicating that registers data have been transferred.
> >
> > Limit the endless loop to only 5 retries.
> 
> Reviwed-by: Mark Brown 

Acked-by: Sangbeom Kim 

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v2 2/5] rtc: s5m: Fix unsuccesful IRQ request during probe

2013-11-28 Thread Sangbeom Kim
On Thursday, November 28, 2013 10:47 PM, Mark Brown wrote:
> > Fix rtc-s5m interrupt request by using regmap_irq_get_virq() for mapping
> > the IRQ.
> 
> Reviwed-by: Mark Brown 

Acked-by: Sangbeom Kim 

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v2 1/5] mfd/rtc: s5m: Fix register updating by adding regmap for RTC

2013-11-28 Thread Sangbeom Kim
On Thursday, November 28, 2013 10:51 PM, Mark Brown wrote:
> > On S5M8767A registers were not properly updated and read due to usage
> > of the same regmap as the PMIC. This could be observed in various
> > hangs, e.g. in infinite loop during waiting for UDR field change.
> 
> Reviwed-by: Mark Brown 

Acked-by: Sangbeom Kim 

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v2 1/5] mfd/rtc: s5m: Fix register updating by adding regmap for RTC

2013-11-28 Thread Sangbeom Kim
On Thursday, November 28, 2013 10:51 PM, Mark Brown wrote:
  On S5M8767A registers were not properly updated and read due to usage
  of the same regmap as the PMIC. This could be observed in various
  hangs, e.g. in infinite loop during waiting for UDR field change.
 
 Reviwed-by: Mark Brown broo...@linaro.org

Acked-by: Sangbeom Kim sbki...@samsung.com

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v2 2/5] rtc: s5m: Fix unsuccesful IRQ request during probe

2013-11-28 Thread Sangbeom Kim
On Thursday, November 28, 2013 10:47 PM, Mark Brown wrote:
  Fix rtc-s5m interrupt request by using regmap_irq_get_virq() for mapping
  the IRQ.
 
 Reviwed-by: Mark Brown broo...@linaro.org

Acked-by: Sangbeom Kim sbki...@samsung.com

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v2 3/5] rtc: s5m: Limit endless loop waiting for register update

2013-11-28 Thread Sangbeom Kim
On Thursday, November 28, 2013 10:48 PM, Mark Brown wrote:
  After setting alarm or time the driver is waiting for UDR register to be
  cleared indicating that registers data have been transferred.
 
  Limit the endless loop to only 5 retries.
 
 Reviwed-by: Mark Brown broo...@linaro.org

Acked-by: Sangbeom Kim sbki...@samsung.com

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v2 4/5] rtc: s5m: Enable IRQ wake during suspend

2013-11-28 Thread Sangbeom Kim
On Thursday, November 28, 2013 5:10 PM, Krzysztof Kozlowski wrote:
 Add PM suspend/resume ops to rtc-s5m driver and enable IRQ wake during
 suspend so the RTC would act like a wake up source. This allows waking
 up from suspend to RAM on RTC alarm interrupt.
 
 Signed-off-by: Krzysztof Kozlowski k.kozlow...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com

Acked-by: Sangbeom Kim sbki...@samsung.com

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v2 5/5] mfd: sec: Constify regmap configs and regmap irqs

2013-11-28 Thread Sangbeom Kim
On Friday, November 29, 2013 2:15 AM, Mark Brown wrote:
  Add const to static struct regmap_irq and static struct
  regmap_config.
 
 Reviewed-by: Mark Brown broo...@linaro.org

Acked-by: Sangbeom Kim sbki...@samsung.com

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 1/1] regulator: s2mps11: Use devm_regulator_register

2013-09-04 Thread Sangbeom Kim
On Wednesday, September 04, 2013 3:42 PM, Sachin Kamat wrote:

> Commit e398b51a ("regulator: s2mps11: Convert to devm_regulator_register()")
> intended to do this conversion. However the actual conversion to devm_* got
> missed out. Fix this.
> 

Acked-by: Sangbeom Kim 

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 1/1] regulator: s2mps11: Use devm_regulator_register

2013-09-04 Thread Sangbeom Kim
On Wednesday, September 04, 2013 3:42 PM, Sachin Kamat wrote:

 Commit e398b51a (regulator: s2mps11: Convert to devm_regulator_register())
 intended to do this conversion. However the actual conversion to devm_* got
 missed out. Fix this.
 

Acked-by: Sangbeom Kim sbki...@samsung.com

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 05/11] regulator: s5m8767: Covert to devm_regulator_register()

2013-09-02 Thread Sangbeom Kim
On Saturday, August 31, 2013 8:29 AM, Mark Brown wrote:

> Subject: [PATCH 05/11] regulator: s5m8767: Covert to devm_regulator_register()
> 
> From: Mark Brown 
> 
> Signed-off-by: Mark Brown 

Acked-by: Sangbeom Kim 

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 04/11] regulator: s2mps11: Convert to devm_regulator_register()

2013-09-02 Thread Sangbeom Kim
On Saturday, August 31, 2013 8:29 AM, Mark Brown wrote:

> Subject: [PATCH 04/11] regulator: s2mps11: Convert to 
> devm_regulator_register()
> 
> From: Mark Brown 
> 
> Signed-off-by: Mark Brown 

Acked-by: Sangbeom Kim 

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 04/11] regulator: s2mps11: Convert to devm_regulator_register()

2013-09-02 Thread Sangbeom Kim
On Saturday, August 31, 2013 8:29 AM, Mark Brown wrote:

 Subject: [PATCH 04/11] regulator: s2mps11: Convert to 
 devm_regulator_register()
 
 From: Mark Brown broo...@linaro.org
 
 Signed-off-by: Mark Brown broo...@linaro.org

Acked-by: Sangbeom Kim sbki...@samsung.com

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 05/11] regulator: s5m8767: Covert to devm_regulator_register()

2013-09-02 Thread Sangbeom Kim
On Saturday, August 31, 2013 8:29 AM, Mark Brown wrote:

 Subject: [PATCH 05/11] regulator: s5m8767: Covert to devm_regulator_register()
 
 From: Mark Brown broo...@linaro.org
 
 Signed-off-by: Mark Brown broo...@linaro.org

Acked-by: Sangbeom Kim sbki...@samsung.com

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] regulator: s2mps11: Fix ramp delay value shift operation

2012-11-23 Thread Sangbeom Kim
This patch fix the abnormal ramp delay setting.
The shift operation was wrong.

Signed-off-by: Sangbeom Kim 
---
 drivers/regulator/s2mps11.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
index 85fc086..bd062a2 100644
--- a/drivers/regulator/s2mps11.c
+++ b/drivers/regulator/s2mps11.c
@@ -269,16 +269,16 @@ static int s2mps11_pmic_probe(struct platform_device 
*pdev)
 
if (ramp_enable) {
if (s2mps11->buck2_ramp)
-   ramp_reg |= get_ramp_delay(s2mps11->ramp_delay2) >> 6;
+   ramp_reg |= get_ramp_delay(s2mps11->ramp_delay2) << 6;
if (s2mps11->buck3_ramp || s2mps11->buck4_ramp)
-   ramp_reg |= get_ramp_delay(s2mps11->ramp_delay34) >> 4;
+   ramp_reg |= get_ramp_delay(s2mps11->ramp_delay34) << 4;
sec_reg_write(iodev, S2MPS11_REG_RAMP, ramp_reg | ramp_enable);
}
 
ramp_reg &= 0x00;
-   ramp_reg |= get_ramp_delay(s2mps11->ramp_delay5) >> 6;
-   ramp_reg |= get_ramp_delay(s2mps11->ramp_delay16) >> 4;
-   ramp_reg |= get_ramp_delay(s2mps11->ramp_delay7810) >> 2;
+   ramp_reg |= get_ramp_delay(s2mps11->ramp_delay5) << 6;
+   ramp_reg |= get_ramp_delay(s2mps11->ramp_delay16) << 4;
+   ramp_reg |= get_ramp_delay(s2mps11->ramp_delay7810) << 2;
ramp_reg |= get_ramp_delay(s2mps11->ramp_delay9);
sec_reg_write(iodev, S2MPS11_REG_RAMP_BUCK, ramp_reg);
 
-- 
1.7.4.1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 21/24] MAINTAINERS: fix drivers/rtc/rtc-sec.c

2012-11-23 Thread Sangbeom Kim
On Sat, Nov 24, 2012 at 9:27 AM , Cesar Eduardo Barros wrote:

> I am guessing that this was a typo for rtc-s3c. Please NACK this patch
> if I am wrong.

rtc-sec and rtc-s3c is different one.
rtc-sec is driver of Samsung mfd.
Rtc-s3c is driver of Samsung SoC.

Currently, We had just done rtc-sec coding.
It just keep on my repo.
Sooner or later, I will post rtc-sec.

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 21/24] MAINTAINERS: fix drivers/rtc/rtc-sec.c

2012-11-23 Thread Sangbeom Kim
On Sat, Nov 24, 2012 at 9:27 AM , Cesar Eduardo Barros wrote:

 I am guessing that this was a typo for rtc-s3c. Please NACK this patch
 if I am wrong.

rtc-sec and rtc-s3c is different one.
rtc-sec is driver of Samsung mfd.
Rtc-s3c is driver of Samsung SoC.

Currently, We had just done rtc-sec coding.
It just keep on my repo.
Sooner or later, I will post rtc-sec.

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] regulator: s2mps11: Fix ramp delay value shift operation

2012-11-23 Thread Sangbeom Kim
This patch fix the abnormal ramp delay setting.
The shift operation was wrong.

Signed-off-by: Sangbeom Kim sbki...@samsung.com
---
 drivers/regulator/s2mps11.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
index 85fc086..bd062a2 100644
--- a/drivers/regulator/s2mps11.c
+++ b/drivers/regulator/s2mps11.c
@@ -269,16 +269,16 @@ static int s2mps11_pmic_probe(struct platform_device 
*pdev)
 
if (ramp_enable) {
if (s2mps11-buck2_ramp)
-   ramp_reg |= get_ramp_delay(s2mps11-ramp_delay2)  6;
+   ramp_reg |= get_ramp_delay(s2mps11-ramp_delay2)  6;
if (s2mps11-buck3_ramp || s2mps11-buck4_ramp)
-   ramp_reg |= get_ramp_delay(s2mps11-ramp_delay34)  4;
+   ramp_reg |= get_ramp_delay(s2mps11-ramp_delay34)  4;
sec_reg_write(iodev, S2MPS11_REG_RAMP, ramp_reg | ramp_enable);
}
 
ramp_reg = 0x00;
-   ramp_reg |= get_ramp_delay(s2mps11-ramp_delay5)  6;
-   ramp_reg |= get_ramp_delay(s2mps11-ramp_delay16)  4;
-   ramp_reg |= get_ramp_delay(s2mps11-ramp_delay7810)  2;
+   ramp_reg |= get_ramp_delay(s2mps11-ramp_delay5)  6;
+   ramp_reg |= get_ramp_delay(s2mps11-ramp_delay16)  4;
+   ramp_reg |= get_ramp_delay(s2mps11-ramp_delay7810)  2;
ramp_reg |= get_ramp_delay(s2mps11-ramp_delay9);
sec_reg_write(iodev, S2MPS11_REG_RAMP_BUCK, ramp_reg);
 
-- 
1.7.4.1


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH V3 3/7] mfd: samsung: Modify samsung mfd header

2012-07-12 Thread Sangbeom Kim
Hi!
On Wednesday, July 11, 2012 9:30 PM, Venu Byravarasu wrote:

> > + * copyright (c) 2011 Samsung Electronics Co., Ltd
> > + *  http://www.samsung.com
> 
> In most of the files you mentioned 2011.
> Should they not be changed to 2012?

Most of the files are created in 2011.
This file is moved from include/linux/mfd/s5m87xx/s5m-core.h
 
> > -   int buck_set1;
> > -   int buck_set2;
> > -   int buck_set3;
> 
> As you have buck4_enable etc below, by any chance do you need buck_set4 as 
> well here?


No, S5M8767 have 3 controllerble gpios.
The purpose of buck_set1,2,3 is each gpio control.
To handle 3 gpio, I had added buck_set1, buck_set2, buck_set3.

> Similarly should you declare buck1_enable here?


No, gpio control can be enabled on buck2, buck3, buck4.
There is no need buck1_enable.

> > -   int buck2_enable;
> > -   int buck3_enable;
> > -   int buck4_enable;
> > -   int buck_default_idx;
> > -   int buck2_default_idx;

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH V3 3/7] mfd: samsung: Modify samsung mfd header

2012-07-12 Thread Sangbeom Kim
Hi!
On Wednesday, July 11, 2012 9:30 PM, Venu Byravarasu wrote:

  + * copyright (c) 2011 Samsung Electronics Co., Ltd
  + *  http://www.samsung.com
 
 In most of the files you mentioned 2011.
 Should they not be changed to 2012?

Most of the files are created in 2011.
This file is moved from include/linux/mfd/s5m87xx/s5m-core.h
 
  -   int buck_set1;
  -   int buck_set2;
  -   int buck_set3;
 
 As you have buck4_enable etc below, by any chance do you need buck_set4 as 
 well here?


No, S5M8767 have 3 controllerble gpios.
The purpose of buck_set1,2,3 is each gpio control.
To handle 3 gpio, I had added buck_set1, buck_set2, buck_set3.

 Similarly should you declare buck1_enable here?


No, gpio control can be enabled on buck2, buck3, buck4.
There is no need buck1_enable.

  -   int buck2_enable;
  -   int buck3_enable;
  -   int buck4_enable;
  -   int buck_default_idx;
  -   int buck2_default_idx;

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 3/3] regulator: s2mps11: Use sec_reg_write rather than sec_reg_update when mask is 0xff

2012-07-11 Thread Sangbeom Kim
Hi,
On Thursday, July 12, 2012 10:39 AM +0900, Axel Lin wrote:
> 
> Signed-off-by: Axel Lin 

Acked-by: Sangbeom Kim 

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 2/3] regulator: s2mps11: Fix wrong setting for config.dev

2012-07-11 Thread Sangbeom Kim
Hi,
On Thursday, July 12, 2012 10:38 AM +0900, Axel Lin wrote:
> 
> Signed-off-by: Axel Lin 

Acked-by: Sangbeom Kim 

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 1/3] regulator: s2mps11: Fixup missing commas

2012-07-11 Thread Sangbeom Kim
Hi!
On Thursday, July 12, 2012 10:36 AM +0900, Axel Lin wrote:

> Signed-off-by: Axel Lin 

S2mps11 regulator patch is based on mfd/for-next branch.
On mfd/for-next branch, Some regulator features didn't apply 
like a set_voltage_time_sel.
So, I didn't add some feature like a set_voltage_time_sel, vsel_mask.
Before send patch, I just added that. 
Anyway, It's my mistake.

Acked-by: Sangbeom Kim 

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V3 5/7] mfd: samsung: Add s2mps11 irq driver

2012-07-11 Thread Sangbeom Kim
This patch support irq handling driver for s2mps11.
As this patch use regmap_irq, s5m8767 and s5m8763 are modified with
regmap_irq.

Signed-off-by: Sangbeom Kim 
---
 drivers/mfd/Kconfig  |1 +
 drivers/mfd/sec-irq.c|  477 --
 include/linux/mfd/samsung/core.h |2 +
 include/linux/mfd/samsung/irq.h  |   42 
 4 files changed, 193 insertions(+), 329 deletions(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index bad68f8..3c263a5 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -513,6 +513,7 @@ config MFD_SEC_CORE
depends on I2C=y && GENERIC_HARDIRQS
select MFD_CORE
select REGMAP_I2C
+   select REGMAP_IRQ
help
 Support for the Samsung Electronics MFD series.
 This driver provides common support for accessing the device,
diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c
index da5ec5b..c901fa5 100644
--- a/drivers/mfd/sec-irq.c
+++ b/drivers/mfd/sec-irq.c
@@ -14,351 +14,260 @@
 #include 
 #include 
 #include 
+#include 
+
 #include 
 #include 
+#include 
 #include 
 #include 
 
-struct sec_irq_data {
-   int reg;
-   int mask;
+static struct regmap_irq s2mps11_irqs[] = {
+   [S2MPS11_IRQ_PWRONF] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_PWRONF_MASK,
+   },
+   [S2MPS11_IRQ_PWRONR] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_PWRONR_MASK,
+   },
+   [S2MPS11_IRQ_JIGONBF] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_JIGONBF_MASK,
+   },
+   [S2MPS11_IRQ_JIGONBR] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_JIGONBR_MASK,
+   },
+   [S2MPS11_IRQ_ACOKBF] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_ACOKBF_MASK,
+   },
+   [S2MPS11_IRQ_ACOKBR] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_ACOKBR_MASK,
+   },
+   [S2MPS11_IRQ_PWRON1S] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_PWRON1S_MASK,
+   },
+   [S2MPS11_IRQ_MRB] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_MRB_MASK,
+   },
+   [S2MPS11_IRQ_RTC60S] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_RTC60S_MASK,
+   },
+   [S2MPS11_IRQ_RTCA1] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_RTCA1_MASK,
+   },
+   [S2MPS11_IRQ_RTCA2] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_RTCA2_MASK,
+   },
+   [S2MPS11_IRQ_SMPL] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_SMPL_MASK,
+   },
+   [S2MPS11_IRQ_RTC1S] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_RTC1S_MASK,
+   },
+   [S2MPS11_IRQ_WTSR] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_WTSR_MASK,
+   },
+   [S2MPS11_IRQ_INT120C] = {
+   .reg_offset = 3,
+   .mask = S2MPS11_IRQ_INT120C_MASK,
+   },
+   [S2MPS11_IRQ_INT140C] = {
+   .reg_offset = 3,
+   .mask = S2MPS11_IRQ_INT140C_MASK,
+   },
 };
 
-static struct sec_irq_data s5m8767_irqs[] = {
+
+static struct regmap_irq s5m8767_irqs[] = {
[S5M8767_IRQ_PWRR] = {
-   .reg = 1,
+   .reg_offset = 1,
.mask = S5M8767_IRQ_PWRR_MASK,
},
[S5M8767_IRQ_PWRF] = {
-   .reg = 1,
+   .reg_offset = 1,
.mask = S5M8767_IRQ_PWRF_MASK,
},
[S5M8767_IRQ_PWR1S] = {
-   .reg = 1,
+   .reg_offset = 1,
.mask = S5M8767_IRQ_PWR1S_MASK,
},
[S5M8767_IRQ_JIGR] = {
-   .reg = 1,
+   .reg_offset = 1,
.mask = S5M8767_IRQ_JIGR_MASK,
},
[S5M8767_IRQ_JIGF] = {
-   .reg = 1,
+   .reg_offset = 1,
.mask = S5M8767_IRQ_JIGF_MASK,
},
[S5M8767_IRQ_LOWBAT2] = {
-   .reg = 1,
+   .reg_offset = 1,
.mask = S5M8767_IRQ_LOWBAT2_MASK,
},
[S5M8767_IRQ_LOWBAT1] = {
-   .reg = 1,
+   .reg_offset = 1,
.mask = S5M8767_IRQ_LOWBAT1_MASK,
},
[S5M8767_IRQ_MRB] = {
-   .reg = 2,
+   .reg_offset = 2,
.mask = S5M8767_IRQ_MRB_MASK,
},
[S5M8767_IRQ_DVSOK2] = {
-   .reg = 2,
+   .reg_offset = 2,
.mask = S5M8767_IRQ_DVSOK2_MASK,
},
[S5M8767_IRQ_DVSOK3] = {
-   .reg = 2,
+   .reg_offset = 2,
.mask = S5M8767_IRQ_DVSOK3_MASK,
},
[S5M8767_IRQ_DVSOK4] = {
-   .reg = 2,
+   .reg_offset = 2,
.mask = S5M8767_IRQ_DVS

[PATCH V3 7/7] MAINTAINRES: Add maintainer for samsung mfd driver

2012-07-11 Thread Sangbeom Kim
There are many samsung multifunction devices which are
s2mps11, s5m8767, s5m8763 etc.
This devices can support regulator, rtc, charger.
I will be supporting the Samsung mfd drivers, that are currently
in development and will be upstreamed shortly.

Signed-off-by: Sangbeom Kim 
---
 MAINTAINERS |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 03df1d1..bfdfc21 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5866,6 +5866,16 @@ L:   linux-fb...@vger.kernel.org
 S: Maintained
 F: drivers/video/s3c-fb.c
 
+SAMSUNG MULTIFUNCTION DEVICE DRIVERS
+M: Sangbeom Kim 
+L: linux-kernel@vger.kernel.org
+S: Supported
+F: drivers/mfd/sec*.c
+F: drivers/regulator/s2m*.c
+F: drivers/regulator/s5m*.c
+F: drivers/rtc/rtc-sec.c
+F: include/linux/mfd/samsung/
+
 SERIAL DRIVERS
 M: Alan Cox 
 L: linux-ser...@vger.kernel.org
-- 
1.7.1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V3 6/7] regualtor: s2mps11: Add samsung s2mps11 regulator driver

2012-07-11 Thread Sangbeom Kim
This patch add Samsung S2MPS11 regulator driver.
The S2MPS11 can support 10 Bucks and 38 LDOs and RTC.
Especially, S2MPS11 is designed for high performance
Samsung application processor.

Signed-off-by: Sangbeom Kim 
---
 drivers/regulator/Kconfig   |8 +
 drivers/regulator/Makefile  |1 +
 drivers/regulator/s2mps11.c |  368 +++
 3 files changed, 377 insertions(+), 0 deletions(-)
 create mode 100644 drivers/regulator/s2mps11.c

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 12c0c0e..c6c02fb 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -233,6 +233,14 @@ config REGULATOR_RC5T583
  through regulator interface. The device supports multiple DCDC/LDO
  outputs which can be controlled by i2c communication.
 
+config REGULATOR_S2MPS11
+   tristate "Samsung S2MPS11 voltage regulator"
+   depends on MFD_SEC_CORE
+   help
+This driver supports a Samsung S2MPS11 voltage output regulator
+via I2C bus. S2MPS11 is comprised of high efficient Buck converters
+including Dual-Phase Buck converter, Buck-Boost converter, various 
LDOs.
+
 config REGULATOR_S5M8767
tristate "Samsung S5M8767A voltage regulator"
depends on MFD_SEC_CORE
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 977fd46..1e31396 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -37,6 +37,7 @@ obj-$(CONFIG_REGULATOR_PALMAS) += palmas-regulator.o
 obj-$(CONFIG_REGULATOR_PCAP) += pcap-regulator.o
 obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o
 obj-$(CONFIG_REGULATOR_RC5T583)  += rc5t583-regulator.o
+obj-$(CONFIG_REGULATOR_S2MPS11) += s2mps11.o
 obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o
 obj-$(CONFIG_REGULATOR_TPS6105X) += tps6105x-regulator.o
 obj-$(CONFIG_REGULATOR_TPS62360) += tps62360-regulator.o
diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
new file mode 100644
index 000..fc9b79d
--- /dev/null
+++ b/drivers/regulator/s2mps11.c
@@ -0,0 +1,368 @@
+/*
+ * s2mps11.c
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd
+ *  http://www.samsung.com
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+struct s2mps11_info {
+   struct device *dev;
+   struct sec_pmic_dev *iodev;
+   struct regulator_dev **rdev;
+
+   int ramp_delay2;
+   int ramp_delay34;
+   int ramp_delay5;
+   int ramp_delay16;
+   int ramp_delay7810;
+   int ramp_delay9;
+
+   bool buck6_ramp;
+   bool buck2_ramp;
+   bool buck3_ramp;
+   bool buck4_ramp;
+};
+
+static int get_ramp_delay(int ramp_delay)
+{
+   unsigned char cnt = 0;
+
+   ramp_delay /= 6;
+
+   while (true) {
+   ramp_delay = ramp_delay >> 1;
+   if (ramp_delay == 0)
+   break;
+   cnt++;
+   }
+   return cnt;
+}
+
+static struct regulator_ops s2mps11_ldo_ops = {
+   .list_voltage   = regulator_list_voltage_linear,
+   .map_voltage= regulator_map_voltage_linear,
+   .is_enabled = regulator_is_enabled_regmap,
+   .enable = regulator_enable_regmap,
+   .disable= regulator_disable_regmap,
+   .get_voltage_sel= regulator_get_voltage_sel_regmap,
+   .set_voltage_sel= regulator_set_voltage_sel_regmap,
+   .set_voltage_time_sel   = regulator_set_voltage_time_sel,
+};
+
+static struct regulator_ops s2mps11_buck_ops = {
+   .list_voltage   = regulator_list_voltage_linear,
+   .map_voltage= regulator_map_voltage_linear,
+   .is_enabled = regulator_is_enabled_regmap,
+   .enable = regulator_enable_regmap,
+   .disable= regulator_disable_regmap,
+   .get_voltage_sel= regulator_get_voltage_sel_regmap,
+   .set_voltage_sel= regulator_set_voltage_sel_regmap,
+   .set_voltage_time_sel   = regulator_set_voltage_time_sel,
+};
+
+#define regulator_desc_ldo1(num)   {   \
+   .name   = "LDO"#num,\
+   .id = S2MPS11_LDO##num, \
+   .ops= _ldo_ops, \
+   .type   = REGULATOR_VOLTAGE,\
+   .owner  = THIS_MODULE,  \
+   .min_uV = S2MPS11_LDO_MIN,  \
+   .uV_step= S2MPS11_LDO_STEP1,\
+   .n_voltages = S2MPS11_LDO_N_VOLTAGES,   \
+   .vsel_

[PATCH V3 4/7] mfd: s2mps11: Add samsung s2mps11 mfd support

2012-07-11 Thread Sangbeom Kim
This patch add Samsung S2MPS11 mfd driver.
The S2MPS11 can support regulators and RTC.

Signed-off-by: Sangbeom Kim 
---
 drivers/mfd/sec-core.c  |   10 ++
 include/linux/mfd/samsung/core.h|   10 ++
 include/linux/mfd/samsung/s2mps11.h |  196 +++
 3 files changed, 216 insertions(+), 0 deletions(-)
 create mode 100644 include/linux/mfd/samsung/s2mps11.h

diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 3a9a467..2988efd 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -54,6 +54,12 @@ static struct mfd_cell s5m8767_devs[] = {
},
 };
 
+static struct mfd_cell s2mps11_devs[] = {
+   {
+   .name = "s2mps11-pmic",
+   },
+};
+
 int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest)
 {
return regmap_read(sec_pmic->regmap, reg, dest);
@@ -145,6 +151,10 @@ static int sec_pmic_probe(struct i2c_client *i2c,
ret = mfd_add_devices(sec_pmic->dev, -1, s5m8767_devs,
ARRAY_SIZE(s5m8767_devs), NULL, 0);
break;
+   case S2MPS11X:
+   ret = mfd_add_devices(sec_pmic->dev, -1, s2mps11_devs,
+   ARRAY_SIZE(s2mps11_devs), NULL, 0);
+   break;
default:
/* If this happens the probe function is problem */
BUG();
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
index 97cf642..b0f6beb 100644
--- a/include/linux/mfd/samsung/core.h
+++ b/include/linux/mfd/samsung/core.h
@@ -20,6 +20,7 @@ enum sec_device_type {
S5M8751X,
S5M8763X,
S5M8767X,
+   S2MPS11X,
 };
 
 /**
@@ -98,9 +99,18 @@ struct sec_platform_data {
int buck4_default_idx;
 
int buck_ramp_delay;
+
+   int buck2_ramp_delay;
+   int buck34_ramp_delay;
+   int buck5_ramp_delay;
+   int buck16_ramp_delay;
+   int buck7810_ramp_delay;
+   int buck9_ramp_delay;
+
boolbuck2_ramp_enable;
boolbuck3_ramp_enable;
boolbuck4_ramp_enable;
+   boolbuck6_ramp_enable;
 
int buck2_init;
int buck3_init;
diff --git a/include/linux/mfd/samsung/s2mps11.h 
b/include/linux/mfd/samsung/s2mps11.h
new file mode 100644
index 000..b900a60
--- /dev/null
+++ b/include/linux/mfd/samsung/s2mps11.h
@@ -0,0 +1,196 @@
+/*
+ * s2mps11.h
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd
+ *  http://www.samsung.com
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ */
+
+#ifndef __LINUX_MFD_S2MPS11_H
+#define __LINUX_MFD_S2MPS11_H
+
+/* S2MPS11 registers */
+enum s2mps11_reg {
+   S2MPS11_REG_ID,
+   S2MPS11_REG_INT1,
+   S2MPS11_REG_INT2,
+   S2MPS11_REG_INT3,
+   S2MPS11_REG_INT1M,
+   S2MPS11_REG_INT2M,
+   S2MPS11_REG_INT3M,
+   S2MPS11_REG_ST1,
+   S2MPS11_REG_ST2,
+   S2MPS11_REG_OFFSRC,
+   S2MPS11_REG_PWRONSRC,
+   S2MPS11_REG_RTC_CTRL,
+   S2MPS11_REG_CTRL1,
+   S2MPS11_REG_ETC_TEST,
+   S2MPS11_REG_RSVD3,
+   S2MPS11_REG_BU_CHG,
+   S2MPS11_REG_RAMP,
+   S2MPS11_REG_RAMP_BUCK,
+   S2MPS11_REG_LDO1_8,
+   S2MPS11_REG_LDO9_16,
+   S2MPS11_REG_LDO17_24,
+   S2MPS11_REG_LDO25_32,
+   S2MPS11_REG_LDO33_38,
+   S2MPS11_REG_LDO1_8_1,
+   S2MPS11_REG_LDO9_16_1,
+   S2MPS11_REG_LDO17_24_1,
+   S2MPS11_REG_LDO25_32_1,
+   S2MPS11_REG_LDO33_38_1,
+   S2MPS11_REG_OTP_ADRL,
+   S2MPS11_REG_OTP_ADRH,
+   S2MPS11_REG_OTP_DATA,
+   S2MPS11_REG_MON1SEL,
+   S2MPS11_REG_MON2SEL,
+   S2MPS11_REG_LEE,
+   S2MPS11_REG_RSVD_NO,
+   S2MPS11_REG_UVLO,
+   S2MPS11_REG_LEE_NO,
+   S2MPS11_REG_B1CTRL1,
+   S2MPS11_REG_B1CTRL2,
+   S2MPS11_REG_B2CTRL1,
+   S2MPS11_REG_B2CTRL2,
+   S2MPS11_REG_B3CTRL1,
+   S2MPS11_REG_B3CTRL2,
+   S2MPS11_REG_B4CTRL1,
+   S2MPS11_REG_B4CTRL2,
+   S2MPS11_REG_B5CTRL1,
+   S2MPS11_REG_BUCK5_SW,
+   S2MPS11_REG_B5CTRL2,
+   S2MPS11_REG_B5CTRL3,
+   S2MPS11_REG_B5CTRL4,
+   S2MPS11_REG_B5CTRL5,
+   S2MPS11_REG_B6CTRL1,
+   S2MPS11_REG_B6CTRL2,
+   S2MPS11_REG_B7CTRL1,
+   S2MPS11_REG_B7CTRL2,
+   S2MPS11_REG_B8CTRL1,
+   S2MPS11_REG_B8CTRL2,
+   S2MPS11_REG_B9CTRL1,
+   

[PATCH V3 3/7] mfd: samsung: Modify samsung mfd header

2012-07-11 Thread Sangbeom Kim
As Prefix of Samsung pmic changed from s5m to s2m,
To make common mfd driver for s2m and s5m series,
This patch rename header of Samsung mfd and modify mfd driver.

Signed-off-by: Sangbeom Kim 
---
 drivers/mfd/sec-core.c   |6 +-
 drivers/mfd/sec-irq.c|5 +-
 drivers/regulator/s5m8767.c  |4 +-
 include/linux/mfd/samsung/core.h |  147 +
 include/linux/mfd/samsung/irq.h  |  110 ++
 include/linux/mfd/samsung/rtc.h  |   83 
 include/linux/mfd/samsung/s5m-core.h |  374 --
 include/linux/mfd/samsung/s5m-pmic.h |  129 
 include/linux/mfd/samsung/s5m-rtc.h  |   84 
 include/linux/mfd/samsung/s5m8763.h  |   96 +
 include/linux/mfd/samsung/s5m8767.h  |  188 +
 11 files changed, 633 insertions(+), 593 deletions(-)
 create mode 100644 include/linux/mfd/samsung/core.h
 create mode 100644 include/linux/mfd/samsung/irq.h
 create mode 100644 include/linux/mfd/samsung/rtc.h
 delete mode 100644 include/linux/mfd/samsung/s5m-core.h
 delete mode 100644 include/linux/mfd/samsung/s5m-pmic.h
 delete mode 100644 include/linux/mfd/samsung/s5m-rtc.h
 create mode 100644 include/linux/mfd/samsung/s5m8763.h
 create mode 100644 include/linux/mfd/samsung/s5m8767.h

diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 5dfe671..3a9a467 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -21,9 +21,9 @@
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
 #include 
 
 static struct mfd_cell s5m8751_devs[] = {
diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c
index d9c1137..da5ec5b 100644
--- a/drivers/mfd/sec-irq.c
+++ b/drivers/mfd/sec-irq.c
@@ -14,7 +14,10 @@
 #include 
 #include 
 #include 
-#include 
+#include 
+#include 
+#include 
+#include 
 
 struct sec_irq_data {
int reg;
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 0049e34..aeea91b 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -19,8 +19,8 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
+#include 
 
 struct s5m8767_info {
struct device *dev;
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
new file mode 100644
index 000..3f5bcb2
--- /dev/null
+++ b/include/linux/mfd/samsung/core.h
@@ -0,0 +1,147 @@
+/*
+ * core.h
+ *
+ * copyright (c) 2011 Samsung Electronics Co., Ltd
+ *  http://www.samsung.com
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ */
+
+#ifndef __LINUX_MFD_SEC_CORE_H
+#define __LINUX_MFD_SEC_CORE_H
+
+#define NUM_IRQ_REGS   4
+
+enum sec_device_type {
+   S5M8751X,
+   S5M8763X,
+   S5M8767X,
+};
+
+/**
+ * struct sec_pmic_dev - s5m87xx master device for sub-drivers
+ * @dev: master device of the chip (can be used to access platform data)
+ * @i2c: i2c client private data for regulator
+ * @rtc: i2c client private data for rtc
+ * @iolock: mutex for serializing io access
+ * @irqlock: mutex for buslock
+ * @irq_base: base IRQ number for sec-pmic, required for IRQs
+ * @irq: generic IRQ number for s5m87xx
+ * @ono: power onoff IRQ number for s5m87xx
+ * @irq_masks_cur: currently active value
+ * @irq_masks_cache: cached hardware value
+ * @type: indicate which s5m87xx "variant" is used
+ */
+struct sec_pmic_dev {
+   struct device *dev;
+   struct regmap *regmap;
+   struct i2c_client *i2c;
+   struct i2c_client *rtc;
+   struct mutex iolock;
+   struct mutex irqlock;
+
+   int device_type;
+   int irq_base;
+   int irq;
+   int ono;
+   u8 irq_masks_cur[NUM_IRQ_REGS];
+   u8 irq_masks_cache[NUM_IRQ_REGS];
+   int type;
+   bool wakeup;
+};
+
+int sec_irq_init(struct sec_pmic_dev *sec_pmic);
+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_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);
+
+struct sec_platform_data {
+   struct sec_regulator_data   *regulators;
+   struct sec_opmode_data  *opmode;
+   int device_type;
+   int num_regulators;
+
+   int irq_base;
+   int (*cfg_pmic_irq)(void);
+
+

[PATCH V3 2/7] mfd: samsung: Modify samsung mfd driver for common api

2012-07-11 Thread Sangbeom Kim
Previous naming rule of samsung pmic start with s5m prefix.
But It is changed by s2m.
To cover various samsung s2m and s5m series,
This patch modify function and variable name for common usage.

Signed-off-by: Sangbeom Kim 
---
 drivers/mfd/sec-core.c   |  130 +++---
 drivers/mfd/sec-irq.c|  204 +-
 drivers/regulator/s5m8767.c  |   78 +++---
 include/linux/mfd/samsung/s5m-core.h |   30 +++---
 include/linux/mfd/samsung/s5m-pmic.h |   24 ++--
 5 files changed, 233 insertions(+), 233 deletions(-)

diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index b090360..5dfe671 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -1,7 +1,7 @@
 /*
- * s5m87xx.c
+ * sec-core.c
  *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd
  *  http://www.samsung.com
  *
  *  This program is free software; you can redistribute  it and/or modify it
@@ -54,95 +54,95 @@ static struct mfd_cell s5m8767_devs[] = {
},
 };
 
-int s5m_reg_read(struct s5m87xx_dev *s5m87xx, u8 reg, void *dest)
+int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest)
 {
-   return regmap_read(s5m87xx->regmap, reg, dest);
+   return regmap_read(sec_pmic->regmap, reg, dest);
 }
-EXPORT_SYMBOL_GPL(s5m_reg_read);
+EXPORT_SYMBOL_GPL(sec_reg_read);
 
-int s5m_bulk_read(struct s5m87xx_dev *s5m87xx, u8 reg, int count, u8 *buf)
+int sec_bulk_read(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf)
 {
-   return regmap_bulk_read(s5m87xx->regmap, reg, buf, count);
+   return regmap_bulk_read(sec_pmic->regmap, reg, buf, count);
 }
-EXPORT_SYMBOL_GPL(s5m_bulk_read);
+EXPORT_SYMBOL_GPL(sec_bulk_read);
 
-int s5m_reg_write(struct s5m87xx_dev *s5m87xx, u8 reg, u8 value)
+int sec_reg_write(struct sec_pmic_dev *sec_pmic, u8 reg, u8 value)
 {
-   return regmap_write(s5m87xx->regmap, reg, value);
+   return regmap_write(sec_pmic->regmap, reg, value);
 }
-EXPORT_SYMBOL_GPL(s5m_reg_write);
+EXPORT_SYMBOL_GPL(sec_reg_write);
 
-int s5m_bulk_write(struct s5m87xx_dev *s5m87xx, u8 reg, int count, u8 *buf)
+int sec_bulk_write(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf)
 {
-   return regmap_raw_write(s5m87xx->regmap, reg, buf, count);
+   return regmap_raw_write(sec_pmic->regmap, reg, buf, count);
 }
-EXPORT_SYMBOL_GPL(s5m_bulk_write);
+EXPORT_SYMBOL_GPL(sec_bulk_write);
 
-int s5m_reg_update(struct s5m87xx_dev *s5m87xx, u8 reg, u8 val, u8 mask)
+int sec_reg_update(struct sec_pmic_dev *sec_pmic, u8 reg, u8 val, u8 mask)
 {
-   return regmap_update_bits(s5m87xx->regmap, reg, mask, val);
+   return regmap_update_bits(sec_pmic->regmap, reg, mask, val);
 }
-EXPORT_SYMBOL_GPL(s5m_reg_update);
+EXPORT_SYMBOL_GPL(sec_reg_update);
 
-static struct regmap_config s5m_regmap_config = {
+static struct regmap_config sec_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
 };
 
-static int s5m87xx_i2c_probe(struct i2c_client *i2c,
+static int sec_pmic_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
 {
-   struct s5m_platform_data *pdata = i2c->dev.platform_data;
-   struct s5m87xx_dev *s5m87xx;
+   struct sec_platform_data *pdata = i2c->dev.platform_data;
+   struct sec_pmic_dev *sec_pmic;
int ret;
 
-   s5m87xx = devm_kzalloc(>dev, sizeof(struct s5m87xx_dev),
+   sec_pmic = devm_kzalloc(>dev, sizeof(struct sec_pmic_dev),
GFP_KERNEL);
-   if (s5m87xx == NULL)
+   if (sec_pmic == NULL)
return -ENOMEM;
 
-   i2c_set_clientdata(i2c, s5m87xx);
-   s5m87xx->dev = >dev;
-   s5m87xx->i2c = i2c;
-   s5m87xx->irq = i2c->irq;
-   s5m87xx->type = id->driver_data;
+   i2c_set_clientdata(i2c, sec_pmic);
+   sec_pmic->dev = >dev;
+   sec_pmic->i2c = i2c;
+   sec_pmic->irq = i2c->irq;
+   sec_pmic->type = id->driver_data;
 
if (pdata) {
-   s5m87xx->device_type = pdata->device_type;
-   s5m87xx->ono = pdata->ono;
-   s5m87xx->irq_base = pdata->irq_base;
-   s5m87xx->wakeup = pdata->wakeup;
+   sec_pmic->device_type = pdata->device_type;
+   sec_pmic->ono = pdata->ono;
+   sec_pmic->irq_base = pdata->irq_base;
+   sec_pmic->wakeup = pdata->wakeup;
}
 
-   s5m87xx->regmap = devm_regmap_init_i2c(i2c, _regmap_config);
-   if (IS_ERR(s5m87xx->regmap)) {
-   ret = PTR_ERR(s5m87xx->regmap);
+   sec_pmic->regmap = devm_regmap_init_i2c(i2c, _regmap_config);
+   if (IS_ERR(sec_pmic->regmap)) {
+   ret = PTR_ERR(sec_pmic->regmap);
dev_err(>dev, "Failed to alloc

[PATCH V3 0/7] Initial release of Samsung S2MPS11 pmic driver

2012-07-11 Thread Sangbeom Kim
The S2MPS11 is comprised of high efficient Buck converters,
various LDOs, and an RTC and tightly coupled with Multi Core Samsung 
Application Processors, which is used in a wide variety of mobile applications
such as smart phones and tablet PCs.
S2MPS11 provide 10 high efficiency buck converters and 38 LDO regulators.
Especially, Buck2 can support 7.0A current capacity for high performance
samsung application processor.
Most of S2MPS11 feature are similar to S5M series.
and Instead of using s5m prefix, Samsung decide to use s2m prefix.
So, I try to make common mfd driver for S2M and S5M series.
Most of s5m prefix is changed into sec prefix.

This patch is based on the samuel's mfd/for-next branch.

Changed since V2:
1. Apply regmap standard api in s2mps11 regulator driver
2. To avoid build breakage, squash some patches

Changes since V1:
1. Replace list_voltage with standard framework
2. Apply regmap_irq
3. Minor changes.

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V3 0/7] Initial release of Samsung S2MPS11 pmic driver

2012-07-11 Thread Sangbeom Kim
The S2MPS11 is comprised of high efficient Buck converters,
various LDOs, and an RTC and tightly coupled with Multi Core Samsung 
Application Processors, which is used in a wide variety of mobile applications
such as smart phones and tablet PCs.
S2MPS11 provide 10 high efficiency buck converters and 38 LDO regulators.
Especially, Buck2 can support 7.0A current capacity for high performance
samsung application processor.
Most of S2MPS11 feature are similar to S5M series.
and Instead of using s5m prefix, Samsung decide to use s2m prefix.
So, I try to make common mfd driver for S2M and S5M series.
Most of s5m prefix is changed into sec prefix.

This patch is based on the samuel's mfd/for-next branch.

Changed since V2:
1. Apply regmap standard api in s2mps11 regulator driver
2. To avoid build breakage, squash some patches

Changes since V1:
1. Replace list_voltage with standard framework
2. Apply regmap_irq
3. Minor changes.

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V3 2/7] mfd: samsung: Modify samsung mfd driver for common api

2012-07-11 Thread Sangbeom Kim
Previous naming rule of samsung pmic start with s5m prefix.
But It is changed by s2m.
To cover various samsung s2m and s5m series,
This patch modify function and variable name for common usage.

Signed-off-by: Sangbeom Kim sbki...@samsung.com
---
 drivers/mfd/sec-core.c   |  130 +++---
 drivers/mfd/sec-irq.c|  204 +-
 drivers/regulator/s5m8767.c  |   78 +++---
 include/linux/mfd/samsung/s5m-core.h |   30 +++---
 include/linux/mfd/samsung/s5m-pmic.h |   24 ++--
 5 files changed, 233 insertions(+), 233 deletions(-)

diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index b090360..5dfe671 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -1,7 +1,7 @@
 /*
- * s5m87xx.c
+ * sec-core.c
  *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd
  *  http://www.samsung.com
  *
  *  This program is free software; you can redistribute  it and/or modify it
@@ -54,95 +54,95 @@ static struct mfd_cell s5m8767_devs[] = {
},
 };
 
-int s5m_reg_read(struct s5m87xx_dev *s5m87xx, u8 reg, void *dest)
+int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest)
 {
-   return regmap_read(s5m87xx-regmap, reg, dest);
+   return regmap_read(sec_pmic-regmap, reg, dest);
 }
-EXPORT_SYMBOL_GPL(s5m_reg_read);
+EXPORT_SYMBOL_GPL(sec_reg_read);
 
-int s5m_bulk_read(struct s5m87xx_dev *s5m87xx, u8 reg, int count, u8 *buf)
+int sec_bulk_read(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf)
 {
-   return regmap_bulk_read(s5m87xx-regmap, reg, buf, count);
+   return regmap_bulk_read(sec_pmic-regmap, reg, buf, count);
 }
-EXPORT_SYMBOL_GPL(s5m_bulk_read);
+EXPORT_SYMBOL_GPL(sec_bulk_read);
 
-int s5m_reg_write(struct s5m87xx_dev *s5m87xx, u8 reg, u8 value)
+int sec_reg_write(struct sec_pmic_dev *sec_pmic, u8 reg, u8 value)
 {
-   return regmap_write(s5m87xx-regmap, reg, value);
+   return regmap_write(sec_pmic-regmap, reg, value);
 }
-EXPORT_SYMBOL_GPL(s5m_reg_write);
+EXPORT_SYMBOL_GPL(sec_reg_write);
 
-int s5m_bulk_write(struct s5m87xx_dev *s5m87xx, u8 reg, int count, u8 *buf)
+int sec_bulk_write(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf)
 {
-   return regmap_raw_write(s5m87xx-regmap, reg, buf, count);
+   return regmap_raw_write(sec_pmic-regmap, reg, buf, count);
 }
-EXPORT_SYMBOL_GPL(s5m_bulk_write);
+EXPORT_SYMBOL_GPL(sec_bulk_write);
 
-int s5m_reg_update(struct s5m87xx_dev *s5m87xx, u8 reg, u8 val, u8 mask)
+int sec_reg_update(struct sec_pmic_dev *sec_pmic, u8 reg, u8 val, u8 mask)
 {
-   return regmap_update_bits(s5m87xx-regmap, reg, mask, val);
+   return regmap_update_bits(sec_pmic-regmap, reg, mask, val);
 }
-EXPORT_SYMBOL_GPL(s5m_reg_update);
+EXPORT_SYMBOL_GPL(sec_reg_update);
 
-static struct regmap_config s5m_regmap_config = {
+static struct regmap_config sec_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
 };
 
-static int s5m87xx_i2c_probe(struct i2c_client *i2c,
+static int sec_pmic_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
 {
-   struct s5m_platform_data *pdata = i2c-dev.platform_data;
-   struct s5m87xx_dev *s5m87xx;
+   struct sec_platform_data *pdata = i2c-dev.platform_data;
+   struct sec_pmic_dev *sec_pmic;
int ret;
 
-   s5m87xx = devm_kzalloc(i2c-dev, sizeof(struct s5m87xx_dev),
+   sec_pmic = devm_kzalloc(i2c-dev, sizeof(struct sec_pmic_dev),
GFP_KERNEL);
-   if (s5m87xx == NULL)
+   if (sec_pmic == NULL)
return -ENOMEM;
 
-   i2c_set_clientdata(i2c, s5m87xx);
-   s5m87xx-dev = i2c-dev;
-   s5m87xx-i2c = i2c;
-   s5m87xx-irq = i2c-irq;
-   s5m87xx-type = id-driver_data;
+   i2c_set_clientdata(i2c, sec_pmic);
+   sec_pmic-dev = i2c-dev;
+   sec_pmic-i2c = i2c;
+   sec_pmic-irq = i2c-irq;
+   sec_pmic-type = id-driver_data;
 
if (pdata) {
-   s5m87xx-device_type = pdata-device_type;
-   s5m87xx-ono = pdata-ono;
-   s5m87xx-irq_base = pdata-irq_base;
-   s5m87xx-wakeup = pdata-wakeup;
+   sec_pmic-device_type = pdata-device_type;
+   sec_pmic-ono = pdata-ono;
+   sec_pmic-irq_base = pdata-irq_base;
+   sec_pmic-wakeup = pdata-wakeup;
}
 
-   s5m87xx-regmap = devm_regmap_init_i2c(i2c, s5m_regmap_config);
-   if (IS_ERR(s5m87xx-regmap)) {
-   ret = PTR_ERR(s5m87xx-regmap);
+   sec_pmic-regmap = devm_regmap_init_i2c(i2c, sec_regmap_config);
+   if (IS_ERR(sec_pmic-regmap)) {
+   ret = PTR_ERR(sec_pmic-regmap);
dev_err(i2c-dev, Failed to allocate register map: %d\n,
ret);
return ret;
}
 
-   s5m87xx-rtc = i2c_new_dummy(i2c-adapter, RTC_I2C_ADDR

[PATCH V3 3/7] mfd: samsung: Modify samsung mfd header

2012-07-11 Thread Sangbeom Kim
As Prefix of Samsung pmic changed from s5m to s2m,
To make common mfd driver for s2m and s5m series,
This patch rename header of Samsung mfd and modify mfd driver.

Signed-off-by: Sangbeom Kim sbki...@samsung.com
---
 drivers/mfd/sec-core.c   |6 +-
 drivers/mfd/sec-irq.c|5 +-
 drivers/regulator/s5m8767.c  |4 +-
 include/linux/mfd/samsung/core.h |  147 +
 include/linux/mfd/samsung/irq.h  |  110 ++
 include/linux/mfd/samsung/rtc.h  |   83 
 include/linux/mfd/samsung/s5m-core.h |  374 --
 include/linux/mfd/samsung/s5m-pmic.h |  129 
 include/linux/mfd/samsung/s5m-rtc.h  |   84 
 include/linux/mfd/samsung/s5m8763.h  |   96 +
 include/linux/mfd/samsung/s5m8767.h  |  188 +
 11 files changed, 633 insertions(+), 593 deletions(-)
 create mode 100644 include/linux/mfd/samsung/core.h
 create mode 100644 include/linux/mfd/samsung/irq.h
 create mode 100644 include/linux/mfd/samsung/rtc.h
 delete mode 100644 include/linux/mfd/samsung/s5m-core.h
 delete mode 100644 include/linux/mfd/samsung/s5m-pmic.h
 delete mode 100644 include/linux/mfd/samsung/s5m-rtc.h
 create mode 100644 include/linux/mfd/samsung/s5m8763.h
 create mode 100644 include/linux/mfd/samsung/s5m8767.h

diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 5dfe671..3a9a467 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -21,9 +21,9 @@
 #include linux/pm_runtime.h
 #include linux/mutex.h
 #include linux/mfd/core.h
-#include linux/mfd/samsung/s5m-core.h
-#include linux/mfd/samsung/s5m-pmic.h
-#include linux/mfd/samsung/s5m-rtc.h
+#include linux/mfd/samsung/core.h
+#include linux/mfd/samsung/irq.h
+#include linux/mfd/samsung/rtc.h
 #include linux/regmap.h
 
 static struct mfd_cell s5m8751_devs[] = {
diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c
index d9c1137..da5ec5b 100644
--- a/drivers/mfd/sec-irq.c
+++ b/drivers/mfd/sec-irq.c
@@ -14,7 +14,10 @@
 #include linux/device.h
 #include linux/interrupt.h
 #include linux/irq.h
-#include linux/mfd/samsung/s5m-core.h
+#include linux/mfd/samsung/core.h
+#include linux/mfd/samsung/irq.h
+#include linux/mfd/samsung/s5m8763.h
+#include linux/mfd/samsung/s5m8767.h
 
 struct sec_irq_data {
int reg;
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 0049e34..aeea91b 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -19,8 +19,8 @@
 #include linux/platform_device.h
 #include linux/regulator/driver.h
 #include linux/regulator/machine.h
-#include linux/mfd/samsung/s5m-core.h
-#include linux/mfd/samsung/s5m-pmic.h
+#include linux/mfd/samsung/core.h
+#include linux/mfd/samsung/s5m8767.h
 
 struct s5m8767_info {
struct device *dev;
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
new file mode 100644
index 000..3f5bcb2
--- /dev/null
+++ b/include/linux/mfd/samsung/core.h
@@ -0,0 +1,147 @@
+/*
+ * core.h
+ *
+ * copyright (c) 2011 Samsung Electronics Co., Ltd
+ *  http://www.samsung.com
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ */
+
+#ifndef __LINUX_MFD_SEC_CORE_H
+#define __LINUX_MFD_SEC_CORE_H
+
+#define NUM_IRQ_REGS   4
+
+enum sec_device_type {
+   S5M8751X,
+   S5M8763X,
+   S5M8767X,
+};
+
+/**
+ * struct sec_pmic_dev - s5m87xx master device for sub-drivers
+ * @dev: master device of the chip (can be used to access platform data)
+ * @i2c: i2c client private data for regulator
+ * @rtc: i2c client private data for rtc
+ * @iolock: mutex for serializing io access
+ * @irqlock: mutex for buslock
+ * @irq_base: base IRQ number for sec-pmic, required for IRQs
+ * @irq: generic IRQ number for s5m87xx
+ * @ono: power onoff IRQ number for s5m87xx
+ * @irq_masks_cur: currently active value
+ * @irq_masks_cache: cached hardware value
+ * @type: indicate which s5m87xx variant is used
+ */
+struct sec_pmic_dev {
+   struct device *dev;
+   struct regmap *regmap;
+   struct i2c_client *i2c;
+   struct i2c_client *rtc;
+   struct mutex iolock;
+   struct mutex irqlock;
+
+   int device_type;
+   int irq_base;
+   int irq;
+   int ono;
+   u8 irq_masks_cur[NUM_IRQ_REGS];
+   u8 irq_masks_cache[NUM_IRQ_REGS];
+   int type;
+   bool wakeup;
+};
+
+int sec_irq_init(struct sec_pmic_dev *sec_pmic);
+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_reg_write(struct sec_pmic_dev *sec_pmic, u8 reg

[PATCH V3 4/7] mfd: s2mps11: Add samsung s2mps11 mfd support

2012-07-11 Thread Sangbeom Kim
This patch add Samsung S2MPS11 mfd driver.
The S2MPS11 can support regulators and RTC.

Signed-off-by: Sangbeom Kim sbki...@samsung.com
---
 drivers/mfd/sec-core.c  |   10 ++
 include/linux/mfd/samsung/core.h|   10 ++
 include/linux/mfd/samsung/s2mps11.h |  196 +++
 3 files changed, 216 insertions(+), 0 deletions(-)
 create mode 100644 include/linux/mfd/samsung/s2mps11.h

diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 3a9a467..2988efd 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -54,6 +54,12 @@ static struct mfd_cell s5m8767_devs[] = {
},
 };
 
+static struct mfd_cell s2mps11_devs[] = {
+   {
+   .name = s2mps11-pmic,
+   },
+};
+
 int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest)
 {
return regmap_read(sec_pmic-regmap, reg, dest);
@@ -145,6 +151,10 @@ static int sec_pmic_probe(struct i2c_client *i2c,
ret = mfd_add_devices(sec_pmic-dev, -1, s5m8767_devs,
ARRAY_SIZE(s5m8767_devs), NULL, 0);
break;
+   case S2MPS11X:
+   ret = mfd_add_devices(sec_pmic-dev, -1, s2mps11_devs,
+   ARRAY_SIZE(s2mps11_devs), NULL, 0);
+   break;
default:
/* If this happens the probe function is problem */
BUG();
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
index 97cf642..b0f6beb 100644
--- a/include/linux/mfd/samsung/core.h
+++ b/include/linux/mfd/samsung/core.h
@@ -20,6 +20,7 @@ enum sec_device_type {
S5M8751X,
S5M8763X,
S5M8767X,
+   S2MPS11X,
 };
 
 /**
@@ -98,9 +99,18 @@ struct sec_platform_data {
int buck4_default_idx;
 
int buck_ramp_delay;
+
+   int buck2_ramp_delay;
+   int buck34_ramp_delay;
+   int buck5_ramp_delay;
+   int buck16_ramp_delay;
+   int buck7810_ramp_delay;
+   int buck9_ramp_delay;
+
boolbuck2_ramp_enable;
boolbuck3_ramp_enable;
boolbuck4_ramp_enable;
+   boolbuck6_ramp_enable;
 
int buck2_init;
int buck3_init;
diff --git a/include/linux/mfd/samsung/s2mps11.h 
b/include/linux/mfd/samsung/s2mps11.h
new file mode 100644
index 000..b900a60
--- /dev/null
+++ b/include/linux/mfd/samsung/s2mps11.h
@@ -0,0 +1,196 @@
+/*
+ * s2mps11.h
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd
+ *  http://www.samsung.com
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ */
+
+#ifndef __LINUX_MFD_S2MPS11_H
+#define __LINUX_MFD_S2MPS11_H
+
+/* S2MPS11 registers */
+enum s2mps11_reg {
+   S2MPS11_REG_ID,
+   S2MPS11_REG_INT1,
+   S2MPS11_REG_INT2,
+   S2MPS11_REG_INT3,
+   S2MPS11_REG_INT1M,
+   S2MPS11_REG_INT2M,
+   S2MPS11_REG_INT3M,
+   S2MPS11_REG_ST1,
+   S2MPS11_REG_ST2,
+   S2MPS11_REG_OFFSRC,
+   S2MPS11_REG_PWRONSRC,
+   S2MPS11_REG_RTC_CTRL,
+   S2MPS11_REG_CTRL1,
+   S2MPS11_REG_ETC_TEST,
+   S2MPS11_REG_RSVD3,
+   S2MPS11_REG_BU_CHG,
+   S2MPS11_REG_RAMP,
+   S2MPS11_REG_RAMP_BUCK,
+   S2MPS11_REG_LDO1_8,
+   S2MPS11_REG_LDO9_16,
+   S2MPS11_REG_LDO17_24,
+   S2MPS11_REG_LDO25_32,
+   S2MPS11_REG_LDO33_38,
+   S2MPS11_REG_LDO1_8_1,
+   S2MPS11_REG_LDO9_16_1,
+   S2MPS11_REG_LDO17_24_1,
+   S2MPS11_REG_LDO25_32_1,
+   S2MPS11_REG_LDO33_38_1,
+   S2MPS11_REG_OTP_ADRL,
+   S2MPS11_REG_OTP_ADRH,
+   S2MPS11_REG_OTP_DATA,
+   S2MPS11_REG_MON1SEL,
+   S2MPS11_REG_MON2SEL,
+   S2MPS11_REG_LEE,
+   S2MPS11_REG_RSVD_NO,
+   S2MPS11_REG_UVLO,
+   S2MPS11_REG_LEE_NO,
+   S2MPS11_REG_B1CTRL1,
+   S2MPS11_REG_B1CTRL2,
+   S2MPS11_REG_B2CTRL1,
+   S2MPS11_REG_B2CTRL2,
+   S2MPS11_REG_B3CTRL1,
+   S2MPS11_REG_B3CTRL2,
+   S2MPS11_REG_B4CTRL1,
+   S2MPS11_REG_B4CTRL2,
+   S2MPS11_REG_B5CTRL1,
+   S2MPS11_REG_BUCK5_SW,
+   S2MPS11_REG_B5CTRL2,
+   S2MPS11_REG_B5CTRL3,
+   S2MPS11_REG_B5CTRL4,
+   S2MPS11_REG_B5CTRL5,
+   S2MPS11_REG_B6CTRL1,
+   S2MPS11_REG_B6CTRL2,
+   S2MPS11_REG_B7CTRL1,
+   S2MPS11_REG_B7CTRL2,
+   S2MPS11_REG_B8CTRL1,
+   S2MPS11_REG_B8CTRL2,
+   S2MPS11_REG_B9CTRL1

[PATCH V3 6/7] regualtor: s2mps11: Add samsung s2mps11 regulator driver

2012-07-11 Thread Sangbeom Kim
This patch add Samsung S2MPS11 regulator driver.
The S2MPS11 can support 10 Bucks and 38 LDOs and RTC.
Especially, S2MPS11 is designed for high performance
Samsung application processor.

Signed-off-by: Sangbeom Kim sbki...@samsung.com
---
 drivers/regulator/Kconfig   |8 +
 drivers/regulator/Makefile  |1 +
 drivers/regulator/s2mps11.c |  368 +++
 3 files changed, 377 insertions(+), 0 deletions(-)
 create mode 100644 drivers/regulator/s2mps11.c

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 12c0c0e..c6c02fb 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -233,6 +233,14 @@ config REGULATOR_RC5T583
  through regulator interface. The device supports multiple DCDC/LDO
  outputs which can be controlled by i2c communication.
 
+config REGULATOR_S2MPS11
+   tristate Samsung S2MPS11 voltage regulator
+   depends on MFD_SEC_CORE
+   help
+This driver supports a Samsung S2MPS11 voltage output regulator
+via I2C bus. S2MPS11 is comprised of high efficient Buck converters
+including Dual-Phase Buck converter, Buck-Boost converter, various 
LDOs.
+
 config REGULATOR_S5M8767
tristate Samsung S5M8767A voltage regulator
depends on MFD_SEC_CORE
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 977fd46..1e31396 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -37,6 +37,7 @@ obj-$(CONFIG_REGULATOR_PALMAS) += palmas-regulator.o
 obj-$(CONFIG_REGULATOR_PCAP) += pcap-regulator.o
 obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o
 obj-$(CONFIG_REGULATOR_RC5T583)  += rc5t583-regulator.o
+obj-$(CONFIG_REGULATOR_S2MPS11) += s2mps11.o
 obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o
 obj-$(CONFIG_REGULATOR_TPS6105X) += tps6105x-regulator.o
 obj-$(CONFIG_REGULATOR_TPS62360) += tps62360-regulator.o
diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
new file mode 100644
index 000..fc9b79d
--- /dev/null
+++ b/drivers/regulator/s2mps11.c
@@ -0,0 +1,368 @@
+/*
+ * s2mps11.c
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd
+ *  http://www.samsung.com
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ */
+
+#include linux/bug.h
+#include linux/delay.h
+#include linux/err.h
+#include linux/gpio.h
+#include linux/slab.h
+#include linux/module.h
+#include linux/platform_device.h
+#include linux/regulator/driver.h
+#include linux/regulator/machine.h
+#include linux/mfd/samsung/core.h
+#include linux/mfd/samsung/s2mps11.h
+
+struct s2mps11_info {
+   struct device *dev;
+   struct sec_pmic_dev *iodev;
+   struct regulator_dev **rdev;
+
+   int ramp_delay2;
+   int ramp_delay34;
+   int ramp_delay5;
+   int ramp_delay16;
+   int ramp_delay7810;
+   int ramp_delay9;
+
+   bool buck6_ramp;
+   bool buck2_ramp;
+   bool buck3_ramp;
+   bool buck4_ramp;
+};
+
+static int get_ramp_delay(int ramp_delay)
+{
+   unsigned char cnt = 0;
+
+   ramp_delay /= 6;
+
+   while (true) {
+   ramp_delay = ramp_delay  1;
+   if (ramp_delay == 0)
+   break;
+   cnt++;
+   }
+   return cnt;
+}
+
+static struct regulator_ops s2mps11_ldo_ops = {
+   .list_voltage   = regulator_list_voltage_linear,
+   .map_voltage= regulator_map_voltage_linear,
+   .is_enabled = regulator_is_enabled_regmap,
+   .enable = regulator_enable_regmap,
+   .disable= regulator_disable_regmap,
+   .get_voltage_sel= regulator_get_voltage_sel_regmap,
+   .set_voltage_sel= regulator_set_voltage_sel_regmap,
+   .set_voltage_time_sel   = regulator_set_voltage_time_sel,
+};
+
+static struct regulator_ops s2mps11_buck_ops = {
+   .list_voltage   = regulator_list_voltage_linear,
+   .map_voltage= regulator_map_voltage_linear,
+   .is_enabled = regulator_is_enabled_regmap,
+   .enable = regulator_enable_regmap,
+   .disable= regulator_disable_regmap,
+   .get_voltage_sel= regulator_get_voltage_sel_regmap,
+   .set_voltage_sel= regulator_set_voltage_sel_regmap,
+   .set_voltage_time_sel   = regulator_set_voltage_time_sel,
+};
+
+#define regulator_desc_ldo1(num)   {   \
+   .name   = LDO#num,\
+   .id = S2MPS11_LDO##num, \
+   .ops= s2mps11_ldo_ops, \
+   .type   = REGULATOR_VOLTAGE,\
+   .owner  = THIS_MODULE

[PATCH V3 7/7] MAINTAINRES: Add maintainer for samsung mfd driver

2012-07-11 Thread Sangbeom Kim
There are many samsung multifunction devices which are
s2mps11, s5m8767, s5m8763 etc.
This devices can support regulator, rtc, charger.
I will be supporting the Samsung mfd drivers, that are currently
in development and will be upstreamed shortly.

Signed-off-by: Sangbeom Kim sbki...@samsung.com
---
 MAINTAINERS |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 03df1d1..bfdfc21 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5866,6 +5866,16 @@ L:   linux-fb...@vger.kernel.org
 S: Maintained
 F: drivers/video/s3c-fb.c
 
+SAMSUNG MULTIFUNCTION DEVICE DRIVERS
+M: Sangbeom Kim sbki...@samsung.com
+L: linux-kernel@vger.kernel.org
+S: Supported
+F: drivers/mfd/sec*.c
+F: drivers/regulator/s2m*.c
+F: drivers/regulator/s5m*.c
+F: drivers/rtc/rtc-sec.c
+F: include/linux/mfd/samsung/
+
 SERIAL DRIVERS
 M: Alan Cox a...@linux.intel.com
 L: linux-ser...@vger.kernel.org
-- 
1.7.1


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V3 5/7] mfd: samsung: Add s2mps11 irq driver

2012-07-11 Thread Sangbeom Kim
This patch support irq handling driver for s2mps11.
As this patch use regmap_irq, s5m8767 and s5m8763 are modified with
regmap_irq.

Signed-off-by: Sangbeom Kim sbki...@samsung.com
---
 drivers/mfd/Kconfig  |1 +
 drivers/mfd/sec-irq.c|  477 --
 include/linux/mfd/samsung/core.h |2 +
 include/linux/mfd/samsung/irq.h  |   42 
 4 files changed, 193 insertions(+), 329 deletions(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index bad68f8..3c263a5 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -513,6 +513,7 @@ config MFD_SEC_CORE
depends on I2C=y  GENERIC_HARDIRQS
select MFD_CORE
select REGMAP_I2C
+   select REGMAP_IRQ
help
 Support for the Samsung Electronics MFD series.
 This driver provides common support for accessing the device,
diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c
index da5ec5b..c901fa5 100644
--- a/drivers/mfd/sec-irq.c
+++ b/drivers/mfd/sec-irq.c
@@ -14,351 +14,260 @@
 #include linux/device.h
 #include linux/interrupt.h
 #include linux/irq.h
+#include linux/regmap.h
+
 #include linux/mfd/samsung/core.h
 #include linux/mfd/samsung/irq.h
+#include linux/mfd/samsung/s2mps11.h
 #include linux/mfd/samsung/s5m8763.h
 #include linux/mfd/samsung/s5m8767.h
 
-struct sec_irq_data {
-   int reg;
-   int mask;
+static struct regmap_irq s2mps11_irqs[] = {
+   [S2MPS11_IRQ_PWRONF] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_PWRONF_MASK,
+   },
+   [S2MPS11_IRQ_PWRONR] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_PWRONR_MASK,
+   },
+   [S2MPS11_IRQ_JIGONBF] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_JIGONBF_MASK,
+   },
+   [S2MPS11_IRQ_JIGONBR] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_JIGONBR_MASK,
+   },
+   [S2MPS11_IRQ_ACOKBF] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_ACOKBF_MASK,
+   },
+   [S2MPS11_IRQ_ACOKBR] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_ACOKBR_MASK,
+   },
+   [S2MPS11_IRQ_PWRON1S] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_PWRON1S_MASK,
+   },
+   [S2MPS11_IRQ_MRB] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_MRB_MASK,
+   },
+   [S2MPS11_IRQ_RTC60S] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_RTC60S_MASK,
+   },
+   [S2MPS11_IRQ_RTCA1] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_RTCA1_MASK,
+   },
+   [S2MPS11_IRQ_RTCA2] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_RTCA2_MASK,
+   },
+   [S2MPS11_IRQ_SMPL] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_SMPL_MASK,
+   },
+   [S2MPS11_IRQ_RTC1S] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_RTC1S_MASK,
+   },
+   [S2MPS11_IRQ_WTSR] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_WTSR_MASK,
+   },
+   [S2MPS11_IRQ_INT120C] = {
+   .reg_offset = 3,
+   .mask = S2MPS11_IRQ_INT120C_MASK,
+   },
+   [S2MPS11_IRQ_INT140C] = {
+   .reg_offset = 3,
+   .mask = S2MPS11_IRQ_INT140C_MASK,
+   },
 };
 
-static struct sec_irq_data s5m8767_irqs[] = {
+
+static struct regmap_irq s5m8767_irqs[] = {
[S5M8767_IRQ_PWRR] = {
-   .reg = 1,
+   .reg_offset = 1,
.mask = S5M8767_IRQ_PWRR_MASK,
},
[S5M8767_IRQ_PWRF] = {
-   .reg = 1,
+   .reg_offset = 1,
.mask = S5M8767_IRQ_PWRF_MASK,
},
[S5M8767_IRQ_PWR1S] = {
-   .reg = 1,
+   .reg_offset = 1,
.mask = S5M8767_IRQ_PWR1S_MASK,
},
[S5M8767_IRQ_JIGR] = {
-   .reg = 1,
+   .reg_offset = 1,
.mask = S5M8767_IRQ_JIGR_MASK,
},
[S5M8767_IRQ_JIGF] = {
-   .reg = 1,
+   .reg_offset = 1,
.mask = S5M8767_IRQ_JIGF_MASK,
},
[S5M8767_IRQ_LOWBAT2] = {
-   .reg = 1,
+   .reg_offset = 1,
.mask = S5M8767_IRQ_LOWBAT2_MASK,
},
[S5M8767_IRQ_LOWBAT1] = {
-   .reg = 1,
+   .reg_offset = 1,
.mask = S5M8767_IRQ_LOWBAT1_MASK,
},
[S5M8767_IRQ_MRB] = {
-   .reg = 2,
+   .reg_offset = 2,
.mask = S5M8767_IRQ_MRB_MASK,
},
[S5M8767_IRQ_DVSOK2] = {
-   .reg = 2,
+   .reg_offset = 2,
.mask = S5M8767_IRQ_DVSOK2_MASK,
},
[S5M8767_IRQ_DVSOK3] = {
-   .reg = 2,
+   .reg_offset = 2

RE: [PATCH 1/3] regulator: s2mps11: Fixup missing commas

2012-07-11 Thread Sangbeom Kim
Hi!
On Thursday, July 12, 2012 10:36 AM +0900, Axel Lin wrote:

 Signed-off-by: Axel Lin axel@gmail.com

S2mps11 regulator patch is based on mfd/for-next branch.
On mfd/for-next branch, Some regulator features didn't apply 
like a set_voltage_time_sel.
So, I didn't add some feature like a set_voltage_time_sel, vsel_mask.
Before send patch, I just added that. 
Anyway, It's my mistake.

Acked-by: Sangbeom Kim sbki...@samsung.com

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 2/3] regulator: s2mps11: Fix wrong setting for config.dev

2012-07-11 Thread Sangbeom Kim
Hi,
On Thursday, July 12, 2012 10:38 AM +0900, Axel Lin wrote:
 
 Signed-off-by: Axel Lin axel@gmail.com

Acked-by: Sangbeom Kim sbki...@samsung.com

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 3/3] regulator: s2mps11: Use sec_reg_write rather than sec_reg_update when mask is 0xff

2012-07-11 Thread Sangbeom Kim
Hi,
On Thursday, July 12, 2012 10:39 AM +0900, Axel Lin wrote:
 
 Signed-off-by: Axel Lin axel@gmail.com

Acked-by: Sangbeom Kim sbki...@samsung.com

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH V2 3/7] regulator: s5m8767: Modify function and variable name

2012-07-09 Thread Sangbeom Kim
Hi
Monday, July 09, 2012 10:03 PM +0900, Mark Brown wrote:

> This needs to be squashed down into the patch doing the rename in the
> core to avoid build breakage.  Otherwise looks good.
Ok, I will squash and resend it.

Thanks,
Sangbeom.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH V2 0/7] Initial release of Samsung S2MPS11 pmic driver

2012-07-09 Thread Sangbeom Kim
Hi!
On Mon, Jul 09, 2012 at 08:13PM +0900, Samuel Ortiz wrote:
> Hi Sangbeom,
> 
> On Sat, Jul 07, 2012 at 06:39:12PM +0900, Sangbeom Kim wrote:
> > The S2MPS11 is comprised of high efficient Buck converters,
> > various LDOs, and an RTC and tightly coupled with Multi Core Samsung
> > Application Processors, which is used in a wide variety of mobile 
> > applications
> > such as smart phones and tablet PCs.
> > S2MPS11 provide 10 high efficiency buck converters and 38 LDO regulators.
> > Especially, Buck2 can support 7.0A current capacity for high performance
> > samsung application processor.
> > Most of S2MPS11 feature are similar to S5M series.
> > and Instead of using s5m prefix, Samsung decide to use s2m prefix.
> > So, I try to make common mfd driver for S2M and S5M series.
> > Most of s5m prefix is changed into sec prefix.
> >
> > Changes since V1:
> > 1. Replace list_voltage with standard framework
> > 2. Apply regmap_irq
> > 3. Minor changes.
> I was trying to apply this patchset to my for-next branch, but it doesn't
> apply properly.
> Could you please rebase it against this branch and send it to me ?
> 
> Cheers,
> Samuel.

Sorry, After rebase it, I will send again.

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH V2 0/7] Initial release of Samsung S2MPS11 pmic driver

2012-07-09 Thread Sangbeom Kim
Hi!
On Mon, Jul 09, 2012 at 08:13PM +0900, Samuel Ortiz wrote:
 Hi Sangbeom,
 
 On Sat, Jul 07, 2012 at 06:39:12PM +0900, Sangbeom Kim wrote:
  The S2MPS11 is comprised of high efficient Buck converters,
  various LDOs, and an RTC and tightly coupled with Multi Core Samsung
  Application Processors, which is used in a wide variety of mobile 
  applications
  such as smart phones and tablet PCs.
  S2MPS11 provide 10 high efficiency buck converters and 38 LDO regulators.
  Especially, Buck2 can support 7.0A current capacity for high performance
  samsung application processor.
  Most of S2MPS11 feature are similar to S5M series.
  and Instead of using s5m prefix, Samsung decide to use s2m prefix.
  So, I try to make common mfd driver for S2M and S5M series.
  Most of s5m prefix is changed into sec prefix.
 
  Changes since V1:
  1. Replace list_voltage with standard framework
  2. Apply regmap_irq
  3. Minor changes.
 I was trying to apply this patchset to my for-next branch, but it doesn't
 apply properly.
 Could you please rebase it against this branch and send it to me ?
 
 Cheers,
 Samuel.

Sorry, After rebase it, I will send again.

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH V2 3/7] regulator: s5m8767: Modify function and variable name

2012-07-09 Thread Sangbeom Kim
Hi
Monday, July 09, 2012 10:03 PM +0900, Mark Brown wrote:

 This needs to be squashed down into the patch doing the rename in the
 core to avoid build breakage.  Otherwise looks good.
Ok, I will squash and resend it.

Thanks,
Sangbeom.


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2 7/7] MAINTAINRES: Add maintainer for samsung mfd driver

2012-07-07 Thread Sangbeom Kim
There are many samsung multifunction devices which are
s2mps11, s5m8767, s5m8763 etc.
This devices can support regulator, rtc, charger.
I will be supporting the Samsung mfd drivers, that are currently
in development and will be upstreamed shortly.

Signed-off-by: Sangbeom Kim 
---
 MAINTAINERS |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index eb22272..398f9d4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5866,6 +5866,16 @@ L:   linux-fb...@vger.kernel.org
 S: Maintained
 F: drivers/video/s3c-fb.c
 
+SAMSUNG MULTIFUNCTION DEVICE DRIVERS
+M: Sangbeom Kim 
+L: linux-kernel@vger.kernel.org
+S: Supported
+F: drivers/mfd/sec*.c
+F: drivers/regulator/s2m*.c
+F: drivers/regulator/s5m*.c
+F: drivers/rtc/rtc-sec.c
+F: include/linux/mfd/samsung/
+
 SERIAL DRIVERS
 M: Alan Cox 
 L: linux-ser...@vger.kernel.org
-- 
1.7.5.4


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2 6/7] mfd: s2mps11: Add samsung s2mps11 pmic

2012-07-07 Thread Sangbeom Kim
This patch support Samsung s2mps11 mfd driver.
S2MPS11 can support 10 Bucks and 38 LDOs and RTC.
By this patch, s2m and s5m mfd series can be supported.
Especially, S2MPS11 is designed for high performance
Samsung application processor.

Signed-off-by: Sangbeom Kim 
---
 drivers/mfd/Kconfig  |1 +
 drivers/mfd/sec-core.c   |   10 +
 drivers/mfd/sec-irq.c|  488 --
 include/linux/mfd/samsung/core.h |2 +
 include/linux/mfd/samsung/irq.h  |   47 
 5 files changed, 213 insertions(+), 335 deletions(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 28c134c..447662c 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -473,6 +473,7 @@ config MFD_SEC_CORE
depends on I2C=y && GENERIC_HARDIRQS
select MFD_CORE
select REGMAP_I2C
+   select REGMAP_IRQ
help
 Support for the Samsung Electronics PMIC series.
 This driver provides common support for accessing the device,
diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 5bf33cd..a77c7cb 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -54,6 +54,12 @@ static struct mfd_cell s5m8767_devs[] = {
},
 };
 
+static struct mfd_cell s2mps11_devs[] = {
+   {
+   .name = "s2mps11-pmic",
+   },
+};
+
 int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest)
 {
return regmap_read(sec_pmic->regmap, reg, dest);
@@ -145,6 +151,10 @@ static int sec_pmic_probe(struct i2c_client *i2c,
ret = mfd_add_devices(sec_pmic->dev, -1, s5m8767_devs,
ARRAY_SIZE(s5m8767_devs), NULL, 0);
break;
+   case S2MPS11X:
+   ret = mfd_add_devices(sec_pmic->dev, -1, s2mps11_devs,
+   ARRAY_SIZE(s2mps11_devs), NULL, 0);
+   break;
default:
/* If this happens the probe function is problem */
BUG();
diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c
index 370cc4f..dddfbc0 100644
--- a/drivers/mfd/sec-irq.c
+++ b/drivers/mfd/sec-irq.c
@@ -1,7 +1,7 @@
 /*
- * s5m-irq.c
+ * sec-irq.c
  *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd
  *  http://www.samsung.com
  *
  *  This program is free software; you can redistribute  it and/or modify it
@@ -14,350 +14,259 @@
 #include 
 #include 
 #include 
+#include 
+
 #include 
 #include 
+#include 
 #include 
 #include 
 
-struct sec_irq_data {
-   int reg;
-   int mask;
+static struct regmap_irq s2mps11_irqs[] = {
+   [S2MPS11_IRQ_PWRONF] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_PWRONF_MASK,
+   },
+   [S2MPS11_IRQ_PWRONR] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_PWRONR_MASK,
+   },
+   [S2MPS11_IRQ_JIGONBF] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_JIGONBF_MASK,
+   },
+   [S2MPS11_IRQ_JIGONBR] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_JIGONBR_MASK,
+   },
+   [S2MPS11_IRQ_ACOKBF] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_ACOKBF_MASK,
+   },
+   [S2MPS11_IRQ_ACOKBR] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_ACOKBR_MASK,
+   },
+   [S2MPS11_IRQ_PWRON1S] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_PWRON1S_MASK,
+   },
+   [S2MPS11_IRQ_MRB] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_MRB_MASK,
+   },
+   [S2MPS11_IRQ_RTC60S] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_RTC60S_MASK,
+   },
+   [S2MPS11_IRQ_RTCA1] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_RTCA1_MASK,
+   },
+   [S2MPS11_IRQ_RTCA2] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_RTCA2_MASK,
+   },
+   [S2MPS11_IRQ_SMPL] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_SMPL_MASK,
+   },
+   [S2MPS11_IRQ_RTC1S] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_RTC1S_MASK,
+   },
+   [S2MPS11_IRQ_WTSR] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_WTSR_MASK,
+   },
+   [S2MPS11_IRQ_INT120C] = {
+   .reg_offset = 3,
+   .mask = S2MPS11_IRQ_INT120C_MASK,
+   },
+   [S2MPS11_IRQ_INT140C] = {
+   .reg_offset = 3,
+   .mask = S2MPS11_IRQ_INT140C_MASK,
+   },
 };
 
-static struct sec_irq_data s5m8767_irqs[] = {
+static struct regmap_irq s5m8767_irqs[] = {
[S5M8767_IRQ_PWRR] = {
-   .reg = 1,
+   .reg_offset = 1,
.mask = S5M8767_IRQ_PWRR_MASK,
},
[S5M8767_IRQ_PWRF] =

[PATCH V2 5/7] regualtor: s2mps11: Add samsung s2mps11 regulator driver

2012-07-07 Thread Sangbeom Kim
This patch add Samsung S2MPS11 regulator driver.
The S2MPS11 can support 10 Bucks and 38 LDOs and RTC.
Especially, S2MPS11 is designed for high performance
Samsung application processor.

Signed-off-by: Sangbeom Kim 
---
 drivers/regulator/Kconfig   |8 +
 drivers/regulator/Makefile  |1 +
 drivers/regulator/s2mps11.c |  692 +++
 drivers/regulator/s5m8767.c |6 -
 include/linux/mfd/samsung/core.h|   15 +
 include/linux/mfd/samsung/s2mps11.h |  179 +
 6 files changed, 895 insertions(+), 6 deletions(-)
 create mode 100644 drivers/regulator/s2mps11.c
 create mode 100644 include/linux/mfd/samsung/s2mps11.h

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 357752d..1013501 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -256,6 +256,14 @@ config REGULATOR_RC5T583
  through regulator interface. The device supports multiple DCDC/LDO
  outputs which can be controlled by i2c communication.
 
+config REGULATOR_S2MPS11
+   tristate "Samsung S2MPS11 voltage regulator"
+   depends on MFD_SEC_CORE
+   help
+This driver supports a Samsung S2MPS11 voltage output regulator
+via I2C bus. S2MPS11 is comprised of high efficient Buck converters
+including Dual-Phase Buck converter, Buck-Boost converter, various 
LDOs.
+
 config REGULATOR_S5M8767
tristate "Samsung S5M8767A voltage regulator"
depends on MFD_SEC_CORE
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index c746088..a70c4f4 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -40,6 +40,7 @@ obj-$(CONFIG_REGULATOR_PALMAS) += palmas-regulator.o
 obj-$(CONFIG_REGULATOR_PCAP) += pcap-regulator.o
 obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o
 obj-$(CONFIG_REGULATOR_RC5T583)  += rc5t583-regulator.o
+obj-$(CONFIG_REGULATOR_S2MPS11) += s2mps11.o
 obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o
 obj-$(CONFIG_REGULATOR_TPS6105X) += tps6105x-regulator.o
 obj-$(CONFIG_REGULATOR_TPS62360) += tps62360-regulator.o
diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
new file mode 100644
index 000..943fa06
--- /dev/null
+++ b/drivers/regulator/s2mps11.c
@@ -0,0 +1,692 @@
+/*
+ * s2mps11.c
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd
+ *  http://www.samsung.com
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+struct s2mps11_info {
+   struct device *dev;
+   struct sec_pmic_dev *iodev;
+   int num_regulators;
+   struct regulator_dev **rdev;
+   struct sec_opmode_data *opmode;
+
+   int ramp_delay2;
+   int ramp_delay34;
+   int ramp_delay5;
+   int ramp_delay16;
+   int ramp_delay7810;
+   int ramp_delay9;
+
+   bool buck6_ramp;
+   bool buck2_ramp;
+   bool buck3_ramp;
+   bool buck4_ramp;
+};
+
+static const struct sec_voltage_desc buck_voltage_val1 = {
+   .max = 200,
+   .min =  60,
+   .step =   6250,
+};
+
+static const struct sec_voltage_desc buck_voltage_val2 = {
+   .max = 355,
+   .min =  75,
+   .step =  12500,
+};
+
+static const struct sec_voltage_desc buck_voltage_val3 = {
+   .max = 3775000,
+   .min = 300,
+   .step =  25000,
+};
+
+static const struct sec_voltage_desc ldo_voltage_val1 = {
+   .max = 395,
+   .min =  80,
+   .step =  5,
+};
+
+static const struct sec_voltage_desc ldo_voltage_val2 = {
+   .max = 2375000,
+   .min =  80,
+   .step =  25000,
+};
+
+static const struct sec_voltage_desc *reg_voltage_map[] = {
+   [S2MPS11_LDO1] = _voltage_val2,
+   [S2MPS11_LDO2] = _voltage_val1,
+   [S2MPS11_LDO3] = _voltage_val1,
+   [S2MPS11_LDO4] = _voltage_val1,
+   [S2MPS11_LDO5] = _voltage_val1,
+   [S2MPS11_LDO6] = _voltage_val2,
+   [S2MPS11_LDO7] = _voltage_val1,
+   [S2MPS11_LDO8] = _voltage_val1,
+   [S2MPS11_LDO9] = _voltage_val1,
+   [S2MPS11_LDO10] = _voltage_val1,
+   [S2MPS11_LDO11] = _voltage_val2,
+   [S2MPS11_LDO12] = _voltage_val1,
+   [S2MPS11_LDO13] = _voltage_val1,
+   [S2MPS11_LDO14] = _voltage_val1,
+   [S2MPS11_LDO15] = _voltage_val1,
+   [S2MPS11_LDO16] = _voltage_val1,
+   [S2MPS11_LDO17] = _voltage_val1,
+   [S2MPS11_LDO18] = _voltage_val1,
+   [S2MPS11_LDO19] = _voltage_val1,
+   [S2MPS11_LDO20] = _voltage_val1,
+   [S2MPS11_LDO21] = _voltage_val1,
+   [S2MPS11_LDO22] = _voltage_val2,
+   [S2MPS11_LDO23] = _voltage_val2,
+ 

[PATCH V2 4/7] mfd: samsung: Modify samsung mfd header

2012-07-07 Thread Sangbeom Kim
As Prefix of Samsung pmic changed from s5m to s2m,
To make common mfd driver for s2m and s5m series,
This patch rename header of Samsung mfd and modify mfd driver.

Signed-off-by: Sangbeom Kim 
---
 drivers/mfd/sec-core.c   |6 +-
 drivers/mfd/sec-irq.c|5 +-
 drivers/regulator/s5m8767.c  |4 +-
 include/linux/mfd/samsung/core.h |  147 +
 include/linux/mfd/samsung/irq.h  |  113 ++
 include/linux/mfd/samsung/rtc.h  |   84 
 include/linux/mfd/samsung/s5m-core.h |  379 --
 include/linux/mfd/samsung/s5m-pmic.h |  129 
 include/linux/mfd/samsung/s5m-rtc.h  |   84 
 include/linux/mfd/samsung/s5m8763.h  |   97 +
 include/linux/mfd/samsung/s5m8767.h  |  189 +
 11 files changed, 639 insertions(+), 598 deletions(-)
 create mode 100644 include/linux/mfd/samsung/core.h
 create mode 100644 include/linux/mfd/samsung/irq.h
 create mode 100644 include/linux/mfd/samsung/rtc.h
 delete mode 100644 include/linux/mfd/samsung/s5m-core.h
 delete mode 100644 include/linux/mfd/samsung/s5m-pmic.h
 delete mode 100644 include/linux/mfd/samsung/s5m-rtc.h
 create mode 100644 include/linux/mfd/samsung/s5m8763.h
 create mode 100644 include/linux/mfd/samsung/s5m8767.h

diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 6684e77..5bf33cd 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -21,9 +21,9 @@
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
 #include 
 
 static struct mfd_cell s5m8751_devs[] = {
diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c
index c1e2a59..370cc4f 100644
--- a/drivers/mfd/sec-irq.c
+++ b/drivers/mfd/sec-irq.c
@@ -14,7 +14,10 @@
 #include 
 #include 
 #include 
-#include 
+#include 
+#include 
+#include 
+#include 
 
 struct sec_irq_data {
int reg;
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 79b0659..667fb1e 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -19,8 +19,8 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
+#include 
 
 struct s5m8767_info {
struct device *dev;
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
new file mode 100644
index 000..be6277a
--- /dev/null
+++ b/include/linux/mfd/samsung/core.h
@@ -0,0 +1,147 @@
+/*
+ * core.h
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd
+ *  http://www.samsung.com
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ */
+
+#ifndef __LINUX_MFD_SEC_CORE_H
+#define __LINUX_MFD_SEC_CORE_H
+
+#define NUM_IRQ_REGS   4
+
+enum sec_device_type {
+   S5M8751X,
+   S5M8763X,
+   S5M8767X,
+};
+
+/**
+ * struct sec_pmic_dev - s5m87xx master device for sub-drivers
+ * @dev: master device of the chip (can be used to access platform data)
+ * @i2c: i2c client private data for regulator
+ * @rtc: i2c client private data for rtc
+ * @iolock: mutex for serializing io access
+ * @irqlock: mutex for buslock
+ * @irq_base: base IRQ number for s5m87xx, required for IRQs
+ * @irq: generic IRQ number for s5m87xx
+ * @ono: power onoff IRQ number for s5m87xx
+ * @irq_masks_cur: currently active value
+ * @irq_masks_cache: cached hardware value
+ * @type: indicate which s5m87xx "variant" is used
+ */
+struct sec_pmic_dev {
+   struct device *dev;
+   struct regmap *regmap;
+   struct i2c_client *i2c;
+   struct i2c_client *rtc;
+   struct mutex iolock;
+   struct mutex irqlock;
+
+   int device_type;
+   int irq_base;
+   int irq;
+   int ono;
+   u8 irq_masks_cur[NUM_IRQ_REGS];
+   u8 irq_masks_cache[NUM_IRQ_REGS];
+   int type;
+   bool wakeup;
+};
+
+int sec_irq_init(struct sec_pmic_dev *sec_pmic);
+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_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);
+
+struct sec_pmic_platform_data {
+   struct sec_regulator_data   *regulators;
+   struct sec_opmode_data  *opmode;
+   int device_type;
+   int num_regulators;
+
+   int irq_base;
+   int (*cfg_pmic_irq)(void);
+
+

[PATCH V2 3/7] regulator: s5m8767: Modify function and variable name

2012-07-07 Thread Sangbeom Kim
As function and variable name of Samsung mfd driver is changed,
This patch modify s5m8767 regulator driver.

Signed-off-by: Sangbeom Kim 
---
 drivers/regulator/s5m8767.c |   74 +-
 1 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index f292e56..79b0659 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -24,10 +24,10 @@
 
 struct s5m8767_info {
struct device *dev;
-   struct s5m87xx_dev *iodev;
+   struct sec_pmic_dev *iodev;
int num_regulators;
struct regulator_dev **rdev;
-   struct s5m_opmode_data *opmode;
+   struct sec_opmode_data *opmode;
 
int ramp_delay;
bool buck2_ramp;
@@ -45,43 +45,43 @@ struct s5m8767_info {
int buck_gpioindex;
 };
 
-struct s5m_voltage_desc {
+struct sec_voltage_desc {
int max;
int min;
int step;
 };
 
-static const struct s5m_voltage_desc buck_voltage_val1 = {
+static const struct sec_voltage_desc buck_voltage_val1 = {
.max = 2225000,
.min =  65,
.step =   6250,
 };
 
-static const struct s5m_voltage_desc buck_voltage_val2 = {
+static const struct sec_voltage_desc buck_voltage_val2 = {
.max = 160,
.min =  60,
.step =   6250,
 };
 
-static const struct s5m_voltage_desc buck_voltage_val3 = {
+static const struct sec_voltage_desc buck_voltage_val3 = {
.max = 300,
.min =  75,
.step =  12500,
 };
 
-static const struct s5m_voltage_desc ldo_voltage_val1 = {
+static const struct sec_voltage_desc ldo_voltage_val1 = {
.max = 395,
.min =  80,
.step =  5,
 };
 
-static const struct s5m_voltage_desc ldo_voltage_val2 = {
+static const struct sec_voltage_desc ldo_voltage_val2 = {
.max = 2375000,
.min =  80,
.step =  25000,
 };
 
-static const struct s5m_voltage_desc *reg_voltage_map[] = {
+static const struct sec_voltage_desc *reg_voltage_map[] = {
[S5M8767_LDO1] = _voltage_val2,
[S5M8767_LDO2] = _voltage_val2,
[S5M8767_LDO3] = _voltage_val1,
@@ -213,7 +213,7 @@ static int s5m8767_reg_is_enabled(struct regulator_dev 
*rdev)
else if (ret)
return ret;
 
-   ret = s5m_reg_read(s5m8767->iodev, reg, );
+   ret = sec_reg_read(s5m8767->iodev, reg, );
if (ret)
return ret;
 
@@ -230,7 +230,7 @@ static int s5m8767_reg_enable(struct regulator_dev *rdev)
if (ret)
return ret;
 
-   return s5m_reg_update(s5m8767->iodev, reg, enable_ctrl, mask);
+   return sec_reg_update(s5m8767->iodev, reg, enable_ctrl, mask);
 }
 
 static int s5m8767_reg_disable(struct regulator_dev *rdev)
@@ -243,7 +243,7 @@ static int s5m8767_reg_disable(struct regulator_dev *rdev)
if (ret)
return ret;
 
-   return s5m_reg_update(s5m8767->iodev, reg, ~mask, mask);
+   return sec_reg_update(s5m8767->iodev, reg, ~mask, mask);
 }
 
 static int s5m8767_get_voltage_register(struct regulator_dev *rdev, int *_reg)
@@ -305,7 +305,7 @@ static int s5m8767_get_voltage_sel(struct regulator_dev 
*rdev)
 
mask = (reg_id < S5M8767_BUCK1) ? 0x3f : 0xff;
 
-   ret = s5m_reg_read(s5m8767->iodev, reg, );
+   ret = sec_reg_read(s5m8767->iodev, reg, );
if (ret)
return ret;
 
@@ -315,7 +315,7 @@ static int s5m8767_get_voltage_sel(struct regulator_dev 
*rdev)
 }
 
 static int s5m8767_convert_voltage_to_sel(
-   const struct s5m_voltage_desc *desc,
+   const struct sec_voltage_desc *desc,
int min_vol, int max_vol)
 {
int selector = 0;
@@ -407,7 +407,7 @@ static int s5m8767_set_voltage_sel(struct regulator_dev 
*rdev,
if (ret)
return ret;
 
-   return s5m_reg_update(s5m8767->iodev, reg, selector, mask);
+   return sec_reg_update(s5m8767->iodev, reg, selector, mask);
}
 }
 
@@ -416,7 +416,7 @@ static int s5m8767_set_voltage_time_sel(struct 
regulator_dev *rdev,
 unsigned int new_sel)
 {
struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev);
-   const struct s5m_voltage_desc *desc;
+   const struct sec_voltage_desc *desc;
int reg_id = rdev_get_id(rdev);
 
desc = reg_voltage_map[reg_id];
@@ -501,8 +501,8 @@ static struct regulator_desc regulators[] = {
 
 static __devinit int s5m8767_pmic_probe(struct platform_device *pdev)
 {
-   struct s5m87xx_dev *iodev = dev_get_drvdata(pdev->dev.parent);
-   struct s5m_platform_data *pdata = dev_get_platdata(iodev->dev);
+   struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent);
+   struct sec_pmic_platform_data *pdata = dev_get_platdata(iodev->dev);
struct regulator_config config = { };
  

[PATCH V2 2/7] mfd: samsung: Modify samsung mfd driver for common api

2012-07-07 Thread Sangbeom Kim
Previous naming rule of samsung pmic start with s5m prefix.
But It is changed by s2m.
To cover various samsung s2m and s5m series,
This patch modify function and variable name for common usage.

Signed-off-by: Sangbeom Kim 
---
 drivers/mfd/sec-core.c   |  126 +++---
 drivers/mfd/sec-irq.c|  203 +-
 include/linux/mfd/samsung/s5m-core.h |   34 +++---
 include/linux/mfd/samsung/s5m-pmic.h |   34 +++---
 4 files changed, 198 insertions(+), 199 deletions(-)

diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index b090360..6684e77 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -1,5 +1,5 @@
 /*
- * s5m87xx.c
+ * sec_pmic.c
  *
  * Copyright (c) 2011 Samsung Electronics Co., Ltd
  *  http://www.samsung.com
@@ -54,95 +54,95 @@ static struct mfd_cell s5m8767_devs[] = {
},
 };
 
-int s5m_reg_read(struct s5m87xx_dev *s5m87xx, u8 reg, void *dest)
+int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest)
 {
-   return regmap_read(s5m87xx->regmap, reg, dest);
+   return regmap_read(sec_pmic->regmap, reg, dest);
 }
-EXPORT_SYMBOL_GPL(s5m_reg_read);
+EXPORT_SYMBOL_GPL(sec_reg_read);
 
-int s5m_bulk_read(struct s5m87xx_dev *s5m87xx, u8 reg, int count, u8 *buf)
+int sec_bulk_read(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf)
 {
-   return regmap_bulk_read(s5m87xx->regmap, reg, buf, count);
+   return regmap_bulk_read(sec_pmic->regmap, reg, buf, count);
 }
-EXPORT_SYMBOL_GPL(s5m_bulk_read);
+EXPORT_SYMBOL_GPL(sec_bulk_read);
 
-int s5m_reg_write(struct s5m87xx_dev *s5m87xx, u8 reg, u8 value)
+int sec_reg_write(struct sec_pmic_dev *sec_pmic, u8 reg, u8 value)
 {
-   return regmap_write(s5m87xx->regmap, reg, value);
+   return regmap_write(sec_pmic->regmap, reg, value);
 }
-EXPORT_SYMBOL_GPL(s5m_reg_write);
+EXPORT_SYMBOL_GPL(sec_reg_write);
 
-int s5m_bulk_write(struct s5m87xx_dev *s5m87xx, u8 reg, int count, u8 *buf)
+int s5m_bulk_write(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf)
 {
-   return regmap_raw_write(s5m87xx->regmap, reg, buf, count);
+   return regmap_raw_write(sec_pmic->regmap, reg, buf, count);
 }
 EXPORT_SYMBOL_GPL(s5m_bulk_write);
 
-int s5m_reg_update(struct s5m87xx_dev *s5m87xx, u8 reg, u8 val, u8 mask)
+int sec_reg_update(struct sec_pmic_dev *sec_pmic, u8 reg, u8 val, u8 mask)
 {
-   return regmap_update_bits(s5m87xx->regmap, reg, mask, val);
+   return regmap_update_bits(sec_pmic->regmap, reg, mask, val);
 }
-EXPORT_SYMBOL_GPL(s5m_reg_update);
+EXPORT_SYMBOL_GPL(sec_reg_update);
 
-static struct regmap_config s5m_regmap_config = {
+static struct regmap_config sec_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
 };
 
-static int s5m87xx_i2c_probe(struct i2c_client *i2c,
+static int sec_pmic_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
 {
-   struct s5m_platform_data *pdata = i2c->dev.platform_data;
-   struct s5m87xx_dev *s5m87xx;
+   struct sec_pmic_platform_data *pdata = i2c->dev.platform_data;
+   struct sec_pmic_dev *sec_pmic;
int ret;
 
-   s5m87xx = devm_kzalloc(>dev, sizeof(struct s5m87xx_dev),
+   sec_pmic = devm_kzalloc(>dev, sizeof(struct sec_pmic_dev),
GFP_KERNEL);
-   if (s5m87xx == NULL)
+   if (sec_pmic == NULL)
return -ENOMEM;
 
-   i2c_set_clientdata(i2c, s5m87xx);
-   s5m87xx->dev = >dev;
-   s5m87xx->i2c = i2c;
-   s5m87xx->irq = i2c->irq;
-   s5m87xx->type = id->driver_data;
+   i2c_set_clientdata(i2c, sec_pmic);
+   sec_pmic->dev = >dev;
+   sec_pmic->i2c = i2c;
+   sec_pmic->irq = i2c->irq;
+   sec_pmic->type = id->driver_data;
 
if (pdata) {
-   s5m87xx->device_type = pdata->device_type;
-   s5m87xx->ono = pdata->ono;
-   s5m87xx->irq_base = pdata->irq_base;
-   s5m87xx->wakeup = pdata->wakeup;
+   sec_pmic->device_type = pdata->device_type;
+   sec_pmic->ono = pdata->ono;
+   sec_pmic->irq_base = pdata->irq_base;
+   sec_pmic->wakeup = pdata->wakeup;
}
 
-   s5m87xx->regmap = devm_regmap_init_i2c(i2c, _regmap_config);
-   if (IS_ERR(s5m87xx->regmap)) {
-   ret = PTR_ERR(s5m87xx->regmap);
+   sec_pmic->regmap = devm_regmap_init_i2c(i2c, _regmap_config);
+   if (IS_ERR(sec_pmic->regmap)) {
+   ret = PTR_ERR(sec_pmic->regmap);
dev_err(>dev, "Failed to allocate register map: %d\n",
ret);
return ret;
}
 
-   s5m87xx->rtc = i2c_new_dummy(i2c->adapter, RTC_I2C_ADDR);
-   i2c_set_clientdata(s5m87xx->rtc, 

[PATCH V2 0/7] Initial release of Samsung S2MPS11 pmic driver

2012-07-07 Thread Sangbeom Kim
The S2MPS11 is comprised of high efficient Buck converters,
various LDOs, and an RTC and tightly coupled with Multi Core Samsung 
Application Processors, which is used in a wide variety of mobile applications
such as smart phones and tablet PCs.
S2MPS11 provide 10 high efficiency buck converters and 38 LDO regulators.
Especially, Buck2 can support 7.0A current capacity for high performance
samsung application processor.
Most of S2MPS11 feature are similar to S5M series.
and Instead of using s5m prefix, Samsung decide to use s2m prefix.
So, I try to make common mfd driver for S2M and S5M series.
Most of s5m prefix is changed into sec prefix.

Changes since V1:
1. Replace list_voltage with standard framework
2. Apply regmap_irq
3. Minor changes.

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2 0/7] Initial release of Samsung S2MPS11 pmic driver

2012-07-07 Thread Sangbeom Kim
The S2MPS11 is comprised of high efficient Buck converters,
various LDOs, and an RTC and tightly coupled with Multi Core Samsung 
Application Processors, which is used in a wide variety of mobile applications
such as smart phones and tablet PCs.
S2MPS11 provide 10 high efficiency buck converters and 38 LDO regulators.
Especially, Buck2 can support 7.0A current capacity for high performance
samsung application processor.
Most of S2MPS11 feature are similar to S5M series.
and Instead of using s5m prefix, Samsung decide to use s2m prefix.
So, I try to make common mfd driver for S2M and S5M series.
Most of s5m prefix is changed into sec prefix.

Changes since V1:
1. Replace list_voltage with standard framework
2. Apply regmap_irq
3. Minor changes.

Thanks,
Sangbeom.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2 2/7] mfd: samsung: Modify samsung mfd driver for common api

2012-07-07 Thread Sangbeom Kim
Previous naming rule of samsung pmic start with s5m prefix.
But It is changed by s2m.
To cover various samsung s2m and s5m series,
This patch modify function and variable name for common usage.

Signed-off-by: Sangbeom Kim sbki...@samsung.com
---
 drivers/mfd/sec-core.c   |  126 +++---
 drivers/mfd/sec-irq.c|  203 +-
 include/linux/mfd/samsung/s5m-core.h |   34 +++---
 include/linux/mfd/samsung/s5m-pmic.h |   34 +++---
 4 files changed, 198 insertions(+), 199 deletions(-)

diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index b090360..6684e77 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -1,5 +1,5 @@
 /*
- * s5m87xx.c
+ * sec_pmic.c
  *
  * Copyright (c) 2011 Samsung Electronics Co., Ltd
  *  http://www.samsung.com
@@ -54,95 +54,95 @@ static struct mfd_cell s5m8767_devs[] = {
},
 };
 
-int s5m_reg_read(struct s5m87xx_dev *s5m87xx, u8 reg, void *dest)
+int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest)
 {
-   return regmap_read(s5m87xx-regmap, reg, dest);
+   return regmap_read(sec_pmic-regmap, reg, dest);
 }
-EXPORT_SYMBOL_GPL(s5m_reg_read);
+EXPORT_SYMBOL_GPL(sec_reg_read);
 
-int s5m_bulk_read(struct s5m87xx_dev *s5m87xx, u8 reg, int count, u8 *buf)
+int sec_bulk_read(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf)
 {
-   return regmap_bulk_read(s5m87xx-regmap, reg, buf, count);
+   return regmap_bulk_read(sec_pmic-regmap, reg, buf, count);
 }
-EXPORT_SYMBOL_GPL(s5m_bulk_read);
+EXPORT_SYMBOL_GPL(sec_bulk_read);
 
-int s5m_reg_write(struct s5m87xx_dev *s5m87xx, u8 reg, u8 value)
+int sec_reg_write(struct sec_pmic_dev *sec_pmic, u8 reg, u8 value)
 {
-   return regmap_write(s5m87xx-regmap, reg, value);
+   return regmap_write(sec_pmic-regmap, reg, value);
 }
-EXPORT_SYMBOL_GPL(s5m_reg_write);
+EXPORT_SYMBOL_GPL(sec_reg_write);
 
-int s5m_bulk_write(struct s5m87xx_dev *s5m87xx, u8 reg, int count, u8 *buf)
+int s5m_bulk_write(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf)
 {
-   return regmap_raw_write(s5m87xx-regmap, reg, buf, count);
+   return regmap_raw_write(sec_pmic-regmap, reg, buf, count);
 }
 EXPORT_SYMBOL_GPL(s5m_bulk_write);
 
-int s5m_reg_update(struct s5m87xx_dev *s5m87xx, u8 reg, u8 val, u8 mask)
+int sec_reg_update(struct sec_pmic_dev *sec_pmic, u8 reg, u8 val, u8 mask)
 {
-   return regmap_update_bits(s5m87xx-regmap, reg, mask, val);
+   return regmap_update_bits(sec_pmic-regmap, reg, mask, val);
 }
-EXPORT_SYMBOL_GPL(s5m_reg_update);
+EXPORT_SYMBOL_GPL(sec_reg_update);
 
-static struct regmap_config s5m_regmap_config = {
+static struct regmap_config sec_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
 };
 
-static int s5m87xx_i2c_probe(struct i2c_client *i2c,
+static int sec_pmic_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
 {
-   struct s5m_platform_data *pdata = i2c-dev.platform_data;
-   struct s5m87xx_dev *s5m87xx;
+   struct sec_pmic_platform_data *pdata = i2c-dev.platform_data;
+   struct sec_pmic_dev *sec_pmic;
int ret;
 
-   s5m87xx = devm_kzalloc(i2c-dev, sizeof(struct s5m87xx_dev),
+   sec_pmic = devm_kzalloc(i2c-dev, sizeof(struct sec_pmic_dev),
GFP_KERNEL);
-   if (s5m87xx == NULL)
+   if (sec_pmic == NULL)
return -ENOMEM;
 
-   i2c_set_clientdata(i2c, s5m87xx);
-   s5m87xx-dev = i2c-dev;
-   s5m87xx-i2c = i2c;
-   s5m87xx-irq = i2c-irq;
-   s5m87xx-type = id-driver_data;
+   i2c_set_clientdata(i2c, sec_pmic);
+   sec_pmic-dev = i2c-dev;
+   sec_pmic-i2c = i2c;
+   sec_pmic-irq = i2c-irq;
+   sec_pmic-type = id-driver_data;
 
if (pdata) {
-   s5m87xx-device_type = pdata-device_type;
-   s5m87xx-ono = pdata-ono;
-   s5m87xx-irq_base = pdata-irq_base;
-   s5m87xx-wakeup = pdata-wakeup;
+   sec_pmic-device_type = pdata-device_type;
+   sec_pmic-ono = pdata-ono;
+   sec_pmic-irq_base = pdata-irq_base;
+   sec_pmic-wakeup = pdata-wakeup;
}
 
-   s5m87xx-regmap = devm_regmap_init_i2c(i2c, s5m_regmap_config);
-   if (IS_ERR(s5m87xx-regmap)) {
-   ret = PTR_ERR(s5m87xx-regmap);
+   sec_pmic-regmap = devm_regmap_init_i2c(i2c, sec_regmap_config);
+   if (IS_ERR(sec_pmic-regmap)) {
+   ret = PTR_ERR(sec_pmic-regmap);
dev_err(i2c-dev, Failed to allocate register map: %d\n,
ret);
return ret;
}
 
-   s5m87xx-rtc = i2c_new_dummy(i2c-adapter, RTC_I2C_ADDR);
-   i2c_set_clientdata(s5m87xx-rtc, s5m87xx);
+   sec_pmic-rtc = i2c_new_dummy(i2c-adapter, RTC_I2C_ADDR);
+   i2c_set_clientdata(sec_pmic-rtc, sec_pmic);
 
if (pdata  pdata-cfg_pmic_irq)
pdata

[PATCH V2 3/7] regulator: s5m8767: Modify function and variable name

2012-07-07 Thread Sangbeom Kim
As function and variable name of Samsung mfd driver is changed,
This patch modify s5m8767 regulator driver.

Signed-off-by: Sangbeom Kim sbki...@samsung.com
---
 drivers/regulator/s5m8767.c |   74 +-
 1 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index f292e56..79b0659 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -24,10 +24,10 @@
 
 struct s5m8767_info {
struct device *dev;
-   struct s5m87xx_dev *iodev;
+   struct sec_pmic_dev *iodev;
int num_regulators;
struct regulator_dev **rdev;
-   struct s5m_opmode_data *opmode;
+   struct sec_opmode_data *opmode;
 
int ramp_delay;
bool buck2_ramp;
@@ -45,43 +45,43 @@ struct s5m8767_info {
int buck_gpioindex;
 };
 
-struct s5m_voltage_desc {
+struct sec_voltage_desc {
int max;
int min;
int step;
 };
 
-static const struct s5m_voltage_desc buck_voltage_val1 = {
+static const struct sec_voltage_desc buck_voltage_val1 = {
.max = 2225000,
.min =  65,
.step =   6250,
 };
 
-static const struct s5m_voltage_desc buck_voltage_val2 = {
+static const struct sec_voltage_desc buck_voltage_val2 = {
.max = 160,
.min =  60,
.step =   6250,
 };
 
-static const struct s5m_voltage_desc buck_voltage_val3 = {
+static const struct sec_voltage_desc buck_voltage_val3 = {
.max = 300,
.min =  75,
.step =  12500,
 };
 
-static const struct s5m_voltage_desc ldo_voltage_val1 = {
+static const struct sec_voltage_desc ldo_voltage_val1 = {
.max = 395,
.min =  80,
.step =  5,
 };
 
-static const struct s5m_voltage_desc ldo_voltage_val2 = {
+static const struct sec_voltage_desc ldo_voltage_val2 = {
.max = 2375000,
.min =  80,
.step =  25000,
 };
 
-static const struct s5m_voltage_desc *reg_voltage_map[] = {
+static const struct sec_voltage_desc *reg_voltage_map[] = {
[S5M8767_LDO1] = ldo_voltage_val2,
[S5M8767_LDO2] = ldo_voltage_val2,
[S5M8767_LDO3] = ldo_voltage_val1,
@@ -213,7 +213,7 @@ static int s5m8767_reg_is_enabled(struct regulator_dev 
*rdev)
else if (ret)
return ret;
 
-   ret = s5m_reg_read(s5m8767-iodev, reg, val);
+   ret = sec_reg_read(s5m8767-iodev, reg, val);
if (ret)
return ret;
 
@@ -230,7 +230,7 @@ static int s5m8767_reg_enable(struct regulator_dev *rdev)
if (ret)
return ret;
 
-   return s5m_reg_update(s5m8767-iodev, reg, enable_ctrl, mask);
+   return sec_reg_update(s5m8767-iodev, reg, enable_ctrl, mask);
 }
 
 static int s5m8767_reg_disable(struct regulator_dev *rdev)
@@ -243,7 +243,7 @@ static int s5m8767_reg_disable(struct regulator_dev *rdev)
if (ret)
return ret;
 
-   return s5m_reg_update(s5m8767-iodev, reg, ~mask, mask);
+   return sec_reg_update(s5m8767-iodev, reg, ~mask, mask);
 }
 
 static int s5m8767_get_voltage_register(struct regulator_dev *rdev, int *_reg)
@@ -305,7 +305,7 @@ static int s5m8767_get_voltage_sel(struct regulator_dev 
*rdev)
 
mask = (reg_id  S5M8767_BUCK1) ? 0x3f : 0xff;
 
-   ret = s5m_reg_read(s5m8767-iodev, reg, val);
+   ret = sec_reg_read(s5m8767-iodev, reg, val);
if (ret)
return ret;
 
@@ -315,7 +315,7 @@ static int s5m8767_get_voltage_sel(struct regulator_dev 
*rdev)
 }
 
 static int s5m8767_convert_voltage_to_sel(
-   const struct s5m_voltage_desc *desc,
+   const struct sec_voltage_desc *desc,
int min_vol, int max_vol)
 {
int selector = 0;
@@ -407,7 +407,7 @@ static int s5m8767_set_voltage_sel(struct regulator_dev 
*rdev,
if (ret)
return ret;
 
-   return s5m_reg_update(s5m8767-iodev, reg, selector, mask);
+   return sec_reg_update(s5m8767-iodev, reg, selector, mask);
}
 }
 
@@ -416,7 +416,7 @@ static int s5m8767_set_voltage_time_sel(struct 
regulator_dev *rdev,
 unsigned int new_sel)
 {
struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev);
-   const struct s5m_voltage_desc *desc;
+   const struct sec_voltage_desc *desc;
int reg_id = rdev_get_id(rdev);
 
desc = reg_voltage_map[reg_id];
@@ -501,8 +501,8 @@ static struct regulator_desc regulators[] = {
 
 static __devinit int s5m8767_pmic_probe(struct platform_device *pdev)
 {
-   struct s5m87xx_dev *iodev = dev_get_drvdata(pdev-dev.parent);
-   struct s5m_platform_data *pdata = dev_get_platdata(iodev-dev);
+   struct sec_pmic_dev *iodev = dev_get_drvdata(pdev-dev.parent);
+   struct sec_pmic_platform_data *pdata = dev_get_platdata(iodev-dev);
struct regulator_config config = { };
struct

[PATCH V2 4/7] mfd: samsung: Modify samsung mfd header

2012-07-07 Thread Sangbeom Kim
As Prefix of Samsung pmic changed from s5m to s2m,
To make common mfd driver for s2m and s5m series,
This patch rename header of Samsung mfd and modify mfd driver.

Signed-off-by: Sangbeom Kim sbki...@samsung.com
---
 drivers/mfd/sec-core.c   |6 +-
 drivers/mfd/sec-irq.c|5 +-
 drivers/regulator/s5m8767.c  |4 +-
 include/linux/mfd/samsung/core.h |  147 +
 include/linux/mfd/samsung/irq.h  |  113 ++
 include/linux/mfd/samsung/rtc.h  |   84 
 include/linux/mfd/samsung/s5m-core.h |  379 --
 include/linux/mfd/samsung/s5m-pmic.h |  129 
 include/linux/mfd/samsung/s5m-rtc.h  |   84 
 include/linux/mfd/samsung/s5m8763.h  |   97 +
 include/linux/mfd/samsung/s5m8767.h  |  189 +
 11 files changed, 639 insertions(+), 598 deletions(-)
 create mode 100644 include/linux/mfd/samsung/core.h
 create mode 100644 include/linux/mfd/samsung/irq.h
 create mode 100644 include/linux/mfd/samsung/rtc.h
 delete mode 100644 include/linux/mfd/samsung/s5m-core.h
 delete mode 100644 include/linux/mfd/samsung/s5m-pmic.h
 delete mode 100644 include/linux/mfd/samsung/s5m-rtc.h
 create mode 100644 include/linux/mfd/samsung/s5m8763.h
 create mode 100644 include/linux/mfd/samsung/s5m8767.h

diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 6684e77..5bf33cd 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -21,9 +21,9 @@
 #include linux/pm_runtime.h
 #include linux/mutex.h
 #include linux/mfd/core.h
-#include linux/mfd/samsung/s5m-core.h
-#include linux/mfd/samsung/s5m-pmic.h
-#include linux/mfd/samsung/s5m-rtc.h
+#include linux/mfd/samsung/core.h
+#include linux/mfd/samsung/irq.h
+#include linux/mfd/samsung/rtc.h
 #include linux/regmap.h
 
 static struct mfd_cell s5m8751_devs[] = {
diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c
index c1e2a59..370cc4f 100644
--- a/drivers/mfd/sec-irq.c
+++ b/drivers/mfd/sec-irq.c
@@ -14,7 +14,10 @@
 #include linux/device.h
 #include linux/interrupt.h
 #include linux/irq.h
-#include linux/mfd/samsung/s5m-core.h
+#include linux/mfd/samsung/core.h
+#include linux/mfd/samsung/irq.h
+#include linux/mfd/samsung/s5m8763.h
+#include linux/mfd/samsung/s5m8767.h
 
 struct sec_irq_data {
int reg;
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 79b0659..667fb1e 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -19,8 +19,8 @@
 #include linux/platform_device.h
 #include linux/regulator/driver.h
 #include linux/regulator/machine.h
-#include linux/mfd/samsung/s5m-core.h
-#include linux/mfd/samsung/s5m-pmic.h
+#include linux/mfd/samsung/core.h
+#include linux/mfd/samsung/s5m8767.h
 
 struct s5m8767_info {
struct device *dev;
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
new file mode 100644
index 000..be6277a
--- /dev/null
+++ b/include/linux/mfd/samsung/core.h
@@ -0,0 +1,147 @@
+/*
+ * core.h
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd
+ *  http://www.samsung.com
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ */
+
+#ifndef __LINUX_MFD_SEC_CORE_H
+#define __LINUX_MFD_SEC_CORE_H
+
+#define NUM_IRQ_REGS   4
+
+enum sec_device_type {
+   S5M8751X,
+   S5M8763X,
+   S5M8767X,
+};
+
+/**
+ * struct sec_pmic_dev - s5m87xx master device for sub-drivers
+ * @dev: master device of the chip (can be used to access platform data)
+ * @i2c: i2c client private data for regulator
+ * @rtc: i2c client private data for rtc
+ * @iolock: mutex for serializing io access
+ * @irqlock: mutex for buslock
+ * @irq_base: base IRQ number for s5m87xx, required for IRQs
+ * @irq: generic IRQ number for s5m87xx
+ * @ono: power onoff IRQ number for s5m87xx
+ * @irq_masks_cur: currently active value
+ * @irq_masks_cache: cached hardware value
+ * @type: indicate which s5m87xx variant is used
+ */
+struct sec_pmic_dev {
+   struct device *dev;
+   struct regmap *regmap;
+   struct i2c_client *i2c;
+   struct i2c_client *rtc;
+   struct mutex iolock;
+   struct mutex irqlock;
+
+   int device_type;
+   int irq_base;
+   int irq;
+   int ono;
+   u8 irq_masks_cur[NUM_IRQ_REGS];
+   u8 irq_masks_cache[NUM_IRQ_REGS];
+   int type;
+   bool wakeup;
+};
+
+int sec_irq_init(struct sec_pmic_dev *sec_pmic);
+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_reg_write(struct sec_pmic_dev *sec_pmic, u8 reg

[PATCH V2 5/7] regualtor: s2mps11: Add samsung s2mps11 regulator driver

2012-07-07 Thread Sangbeom Kim
This patch add Samsung S2MPS11 regulator driver.
The S2MPS11 can support 10 Bucks and 38 LDOs and RTC.
Especially, S2MPS11 is designed for high performance
Samsung application processor.

Signed-off-by: Sangbeom Kim sbki...@samsung.com
---
 drivers/regulator/Kconfig   |8 +
 drivers/regulator/Makefile  |1 +
 drivers/regulator/s2mps11.c |  692 +++
 drivers/regulator/s5m8767.c |6 -
 include/linux/mfd/samsung/core.h|   15 +
 include/linux/mfd/samsung/s2mps11.h |  179 +
 6 files changed, 895 insertions(+), 6 deletions(-)
 create mode 100644 drivers/regulator/s2mps11.c
 create mode 100644 include/linux/mfd/samsung/s2mps11.h

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 357752d..1013501 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -256,6 +256,14 @@ config REGULATOR_RC5T583
  through regulator interface. The device supports multiple DCDC/LDO
  outputs which can be controlled by i2c communication.
 
+config REGULATOR_S2MPS11
+   tristate Samsung S2MPS11 voltage regulator
+   depends on MFD_SEC_CORE
+   help
+This driver supports a Samsung S2MPS11 voltage output regulator
+via I2C bus. S2MPS11 is comprised of high efficient Buck converters
+including Dual-Phase Buck converter, Buck-Boost converter, various 
LDOs.
+
 config REGULATOR_S5M8767
tristate Samsung S5M8767A voltage regulator
depends on MFD_SEC_CORE
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index c746088..a70c4f4 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -40,6 +40,7 @@ obj-$(CONFIG_REGULATOR_PALMAS) += palmas-regulator.o
 obj-$(CONFIG_REGULATOR_PCAP) += pcap-regulator.o
 obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o
 obj-$(CONFIG_REGULATOR_RC5T583)  += rc5t583-regulator.o
+obj-$(CONFIG_REGULATOR_S2MPS11) += s2mps11.o
 obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o
 obj-$(CONFIG_REGULATOR_TPS6105X) += tps6105x-regulator.o
 obj-$(CONFIG_REGULATOR_TPS62360) += tps62360-regulator.o
diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
new file mode 100644
index 000..943fa06
--- /dev/null
+++ b/drivers/regulator/s2mps11.c
@@ -0,0 +1,692 @@
+/*
+ * s2mps11.c
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd
+ *  http://www.samsung.com
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ */
+
+#include linux/bug.h
+#include linux/delay.h
+#include linux/err.h
+#include linux/gpio.h
+#include linux/slab.h
+#include linux/module.h
+#include linux/platform_device.h
+#include linux/regulator/driver.h
+#include linux/regulator/machine.h
+#include linux/mfd/samsung/core.h
+#include linux/mfd/samsung/s2mps11.h
+
+struct s2mps11_info {
+   struct device *dev;
+   struct sec_pmic_dev *iodev;
+   int num_regulators;
+   struct regulator_dev **rdev;
+   struct sec_opmode_data *opmode;
+
+   int ramp_delay2;
+   int ramp_delay34;
+   int ramp_delay5;
+   int ramp_delay16;
+   int ramp_delay7810;
+   int ramp_delay9;
+
+   bool buck6_ramp;
+   bool buck2_ramp;
+   bool buck3_ramp;
+   bool buck4_ramp;
+};
+
+static const struct sec_voltage_desc buck_voltage_val1 = {
+   .max = 200,
+   .min =  60,
+   .step =   6250,
+};
+
+static const struct sec_voltage_desc buck_voltage_val2 = {
+   .max = 355,
+   .min =  75,
+   .step =  12500,
+};
+
+static const struct sec_voltage_desc buck_voltage_val3 = {
+   .max = 3775000,
+   .min = 300,
+   .step =  25000,
+};
+
+static const struct sec_voltage_desc ldo_voltage_val1 = {
+   .max = 395,
+   .min =  80,
+   .step =  5,
+};
+
+static const struct sec_voltage_desc ldo_voltage_val2 = {
+   .max = 2375000,
+   .min =  80,
+   .step =  25000,
+};
+
+static const struct sec_voltage_desc *reg_voltage_map[] = {
+   [S2MPS11_LDO1] = ldo_voltage_val2,
+   [S2MPS11_LDO2] = ldo_voltage_val1,
+   [S2MPS11_LDO3] = ldo_voltage_val1,
+   [S2MPS11_LDO4] = ldo_voltage_val1,
+   [S2MPS11_LDO5] = ldo_voltage_val1,
+   [S2MPS11_LDO6] = ldo_voltage_val2,
+   [S2MPS11_LDO7] = ldo_voltage_val1,
+   [S2MPS11_LDO8] = ldo_voltage_val1,
+   [S2MPS11_LDO9] = ldo_voltage_val1,
+   [S2MPS11_LDO10] = ldo_voltage_val1,
+   [S2MPS11_LDO11] = ldo_voltage_val2,
+   [S2MPS11_LDO12] = ldo_voltage_val1,
+   [S2MPS11_LDO13] = ldo_voltage_val1,
+   [S2MPS11_LDO14] = ldo_voltage_val1,
+   [S2MPS11_LDO15] = ldo_voltage_val1,
+   [S2MPS11_LDO16] = ldo_voltage_val1,
+   [S2MPS11_LDO17] = ldo_voltage_val1

[PATCH V2 6/7] mfd: s2mps11: Add samsung s2mps11 pmic

2012-07-07 Thread Sangbeom Kim
This patch support Samsung s2mps11 mfd driver.
S2MPS11 can support 10 Bucks and 38 LDOs and RTC.
By this patch, s2m and s5m mfd series can be supported.
Especially, S2MPS11 is designed for high performance
Samsung application processor.

Signed-off-by: Sangbeom Kim sbki...@samsung.com
---
 drivers/mfd/Kconfig  |1 +
 drivers/mfd/sec-core.c   |   10 +
 drivers/mfd/sec-irq.c|  488 --
 include/linux/mfd/samsung/core.h |2 +
 include/linux/mfd/samsung/irq.h  |   47 
 5 files changed, 213 insertions(+), 335 deletions(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 28c134c..447662c 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -473,6 +473,7 @@ config MFD_SEC_CORE
depends on I2C=y  GENERIC_HARDIRQS
select MFD_CORE
select REGMAP_I2C
+   select REGMAP_IRQ
help
 Support for the Samsung Electronics PMIC series.
 This driver provides common support for accessing the device,
diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 5bf33cd..a77c7cb 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -54,6 +54,12 @@ static struct mfd_cell s5m8767_devs[] = {
},
 };
 
+static struct mfd_cell s2mps11_devs[] = {
+   {
+   .name = s2mps11-pmic,
+   },
+};
+
 int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest)
 {
return regmap_read(sec_pmic-regmap, reg, dest);
@@ -145,6 +151,10 @@ static int sec_pmic_probe(struct i2c_client *i2c,
ret = mfd_add_devices(sec_pmic-dev, -1, s5m8767_devs,
ARRAY_SIZE(s5m8767_devs), NULL, 0);
break;
+   case S2MPS11X:
+   ret = mfd_add_devices(sec_pmic-dev, -1, s2mps11_devs,
+   ARRAY_SIZE(s2mps11_devs), NULL, 0);
+   break;
default:
/* If this happens the probe function is problem */
BUG();
diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c
index 370cc4f..dddfbc0 100644
--- a/drivers/mfd/sec-irq.c
+++ b/drivers/mfd/sec-irq.c
@@ -1,7 +1,7 @@
 /*
- * s5m-irq.c
+ * sec-irq.c
  *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd
  *  http://www.samsung.com
  *
  *  This program is free software; you can redistribute  it and/or modify it
@@ -14,350 +14,259 @@
 #include linux/device.h
 #include linux/interrupt.h
 #include linux/irq.h
+#include linux/regmap.h
+
 #include linux/mfd/samsung/core.h
 #include linux/mfd/samsung/irq.h
+#include linux/mfd/samsung/s2mps11.h
 #include linux/mfd/samsung/s5m8763.h
 #include linux/mfd/samsung/s5m8767.h
 
-struct sec_irq_data {
-   int reg;
-   int mask;
+static struct regmap_irq s2mps11_irqs[] = {
+   [S2MPS11_IRQ_PWRONF] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_PWRONF_MASK,
+   },
+   [S2MPS11_IRQ_PWRONR] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_PWRONR_MASK,
+   },
+   [S2MPS11_IRQ_JIGONBF] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_JIGONBF_MASK,
+   },
+   [S2MPS11_IRQ_JIGONBR] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_JIGONBR_MASK,
+   },
+   [S2MPS11_IRQ_ACOKBF] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_ACOKBF_MASK,
+   },
+   [S2MPS11_IRQ_ACOKBR] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_ACOKBR_MASK,
+   },
+   [S2MPS11_IRQ_PWRON1S] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_PWRON1S_MASK,
+   },
+   [S2MPS11_IRQ_MRB] = {
+   .reg_offset = 1,
+   .mask = S2MPS11_IRQ_MRB_MASK,
+   },
+   [S2MPS11_IRQ_RTC60S] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_RTC60S_MASK,
+   },
+   [S2MPS11_IRQ_RTCA1] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_RTCA1_MASK,
+   },
+   [S2MPS11_IRQ_RTCA2] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_RTCA2_MASK,
+   },
+   [S2MPS11_IRQ_SMPL] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_SMPL_MASK,
+   },
+   [S2MPS11_IRQ_RTC1S] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_RTC1S_MASK,
+   },
+   [S2MPS11_IRQ_WTSR] = {
+   .reg_offset = 2,
+   .mask = S2MPS11_IRQ_WTSR_MASK,
+   },
+   [S2MPS11_IRQ_INT120C] = {
+   .reg_offset = 3,
+   .mask = S2MPS11_IRQ_INT120C_MASK,
+   },
+   [S2MPS11_IRQ_INT140C] = {
+   .reg_offset = 3,
+   .mask = S2MPS11_IRQ_INT140C_MASK,
+   },
 };
 
-static struct sec_irq_data s5m8767_irqs[] = {
+static struct regmap_irq s5m8767_irqs

[PATCH V2 7/7] MAINTAINRES: Add maintainer for samsung mfd driver

2012-07-07 Thread Sangbeom Kim
There are many samsung multifunction devices which are
s2mps11, s5m8767, s5m8763 etc.
This devices can support regulator, rtc, charger.
I will be supporting the Samsung mfd drivers, that are currently
in development and will be upstreamed shortly.

Signed-off-by: Sangbeom Kim sbki...@samsung.com
---
 MAINTAINERS |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index eb22272..398f9d4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5866,6 +5866,16 @@ L:   linux-fb...@vger.kernel.org
 S: Maintained
 F: drivers/video/s3c-fb.c
 
+SAMSUNG MULTIFUNCTION DEVICE DRIVERS
+M: Sangbeom Kim sbki...@samsung.com
+L: linux-kernel@vger.kernel.org
+S: Supported
+F: drivers/mfd/sec*.c
+F: drivers/regulator/s2m*.c
+F: drivers/regulator/s5m*.c
+F: drivers/rtc/rtc-sec.c
+F: include/linux/mfd/samsung/
+
 SERIAL DRIVERS
 M: Alan Cox a...@linux.intel.com
 L: linux-ser...@vger.kernel.org
-- 
1.7.5.4


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/