Re: [PATCH v2 2/2] regulator: add device tree support for max8997

2012-01-12 Thread Thomas Abraham
Dear Mr. Ham,

On 12 January 2012 15:19, MyungJoo Ham myungjoo@samsung.com wrote:
 On Thu, Jan 12, 2012 at 4:35 PM, Thomas Abraham
 thomas.abra...@linaro.org wrote:
 Add device tree based discovery support for max8997.

 Cc: MyungJoo Ham myungjoo@samsung.com
 Cc: Rajendra Nayak rna...@ti.com
 Cc: Rob Herring rob.herr...@calxeda.com
 Cc: Grant Likely grant.lik...@secretlab.ca
 Signed-off-by: Thomas Abraham thomas.abra...@linaro.org
 ---
  .../devicetree/bindings/regulator/max8997-pmic.txt |  120 
  drivers/mfd/max8997.c                              |   72 ++-
  drivers/regulator/max8997.c                        |  143 
 +++-
  include/linux/mfd/max8997.h                        |    1 +
  4 files changed, 334 insertions(+), 2 deletions(-)
  create mode 100644 
 Documentation/devicetree/bindings/regulator/max8997-pmic.txt

 diff --git a/Documentation/devicetree/bindings/regulator/max8997-pmic.txt 
 b/Documentation/devicetree/bindings/regulator/max8997-pmic.txt
 new file mode 100644
 index 000..0c4559d
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/regulator/max8997-pmic.txt
 @@ -0,0 +1,120 @@
 +* Maxim MAX8997 Voltage and Current Regulator
 +
 +The Maxim MAX8997 is a multi-function device which includes volatage and
 +current regulators, rtc, charger controller and other sub-blocks. It is
 +interfaced to the host controller using a i2c interface. Each sub-block is
 +addressed by the host system using different i2c slave address. This 
 document
 +describes the bindings for 'pmic' sub-block of max8997.
 +
 +Required properties:
 +- compatible: Should be maxim,max8997-pmic.
 +- reg: Specifies the i2c slave address of the pmic block. It should be 0x66.
 +
 +Optional properties:
 +- interrupt-parent: Specifies the phandle of the interrupt controller to 
 which
 +  the interrupts from max8997 are delivered to.
 +- interrupts: Interrupt specifiers for two interrupt sources.
 +  - First interrupt specifier is for 'irq1' interrupt.
 +  - Second interrupt specifier is for 'alert' interrupt.
 +- max8997,pmic-buck1-uses-gpio-dvs: 'buck1' can be controlled by gpio dvs.
 +- max8997,pmic-buck2-uses-gpio-dvs: 'buck2' can be controlled by gpio dvs.
 +- max8997,pmic-buck5-uses-gpio-dvs: 'buck5' can be controlled by gpio dvs.
 +
 +Additional properties required if either of the optional properties are 
 used:
 +- max8997,pmic-ignore-gpiodvs-side-effect: When GPIO-DVS mode is used for
 +  multiple bucks, changing the voltage value of one of the bucks may affect
 +  that of another buck, which is the side effect of the change 
 (set_voltage).
 +  Use this property to ignore such side effects and change the voltage.
 +
 +- max8997,pmic-buck125-default-dvs-idx: Default voltage setting selected 
 from
 +  the possible 8 options selectable by the dvs gpios. The value of this
 +  property should be between 0 and 7. If not specified or if out of range, 
 the
 +  default value of this property is set to 0.
 +
 +- max8997,pmic-buck125-dvs-gpios: GPIO specifiers for three host gpio's used
 +  for dvs. The format of the gpio specifier depends in the gpio controller.
 +
 +- max8997,pmic-buck1-dvs-voltage: A set of 8 voltage values in micro-volt 
 (uV)
 +  units for buck1 when changing voltage using gpio dvs.
 +
 +- max8997,pmic-buck2-dvs-voltage: A set of 8 voltage values in micro-volt 
 (uV)
 +  units for buck2 when changing voltage using gpio dvs.
 +
 +- max8997,pmic-buck5-dvs-voltage: A set of 8 voltage values in micro-volt 
 (uV)
 +  units for buck5 when changing voltage using gpio dvs.
 +

 These three values are _not_ optional.

 If they are omitted and at least one of buck1/2/5 is supplying
 critical power to the system, which they do in Exynos boards, system
 will not boot properly.

 In order to work properly, at least the first element of each array
 should have a proper value (preferrably the maximum safety voltage if
 this gpio-dvs feature is not used) if others are filled with zeros.

 If GPIO-DVS mode is enabled, all the 8 elements of each array should
 be filled with proper values.

Thanks for this information. I was not aware of that. I assumed that
if GPIO DVS is not used for BUCK 1/2/5, then there is no need to
supply the DVS voltage options. I will modify this accordingly.



 []
 diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c
 index d26e864..053d0b7 100644
 --- a/drivers/regulator/max8997.c
 +++ b/drivers/regulator/max8997.c
 []
 @@ -32,6 +33,7 @@
  struct max8997_data {
        struct device *dev;
 @@ -958,6 +960,138 @@ static struct regulator_desc regulators[] = {
        },
  };

 +#if CONFIG_OF

 #ifdef?

Yes, I will fix this.


 []
 +static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev,
 +                                       struct max8997_platform_data *pdata)
 +{
 []
 +       if (pdata-buck1_gpiodvs) {
 +               if (of_property_read_u32_array(pmic_np,
 +                               

[PATCH] arm: Fix missing api-change from subsys_interface change

2012-01-12 Thread Heiko Stübner
Commit 4a858cfc9a (arm: convert sysdev_class to a regular subsystem)
converted the samsung sysdevs into subsys_interface instances.

While the original add-function only had a (struct sys_device *)
parameter, the dev_add from subsys_interface needs
(struct device *, struct subsys_interface *)
leading to initialized from incompatible pointer type warnings.

Signed-off-by: Heiko Stuebner he...@sntech.de
---
The patch applies cleanly against the current driver-core git,
hopefully it's the right tree.

 arch/arm/mach-exynos/pm.c|2 +-
 arch/arm/mach-s3c2410/cpu-freq.c |8 +---
 arch/arm/mach-s3c2410/dma.c  |5 +++--
 arch/arm/mach-s3c2410/pll.c  |2 +-
 arch/arm/mach-s3c2410/pm.c   |2 +-
 arch/arm/mach-s3c2412/cpu-freq.c |3 ++-
 arch/arm/mach-s3c2412/dma.c  |3 ++-
 arch/arm/mach-s3c2412/irq.c  |2 +-
 arch/arm/mach-s3c2412/pm.c   |2 +-
 arch/arm/mach-s3c2416/irq.c  |3 ++-
 arch/arm/mach-s3c2416/pm.c   |2 +-
 arch/arm/mach-s3c2440/clock.c|2 +-
 arch/arm/mach-s3c2440/dma.c  |3 ++-
 arch/arm/mach-s3c2440/irq.c  |2 +-
 arch/arm/mach-s3c2440/s3c2440-cpufreq.c  |3 ++-
 arch/arm/mach-s3c2440/s3c2440-pll-1200.c |2 +-
 arch/arm/mach-s3c2440/s3c2440-pll-16934400.c |3 ++-
 arch/arm/mach-s3c2440/s3c2442.c  |2 +-
 arch/arm/mach-s3c2440/s3c244x-clock.c|2 +-
 arch/arm/mach-s3c2440/s3c244x-irq.c  |2 +-
 arch/arm/mach-s3c2443/dma.c  |3 ++-
 arch/arm/mach-s3c2443/irq.c  |3 ++-
 arch/arm/mach-s5p64x0/pm.c   |2 +-
 arch/arm/mach-s5pv210/pm.c   |2 +-
 24 files changed, 38 insertions(+), 27 deletions(-)

diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index a4f61a4..21beb91 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -206,7 +206,7 @@ static void exynos4_pm_prepare(void)
 
 }
 
-static int exynos4_pm_add(struct device *dev)
+static int exynos4_pm_add(struct device *dev, struct subsys_interface *sif)
 {
pm_cpu_prep = exynos4_pm_prepare;
pm_cpu_sleep = exynos4_cpu_suspend;
diff --git a/arch/arm/mach-s3c2410/cpu-freq.c b/arch/arm/mach-s3c2410/cpu-freq.c
index 7dc6c46..5404535 100644
--- a/arch/arm/mach-s3c2410/cpu-freq.c
+++ b/arch/arm/mach-s3c2410/cpu-freq.c
@@ -115,7 +115,8 @@ static struct s3c_cpufreq_info s3c2410_cpufreq_info = {
.debug_io_show  = s3c_cpufreq_debugfs_call(s3c2410_iotiming_debugfs),
 };
 
-static int s3c2410_cpufreq_add(struct device *dev)
+static int s3c2410_cpufreq_add(struct device *dev,
+  struct subsys_interface *sif)
 {
return s3c_cpufreq_register(s3c2410_cpufreq_info);
 }
@@ -133,7 +134,8 @@ static int __init s3c2410_cpufreq_init(void)
 
 arch_initcall(s3c2410_cpufreq_init);
 
-static int s3c2410a_cpufreq_add(struct device *dev)
+static int s3c2410a_cpufreq_add(struct device *dev,
+   struct subsys_interface *sif)
 {
/* alter the maximum freq settings for S3C2410A. If a board knows
 * it only has a maximum of 200, then it should register its own
@@ -144,7 +146,7 @@ static int s3c2410a_cpufreq_add(struct device *dev)
s3c2410_cpufreq_info.max.pclk =  6650;
s3c2410_cpufreq_info.name = s3c2410a;
 
-   return s3c2410_cpufreq_add(dev);
+   return s3c2410_cpufreq_add(dev, sif);
 }
 
 static struct subsys_interface s3c2410a_cpufreq_interface = {
diff --git a/arch/arm/mach-s3c2410/dma.c b/arch/arm/mach-s3c2410/dma.c
index 2afd000..4803338 100644
--- a/arch/arm/mach-s3c2410/dma.c
+++ b/arch/arm/mach-s3c2410/dma.c
@@ -132,7 +132,8 @@ static struct s3c24xx_dma_order __initdata 
s3c2410_dma_order = {
},
 };
 
-static int __init s3c2410_dma_add(struct device *dev)
+static int __init s3c2410_dma_add(struct device *dev,
+ struct subsys_interface *sif)
 {
s3c2410_dma_init();
s3c24xx_dma_order_set(s3c2410_dma_order);
@@ -148,7 +149,7 @@ static struct subsys_interface s3c2410_dma_interface = {
 
 static int __init s3c2410_dma_drvinit(void)
 {
-   return subsys_interface_register(s3c2410_interface);
+   return subsys_interface_register(s3c2410_dma_interface);
 }
 
 arch_initcall(s3c2410_dma_drvinit);
diff --git a/arch/arm/mach-s3c2410/pll.c b/arch/arm/mach-s3c2410/pll.c
index c07438b..e0b3b34 100644
--- a/arch/arm/mach-s3c2410/pll.c
+++ b/arch/arm/mach-s3c2410/pll.c
@@ -66,7 +66,7 @@ static struct cpufreq_frequency_table pll_vals_12MHz[] = {
 { .frequency = 27000, .index = PLLVAL(127, 1, 1),  },
 };
 
-static int s3c2410_plls_add(struct device *dev)
+static int s3c2410_plls_add(struct device *dev, struct subsys_interface *sif)
 {
return 

[PATCH 0/5] S3C24XX: unclutter clock init, mostly for S3C2443

2012-01-12 Thread Heiko Stübner
This series tries to unclutter the clock init of S3C2443 and onward a bit.
Most clock-information can be read via generic code and doesn't need
special code for reading the raste of the h and p clock.

I'm not 100% sure on the sanity of the fifth patch, which removes the
plat-s3c24xx/clock.c, as it duplicates a little bit of code into the
s3c2412 machine directory but would remove another nearly meaningless
file from plat-s3c24xx.

This series applies cleanly against current linux-next.

Heiko Stuebner (5):
  S3C2443/S3C2416: remove XXX_setup_clocks methods
  S3C2443/S3C2416: add get_rate for clk_h
  S3C2443/S3C2416: add get_rate for clk_p
  S3C2443/S3C2416: remove call to s3c24xx_setup_clocks
  S3C24XX: remove plat-s3c24xx/clock.c

 arch/arm/mach-s3c2412/clock.c  |1 +
 arch/arm/mach-s3c2412/s3c2412.c|7 ++-
 arch/arm/mach-s3c2416/clock.c  |6 --
 arch/arm/mach-s3c2443/clock.c  |7 ---
 arch/arm/plat-s3c24xx/Makefile |1 -
 arch/arm/plat-s3c24xx/clock.c  |   59 
 arch/arm/plat-s3c24xx/s3c2410-clock.c  |   15 ++
 arch/arm/plat-s3c24xx/s3c2443-clock.c  |   69 +++-
 arch/arm/plat-samsung/include/plat/clock.h |1 -
 9 files changed, 69 insertions(+), 97 deletions(-)
 delete mode 100644 arch/arm/plat-s3c24xx/clock.c

-- 
1.7.5.4

--
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/5] S3C2443/S3C2416: remove call to s3c24xx_setup_clocks

2012-01-12 Thread Heiko Stübner
As the clocks can calculate their rate themself now, there is no
need to set it statically.

Signed-off-by: Heiko Stuebner he...@sntech.de
---
 arch/arm/plat-s3c24xx/s3c2443-clock.c |   14 +++---
 1 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/arch/arm/plat-s3c24xx/s3c2443-clock.c 
b/arch/arm/plat-s3c24xx/s3c2443-clock.c
index bf86dd1..127550c 100644
--- a/arch/arm/plat-s3c24xx/s3c2443-clock.c
+++ b/arch/arm/plat-s3c24xx/s3c2443-clock.c
@@ -563,9 +563,6 @@ void __init_or_cpufreq s3c2443_common_setup_clocks(pll_fn 
get_mpll)
struct clk *xtal_clk;
unsigned long xtal;
unsigned long pll;
-   unsigned long fclk;
-   unsigned long hclk;
-   unsigned long pclk;
int ptr;
 
xtal_clk = clk_get(NULL, xtal);
@@ -574,17 +571,12 @@ void __init_or_cpufreq s3c2443_common_setup_clocks(pll_fn 
get_mpll)
 
pll = get_mpll(mpllcon, xtal);
clk_msysclk.clk.rate = pll;
-
-   fclk = clk_get_rate(clk_armdiv);
-   hclk = clk_get_rate(clk_h);
-   pclk = clk_get_rate(clk_p);
-
-   s3c24xx_setup_clocks(fclk, hclk, pclk);
+   clk_mpll.rate = pll;
 
printk(CPU: MPLL %s %ld.%03ld MHz, cpu %ld.%03ld MHz, mem %ld.%03ld 
MHz, pclk %ld.%03ld MHz\n,
   (mpllcon  S3C2443_PLLCON_OFF) ? off:on,
-  print_mhz(pll), print_mhz(fclk),
-  print_mhz(hclk), print_mhz(pclk));
+  print_mhz(pll), print_mhz(clk_get_rate(clk_armdiv)),
+  print_mhz(clk_get_rate(clk_h)), 
print_mhz(clk_get_rate(clk_p)));
 
for (ptr = 0; ptr  ARRAY_SIZE(clksrc_clks); ptr++)
s3c_set_clksrc(clksrc_clks[ptr], true);
-- 
1.7.5.4

--
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/5] S3C24XX: remove plat-s3c24xx/clock.c

2012-01-12 Thread Heiko Stübner
With its users reduced, the clock.c does not need to stay around.
s3c24xx_setup_clocks can move into s3c2410-clocks.c for 2410 and 244x,
and its functionality also into s3c2412.c

Signed-off-by: Heiko Stuebner he...@sntech.de
---
 arch/arm/mach-s3c2412/clock.c |1 +
 arch/arm/mach-s3c2412/s3c2412.c   |7 +++-
 arch/arm/plat-s3c24xx/Makefile|1 -
 arch/arm/plat-s3c24xx/clock.c |   59 -
 arch/arm/plat-s3c24xx/s3c2410-clock.c |   15 
 5 files changed, 22 insertions(+), 61 deletions(-)
 delete mode 100644 arch/arm/plat-s3c24xx/clock.c

diff --git a/arch/arm/mach-s3c2412/clock.c b/arch/arm/mach-s3c2412/clock.c
index d10b695..3a1312b 100644
--- a/arch/arm/mach-s3c2412/clock.c
+++ b/arch/arm/mach-s3c2412/clock.c
@@ -44,6 +44,7 @@
 #include plat/s3c2412.h
 #include plat/clock.h
 #include plat/cpu.h
+#include plat/pll.h
 
 /* We currently have to assume that the system is running
  * from the XTPll input, and that all ***REFCLKs are being
diff --git a/arch/arm/mach-s3c2412/s3c2412.c b/arch/arm/mach-s3c2412/s3c2412.c
index c6eac98..224d4cd 100644
--- a/arch/arm/mach-s3c2412/s3c2412.c
+++ b/arch/arm/mach-s3c2412/s3c2412.c
@@ -202,7 +202,12 @@ void __init_or_cpufreq s3c2412_setup_clocks(void)
printk(S3C2412: core %ld.%03ld MHz, memory %ld.%03ld MHz, peripheral 
%ld.%03ld MHz\n,
   print_mhz(fclk), print_mhz(hclk), print_mhz(pclk));
 
-   s3c24xx_setup_clocks(fclk, hclk, pclk);
+   clk_upll.rate = s3c24xx_get_pll(__raw_readl(S3C2410_UPLLCON),
+   clk_xtal.rate);
+
+   clk_h.rate = hclk;
+   clk_p.rate = pclk;
+   clk_f.rate = fclk;
 }
 
 void __init s3c2412_init_clocks(int xtal)
diff --git a/arch/arm/plat-s3c24xx/Makefile b/arch/arm/plat-s3c24xx/Makefile
index b2b0112..0be2263 100644
--- a/arch/arm/plat-s3c24xx/Makefile
+++ b/arch/arm/plat-s3c24xx/Makefile
@@ -15,7 +15,6 @@ obj-  :=
 obj-y  += cpu.o
 obj-y  += irq.o
 obj-y  += dev-uart.o
-obj-y  += clock.o
 obj-$(CONFIG_S3C24XX_DCLK) += clock-dclk.o
 
 obj-$(CONFIG_CPU_FREQ_S3C24XX) += cpu-freq.o
diff --git a/arch/arm/plat-s3c24xx/clock.c b/arch/arm/plat-s3c24xx/clock.c
deleted file mode 100644
index 931d26d..000
--- a/arch/arm/plat-s3c24xx/clock.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* linux/arch/arm/plat-s3c24xx/clock.c
- *
- * Copyright (c) 2004-2005 Simtec Electronics
- * Ben Dooks b...@simtec.co.uk
- *
- * S3C24XX Core clock control support
- *
- * Based on, and code from linux/arch/arm/mach-versatile/clock.c
- **
- **  Copyright (C) 2004 ARM Limited.
- **  Written by Deep Blue Solutions Limited.
- *
- *
- * 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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include linux/init.h
-#include linux/kernel.h
-#include linux/clk.h
-#include linux/io.h
-
-#include mach/hardware.h
-#include asm/irq.h
-
-#include mach/regs-clock.h
-#include mach/regs-gpio.h
-
-#include plat/cpu-freq.h
-
-#include plat/clock.h
-#include plat/cpu.h
-#include plat/pll.h
-
-/* initialise all the clocks */
-
-void __init_or_cpufreq s3c24xx_setup_clocks(unsigned long fclk,
-  unsigned long hclk,
-  unsigned long pclk)
-{
-   clk_upll.rate = s3c24xx_get_pll(__raw_readl(S3C2410_UPLLCON),
-   clk_xtal.rate);
-
-   clk_mpll.rate = fclk;
-   clk_h.rate = hclk;
-   clk_p.rate = pclk;
-   clk_f.rate = fclk;
-}
diff --git a/arch/arm/plat-s3c24xx/s3c2410-clock.c 
b/arch/arm/plat-s3c24xx/s3c2410-clock.c
index 25dc4d4..76edfb8 100644
--- a/arch/arm/plat-s3c24xx/s3c2410-clock.c
+++ b/arch/arm/plat-s3c24xx/s3c2410-clock.c
@@ -44,6 +44,8 @@
 #include plat/s3c2410.h
 #include plat/clock.h
 #include plat/cpu.h
+#include plat/pll.h
+#include plat/cpu-freq.h
 
 int s3c2410_clkcon_enable(struct clk *clk, int enable)
 {
@@ -251,3 +253,16 @@ int __init s3c2410_baseclk_add(void)
s3c_pwmclk_init();
return 0;
 }
+
+void __init_or_cpufreq s3c24xx_setup_clocks(unsigned long fclk,
+  unsigned long hclk,
+  unsigned long pclk)
+{
+   clk_upll.rate = 

Re: Build error at drivers/base/power/domain_governor.c when PM_RUNTIME is not set

2012-01-12 Thread Rafael J. Wysocki
On Thursday, January 12, 2012, Kukjin Kim wrote:
 Rafael J. Wysocki wrote:
  
  On Monday, January 09, 2012, Kukjin Kim wrote:
   Hi Rafael,
  
   This is just reporting of build error.
  
   Current mainline happens build error at
  drivers/base/power/domain_governor.c
   file like following when CONFIG_PM_RUNTIME is not set. For example, it
   happens with s3c6400_defconfig now.
  
   drivers/base/power/domain_governor.c: In function 'default_stop_ok':
   drivers/base/power/domain_governor.c:25: error: 'struct dev_pm_info' has
  no
   member named 'max_time_suspended_ns'
   drivers/base/power/domain_governor.c:29: error: 'struct dev_pm_info' has
  no
   member named 'max_time_suspended_ns'
   drivers/base/power/domain_governor.c: In function
  'default_power_down_ok':
   drivers/base/power/domain_governor.c:94: error: 'struct dev_pm_info' has
  no
   member named 'max_time_suspended_ns'
   drivers/base/power/domain_governor.c:98: error: 'struct dev_pm_info' has
  no
   member named 'max_time_suspended_ns'
   drivers/base/power/domain_governor.c:100: error: 'struct dev_pm_info'
  has no
   member named 'suspend_time'
  
  The appended patch fixes the problem for me, can you please test it?
  
 Hi Rafael,
 
 Looks ok to me :)

Cool, thanks!

Rafael
--
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: Fix missing api-change from subsys_interface change

2012-01-12 Thread Kukjin Kim
Greg KH wrote:
 
 On Thu, Jan 12, 2012 at 02:30:48PM +0100, Heiko Stübner wrote:
  Commit 4a858cfc9a (arm: convert sysdev_class to a regular subsystem)
  converted the samsung sysdevs into subsys_interface instances.
 
  While the original add-function only had a (struct sys_device *)
  parameter, the dev_add from subsys_interface needs
  (struct device *, struct subsys_interface *)
  leading to initialized from incompatible pointer type warnings.
 
  Signed-off-by: Heiko Stuebner he...@sntech.de
  ---
  The patch applies cleanly against the current driver-core git,
  hopefully it's the right tree.
 
 Thanks for fixing this up, sorry for getting it wrong.
 
 This should be done against the Samsung arm git tree, and go in through
 that one.  The driver-core git tree is equal to Linus's tree of a few
 days ago, there are no driver-core patches in it at the moment.
 
 Kukjin, can you take these?
 
Sure, let me pick this up in my fixes.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim kgene@samsung.com, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

--
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] watchdog: fix error in probe() of s3c2410_wdt (reset at booting)

2012-01-12 Thread MyungJoo Ham
Probe function of s3c2410 watchdog calls request_irq before initializing
required value (wdt_count). This incurs resetting watchdog counter value
and watchdog-reboot during booting up.

This patch addresses such an issue by calling request_irq later.

Error handling in probe function and calling oder in remove function are
also revised accordingly.

Reported-by: Chanwoo Park cw00.c...@samsung.com
Signed-off-by: MyungJoo Ham myungjoo@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 drivers/watchdog/s3c2410_wdt.c |   29 +++--
 1 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
index a79e384..07bd768 100644
--- a/drivers/watchdog/s3c2410_wdt.c
+++ b/drivers/watchdog/s3c2410_wdt.c
@@ -342,22 +342,17 @@ static int __devinit s3c2410wdt_probe(struct 
platform_device *pdev)
goto err_map;
}
 
-   ret = request_irq(wdt_irq-start, s3c2410wdt_irq, 0, pdev-name, pdev);
-   if (ret != 0) {
-   dev_err(dev, failed to install irq (%d)\n, ret);
-   goto err_map;
-   }
-
wdt_clock = clk_get(pdev-dev, watchdog);
if (IS_ERR(wdt_clock)) {
dev_err(dev, failed to find watchdog clock source\n);
ret = PTR_ERR(wdt_clock);
-   goto err_irq;
+   goto err_map;
}
 
clk_enable(wdt_clock);
 
-   if (s3c2410wdt_cpufreq_register()  0) {
+   ret = s3c2410wdt_cpufreq_register();
+   if (ret  0) {
printk(KERN_ERR PFX failed to register cpufreq\n);
goto err_clk;
}
@@ -395,6 +390,12 @@ static int __devinit s3c2410wdt_probe(struct 
platform_device *pdev)
s3c2410wdt_stop(s3c2410_wdd);
}
 
+   ret = request_irq(wdt_irq-start, s3c2410wdt_irq, 0, pdev-name, pdev);
+   if (ret != 0) {
+   dev_err(dev, failed to install irq (%d)\n, ret);
+   goto err_reg;
+   }
+
/* print out a statement of readiness */
 
wtcon = readl(wdt_base + S3C2410_WTCON);
@@ -406,6 +407,9 @@ static int __devinit s3c2410wdt_probe(struct 
platform_device *pdev)
 
return 0;
 
+ err_reg:
+   watchdog_unregister_device(s3c2410_wdd);
+
  err_cpufreq:
s3c2410wdt_cpufreq_deregister();
 
@@ -413,9 +417,6 @@ static int __devinit s3c2410wdt_probe(struct 
platform_device *pdev)
clk_disable(wdt_clock);
clk_put(wdt_clock);
 
- err_irq:
-   free_irq(wdt_irq-start, pdev);
-
  err_map:
iounmap(wdt_base);
 
@@ -428,6 +429,9 @@ static int __devinit s3c2410wdt_probe(struct 
platform_device *pdev)
 
 static int __devexit s3c2410wdt_remove(struct platform_device *dev)
 {
+   free_irq(wdt_irq-start, dev);
+   wdt_irq = NULL;
+
watchdog_unregister_device(s3c2410_wdd);
 
s3c2410wdt_cpufreq_deregister();
@@ -436,9 +440,6 @@ static int __devexit s3c2410wdt_remove(struct 
platform_device *dev)
clk_put(wdt_clock);
wdt_clock = NULL;
 
-   free_irq(wdt_irq-start, dev);
-   wdt_irq = NULL;
-
iounmap(wdt_base);
 
release_mem_region(wdt_mem-start, resource_size(wdt_mem));
-- 
1.7.4.1

--
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