Re: [PATCH] ARM: S3C64XX: Remove un-used code

2011-08-19 Thread Banajit Goswami
Hi Mark,

On Fri, Aug 19, 2011 at 10:23 AM, Mark Brown
broo...@opensource.wolfsonmicro.com wrote:
 On Fri, Aug 19, 2011 at 09:40:29AM +0530, Banajit Goswami wrote:
 On Fri, Aug 19, 2011 at 7:29 AM, Mark Brown
 broo...@opensource.wolfsonmicro.com wrote:
  On Tue, Aug 16, 2011 at 06:11:28PM +0530, Banajit Goswami wrote:
  Remove un-used backlight code for SMDK6410 board

  Is the data actually wrong?  If not it'd seem better to finish hooking
  it up properly than to remove it.

 No, this code is no longer needed, as we are having a common backlight
 infrastructure , which serves the same purpose.

 Ideally your commit log should make this clear - it looks like you're
 just deleting unreferenced code.
Thanks.
Will add more description now on.

Thanks and Regards,
Banajit Goswami
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ARM: S3C64XX: Remove un-used code

2011-08-18 Thread Banajit Goswami
Hi Mark,

On Fri, Aug 19, 2011 at 7:29 AM, Mark Brown
broo...@opensource.wolfsonmicro.com wrote:
 On Tue, Aug 16, 2011 at 06:11:28PM +0530, Banajit Goswami wrote:
 Remove un-used backlight code for SMDK6410 board

 Is the data actually wrong?  If not it'd seem better to finish hooking
 it up properly than to remove it.
No, this code is no longer needed, as we are having a common backlight
infrastructure , which serves the same purpose.

 --
 To unsubscribe from this list: send the line unsubscribe linux-samsung-soc 
 in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html


Thanks and Regards,
Banajit Goswami
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ARM: S3C64XX: Remove un-used code

2011-08-18 Thread Banajit Goswami
Hi Mr. Kim,

On Fri, Aug 19, 2011 at 10:59 AM, Kukjin Kim kgene@samsung.com wrote:
 Mark Brown wrote:

 On Fri, Aug 19, 2011 at 09:40:29AM +0530, Banajit Goswami wrote:
  On Fri, Aug 19, 2011 at 7:29 AM, Mark Brown
  broo...@opensource.wolfsonmicro.com wrote:
   On Tue, Aug 16, 2011 at 06:11:28PM +0530, Banajit Goswami wrote:
   Remove un-used backlight code for SMDK6410 board

   Is the data actually wrong?  If not it'd seem better to finish hooking
   it up properly than to remove it.

  No, this code is no longer needed, as we are having a common backlight
  infrastructure , which serves the same purpose.

 Ideally your commit log should make this clear - it looks like you're
 just deleting unreferenced code.

 Yes, I agree with your opinion...It was difficult to know why it is un-used
 code when I applied that.

Yes, I will explain more in comments in future!

 OK, I will amend its commit log in my tree to clear.
Thank you!


Thanks and Regards,
Banajit Goswami
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ARM: S3C64XX: Remove un-used code

2011-08-16 Thread Banajit Goswami
Remove un-used backlight code for SMDK6410 board

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/mach-s3c64xx/mach-smdk6410.c |   39 -
 1 files changed, 0 insertions(+), 39 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c 
b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index ecbea92..a9f3183 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -262,45 +262,6 @@ static struct samsung_keypad_platdata smdk6410_keypad_data 
__initdata = {
.cols   = 8,
 };
 
-static int smdk6410_backlight_init(struct device *dev)
-{
-   int ret;
-
-   ret = gpio_request(S3C64XX_GPF(15), Backlight);
-   if (ret) {
-   printk(KERN_ERR failed to request GPF for PWM-OUT1\n);
-   return ret;
-   }
-
-   /* Configure GPIO pin with S3C64XX_GPF15_PWM_TOUT1 */
-   s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_SFN(2));
-
-   return 0;
-}
-
-static void smdk6410_backlight_exit(struct device *dev)
-{
-   s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_OUTPUT);
-   gpio_free(S3C64XX_GPF(15));
-}
-
-static struct platform_pwm_backlight_data smdk6410_backlight_data = {
-   .pwm_id = 1,
-   .max_brightness = 255,
-   .dft_brightness = 255,
-   .pwm_period_ns  = 78770,
-   .init   = smdk6410_backlight_init,
-   .exit   = smdk6410_backlight_exit,
-};
-
-static struct platform_device smdk6410_backlight_device = {
-   .name   = pwm-backlight,
-   .dev= {
-   .parent = s3c_device_timer[1].dev,
-   .platform_data  = smdk6410_backlight_data,
-   },
-};
-
 static struct map_desc smdk6410_iodesc[] = {};
 
 static struct platform_device *smdk6410_devices[] __initdata = {
-- 
1.7.2.3

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ARM: SAMSUNG: Consolidate common function to set SDHCI plat data

2011-08-11 Thread Banajit Goswami
Moves similar functions to set SDHCI platform data for all Samsung
boards to a common location, thereby saves a few lines.

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/plat-samsung/dev-hsmmc.c  |   19 +--
 arch/arm/plat-samsung/dev-hsmmc1.c |   19 +--
 arch/arm/plat-samsung/dev-hsmmc2.c |   19 +--
 arch/arm/plat-samsung/dev-hsmmc3.c |   19 +--
 arch/arm/plat-samsung/include/plat/sdhci.h |7 +++
 arch/arm/plat-samsung/platformdata.c   |   22 ++
 6 files changed, 33 insertions(+), 72 deletions(-)

diff --git a/arch/arm/plat-samsung/dev-hsmmc.c 
b/arch/arm/plat-samsung/dev-hsmmc.c
index db7a65c..06825c4 100644
--- a/arch/arm/plat-samsung/dev-hsmmc.c
+++ b/arch/arm/plat-samsung/dev-hsmmc.c
@@ -58,22 +58,5 @@ struct platform_device s3c_device_hsmmc0 = {
 
 void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd)
 {
-   struct s3c_sdhci_platdata *set = s3c_hsmmc0_def_platdata;
-
-   set-cd_type = pd-cd_type;
-   set-ext_cd_init = pd-ext_cd_init;
-   set-ext_cd_cleanup = pd-ext_cd_cleanup;
-   set-ext_cd_gpio = pd-ext_cd_gpio;
-   set-ext_cd_gpio_invert = pd-ext_cd_gpio_invert;
-
-   if (pd-max_width)
-   set-max_width = pd-max_width;
-   if (pd-cfg_gpio)
-   set-cfg_gpio = pd-cfg_gpio;
-   if (pd-cfg_card)
-   set-cfg_card = pd-cfg_card;
-   if (pd-host_caps)
-   set-host_caps |= pd-host_caps;
-   if (pd-clk_type)
-   set-clk_type = pd-clk_type;
+   s3c_sdhci_set_platdata(pd, s3c_hsmmc0_def_platdata);
 }
diff --git a/arch/arm/plat-samsung/dev-hsmmc1.c 
b/arch/arm/plat-samsung/dev-hsmmc1.c
index 2497321..4524ef4 100644
--- a/arch/arm/plat-samsung/dev-hsmmc1.c
+++ b/arch/arm/plat-samsung/dev-hsmmc1.c
@@ -58,22 +58,5 @@ struct platform_device s3c_device_hsmmc1 = {
 
 void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd)
 {
-   struct s3c_sdhci_platdata *set = s3c_hsmmc1_def_platdata;
-
-   set-cd_type = pd-cd_type;
-   set-ext_cd_init = pd-ext_cd_init;
-   set-ext_cd_cleanup = pd-ext_cd_cleanup;
-   set-ext_cd_gpio = pd-ext_cd_gpio;
-   set-ext_cd_gpio_invert = pd-ext_cd_gpio_invert;
-
-   if (pd-max_width)
-   set-max_width = pd-max_width;
-   if (pd-cfg_gpio)
-   set-cfg_gpio = pd-cfg_gpio;
-   if (pd-cfg_card)
-   set-cfg_card = pd-cfg_card;
-   if (pd-host_caps)
-   set-host_caps |= pd-host_caps;
-   if (pd-clk_type)
-   set-clk_type = pd-clk_type;
+   s3c_sdhci_set_platdata(pd, s3c_hsmmc1_def_platdata);
 }
diff --git a/arch/arm/plat-samsung/dev-hsmmc2.c 
b/arch/arm/plat-samsung/dev-hsmmc2.c
index f60aedb..9cede96 100644
--- a/arch/arm/plat-samsung/dev-hsmmc2.c
+++ b/arch/arm/plat-samsung/dev-hsmmc2.c
@@ -59,22 +59,5 @@ struct platform_device s3c_device_hsmmc2 = {
 
 void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
 {
-   struct s3c_sdhci_platdata *set = s3c_hsmmc2_def_platdata;
-
-   set-cd_type = pd-cd_type;
-   set-ext_cd_init = pd-ext_cd_init;
-   set-ext_cd_cleanup = pd-ext_cd_cleanup;
-   set-ext_cd_gpio = pd-ext_cd_gpio;
-   set-ext_cd_gpio_invert = pd-ext_cd_gpio_invert;
-
-   if (pd-max_width)
-   set-max_width = pd-max_width;
-   if (pd-cfg_gpio)
-   set-cfg_gpio = pd-cfg_gpio;
-   if (pd-cfg_card)
-   set-cfg_card = pd-cfg_card;
-   if (pd-host_caps)
-   set-host_caps |= pd-host_caps;
-   if (pd-clk_type)
-   set-clk_type = pd-clk_type;
+   s3c_sdhci_set_platdata(pd, s3c_hsmmc2_def_platdata);
 }
diff --git a/arch/arm/plat-samsung/dev-hsmmc3.c 
b/arch/arm/plat-samsung/dev-hsmmc3.c
index ede776f..0358ef4 100644
--- a/arch/arm/plat-samsung/dev-hsmmc3.c
+++ b/arch/arm/plat-samsung/dev-hsmmc3.c
@@ -62,22 +62,5 @@ struct platform_device s3c_device_hsmmc3 = {
 
 void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd)
 {
-   struct s3c_sdhci_platdata *set = s3c_hsmmc3_def_platdata;
-
-   set-cd_type = pd-cd_type;
-   set-ext_cd_init = pd-ext_cd_init;
-   set-ext_cd_cleanup = pd-ext_cd_cleanup;
-   set-ext_cd_gpio = pd-ext_cd_gpio;
-   set-ext_cd_gpio_invert = pd-ext_cd_gpio_invert;
-
-   if (pd-max_width)
-   set-max_width = pd-max_width;
-   if (pd-cfg_gpio)
-   set-cfg_gpio = pd-cfg_gpio;
-   if (pd-cfg_card)
-   set-cfg_card = pd-cfg_card;
-   if (pd-host_caps)
-   set-host_caps |= pd-host_caps;
-   if (pd-clk_type)
-   set-clk_type = pd-clk_type;
+   s3c_sdhci_set_platdata(pd, s3c_hsmmc3_def_platdata);
 }
diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h 
b/arch/arm/plat-samsung/include/plat/sdhci.h
index 058e096..20dc81c 100644
--- a/arch/arm/plat-samsung/include/plat/sdhci.h
+++ b/arch/arm/plat

Re: [PATCH 0/8] ARM: SAMSUNG: Add common PWM Backlight support

2011-07-27 Thread Banajit Goswami
Hi Dmitry,

On Tue, Jul 26, 2011 at 12:27 PM, Dmitry Eremin-Solenikov
dbarysh...@gmail.com wrote:
 Hello,

 On Fri, 15 Jul 2011 20:12:40 +0530, Banajit Goswami wrote:

 The patches are created against for-next branch of Kukjin Kim's tree
 at:
  git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git

  Patch [1/8]
   -- add a common infrastructure to support PWM backlight for various
      Samsung boards.

 Why can't you use the drivers/video/backlight/pwm-bl.c ?
These patches indeed use the drivers/video/backlight/pwm-bl.c driver (do not
replace it), and provide board specific data from a common place.
The patches are meant to avoid any duplicate code which might be needed
for different Samsung boards.

 --
 With best wishes
 Dmitry

Thanks and Regards,
Banajit
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/7] ARM: SAMSUNG: Code cleanup for various devices

2011-07-19 Thread Banajit Goswami
 Use generic s3c_set_platdata to perform the same job. Saves a few lines
 of code. 
 
 The patches are created against for-next branch of Kukjin Kim's tree at:
 git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git

 These patches are only compile tested.

 o To Kukjin Kim
  PATCH[1/7] ARM: SAMSUNG: Use generic s3c_set_platdata for TS
  PATCH[2/7] ARM: SAMSUNG: Use generic s3c_set_platdata for FB
  PATCH[3/7] ARM: SAMSUNG: Use generic s3c_set_platdata for HWMON
  PATCH[4/7] ARM: SAMSUNG: Use generic s3c_set_platdata for USB OHCI
  PATCH[5/7] ARM: SAMSUNG: Use generic s3c_set_platdata for NAND

 o To Ben Dooks
  PATCH[6/7] ARM: S3C64XX: Use generic s3c_set_platdata for OneNAND
  PATCH[7/7] ARM: S3C24XX: Use generic s3c_set_platdata for devices

 arch/arm/mach-s3c64xx/dev-onenand1.c |   10 +++-
 arch/arm/plat-s3c24xx/devs.c |   38 ++---
 arch/arm/plat-samsung/dev-fb.c   |   14 +--
 arch/arm/plat-samsung/dev-hwmon.c|   14 +--
 arch/arm/plat-samsung/dev-nand.c |9 ++-
 arch/arm/plat-samsung/dev-ts.c   |   14 +--
 arch/arm/plat-samsung/dev-usb.c  |9 +--
 7 files changed, 22 insertions(+), 86 deletions(-)

-- 
1.7.2.3

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/7] ARM: SAMSUNG: Use generic s3c_set_platdata for TS

2011-07-19 Thread Banajit Goswami
Call the generic s3c_set_platdata to set TS platform data

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/plat-samsung/dev-ts.c |   14 ++
 1 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/arch/arm/plat-samsung/dev-ts.c b/arch/arm/plat-samsung/dev-ts.c
index 3e4bd81..82543f0 100644
--- a/arch/arm/plat-samsung/dev-ts.c
+++ b/arch/arm/plat-samsung/dev-ts.c
@@ -45,16 +45,6 @@ struct platform_device s3c_device_ts = {
 
 void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *pd)
 {
-   struct s3c2410_ts_mach_info *npd;
-
-   if (!pd) {
-   printk(KERN_ERR %s: no platform data\n, __func__);
-   return;
-   }
-
-   npd = kmemdup(pd, sizeof(struct s3c2410_ts_mach_info), GFP_KERNEL);
-   if (!npd)
-   printk(KERN_ERR %s: no memory for platform data\n, __func__);
-
-   s3c_device_ts.dev.platform_data = npd;
+   s3c_set_platdata(pd, sizeof(struct s3c2410_ts_mach_info),
+s3c_device_ts);
 }
-- 
1.7.2.3

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/7] ARM: SAMSUNG: Use generic s3c_set_platdata for FB

2011-07-19 Thread Banajit Goswami
Call the generic s3c_set_platdata to set FB platform data

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/plat-samsung/dev-fb.c |   14 ++
 1 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/arch/arm/plat-samsung/dev-fb.c b/arch/arm/plat-samsung/dev-fb.c
index bf60204..49a1362 100644
--- a/arch/arm/plat-samsung/dev-fb.c
+++ b/arch/arm/plat-samsung/dev-fb.c
@@ -58,16 +58,6 @@ struct platform_device s3c_device_fb = {
 
 void __init s3c_fb_set_platdata(struct s3c_fb_platdata *pd)
 {
-   struct s3c_fb_platdata *npd;
-
-   if (!pd) {
-   printk(KERN_ERR %s: no platform data\n, __func__);
-   return;
-   }
-
-   npd = kmemdup(pd, sizeof(struct s3c_fb_platdata), GFP_KERNEL);
-   if (!npd)
-   printk(KERN_ERR %s: no memory for platform data\n, __func__);
-
-   s3c_device_fb.dev.platform_data = npd;
+   s3c_set_platdata(pd, sizeof(struct s3c_fb_platdata),
+s3c_device_fb);
 }
-- 
1.7.2.3

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/7] ARM: SAMSUNG: Use generic s3c_set_platdata for NAND

2011-07-19 Thread Banajit Goswami
Call the generic s3c_set_platdata to set NAND platdata

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/plat-samsung/dev-nand.c |9 +++--
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/arm/plat-samsung/dev-nand.c b/arch/arm/plat-samsung/dev-nand.c
index 6927ae8..b8e30ec 100644
--- a/arch/arm/plat-samsung/dev-nand.c
+++ b/arch/arm/plat-samsung/dev-nand.c
@@ -91,11 +91,10 @@ void __init s3c_nand_set_platdata(struct 
s3c2410_platform_nand *nand)
 * time then there is little chance the system is going to run.
 */ 
 
-   npd = kmemdup(nand, sizeof(struct s3c2410_platform_nand), GFP_KERNEL);
-   if (!npd) {
-   printk(KERN_ERR %s: failed copying platform data\n, __func__);
+   npd = s3c_set_platdata(nand, sizeof(struct s3c2410_platform_nand),
+   s3c_device_nand);
+   if (!npd)
return;
-   }
 
/* now see if we need to copy any of the nand set data */
 
@@ -123,6 +122,4 @@ void __init s3c_nand_set_platdata(struct 
s3c2410_platform_nand *nand)
to++;
}
}
-
-   s3c_device_nand.dev.platform_data = npd;
 }
-- 
1.7.2.3

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/7] ARM: S3C64XX: Use generic s3c_set_platdata for OneNAND

2011-07-19 Thread Banajit Goswami
Call the generic s3c_set_platdata for setting platdata for OneNAND on
S3C64XX

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/mach-s3c64xx/dev-onenand1.c |   10 --
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/dev-onenand1.c 
b/arch/arm/mach-s3c64xx/dev-onenand1.c
index 92ffd5b..999f9e1 100644
--- a/arch/arm/mach-s3c64xx/dev-onenand1.c
+++ b/arch/arm/mach-s3c64xx/dev-onenand1.c
@@ -19,6 +19,8 @@
 #include mach/irqs.h
 #include mach/map.h
 
+#include plat/devs.h
+
 static struct resource s3c64xx_onenand1_resources[] = {
[0] = {
.start  = S3C64XX_PA_ONENAND1,
@@ -46,10 +48,6 @@ struct platform_device s3c64xx_device_onenand1 = {
 
 void s3c64xx_onenand1_set_platdata(struct onenand_platform_data *pdata)
 {
-   struct onenand_platform_data *pd;
-
-   pd = kmemdup(pdata, sizeof(struct onenand_platform_data), GFP_KERNEL);
-   if (!pd)
-   printk(KERN_ERR %s: no memory for platform data\n, __func__);
-   s3c64xx_device_onenand1.dev.platform_data = pd;
+   s3c_set_platdata(pdata, sizeof(struct onenand_platform_data),
+s3c64xx_device_onenand1);
 }
-- 
1.7.2.3

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 7/7] ARM: S3C24XX: Use generic s3c_set_platdata for devices

2011-07-19 Thread Banajit Goswami
Call the generic s3c_set_platdata for various set_platdata functions
of S3C24XX

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/plat-s3c24xx/devs.c |   38 +++---
 1 files changed, 7 insertions(+), 31 deletions(-)

diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c
index 7366799..a76bf2d 100644
--- a/arch/arm/plat-s3c24xx/devs.c
+++ b/arch/arm/plat-s3c24xx/devs.c
@@ -150,9 +150,8 @@ void __init s3c24xx_fb_set_platdata(struct 
s3c2410fb_mach_info *pd)
 {
struct s3c2410fb_mach_info *npd;
 
-   npd = kmemdup(pd, sizeof(*npd), GFP_KERNEL);
+   npd = s3c_set_platdata(pd, sizeof(*npd), s3c_device_lcd);
if (npd) {
-   s3c_device_lcd.dev.platform_data = npd;
npd-displays = kmemdup(pd-displays,
sizeof(struct s3c2410fb_display) * npd-num_displays,
GFP_KERNEL);
@@ -188,12 +187,10 @@ struct platform_device s3c_device_ts = {
 };
 EXPORT_SYMBOL(s3c_device_ts);
 
-static struct s3c2410_ts_mach_info s3c2410ts_info;
-
 void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info 
*hard_s3c2410ts_info)
 {
-   memcpy(s3c2410ts_info, hard_s3c2410ts_info, sizeof(struct 
s3c2410_ts_mach_info));
-   s3c_device_ts.dev.platform_data = s3c2410ts_info;
+   s3c_set_platdata(hard_s3c2410ts_info,
+sizeof(struct s3c2410_ts_mach_info), s3c_device_ts);
 }
 
 /* USB Device (Gadget)*/
@@ -223,15 +220,7 @@ EXPORT_SYMBOL(s3c_device_usbgadget);
 
 void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd)
 {
-   struct s3c2410_udc_mach_info *npd;
-
-   npd = kmalloc(sizeof(*npd), GFP_KERNEL);
-   if (npd) {
-   memcpy(npd, pd, sizeof(*npd));
-   s3c_device_usbgadget.dev.platform_data = npd;
-   } else {
-   printk(KERN_ERR no memory for udc platform data\n);
-   }
+   s3c_set_platdata(pd, sizeof(*pd), s3c_device_usbgadget);
 }
 
 /* USB High Speed 2.0 Device (Gadget) */
@@ -263,15 +252,7 @@ struct platform_device s3c_device_usb_hsudc = {
 
 void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd)
 {
-   struct s3c24xx_hsudc_platdata *npd;
-
-   npd = kmalloc(sizeof(*npd), GFP_KERNEL);
-   if (npd) {
-   memcpy(npd, pd, sizeof(*npd));
-   s3c_device_usb_hsudc.dev.platform_data = npd;
-   } else {
-   printk(KERN_ERR no memory for udc platform data\n);
-   }
+   s3c_set_platdata(pd, sizeof(*pd), s3c_device_usb_hsudc);
 }
 
 /* IIS */
@@ -383,13 +364,8 @@ EXPORT_SYMBOL(s3c_device_sdi);
 
 void __init s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata)
 {
-   struct s3c24xx_mci_pdata *npd;
-
-   npd = kmemdup(pdata, sizeof(struct s3c24xx_mci_pdata), GFP_KERNEL);
-   if (!npd)
-   printk(KERN_ERR %s: no memory to copy pdata, __func__);
-
-   s3c_device_sdi.dev.platform_data = npd;
+   s3c_set_platdata(pdata, sizeof(struct s3c24xx_mci_pdata),
+s3c_device_sdi);
 }
 
 
-- 
1.7.2.3

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/8] ARM: SAMSUNG: Add common PWM Backlight support

2011-07-15 Thread Banajit Goswami
 The patches are created against for-next branch of Kukjin Kim's tree at:
 git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git

 Patch [1/8]
  -- add a common infrastructure to support PWM backlight for various 
 Samsung boards.

 Patch [2/8]
  -- Add support for PWM backlight for SMDKV310 board.

 Patch [3/8]
  -- Add support for PWM backlight for SMDKC210 board.

 Patch [4/8]
  -- Add support for PWM backlight for SMDKV210 board.

 Patch [5/8]
  -- Add support for PWM backlight for SMDKC100 board.

 Patch [6/8]
  -- Add support for PWM backlight for SMDK6440 board.

Patch [7/8]
  -- Add support for PWM backlight for SMDK6450 board.

 Patch [8/8]
  -- Add support for PWM backlight for SMDK6410 board.

 Patch 3 with PWM Backlight support for SMDKC210 is only compile tested.

   [Patch 1/8] ARM: SAMSUNG: Create a common infrastructure for PWM backlight 
support
   [Patch 2/8] ARM: EXYNOS4: Add PWM backlight support on Samsung SMDKV310 board
   [Patch 3/8] ARM: EXYNOS4: Add PWM backlight support on Samsung SMDKC210 board
   [Patch 4/8] ARM: S5PV210: Add PWM backlight support on Samsung SMDKV210 board
   [Patch 5/8] ARM: S5PC100: Add PWM backlight support on Samsung SMDKC100 board
   [Patch 6/8] ARM: S5P64X0: Add PWM backlight support on Samsung SMDK6440 board
   [Patch 7/8] ARM: S5P64X0: Add PWM backlight support on Samsung SMDK6450 board
   [Patch 8/8] ARM: S3C64XX: Add PWM backlight support on Samsung SMDK6410 board

 arch/arm/mach-exynos4/Kconfig  |4 +
 arch/arm/mach-exynos4/mach-smdkc210.c  |   16 +++
 arch/arm/mach-exynos4/mach-smdkv310.c  |   16 +++
 arch/arm/mach-s3c64xx/Kconfig  |1 +
 arch/arm/mach-s3c64xx/mach-smdk6410.c  |   15 ++-
 arch/arm/mach-s5p64x0/Kconfig  |2 +
 arch/arm/mach-s5p64x0/mach-smdk6440.c  |   54 ++---
 arch/arm/mach-s5p64x0/mach-smdk6450.c  |   54 ++---
 arch/arm/mach-s5pc100/Kconfig  |1 +
 arch/arm/mach-s5pc100/mach-smdkc100.c  |   55 ++---
 arch/arm/mach-s5pv210/Kconfig  |1 +
 arch/arm/mach-s5pv210/mach-smdkv210.c  |   54 ++---
 arch/arm/plat-samsung/Kconfig  |6 +
 arch/arm/plat-samsung/Makefile |1 +
 arch/arm/plat-samsung/dev-backlight.c  |  151 
 arch/arm/plat-samsung/include/plat/backlight.h |   26 
 16 files changed, 291 insertions(+), 166 deletions(-)
 create mode 100644 arch/arm/plat-samsung/dev-backlight.c
 create mode 100644 arch/arm/plat-samsung/include/plat/backlight.h

-- 
1.7.2.3

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/8] ARM: SAMSUNG: Create a common infrastructure for PWM backlight support

2011-07-15 Thread Banajit Goswami
This patch creates a common structure for LCD backlight
using PWM timer to be used by various Samsung boards.

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/plat-samsung/Kconfig  |6 +
 arch/arm/plat-samsung/Makefile |1 +
 arch/arm/plat-samsung/dev-backlight.c  |  151 
 arch/arm/plat-samsung/include/plat/backlight.h |   26 
 4 files changed, 184 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-samsung/dev-backlight.c
 create mode 100644 arch/arm/plat-samsung/include/plat/backlight.h

diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 4d79519..b3e1065 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -280,6 +280,12 @@ config SAMSUNG_DEV_PWM
help
  Compile in platform device definition for PWM Timer
 
+config SAMSUNG_DEV_BACKLIGHT
+   bool
+   depends on SAMSUNG_DEV_PWM
+   help
+ Compile in platform device definition LCD backlight with PWM Timer
+
 config S3C24XX_PWM
bool PWM device support
select HAVE_PWM
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
index 53eb15b..853764b 100644
--- a/arch/arm/plat-samsung/Makefile
+++ b/arch/arm/plat-samsung/Makefile
@@ -59,6 +59,7 @@ obj-$(CONFIG_SAMSUNG_DEV_IDE) += dev-ide.o
 obj-$(CONFIG_SAMSUNG_DEV_TS)   += dev-ts.o
 obj-$(CONFIG_SAMSUNG_DEV_KEYPAD)   += dev-keypad.o
 obj-$(CONFIG_SAMSUNG_DEV_PWM)  += dev-pwm.o
+obj-$(CONFIG_SAMSUNG_DEV_BACKLIGHT)+= dev-backlight.o
 
 # DMA support
 
diff --git a/arch/arm/plat-samsung/dev-backlight.c 
b/arch/arm/plat-samsung/dev-backlight.c
new file mode 100644
index 000..f960d1f
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-backlight.c
@@ -0,0 +1,151 @@
+/* linux/arch/arm/plat-samsung/dev-backlight.c
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd.
+ *  http://www.samsung.com
+ *
+ * Common infrastructure for PWM Backlight for Samsung boards
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include linux/gpio.h
+#include linux/platform_device.h
+#include linux/io.h
+#include linux/pwm_backlight.h
+
+#include plat/devs.h
+#include plat/gpio-cfg.h
+#include plat/backlight.h
+
+static int samsung_bl_init(struct device *dev)
+{
+   int ret = 0;
+   struct platform_device *timer_dev =
+   container_of(dev-parent, struct platform_device, dev);
+   struct samsung_bl_gpio_info *bl_gpio_info =
+   timer_dev-dev.platform_data;
+
+   ret = gpio_request(bl_gpio_info-no, Backlight);
+   if (ret) {
+   printk(KERN_ERR failed to request GPIO for LCD Backlight\n);
+   return ret;
+   }
+
+   /* Configure GPIO pin with specific GPIO function for PWM timer */
+   s3c_gpio_cfgpin(bl_gpio_info-no, bl_gpio_info-func);
+
+   return 0;
+}
+
+static void samsung_bl_exit(struct device *dev)
+{
+   struct platform_device *timer_dev =
+   container_of(dev-parent, struct platform_device, dev);
+   struct samsung_bl_gpio_info *bl_gpio_info =
+   timer_dev-dev.platform_data;
+
+   s3c_gpio_cfgpin(bl_gpio_info-no, S3C_GPIO_OUTPUT);
+   gpio_free(bl_gpio_info-no);
+}
+
+/* Initialize few important fields of platform_pwm_backlight_data
+ * structure with default values. These fields can be overridden by
+ * board-specific values sent from machine file.
+ * For ease of operation, these fields are initialized with values
+ * used by most samsung boards.
+ * Users has the option of sending info about other parameters
+ * for their specific boards
+ */
+
+static struct platform_pwm_backlight_data samsung_dfl_bl_data __initdata = {
+   .max_brightness = 255,
+   .dft_brightness = 255,
+   .pwm_period_ns  = 78770,
+   .init   = samsung_bl_init,
+   .exit   = samsung_bl_exit,
+};
+
+static struct platform_device samsung_dfl_bl_device __initdata = {
+   .name   = pwm-backlight,
+};
+
+/* samsung_bl_set - Set board specific data (if any) provided by user for
+ * PWM Backlight control and register specific PWM and backlight device.
+ * @gpio_info: structure containing GPIO info for PWM timer
+ * @bl_data:   structure containing Backlight control data
+ */
+void samsung_bl_set(struct samsung_bl_gpio_info *gpio_info,
+   struct platform_pwm_backlight_data *bl_data)
+{
+   int ret = 0;
+   struct platform_device *samsung_bl_device;
+   struct platform_pwm_backlight_data *samsung_bl_data;
+
+   samsung_bl_device = kmemdup(samsung_dfl_bl_device,
+   sizeof(struct platform_device), GFP_KERNEL);
+   if (!samsung_bl_device) {
+   printk(KERN_ERR %s: no memory for platform dev\n, __func__

[PATCH 2/8] ARM: EXYNOS4: Add PWM backlight support on Samsung SMDKV310 board

2011-07-15 Thread Banajit Goswami
This patch adds support for LCD backlight using PWM timer for
Samsung SMDKV310 board.

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/mach-exynos4/Kconfig |2 ++
 arch/arm/mach-exynos4/mach-smdkv310.c |   16 
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig
index 5115b90..e27f044 100644
--- a/arch/arm/mach-exynos4/Kconfig
+++ b/arch/arm/mach-exynos4/Kconfig
@@ -128,8 +128,10 @@ config MACH_SMDKV310
select S3C_DEV_HSMMC2
select S3C_DEV_HSMMC3
select EXYNOS4_DEV_AHCI
+   select SAMSUNG_DEV_BACKLIGHT
select SAMSUNG_DEV_KEYPAD
select EXYNOS4_DEV_PD
+   select SAMSUNG_DEV_PWM
select EXYNOS4_DEV_SYSMMU
select EXYNOS4_SETUP_I2C1
select EXYNOS4_SETUP_KEYPAD
diff --git a/arch/arm/mach-exynos4/mach-smdkv310.c 
b/arch/arm/mach-exynos4/mach-smdkv310.c
index be16236..e85d646 100644
--- a/arch/arm/mach-exynos4/mach-smdkv310.c
+++ b/arch/arm/mach-exynos4/mach-smdkv310.c
@@ -16,6 +16,7 @@
 #include linux/io.h
 #include linux/i2c.h
 #include linux/input.h
+#include linux/pwm_backlight.h
 
 #include asm/mach/arch.h
 #include asm/mach-types.h
@@ -29,6 +30,8 @@
 #include plat/sdhci.h
 #include plat/iic.h
 #include plat/pd.h
+#include plat/gpio-cfg.h
+#include plat/backlight.h
 
 #include mach/map.h
 
@@ -210,6 +213,17 @@ static void __init smdkv310_smsc911x_init(void)
 (0x1  S5P_SROM_BCX__TACS__SHIFT), S5P_SROM_BC1);
 }
 
+/* LCD Backlight data */
+static struct samsung_bl_gpio_info smdkv310_bl_gpio_info = {
+   .no = EXYNOS4_GPD0(1),
+   .func = S3C_GPIO_SFN(2),
+};
+
+static struct platform_pwm_backlight_data smdkv310_bl_data = {
+   .pwm_id = 1,
+   .pwm_period_ns  = 1000,
+};
+
 static void __init smdkv310_map_io(void)
 {
s5p_init_io(NULL, 0, S5P_VA_CHIPID);
@@ -231,6 +245,8 @@ static void __init smdkv310_machine_init(void)
 
samsung_keypad_set_platdata(smdkv310_keypad_data);
 
+   samsung_bl_set(smdkv310_bl_gpio_info, smdkv310_bl_data);
+
platform_add_devices(smdkv310_devices, ARRAY_SIZE(smdkv310_devices));
 }
 
-- 
1.7.2.3

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/8] ARM: S5PV210: Add PWM backlight support on Samsung SMDKV210 board

2011-07-15 Thread Banajit Goswami
This patch adds support for LCD backlight using PWM timer for
Samsung SMDKV210 board.

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/mach-s5pv210/Kconfig |1 +
 arch/arm/mach-s5pv210/mach-smdkv210.c |   54 -
 2 files changed, 14 insertions(+), 41 deletions(-)

diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 37b5a97..79bb3a0 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -134,6 +134,7 @@ config MACH_SMDKV210
select S3C_DEV_RTC
select S3C_DEV_WDT
select SAMSUNG_DEV_ADC
+   select SAMSUNG_DEV_BACKLIGHT
select SAMSUNG_DEV_IDE
select SAMSUNG_DEV_KEYPAD
select SAMSUNG_DEV_PWM
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c 
b/arch/arm/mach-s5pv210/mach-smdkv210.c
index c6a9e86..c4d9b7d 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -45,6 +45,7 @@
 #include plat/pm.h
 #include plat/fb.h
 #include plat/s5p-time.h
+#include plat/backlight.h
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define SMDKV210_UCON_DEFAULT  (S3C2410_UCON_TXILEVEL |\
@@ -210,45 +211,6 @@ static struct s3c_fb_platdata smdkv210_lcd0_pdata 
__initdata = {
.setup_gpio = s5pv210_fb_gpio_setup_24bpp,
 };
 
-static int smdkv210_backlight_init(struct device *dev)
-{
-   int ret;
-
-   ret = gpio_request(S5PV210_GPD0(3), Backlight);
-   if (ret) {
-   printk(KERN_ERR failed to request GPD for PWM-OUT 3\n);
-   return ret;
-   }
-
-   /* Configure GPIO pin with S5PV210_GPD_0_3_TOUT_3 */
-   s3c_gpio_cfgpin(S5PV210_GPD0(3), S3C_GPIO_SFN(2));
-
-   return 0;
-}
-
-static void smdkv210_backlight_exit(struct device *dev)
-{
-   s3c_gpio_cfgpin(S5PV210_GPD0(3), S3C_GPIO_OUTPUT);
-   gpio_free(S5PV210_GPD0(3));
-}
-
-static struct platform_pwm_backlight_data smdkv210_backlight_data = {
-   .pwm_id = 3,
-   .max_brightness = 255,
-   .dft_brightness = 255,
-   .pwm_period_ns  = 78770,
-   .init   = smdkv210_backlight_init,
-   .exit   = smdkv210_backlight_exit,
-};
-
-static struct platform_device smdkv210_backlight_device = {
-   .name   = pwm-backlight,
-   .dev= {
-   .parent = s3c_device_timer[3].dev,
-   .platform_data  = smdkv210_backlight_data,
-   },
-};
-
 static struct platform_device *smdkv210_devices[] __initdata = {
s3c_device_adc,
s3c_device_cfcon,
@@ -270,8 +232,6 @@ static struct platform_device *smdkv210_devices[] 
__initdata = {
samsung_device_keypad,
smdkv210_dm9000,
smdkv210_lcd_lte480wv,
-   s3c_device_timer[3],
-   smdkv210_backlight_device,
 };
 
 static void __init smdkv210_dm9000_init(void)
@@ -310,6 +270,16 @@ static struct s3c2410_ts_mach_info s3c_ts_platform 
__initdata = {
.oversampling_shift = 2,
 };
 
+/* LCD Backlight data */
+static struct samsung_bl_gpio_info smdkv210_bl_gpio_info = {
+   .no = S5PV210_GPD0(3),
+   .func = S3C_GPIO_SFN(2),
+};
+
+static struct platform_pwm_backlight_data smdkv210_bl_data = {
+   .pwm_id = 3,
+};
+
 static void __init smdkv210_map_io(void)
 {
s5p_init_io(NULL, 0, S5P_VA_CHIPID);
@@ -341,6 +311,8 @@ static void __init smdkv210_machine_init(void)
 
s3c_fb_set_platdata(smdkv210_lcd0_pdata);
 
+   samsung_bl_set(smdkv210_bl_gpio_info, smdkv210_bl_data);
+
platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices));
 }
 
-- 
1.7.2.3

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 8/8] ARM: S3C64XX: Add PWM backlight support on Samsung SMDK6410 board

2011-07-15 Thread Banajit Goswami
This patch adds support for LCD backlight using PWM timer for
Samsung SMDK6410 board.

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/mach-s3c64xx/Kconfig |1 +
 arch/arm/mach-s3c64xx/mach-smdk6410.c |   15 +--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index 4e2c371..f057b6a 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -142,6 +142,7 @@ config MACH_SMDK6410
select S3C_DEV_USB_HOST
select S3C_DEV_USB_HSOTG
select S3C_DEV_WDT
+   select SAMSUNG_DEV_BACKLIGHT
select SAMSUNG_DEV_KEYPAD
select SAMSUNG_DEV_PWM
select HAVE_S3C2410_WATCHDOG if WATCHDOG
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c 
b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index e0521e0..2aa28a2 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -71,6 +71,7 @@
 #include plat/adc.h
 #include plat/ts.h
 #include plat/keypad.h
+#include plat/backlight.h
 
 #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
@@ -329,8 +330,6 @@ static struct platform_device *smdk6410_devices[] 
__initdata = {
s3c_device_rtc,
s3c_device_ts,
s3c_device_wdt,
-   s3c_device_timer[1],
-   smdk6410_backlight_device,
 };
 
 #ifdef CONFIG_REGULATOR
@@ -665,6 +664,16 @@ static struct s3c2410_ts_mach_info s3c_ts_platform 
__initdata = {
.oversampling_shift = 2,
 };
 
+/* LCD Backlight data */
+static struct samsung_bl_gpio_info smdk6410_bl_gpio_info = {
+   .no = S3C64XX_GPF(15),
+   .func = S3C_GPIO_SFN(2),
+};
+
+static struct platform_pwm_backlight_data smdk6410_bl_data = {
+   .pwm_id = 1,
+};
+
 static void __init smdk6410_map_io(void)
 {
u32 tmp;
@@ -726,6 +735,8 @@ static void __init smdk6410_machine_init(void)
 
s3c_ide_set_platdata(smdk6410_ide_pdata);
 
+   samsung_bl_set(smdk6410_bl_gpio_info, smdk6410_bl_data);
+
platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices));
 }
 
-- 
1.7.2.3

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ARM: EXYNOS4: Add PWM backlight support on Samsung SMDKV310

2011-06-23 Thread Banajit Goswami
 From: JinGoo Han jg1@samsung.com

 Hi, Banajit.
Hi Jingoo,


 Signed-off-by: Banajit Goswami banaji...@samsung.com
 ---
...
snip
...
 +     .pwm_period_ns  = 78770,
 Please use 1000 as pwm_period_ns instead of 78770 as follows:
 -       .pwm_period_ns  = 78770,
 +       .pwm_period_ns  = 1000,

Yes, I will modify the period value and send updated patch

 The value '78770' makes noise related to resonance at LCD board.

 I will explain how I get the value of PWM period.

 The SMDK boards use LT3591 as backlight LED driver of LTE480WV LCD
 According to the LT3591 datasheet, the switching frequency should
 be 1MHz. So, PWM period is calculated by following formula:
        PWM period = 1/switching frequency
                       = 1/1MHz
                       = 1000 ns

Thanks for the explanation.

 You can find LT3591 datasheet easily on the Internet. Please refer to it
 for more information.
 Good luck.
Thanks you.

 +     .init           = smdkv310_backlight_init,
...
snip
...


Regards,
Banajit
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ARM: EXYNOS4: Add PWM backlight support on Samsung SMDKV310

2011-06-23 Thread Banajit Goswami
On Thu, Jun 23, 2011 at 5:14 PM, Kukjin Kim kgene@samsung.com wrote:
 Banajit Goswami wrote:

  From: JinGoo Han jg1@samsung.com
 
  Hi, Banajit.
 Hi Jingoo,

 Hi all,
Hello,

 Hmm...
 If the same code is required into each boards, please don't add them on both.

 I think, we can avoid duplication...
Yes, I have already started working on it.
I can send it by tomorrow.

 Thanks.

 Best regards,
 Kgene.

Thanks,
Banajit
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC][PATCH 3/5] ARM: SAMSUNG: Adding IO mapping for OTG PHY.

2011-06-21 Thread Banajit Goswami
Hi Praveen,

On Tue, Jun 21, 2011 at 12:33 PM, p.pan...@samsung.com wrote:

 From: Praveen Paneri p.pan...@samsung.com

 Adding virtual addresses for OTG PHY.

 Signed-off-by: Praveen Paneri p.pan...@samsung.com
 ---
  arch/arm/mach-s5p64x0/cpu.c |    5 +
  1 files changed, 5 insertions(+), 0 deletions(-)

 diff --git a/arch/arm/mach-s5p64x0/cpu.c b/arch/arm/mach-s5p64x0/cpu.c
 index a5c0095..8dc6f20 100644
 --- a/arch/arm/mach-s5p64x0/cpu.c
 +++ b/arch/arm/mach-s5p64x0/cpu.c
 @@ -57,6 +57,11 @@ static struct map_desc s5p64x0_iodesc[] __initdata = {
                .pfn            = __phys_to_pfn(S5P64X0_PA_VIC1),
                .length         = SZ_16K,
                .type           = MT_DEVICE,
 +       }, {
 +               .virtual        = (unsigned long)S3C_VA_USB_HSPHY,
 +               .pfn            = __phys_to_pfn(S5P64X0_PA_USB_HSPHY),
 +               .length         = SZ_1M,

Do we really need 1M for this??

 +               .type           = MT_DEVICE,
        },
  };

 --
 1.7.0.4


 ___
 linux-arm-kernel mailing list
 linux-arm-ker...@lists.infradead.org
 http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH V2 5/6] ARM: SAMSUNG: Add PWM backlight support on Samsung S5PC100

2011-03-01 Thread Banajit Goswami
This patch adds support for LCD backlight using PWM timer for
Samsung SMDKC100 board.

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
Changes since v1:
- Used common GPIO macro
- Removed redundant timers

 arch/arm/mach-s5pc100/Kconfig |1 +
 arch/arm/mach-s5pc100/mach-smdkc100.c |   49 ++---
 2 files changed, 45 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index b8fbf2f..608722f 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -58,6 +58,7 @@ config MACH_SMDKC100
select SAMSUNG_DEV_ADC
select SAMSUNG_DEV_IDE
select SAMSUNG_DEV_KEYPAD
+   select SAMSUNG_DEV_PWM
select SAMSUNG_DEV_TS
select S5PC100_SETUP_FB_24BPP
select S5PC100_SETUP_I2C1
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c 
b/arch/arm/mach-s5pc100/mach-smdkc100.c
index dd192a2..22d5348 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -23,12 +23,15 @@
 #include linux/fb.h
 #include linux/delay.h
 #include linux/input.h
+#include linux/pwm_backlight.h
 
 #include asm/mach/arch.h
 #include asm/mach/map.h
 
 #include mach/map.h
 #include mach/regs-fb.h
+#include mach/regs-gpio.h
+
 #include video/platform_lcd.h
 
 #include asm/irq.h
@@ -107,9 +110,6 @@ static struct i2c_board_info i2c_devs1[] __initdata = {
 static void smdkc100_lcd_power_set(struct plat_lcd_data *pd,
   unsigned int power)
 {
-   /* backlight */
-   gpio_direction_output(S5PC100_GPD(0), power);
-
if (power) {
/* module reset */
gpio_direction_output(S5PC100_GPH0(6), 1);
@@ -178,6 +178,45 @@ static struct samsung_keypad_platdata smdkc100_keypad_data 
__initdata = {
.rows   = 2,
.cols   = 8,
 };
+
+static int smdkc100_backlight_init(struct device *dev)
+{
+   int ret;
+
+   ret = gpio_request(S5PC100_GPD(0), Backlight);
+   if (ret) {
+   printk(KERN_ERR failed to request GPF for PWM-OUT0\n);
+   return ret;
+   }
+
+   /* Configure GPIO pin with S5PC100_GPD_TOUT_0 */
+   s3c_gpio_cfgpin(S5PC100_GPD(0), S3C_GPIO_SFN(2));
+
+   return 0;
+}
+
+static void smdkc100_backlight_exit(struct device *dev)
+{
+   s3c_gpio_cfgpin(S5PC100_GPD(0), S3C_GPIO_OUTPUT);
+   gpio_free(S5PC100_GPD(0));
+}
+
+static struct platform_pwm_backlight_data smdkc100_backlight_data = {
+   .pwm_id = 0,
+   .max_brightness = 255,
+   .dft_brightness = 255,
+   .pwm_period_ns  = 78770,
+   .init   = smdkc100_backlight_init,
+   .exit   = smdkc100_backlight_exit,
+};
+
+static struct platform_device smdkc100_backlight_device = {
+   .name   = pwm-backlight,
+   .dev= {
+   .parent = s3c_device_timer[0].dev,
+   .platform_data  = smdkc100_backlight_data,
+   },
+};
 
 static struct platform_device *smdkc100_devices[] __initdata = {
s3c_device_adc,
@@ -200,6 +238,8 @@ static struct platform_device *smdkc100_devices[] 
__initdata = {
s5p_device_fimc1,
s5p_device_fimc2,
s5pc100_device_spdif,
+   s3c_device_timer[0],
+   smdkc100_backlight_device,
 };
 
 static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
@@ -233,7 +274,6 @@ static void __init smdkc100_machine_init(void)
s5pc100_spdif_setup_gpio(S5PC100_SPDIF_GPD);
 
/* LCD init */
-   gpio_request(S5PC100_GPD(0), GPD);
gpio_request(S5PC100_GPH0(6), GPH0);
smdkc100_lcd_power_set(smdkc100_lcd_power_data, 0);
platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices));
-- 
1.6.5.2

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH V2 4/6] ARM: SAMSUNG: Add PWM backlight support on Samsung S5P6450

2011-03-01 Thread Banajit Goswami
This patch adds support for LCD backlight control using PWM timer
for Samsung SMDK6450 board.

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
Changes since v1:
- Used common GPIO macro
- Removed redundant timers

 arch/arm/mach-s5p64x0/Kconfig |1 +
 arch/arm/mach-s5p64x0/mach-smdk6450.c |   43 +
 2 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig
index be5888a..08b0a5b 100644
--- a/arch/arm/mach-s5p64x0/Kconfig
+++ b/arch/arm/mach-s5p64x0/Kconfig
@@ -48,6 +48,7 @@ config MACH_SMDK6450
select S3C_DEV_WDT
select S3C64XX_DEV_SPI
select SAMSUNG_DEV_ADC
+   select SAMSUNG_DEV_PWM
select SAMSUNG_DEV_TS
select S5P64X0_SETUP_I2C1
help
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c 
b/arch/arm/mach-s5p64x0/mach-smdk6450.c
index 3a20de0..296cc0f 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6450.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c
@@ -22,6 +22,7 @@
 #include linux/module.h
 #include linux/clk.h
 #include linux/gpio.h
+#include linux/pwm_backlight.h
 
 #include asm/mach/arch.h
 #include asm/mach/map.h
@@ -32,6 +33,7 @@
 #include mach/map.h
 #include mach/regs-clock.h
 #include mach/i2c.h
+#include mach/regs-gpio.h
 
 #include plat/regs-serial.h
 #include plat/gpio-cfg.h
@@ -106,6 +108,45 @@ static struct s3c2410_uartcfg smdk6450_uartcfgs[] 
__initdata = {
 #endif
 };
 
+static int smdk6450_backlight_init(struct device *dev)
+{
+   int ret;
+
+   ret = gpio_request(S5P6450_GPF(15), Backlight);
+   if (ret) {
+   printk(KERN_ERR failed to request GPF for PWM-OUT1\n);
+   return ret;
+   }
+
+   /* Configure GPIO pin with S5P6450_GPF15_PWM_TOUT1 */
+   s3c_gpio_cfgpin(S5P6450_GPF(15), S3C_GPIO_SFN(2));
+
+   return 0;
+}
+
+static void smdk6450_backlight_exit(struct device *dev)
+{
+   s3c_gpio_cfgpin(S5P6450_GPF(15), S3C_GPIO_OUTPUT);
+   gpio_free(S5P6450_GPF(15));
+}
+
+static struct platform_pwm_backlight_data smdk6450_backlight_data = {
+   .pwm_id = 1,
+   .max_brightness = 255,
+   .dft_brightness = 255,
+   .pwm_period_ns  = 78770,
+   .init   = smdk6450_backlight_init,
+   .exit   = smdk6450_backlight_exit,
+};
+
+static struct platform_device smdk6450_backlight_device = {
+   .name   = pwm-backlight,
+   .dev= {
+   .parent = s3c_device_timer[1].dev,
+   .platform_data  = smdk6450_backlight_data,
+   },
+};
+
 static struct platform_device *smdk6450_devices[] __initdata = {
s3c_device_adc,
s3c_device_rtc,
@@ -115,6 +156,8 @@ static struct platform_device *smdk6450_devices[] 
__initdata = {
s3c_device_wdt,
samsung_asoc_dma,
s5p6450_device_iis0,
+   s3c_device_timer[1],
+   smdk6450_backlight_device,
/* s5p6450_device_spi0 will be added */
 };
 
-- 
1.6.5.2

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH V2 6/6] ARM: SAMSUNG: Add PWM backlight support on Samsung S5PV210

2011-03-01 Thread Banajit Goswami
This patch adds support for LCD backlight control using PWM timer
for Samsung's SMDKV210 board.

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
Changes since v1:
- Used common GPIO macro
- Removed redundant timers

 arch/arm/mach-s5pv210/Kconfig |1 +
 arch/arm/mach-s5pv210/mach-smdkv210.c |   43 +
 2 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 53aabef..d7fd031 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -130,6 +130,7 @@ config MACH_SMDKV210
select SAMSUNG_DEV_ADC
select SAMSUNG_DEV_IDE
select SAMSUNG_DEV_KEYPAD
+   select SAMSUNG_DEV_PWM
select SAMSUNG_DEV_TS
select S5PV210_SETUP_FB_24BPP
select S5PV210_SETUP_I2C1
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c 
b/arch/arm/mach-s5pv210/mach-smdkv210.c
index bc9fdb5..8833e7b 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -18,6 +18,7 @@
 #include linux/fb.h
 #include linux/gpio.h
 #include linux/delay.h
+#include linux/pwm_backlight.h
 
 #include asm/mach/arch.h
 #include asm/mach/map.h
@@ -43,6 +44,7 @@
 #include plat/keypad.h
 #include plat/pm.h
 #include plat/fb.h
+#include plat/gpio-cfg.h
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define SMDKV210_UCON_DEFAULT  (S3C2410_UCON_TXILEVEL |\
@@ -208,6 +210,45 @@ static struct s3c_fb_platdata smdkv210_lcd0_pdata 
__initdata = {
.setup_gpio = s5pv210_fb_gpio_setup_24bpp,
 };
 
+static int smdkv210_backlight_init(struct device *dev)
+{
+   int ret;
+
+   ret = gpio_request(S5PV210_GPD0(3), Backlight);
+   if (ret) {
+   printk(KERN_ERR failed to request GPD for PWM-OUT 3\n);
+   return ret;
+   }
+
+   /* Configure GPIO pin with S5PV210_GPD_0_3_TOUT_3 */
+   s3c_gpio_cfgpin(S5PV210_GPD0(3), S3C_GPIO_SFN(2));
+
+   return 0;
+}
+
+static void smdkv210_backlight_exit(struct device *dev)
+{
+   s3c_gpio_cfgpin(S5PV210_GPD0(3), S3C_GPIO_OUTPUT);
+   gpio_free(S5PV210_GPD0(3));
+}
+
+static struct platform_pwm_backlight_data smdkv210_backlight_data = {
+   .pwm_id = 3,
+   .max_brightness = 255,
+   .dft_brightness = 255,
+   .pwm_period_ns  = 78770,
+   .init   = smdkv210_backlight_init,
+   .exit   = smdkv210_backlight_exit,
+};
+
+static struct platform_device smdkv210_backlight_device = {
+   .name   = pwm-backlight,
+   .dev= {
+   .parent = s3c_device_timer[3].dev,
+   .platform_data  = smdkv210_backlight_data,
+   },
+};
+
 static struct platform_device *smdkv210_devices[] __initdata = {
s3c_device_adc,
s3c_device_cfcon,
@@ -229,6 +270,8 @@ static struct platform_device *smdkv210_devices[] 
__initdata = {
samsung_device_keypad,
smdkv210_dm9000,
smdkv210_lcd_lte480wv,
+   s3c_device_timer[3],
+   smdkv210_backlight_device,
 };
 
 static void __init smdkv210_dm9000_init(void)
-- 
1.6.5.2

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH V2 3/6] ARM: SAMSUNG: Add PWM backlight support on Samsung S5P6440

2011-03-01 Thread Banajit Goswami
This patch adds support for LCD backlight control using PWM timer
for Samsung SMDK6440 board.

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
Changes since v1:
- Used common GPIO macro
- Removed redundant timers

 arch/arm/mach-s5p64x0/Kconfig |1 +
 arch/arm/mach-s5p64x0/mach-smdk6440.c |   43 +
 2 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig
index 164d278..be5888a 100644
--- a/arch/arm/mach-s5p64x0/Kconfig
+++ b/arch/arm/mach-s5p64x0/Kconfig
@@ -34,6 +34,7 @@ config MACH_SMDK6440
select S3C_DEV_WDT
select S3C64XX_DEV_SPI
select SAMSUNG_DEV_ADC
+   select SAMSUNG_DEV_PWM
select SAMSUNG_DEV_TS
select S5P64X0_SETUP_I2C1
help
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c 
b/arch/arm/mach-s5p64x0/mach-smdk6440.c
index e5beb84..58941d7 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6440.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c
@@ -22,6 +22,7 @@
 #include linux/module.h
 #include linux/clk.h
 #include linux/gpio.h
+#include linux/pwm_backlight.h
 
 #include asm/mach/arch.h
 #include asm/mach/map.h
@@ -32,6 +33,7 @@
 #include mach/map.h
 #include mach/regs-clock.h
 #include mach/i2c.h
+#include mach/regs-gpio.h
 
 #include plat/regs-serial.h
 #include plat/gpio-cfg.h
@@ -88,6 +90,45 @@ static struct s3c2410_uartcfg smdk6440_uartcfgs[] __initdata 
= {
},
 };
 
+static int smdk6440_backlight_init(struct device *dev)
+{
+   int ret;
+
+   ret = gpio_request(S5P6440_GPF(15), Backlight);
+   if (ret) {
+   printk(KERN_ERR failed to request GPF for PWM-OUT1\n);
+   return ret;
+   }
+
+   /* Configure GPIO pin with S5P6440_GPF15_PWM_TOUT1 */
+   s3c_gpio_cfgpin(S5P6440_GPF(15), S3C_GPIO_SFN(2));
+
+   return 0;
+}
+
+static void smdk6440_backlight_exit(struct device *dev)
+{
+   s3c_gpio_cfgpin(S5P6440_GPF(15), S3C_GPIO_OUTPUT);
+   gpio_free(S5P6440_GPF(15));
+}
+
+static struct platform_pwm_backlight_data smdk6440_backlight_data = {
+   .pwm_id = 1,
+   .max_brightness = 255,
+   .dft_brightness = 255,
+   .pwm_period_ns  = 78770,
+   .init   = smdk6440_backlight_init,
+   .exit   = smdk6440_backlight_exit,
+};
+
+static struct platform_device smdk6440_backlight_device = {
+   .name   = pwm-backlight,
+   .dev= {
+   .parent = s3c_device_timer[1].dev,
+   .platform_data  = smdk6440_backlight_data,
+   },
+};
+
 static struct platform_device *smdk6440_devices[] __initdata = {
s3c_device_adc,
s3c_device_rtc,
@@ -97,6 +138,8 @@ static struct platform_device *smdk6440_devices[] __initdata 
= {
s3c_device_wdt,
samsung_asoc_dma,
s5p6440_device_iis,
+   s3c_device_timer[1],
+   smdk6440_backlight_device,
 };
 
 static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = {
-- 
1.6.5.2

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ARM: S5P64X0: Modify number of GPIO lines in Bank F

2011-02-25 Thread Banajit Goswami
This patch modifies the number of total GPIO lines for Bank F
for Samsung S5P6440 and S5P6450 SoCs from 2 to 16.
This is necessary as the GPIO lines from 0 to 13 are reserved
and only lines 14 and 15 are used. As during initialization,
the line number starts at 0, putting 2 does not solve the
intended purpose.

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/mach-s5p64x0/include/mach/gpio.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-s5p64x0/include/mach/gpio.h 
b/arch/arm/mach-s5p64x0/include/mach/gpio.h
index 5486c8f..adb5f29 100644
--- a/arch/arm/mach-s5p64x0/include/mach/gpio.h
+++ b/arch/arm/mach-s5p64x0/include/mach/gpio.h
@@ -23,7 +23,7 @@
 #define S5P6440_GPIO_A_NR  (6)
 #define S5P6440_GPIO_B_NR  (7)
 #define S5P6440_GPIO_C_NR  (8)
-#define S5P6440_GPIO_F_NR  (2)
+#define S5P6440_GPIO_F_NR  (16)
 #define S5P6440_GPIO_G_NR  (7)
 #define S5P6440_GPIO_H_NR  (10)
 #define S5P6440_GPIO_I_NR  (16)
@@ -36,7 +36,7 @@
 #define S5P6450_GPIO_B_NR  (7)
 #define S5P6450_GPIO_C_NR  (8)
 #define S5P6450_GPIO_D_NR  (8)
-#define S5P6450_GPIO_F_NR  (2)
+#define S5P6450_GPIO_F_NR  (16)
 #define S5P6450_GPIO_G_NR  (14)
 #define S5P6450_GPIO_H_NR  (10)
 #define S5P6450_GPIO_I_NR  (16)
-- 
1.6.5.2

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/6] ARM: SAMSUNG: Add support PWM backlight

2011-02-25 Thread Banajit Goswami
This patch adds support PWM backlight for S5P SoCs.

1. Move PWM timer code from plat-s3c24xx to plat-samsung for common useability
2. Add PWM backlight support for SMDK6410/6440/6450/C100 and SMDKV210

Note: The modification of GPIO F for S5P64X0 patch should be merged first as
there is a dependency for PWM on S5P64X0.

[PATCH 1/6] ARM: SAMSUNG: Move PWM device definition from plat-s3c24xx to 
plat-samsung
[PATCH 2/6] ARM: S3C64XX: Add PWM backlight support on SMDK6410
[PATCH 3/6] ARM: S5P64X0: Add PWM backlight support on SMDK6440
[PATCH 4/6] ARM: S5P64X0: Add PWM backlight support on SMDK6450
[PATCH 5/6] ARM: S5PC100: Add PWM backlight support on SMDKC100
[PATCH 6/6] ARM: S5PV210: Add PWM backlight support on SMDKV210
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/6] ARM: S5PC100: Add PWM backlight support on SMDKC100

2011-02-25 Thread Banajit Goswami
This patch adds support for LCD backlight using PWM timer for
Samsung SMDKC100 board.

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/mach-s5pc100/Kconfig |1 +
 arch/arm/mach-s5pc100/mach-smdkc100.c |   48 ++---
 2 files changed, 45 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index b8fbf2f..608722f 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -58,6 +58,7 @@ config MACH_SMDKC100
select SAMSUNG_DEV_ADC
select SAMSUNG_DEV_IDE
select SAMSUNG_DEV_KEYPAD
+   select SAMSUNG_DEV_PWM
select SAMSUNG_DEV_TS
select S5PC100_SETUP_FB_24BPP
select S5PC100_SETUP_I2C1
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c 
b/arch/arm/mach-s5pc100/mach-smdkc100.c
index dd192a2..22d5348 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -23,12 +23,15 @@
 #include linux/fb.h
 #include linux/delay.h
 #include linux/input.h
+#include linux/pwm_backlight.h
 
 #include asm/mach/arch.h
 #include asm/mach/map.h
 
 #include mach/map.h
 #include mach/regs-fb.h
+#include mach/regs-gpio.h
+
 #include video/platform_lcd.h
 
 #include asm/irq.h
@@ -107,9 +110,6 @@ static struct i2c_board_info i2c_devs1[] __initdata = {
 static void smdkc100_lcd_power_set(struct plat_lcd_data *pd,
   unsigned int power)
 {
-   /* backlight */
-   gpio_direction_output(S5PC100_GPD(0), power);
-
if (power) {
/* module reset */
gpio_direction_output(S5PC100_GPH0(6), 1);
@@ -178,6 +178,44 @@ static struct samsung_keypad_platdata smdkc100_keypad_data 
__initdata = {
.rows   = 2,
.cols   = 8,
 };
+
+static int smdkc100_backlight_init(struct device *dev)
+{
+   int ret;
+
+   ret = gpio_request(S5PC100_GPD(0), Backlight);
+   if (ret) {
+   printk(KERN_ERR failed to request GPF for PWM-OUT0\n);
+   return ret;
+   }
+
+   /* Configure GPIO pin with S5PC100_GPD_TOUT_0 */
+   s3c_gpio_cfgpin(S5PC100_GPD(0), (0x2  0));
+
+   return 0;
+}
+
+static void smdkc100_backlight_exit(struct device *dev)
+{
+   s3c_gpio_cfgpin(S5PC100_GPD(0), S3C_GPIO_OUTPUT);
+   gpio_free(S5PC100_GPD(0));
+}
+
+static struct platform_pwm_backlight_data smdkc100_backlight_data = {
+   .pwm_id = 0,
+   .max_brightness = 255,
+   .dft_brightness = 255,
+   .pwm_period_ns  = 78770,
+   .init   = smdkc100_backlight_init,
+   .exit   = smdkc100_backlight_exit,
+};
+
+static struct platform_device smdkc100_backlight_device = {
+   .name   = pwm-backlight,
+   .dev= {
+   .parent = s3c_device_timer[0].dev,
+   .platform_data  = smdkc100_backlight_data,
+   },
+};
 
 static struct platform_device *smdkc100_devices[] __initdata = {
s3c_device_adc,
@@ -200,6 +238,9 @@ static struct platform_device *smdkc100_devices[] 
__initdata = {
s5p_device_fimc1,
s5p_device_fimc2,
s5pc100_device_spdif,
+   s3c_device_timer[0],
+   s3c_device_timer[1],
+   smdkc100_backlight_device,
 };
 
 static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
@@ -233,7 +274,6 @@ static void __init smdkc100_machine_init(void)
s5pc100_spdif_setup_gpio(S5PC100_SPDIF_GPD);
 
/* LCD init */
-   gpio_request(S5PC100_GPD(0), GPD);
gpio_request(S5PC100_GPH0(6), GPH0);
smdkc100_lcd_power_set(smdkc100_lcd_power_data, 0);
platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices));
-- 
1.6.5.2

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/6] ARM: S5P64X0: Add PWM backlight support on SMDK6440

2011-02-25 Thread Banajit Goswami
This patch adds support for LCD backlight control using PWM timer
for Samsung SMDK6440 board.

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/mach-s5p64x0/Kconfig |1 +
 arch/arm/mach-s5p64x0/mach-smdk6440.c |   44 +
 2 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig
index 164d278..be5888a 100644
--- a/arch/arm/mach-s5p64x0/Kconfig
+++ b/arch/arm/mach-s5p64x0/Kconfig
@@ -34,6 +34,7 @@ config MACH_SMDK6440
select S3C_DEV_WDT
select S3C64XX_DEV_SPI
select SAMSUNG_DEV_ADC
+   select SAMSUNG_DEV_PWM
select SAMSUNG_DEV_TS
select S5P64X0_SETUP_I2C1
help
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c 
b/arch/arm/mach-s5p64x0/mach-smdk6440.c
index e5beb84..58941d7 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6440.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c
@@ -22,6 +22,7 @@
 #include linux/module.h
 #include linux/clk.h
 #include linux/gpio.h
+#include linux/pwm_backlight.h
 
 #include asm/mach/arch.h
 #include asm/mach/map.h
@@ -32,6 +33,7 @@
 #include mach/map.h
 #include mach/regs-clock.h
 #include mach/i2c.h
+#include mach/regs-gpio.h
 
 #include plat/regs-serial.h
 #include plat/gpio-cfg.h
@@ -88,6 +90,45 @@ static struct s3c2410_uartcfg smdk6440_uartcfgs[] __initdata 
= {
},
 };
 
+static int smdk6440_backlight_init(struct device *dev)
+{
+   int ret;
+
+   ret = gpio_request(S5P6440_GPF(15), Backlight);
+   if (ret) {
+   printk(KERN_ERR failed to request GPF for PWM-OUT1\n);
+   return ret;
+   }
+
+   /* Configure GPIO pin with S5P6440_GPF15_PWM_TOUT1 */
+   s3c_gpio_cfgpin(S5P6440_GPF(15), (0x02  30));
+
+   return 0;
+}
+
+static void smdk6440_backlight_exit(struct device *dev)
+{
+   s3c_gpio_cfgpin(S5P6440_GPF(15), S3C_GPIO_OUTPUT);
+   gpio_free(S5P6440_GPF(15));
+}
+
+static struct platform_pwm_backlight_data smdk6440_backlight_data = {
+   .pwm_id = 1,
+   .max_brightness = 255,
+   .dft_brightness = 255,
+   .pwm_period_ns  = 78770,
+   .init   = smdk6440_backlight_init,
+   .exit   = smdk6440_backlight_exit,
+};
+
+static struct platform_device smdk6440_backlight_device = {
+   .name   = pwm-backlight,
+   .dev= {
+   .parent = s3c_device_timer[1].dev,
+   .platform_data  = smdk6440_backlight_data,
+   },
+};
+
 static struct platform_device *smdk6440_devices[] __initdata = {
s3c_device_adc,
s3c_device_rtc,
@@ -97,6 +138,9 @@ static struct platform_device *smdk6440_devices[] __initdata 
= {
s3c_device_wdt,
samsung_asoc_dma,
s5p6440_device_iis,
+   s3c_device_timer[0],
+   s3c_device_timer[1],
+   smdk6440_backlight_device,
 };
 
 static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = {
-- 
1.6.5.2

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/6] ARM: S3C64XX: Add PWM backlight support on SMDK6410

2011-02-25 Thread Banajit Goswami
This patch adds support for LCD backlight using PWM timer for
Samsung SMDK6410 board.

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/mach-s3c64xx/Kconfig |1 +
 arch/arm/mach-s3c64xx/mach-smdk6410.c |   46 ++--
 2 files changed, 44 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index f3a953f..e4177e2 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -143,6 +143,7 @@ config MACH_SMDK6410
select S3C_DEV_USB_HSOTG
select S3C_DEV_WDT
select SAMSUNG_DEV_KEYPAD
+   select SAMSUNG_DEV_PWM
select HAVE_S3C2410_WATCHDOG if WATCHDOG
select S3C64XX_SETUP_SDHCI
select S3C64XX_SETUP_I2C1
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c 
b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index e85192a..4a3fe0c 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -28,6 +28,7 @@
 #include linux/delay.h
 #include linux/smsc911x.h
 #include linux/regulator/fixed.h
+#include linux/pwm_backlight.h
 
 #ifdef CONFIG_SMDK6410_WM1190_EV1
 #include linux/mfd/wm8350/core.h
@@ -48,6 +49,7 @@
 #include mach/hardware.h
 #include mach/regs-fb.h
 #include mach/map.h
+#include mach/gpio-bank-f.h
 
 #include asm/irq.h
 #include asm/mach-types.h
@@ -118,7 +120,6 @@ static void smdk6410_lcd_power_set(struct plat_lcd_data *pd,
 {
if (power) {
gpio_direction_output(S3C64XX_GPF(13), 1);
-   gpio_direction_output(S3C64XX_GPF(15), 1);
 
/* fire nRESET on power up */
gpio_direction_output(S3C64XX_GPN(5), 0);
@@ -126,7 +127,6 @@ static void smdk6410_lcd_power_set(struct plat_lcd_data *pd,
gpio_direction_output(S3C64XX_GPN(5), 1);
msleep(1);
} else {
-   gpio_direction_output(S3C64XX_GPF(15), 0);
gpio_direction_output(S3C64XX_GPF(13), 0);
}
 }
@@ -269,6 +269,45 @@ static struct samsung_keypad_platdata smdk6410_keypad_data 
__initdata = {
.cols   = 8,
 };
 
+static int smdk6410_backlight_init(struct device *dev)
+{
+   int ret;
+
+   ret = gpio_request(S3C64XX_GPF(15), Backlight);
+   if (ret) {
+   printk(KERN_ERR failed to request GPF for PWM-OUT1\n);
+   return ret;
+   }
+
+   /* Configure GPIO pin with S3C64XX_GPF15_PWM_TOUT1 */
+   s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C64XX_GPF15_PWM_TOUT1);
+
+   return 0;
+}
+
+static void smdk6410_backlight_exit(struct device *dev)
+{
+   s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_OUTPUT);
+   gpio_free(S3C64XX_GPF(15));
+}
+
+static struct platform_pwm_backlight_data smdk6410_backlight_data = {
+   .pwm_id = 1,
+   .max_brightness = 255,
+   .dft_brightness = 255,
+   .pwm_period_ns  = 78770,
+   .init   = smdk6410_backlight_init,
+   .exit   = smdk6410_backlight_exit,
+};
+
+static struct platform_device smdk6410_backlight_device = {
+   .name   = pwm-backlight,
+   .dev= {
+   .parent = s3c_device_timer[1].dev,
+   .platform_data  = smdk6410_backlight_data,
+   },
+};
+
 static struct map_desc smdk6410_iodesc[] = {};
 
 static struct platform_device *smdk6410_devices[] __initdata = {
@@ -298,6 +337,9 @@ static struct platform_device *smdk6410_devices[] 
__initdata = {
s3c_device_rtc,
s3c_device_ts,
s3c_device_wdt,
+   s3c_device_timer[0],
+   s3c_device_timer[1],
+   smdk6410_backlight_device,
 };
 
 #ifdef CONFIG_REGULATOR
@@ -693,7 +735,6 @@ static void __init smdk6410_machine_init(void)
 
gpio_request(S3C64XX_GPN(5), LCD power);
gpio_request(S3C64XX_GPF(13), LCD power);
-   gpio_request(S3C64XX_GPF(15), LCD power);
 
i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
-- 
1.6.5.2

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/6] ARM: SAMSUNG: Move PWM device definition from plat-s3c24xx to plat-samsung

2011-02-25 Thread Banajit Goswami
This patch does the following:
1. It moves file pwm.c from plat-s3c24xx to plat-samsung. This will
   enable all machines with Samsung SoCs to make use of the same code.
2. The device definitions have been separated to a new file dev-pwm.c
   for better clarity and structure.
3. It will enable all Samsung S3C and S5P series SoC's to use common
   PWM Kconfig definition.

Signed-off-by: Banajit Goswami banaji...@samsung.com
---
 arch/arm/mach-s3c64xx/Kconfig   |4 +-
 arch/arm/plat-s3c24xx/Kconfig   |7 -
 arch/arm/plat-samsung/Kconfig   |   13 +
 arch/arm/plat-samsung/Makefile  |1 +
 arch/arm/plat-samsung/dev-pwm.c |   52 +++
 arch/arm/plat-samsung/pwm.c |   33 
 6 files changed, 68 insertions(+), 42 deletions(-)
 create mode 100644 arch/arm/plat-samsung/dev-pwm.c

diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index 579d2f0..f3a953f 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -231,7 +231,7 @@ config MACH_HMT
select S3C_DEV_NAND
select S3C_DEV_USB_HOST
select S3C64XX_SETUP_FB_24BPP
-   select HAVE_PWM
+   select SAMSUNG_DEV_PWM
help
  Machine support for the Airgoo HMT
 
@@ -249,8 +249,8 @@ config MACH_SMARTQ
select S3C64XX_SETUP_SDHCI
select S3C64XX_SETUP_FB_24BPP
select SAMSUNG_DEV_ADC
+   select SAMSUNG_DEV_PWM
select SAMSUNG_DEV_TS
-   select HAVE_PWM
help
Shared machine support for SmartQ 5/7
 
diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
index eb105e6..d9c4096 100644
--- a/arch/arm/plat-s3c24xx/Kconfig
+++ b/arch/arm/plat-s3c24xx/Kconfig
@@ -56,13 +56,6 @@ config S3C24XX_DCLK
help
  Clock code for supporting DCLK/CLKOUT on S3C24XX architectures
 
-config S3C24XX_PWM
-   bool PWM device support
-   select HAVE_PWM
-   help
- Support for exporting the PWM timer blocks via the pwm device
- system.
-
 # gpio configurations
 
 config S3C24XX_GPIO_EXTRA
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 32be05c..184a85a 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -273,6 +273,19 @@ config SAMSUNG_DEV_KEYPAD
help
  Compile in platform device definitions for keypad
 
+config SAMSUNG_DEV_PWM
+   bool
+   default y if ARCH_S3C2410
+   help
+ Compile in platform device definition for PWM Timer
+
+config S3C24XX_PWM
+   bool PWM device support
+   select HAVE_PWM
+   help
+ Support for exporting the PWM timer blocks via the pwm device
+ system.
+
 # DMA
 
 config S3C_DMA
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
index 29932f8..e9de58a 100644
--- a/arch/arm/plat-samsung/Makefile
+++ b/arch/arm/plat-samsung/Makefile
@@ -59,6 +59,7 @@ obj-$(CONFIG_SAMSUNG_DEV_ADC) += dev-adc.o
 obj-$(CONFIG_SAMSUNG_DEV_IDE)  += dev-ide.o
 obj-$(CONFIG_SAMSUNG_DEV_TS)   += dev-ts.o
 obj-$(CONFIG_SAMSUNG_DEV_KEYPAD)   += dev-keypad.o
+obj-$(CONFIG_SAMSUNG_DEV_PWM)  += dev-pwm.o
 
 # DMA support
 
diff --git a/arch/arm/plat-samsung/dev-pwm.c b/arch/arm/plat-samsung/dev-pwm.c
new file mode 100644
index 000..68c5986
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-pwm.c
@@ -0,0 +1,53 @@
+/* linux/arch/arm/plat-samsung/dev-pwm.c
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * Copyright (c) 2007 Ben Dooks
+ * Copyright (c) 2008 Simtec Electronics
+ * Ben Dooks b...@simtec.co.uk, ben-li...@fluff.org
+ *
+ * S3C series device definition for the PWM timer
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include linux/kernel.h
+#include linux/platform_device.h
+
+#include mach/irqs.h
+
+#include plat/devs.h
+
+#define TIMER_RESOURCE_SIZE (1)
+
+#define TIMER_RESOURCE(_tmr, _irq) \
+   (struct resource [TIMER_RESOURCE_SIZE]) {   \
+   [0] = { \
+   .start  = _irq, \
+   .end= _irq, \
+   .flags  = IORESOURCE_IRQ\
+   }   \
+   }
+
+#define DEFINE_S3C_TIMER(_tmr_no, _irq)\
+   .name   = s3c24xx-pwm,\
+   .id = _tmr_no,  \
+   .num_resources  = TIMER_RESOURCE_SIZE,  \
+   .resource   = TIMER_RESOURCE(_tmr_no, _irq),\
+
+/*
+ * since we already have an static mapping for the timer,
+ * we do not bother setting any IO resource for the base.
+ */
+
+struct platform_device s3c_device_timer[] = {
+   [0