Re: [PATCH v3 0/9] ARM: S3C24XX: rework irq handling for a later dt usage

2013-01-27 Thread Heiko Stübner
Am Freitag, 25. Januar 2013, 19:59:18 schrieb Kukjin Kim:
 Heiko Stübner wrote:
  Third version of redoing the s3c24xx irqs in a generic way by using a
  declarative approach.
  
  Main change is the different approach to the init. Moved the
  s3c24xx_init_intc function from the dt patchset here, so that both init
  types (dt and non-dt) can use a similar init scheme.
  
  As in the second version, the 1st patch might be hard to read due to the
  rewrite character, but I didn't see a way to do these changes in
  individual steps. So it might be helpful to look at the result after
  applying this patch.
  
  Runtime-tested on a s3c2416 based board and compile tested for the
  others.
  
  As also written before, inclusion of the other S3C24XX SoCs to follow
  once the general approach is acceptable.
  
  Applies to the most current for-next (from two hours ago) from linux-
  samsung
  
  Heiko Stuebner (9):
ARM: S3C24XX: transform irq handling into a declarative form
ARM: S3C24XX: Move irq syscore-ops to irq-pm
ARM: S3C24XX: Modify s3c_irq_wake to use the hwirq property
ARM: S3C24XX: move s3c2416 irq init to common irq code
ARM: S3C24XX: modify s3c2416 irq init to initialize all irqs
ARM: S3C24XX: transform s3c2416 irqs into new structure
ARM: S3C24XX: move s3c2443 irq code to irq.c
ARM: S3C24XX: modify s3c2443 irq init to initialize all irqs
ARM: S3C24XX: transform s3c2443 subirqs into new structure
   
   arch/arm/mach-s3c24xx/Makefile   |4 +-
   arch/arm/mach-s3c24xx/common.h   |2 +
   arch/arm/mach-s3c24xx/irq-pm.c   |   41 +-
   arch/arm/mach-s3c24xx/irq-s3c2416.c  |  348 
   arch/arm/mach-s3c24xx/irq-s3c2443.c  |  281 ---
   arch/arm/mach-s3c24xx/mach-smdk2416.c|2 +-
   arch/arm/mach-s3c24xx/mach-smdk2443.c|2 +-
   arch/arm/mach-s3c24xx/s3c2410.c  |4 +-
   arch/arm/mach-s3c24xx/s3c2412.c  |4 +-
   arch/arm/mach-s3c24xx/s3c2416.c  |4 +-
   arch/arm/mach-s3c24xx/s3c2440.c  |4 +-
   arch/arm/mach-s3c24xx/s3c2442.c  |4 +-
   arch/arm/plat-s3c24xx/Kconfig|1 +
   arch/arm/plat-s3c24xx/irq.c  | 1110
   +++--- arch/arm/plat-samsung/include/plat/pm.h 
   |6 -
   arch/arm/plat-samsung/include/plat/s3c2416.h |1 +
   arch/arm/plat-samsung/include/plat/s3c2443.h |2 +
   17 files changed, 688 insertions(+), 1132 deletions(-)
   delete mode 100644 arch/arm/mach-s3c24xx/irq-s3c2416.c
   delete mode 100644 arch/arm/mach-s3c24xx/irq-s3c2443.c
  
  --
  1.7.2.3
 
 Heiko, looks good to me :-)
very cool :-)

 BTW, can you rebase this against on next/cleanup-s3c24xx branch in my tree?
will try to do this today


Heiko
--
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 v4 1/9] ARM: S3C24XX: transform irq handling into a declarative form

2013-01-27 Thread Heiko Stübner
The irqs available on the machine and even the bit settings in the
irq registers differ a lot through all the s3c24xx subarchitectures.
This results in each subarch having its own irq init which adds its
specific irqs to the base ones created in plat-s3c24xx/irq.c.

This of course makes a future move to devicetree hard to implement.

Therefore this patch transforms the base irq handling to a declarative
style, where the irq types as well as its parent/child relationship
gets read from a predefined datastructure, which later on can hopefully
be easily represented in devicetree too.

It should also be easy to include the subarch specific irqs here
in later patches, reducing code size and duplication.

It should not affect anything outside of the file, as the original
irq numbers and their handling are preserved (hopefully) correctly.

Signed-off-by: Heiko Stuebner he...@sntech.de
---
changes since v2:
- redo the initialization, move parts of the upcoming dt init here
  to enable both init variants to share the code
changes since v1:
- more generalized irq types, resulting in only types for
  none, eint, edge and level being needed
- use chained_irq_enter/exit to simplify subirq handling

 arch/arm/plat-s3c24xx/Kconfig |1 +
 arch/arm/plat-s3c24xx/irq.c   |  930 -
 2 files changed, 445 insertions(+), 486 deletions(-)

diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
index eef3b6a..3bb5c8f 100644
--- a/arch/arm/plat-s3c24xx/Kconfig
+++ b/arch/arm/plat-s3c24xx/Kconfig
@@ -9,6 +9,7 @@ config PLAT_S3C24XX
select ARCH_REQUIRE_GPIOLIB
select NO_IOPORT
select S3C_DEV_NAND
+   select IRQ_DOMAIN
help
  Base platform code for any Samsung S3C24XX device
 
diff --git a/arch/arm/plat-s3c24xx/irq.c b/arch/arm/plat-s3c24xx/irq.c
index fe57bbb..9e24ef5 100644
--- a/arch/arm/plat-s3c24xx/irq.c
+++ b/arch/arm/plat-s3c24xx/irq.c
@@ -1,7 +1,9 @@
-/* linux/arch/arm/plat-s3c24xx/irq.c
+/*
+ * S3C24XX IRQ handling
  *
  * Copyright (c) 2003-2004 Simtec Electronics
  * Ben Dooks b...@simtec.co.uk
+ * Copyright (c) 2012 Heiko Stuebner he...@sntech.de
  *
  * 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
@@ -12,175 +14,124 @@
  * 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/slab.h
 #include linux/module.h
+#include linux/io.h
+#include linux/err.h
 #include linux/interrupt.h
 #include linux/ioport.h
 #include linux/device.h
 #include linux/syscore_ops.h
+#include linux/irqdomain.h
 
-#include asm/irq.h
 #include asm/mach/irq.h
 
-#include plat/regs-irqtype.h
+#include mach/regs-irq.h
+#include mach/regs-gpio.h
 
 #include plat/cpu.h
+#include plat/regs-irqtype.h
 #include plat/pm.h
 #include plat/irq.h
 
-static void
-s3c_irq_mask(struct irq_data *data)
-{
-   unsigned int irqno = data-irq - IRQ_EINT0;
-   unsigned long mask;
-
-   mask = __raw_readl(S3C2410_INTMSK);
-   mask |= 1UL  irqno;
-   __raw_writel(mask, S3C2410_INTMSK);
-}
-
-static inline void
-s3c_irq_ack(struct irq_data *data)
-{
-   unsigned long bitval = 1UL  (data-irq - IRQ_EINT0);
-
-   __raw_writel(bitval, S3C2410_SRCPND);
-   __raw_writel(bitval, S3C2410_INTPND);
-}
-
-static inline void
-s3c_irq_maskack(struct irq_data *data)
-{
-   unsigned long bitval = 1UL  (data-irq - IRQ_EINT0);
-   unsigned long mask;
+#define S3C_IRQTYPE_NONE   0
+#define S3C_IRQTYPE_EINT   1
+#define S3C_IRQTYPE_EDGE   2
+#define S3C_IRQTYPE_LEVEL  3
 
-   mask = __raw_readl(S3C2410_INTMSK);
-   __raw_writel(mask|bitval, S3C2410_INTMSK);
+struct s3c_irq_data {
+   unsigned int type;
+   unsigned long parent_irq;
 
-   __raw_writel(bitval, S3C2410_SRCPND);
-   __raw_writel(bitval, S3C2410_INTPND);
-}
-
-
-static void
-s3c_irq_unmask(struct irq_data *data)
-{
-   unsigned int irqno = data-irq;
-   unsigned long mask;
-
-   if (irqno != IRQ_TIMER4  irqno != IRQ_EINT8t23)
-   irqdbf2(s3c_irq_unmask %d\n, irqno);
-
-   irqno -= IRQ_EINT0;
-
-   mask = __raw_readl(S3C2410_INTMSK);
-   mask = ~(1UL  irqno);
-   __raw_writel(mask, S3C2410_INTMSK);
-}
-
-struct irq_chip s3c_irq_level_chip = {
-   .name   = s3c-level,
-   .irq_ack= s3c_irq_maskack,
-   .irq_mask   = s3c_irq_mask,
-   .irq_unmask = s3c_irq_unmask,
-   .irq_set_wake   = s3c_irq_wake
+   /* data gets filled during init */
+   struct s3c_irq_intc *intc;
+   unsigned 

[PATCH v4 2/9] ARM: S3C24XX: Move irq syscore-ops to irq-pm

2013-01-27 Thread Heiko Stübner
With this the definition of s3c24xx_irq_syscore_ops can also move to
common.h from plat/pm.h and the definitions of s3c24xx_irq_suspend
and s3c24xx_irq_resume are also not necessary anymore in plat/pm.h

Signed-off-by: Heiko Stuebner he...@sntech.de
---
 arch/arm/mach-s3c24xx/common.h  |2 ++
 arch/arm/mach-s3c24xx/irq-pm.c  |   10 --
 arch/arm/mach-s3c24xx/s3c2410.c |4 +++-
 arch/arm/mach-s3c24xx/s3c2412.c |4 +++-
 arch/arm/mach-s3c24xx/s3c2416.c |4 +++-
 arch/arm/mach-s3c24xx/s3c2440.c |4 +++-
 arch/arm/mach-s3c24xx/s3c2442.c |4 +++-
 arch/arm/plat-s3c24xx/irq.c |6 --
 arch/arm/plat-samsung/include/plat/pm.h |6 --
 9 files changed, 25 insertions(+), 19 deletions(-)

diff --git a/arch/arm/mach-s3c24xx/common.h b/arch/arm/mach-s3c24xx/common.h
index c2f596e..ed6276f 100644
--- a/arch/arm/mach-s3c24xx/common.h
+++ b/arch/arm/mach-s3c24xx/common.h
@@ -15,4 +15,6 @@
 void s3c2410_restart(char mode, const char *cmd);
 void s3c244x_restart(char mode, const char *cmd);
 
+extern struct syscore_ops s3c24xx_irq_syscore_ops;
+
 #endif /* __ARCH_ARM_MACH_S3C24XX_COMMON_H */
diff --git a/arch/arm/mach-s3c24xx/irq-pm.c b/arch/arm/mach-s3c24xx/irq-pm.c
index 0efb2e2..d48126d 100644
--- a/arch/arm/mach-s3c24xx/irq-pm.c
+++ b/arch/arm/mach-s3c24xx/irq-pm.c
@@ -15,6 +15,7 @@
 #include linux/module.h
 #include linux/interrupt.h
 #include linux/irq.h
+#include linux/syscore_ops.h
 
 #include plat/cpu.h
 #include plat/pm.h
@@ -64,7 +65,7 @@ static unsigned long save_extint[3];
 static unsigned long save_eintflt[4];
 static unsigned long save_eintmask;
 
-int s3c24xx_irq_suspend(void)
+static int s3c24xx_irq_suspend(void)
 {
unsigned int i;
 
@@ -80,7 +81,7 @@ int s3c24xx_irq_suspend(void)
return 0;
 }
 
-void s3c24xx_irq_resume(void)
+static void s3c24xx_irq_resume(void)
 {
unsigned int i;
 
@@ -93,3 +94,8 @@ void s3c24xx_irq_resume(void)
s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
__raw_writel(save_eintmask, S3C24XX_EINTMASK);
 }
+
+struct syscore_ops s3c24xx_irq_syscore_ops = {
+   .suspend= s3c24xx_irq_suspend,
+   .resume = s3c24xx_irq_resume,
+};
diff --git a/arch/arm/mach-s3c24xx/s3c2410.c b/arch/arm/mach-s3c24xx/s3c2410.c
index a3c5cb0..9ebef95 100644
--- a/arch/arm/mach-s3c24xx/s3c2410.c
+++ b/arch/arm/mach-s3c24xx/s3c2410.c
@@ -49,6 +49,8 @@
 #include plat/gpio-cfg.h
 #include plat/gpio-cfg-helpers.h
 
+#include common.h
+
 /* Initial IO mappings */
 
 static struct map_desc s3c2410_iodesc[] __initdata = {
@@ -182,8 +184,8 @@ int __init s3c2410_init(void)
 
 #ifdef CONFIG_PM
register_syscore_ops(s3c2410_pm_syscore_ops);
-#endif
register_syscore_ops(s3c24xx_irq_syscore_ops);
+#endif
 
return device_register(s3c2410_dev);
 }
diff --git a/arch/arm/mach-s3c24xx/s3c2412.c b/arch/arm/mach-s3c24xx/s3c2412.c
index c511a22..533b4a9 100644
--- a/arch/arm/mach-s3c24xx/s3c2412.c
+++ b/arch/arm/mach-s3c24xx/s3c2412.c
@@ -52,6 +52,8 @@
 #define S3C2412_SWRST  (S3C24XX_VA_CLKPWR + 0x30)
 #define S3C2412_SWRST_RESET(0x533C2412)
 
+#include common.h
+
 #ifndef CONFIG_CPU_S3C2412_ONLY
 void __iomem *s3c24xx_va_gpio2 = S3C24XX_VA_GPIO;
 
@@ -245,8 +247,8 @@ int __init s3c2412_init(void)
 
 #ifdef CONFIG_PM
register_syscore_ops(s3c2412_pm_syscore_ops);
-#endif
register_syscore_ops(s3c24xx_irq_syscore_ops);
+#endif
 
return device_register(s3c2412_dev);
 }
diff --git a/arch/arm/mach-s3c24xx/s3c2416.c b/arch/arm/mach-s3c24xx/s3c2416.c
index 77ee0b7..e30476d 100644
--- a/arch/arm/mach-s3c24xx/s3c2416.c
+++ b/arch/arm/mach-s3c24xx/s3c2416.c
@@ -63,6 +63,8 @@
 #include plat/rtc-core.h
 #include plat/spi-core.h
 
+#include common.h
+
 static struct map_desc s3c2416_iodesc[] __initdata = {
IODESC_ENT(WATCHDOG),
IODESC_ENT(CLKPWR),
@@ -105,9 +107,9 @@ int __init s3c2416_init(void)
 
 #ifdef CONFIG_PM
register_syscore_ops(s3c2416_pm_syscore_ops);
-#endif
register_syscore_ops(s3c24xx_irq_syscore_ops);
register_syscore_ops(s3c2416_irq_syscore_ops);
+#endif
 
return device_register(s3c2416_dev);
 }
diff --git a/arch/arm/mach-s3c24xx/s3c2440.c b/arch/arm/mach-s3c24xx/s3c2440.c
index 2b3dddb..559e394 100644
--- a/arch/arm/mach-s3c24xx/s3c2440.c
+++ b/arch/arm/mach-s3c24xx/s3c2440.c
@@ -40,6 +40,8 @@
 #include plat/gpio-cfg.h
 #include plat/gpio-cfg-helpers.h
 
+#include common.h
+
 static struct device s3c2440_dev = {
.bus= s3c2440_subsys,
 };
@@ -57,9 +59,9 @@ int __init s3c2440_init(void)
 
 #ifdef CONFIG_PM
register_syscore_ops(s3c2410_pm_syscore_ops);
+   register_syscore_ops(s3c24xx_irq_syscore_ops);
 #endif
register_syscore_ops(s3c244x_pm_syscore_ops);
-   register_syscore_ops(s3c24xx_irq_syscore_ops);
 
/* register our system device for everything else */
 
diff --git 

Re: [PATCH 3/4] ARM: dts: add support for hdmi-ddc to exynos4412-origen

2013-01-27 Thread Sylwester Nawrocki

Hi,

On 01/25/2013 11:39 AM, Rahul Sharma wrote:

Signed-off-by: Rahul Sharmarahul.sha...@samsung.com


Please explain why this patch is needed, in more detail...


---
  arch/arm/boot/dts/exynos4.dtsi  |  1 -
  arch/arm/boot/dts/exynos4412-origen.dts | 13 +
  2 files changed, 13 insertions(+), 1 deletion(-)
  mode change 100644 =  100755 arch/arm/boot/dts/exynos4412.dtsi

diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index 07cb7d4..a75e2f5 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -219,7 +219,6 @@
compatible = samsung,s3c2440-i2c;
reg =0x138C 0x100;
interrupts =0 64 0;
-   status = disabled;


No, it's not how it is supposed to be done. If you want to enable
this specific I2C controller on your board, just add status = okay;
line in its node in the board-specific dts file. Please see below.


};

i2c_7: i2c@138D {
diff --git a/arch/arm/boot/dts/exynos4412-origen.dts 
b/arch/arm/boot/dts/exynos4412-origen.dts
index 4eba374..6299f1b 100644
--- a/arch/arm/boot/dts/exynos4412-origen.dts
+++ b/arch/arm/boot/dts/exynos4412-origen.dts
@@ -59,4 +59,17 @@
serial@1383 {
status = okay;
};
+
+   i2c_6: i2c@138C {
+   samsung,i2c-sda-delay =100;
+   samsung,i2c-max-bus-freq =66000;
+
+   pinctrl-0 =i2c6_bus;
+   pinctrl-names = default;


status = okay;


+   hdmiddc@50 {
+   compatible = samsung,exynos4-hdmiddc;
+   reg =0x50;
+   };
+   };
  };
diff --git a/arch/arm/boot/dts/exynos4412.dtsi 
b/arch/arm/boot/dts/exynos4412.dtsi
old mode 100644
new mode 100755


Are you sure you need to add all these execute permissions ?
Do you think these values are more sane than the previous ones ?
I'm afraid there is something going wrong with the file permissions
in your environment...

--

Thanks,
Sylwester
--
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 v4 3/9] ARM: S3C24XX: Modify s3c_irq_wake to use the hwirq property

2013-01-27 Thread Heiko Stübner
This gets rid of the use of static irq mappings there.

Signed-off-by: Heiko Stuebner he...@sntech.de
---
 arch/arm/mach-s3c24xx/irq-pm.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-s3c24xx/irq-pm.c b/arch/arm/mach-s3c24xx/irq-pm.c
index d48126d..640ec91 100644
--- a/arch/arm/mach-s3c24xx/irq-pm.c
+++ b/arch/arm/mach-s3c24xx/irq-pm.c
@@ -30,18 +30,18 @@
  * set bit to 1 in allow bitfield to enable the wakeup settings on it
 */
 
-unsigned long s3c_irqwake_intallow = 1L  (IRQ_RTC - IRQ_EINT0) | 0xfL;
+unsigned long s3c_irqwake_intallow = 1L  30 | 0xfL;
 unsigned long s3c_irqwake_eintallow= 0xfff0L;
 
 int s3c_irq_wake(struct irq_data *data, unsigned int state)
 {
-   unsigned long irqbit = 1  (data-irq - IRQ_EINT0);
+   unsigned long irqbit = 1  data-hwirq;
 
if (!(s3c_irqwake_intallow  irqbit))
return -ENOENT;
 
-   printk(KERN_INFO wake %s for irq %d\n,
-  state ? enabled : disabled, data-irq);
+   pr_info(wake %s for hwirq %lu\n,
+   state ? enabled : disabled, data-hwirq);
 
if (!state)
s3c_irqwake_intmask |= irqbit;
-- 
1.7.10.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 v4 4/9] ARM: S3C24XX: move s3c2416 irq init to common irq code

2013-01-27 Thread Heiko Stübner
This is needed to further clean up the irq init.

Signed-off-by: Heiko Stuebner he...@sntech.de
---
 arch/arm/mach-s3c24xx/Makefile  |2 +-
 arch/arm/mach-s3c24xx/irq-pm.c  |   23 +++
 arch/arm/mach-s3c24xx/irq-s3c2416.c |  348 ---
 arch/arm/plat-s3c24xx/irq.c |  286 
 4 files changed, 310 insertions(+), 349 deletions(-)
 delete mode 100644 arch/arm/mach-s3c24xx/irq-s3c2416.c

diff --git a/arch/arm/mach-s3c24xx/Makefile b/arch/arm/mach-s3c24xx/Makefile
index 08b87cd..68d134f 100644
--- a/arch/arm/mach-s3c24xx/Makefile
+++ b/arch/arm/mach-s3c24xx/Makefile
@@ -28,7 +28,7 @@ obj-$(CONFIG_S3C2412_DMA) += dma-s3c2412.o
 obj-$(CONFIG_S3C2412_PM)   += pm-s3c2412.o
 obj-$(CONFIG_S3C2412_PM_SLEEP) += sleep-s3c2412.o
 
-obj-$(CONFIG_CPU_S3C2416)  += s3c2416.o irq-s3c2416.o clock-s3c2416.o
+obj-$(CONFIG_CPU_S3C2416)  += s3c2416.o clock-s3c2416.o
 obj-$(CONFIG_S3C2416_PM)   += pm-s3c2416.o
 
 obj-$(CONFIG_CPU_S3C2440)  += s3c2440.o irq-s3c2440.o clock-s3c2440.o
diff --git a/arch/arm/mach-s3c24xx/irq-pm.c b/arch/arm/mach-s3c24xx/irq-pm.c
index 640ec91..e119959 100644
--- a/arch/arm/mach-s3c24xx/irq-pm.c
+++ b/arch/arm/mach-s3c24xx/irq-pm.c
@@ -99,3 +99,26 @@ struct syscore_ops s3c24xx_irq_syscore_ops = {
.suspend= s3c24xx_irq_suspend,
.resume = s3c24xx_irq_resume,
 };
+
+#ifdef CONFIG_CPU_S3C2416
+static struct sleep_save s3c2416_irq_save[] = {
+   SAVE_ITEM(S3C2416_INTMSK2),
+};
+
+static int s3c2416_irq_suspend(void)
+{
+   s3c_pm_do_save(s3c2416_irq_save, ARRAY_SIZE(s3c2416_irq_save));
+
+   return 0;
+}
+
+static void s3c2416_irq_resume(void)
+{
+   s3c_pm_do_restore(s3c2416_irq_save, ARRAY_SIZE(s3c2416_irq_save));
+}
+
+struct syscore_ops s3c2416_irq_syscore_ops = {
+   .suspend= s3c2416_irq_suspend,
+   .resume = s3c2416_irq_resume,
+};
+#endif
diff --git a/arch/arm/mach-s3c24xx/irq-s3c2416.c 
b/arch/arm/mach-s3c24xx/irq-s3c2416.c
deleted file mode 100644
index ff141b0..000
--- a/arch/arm/mach-s3c24xx/irq-s3c2416.c
+++ /dev/null
@@ -1,348 +0,0 @@
-/* linux/arch/arm/mach-s3c2416/irq.c
- *
- * Copyright (c) 2009 Yauhen Kharuzhy jek...@gmail.com,
- * as part of OpenInkpot project
- * Copyright (c) 2009 Promwad Innovation Company
- * Yauhen Kharuzhy yauhen.kharu...@promwad.com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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/module.h
-#include linux/interrupt.h
-#include linux/ioport.h
-#include linux/device.h
-#include linux/io.h
-#include linux/syscore_ops.h
-
-#include mach/hardware.h
-#include asm/irq.h
-
-#include asm/mach/irq.h
-
-#include mach/regs-irq.h
-#include mach/regs-gpio.h
-
-#include plat/cpu.h
-#include plat/pm.h
-#include plat/irq.h
-
-#define INTMSK(start, end) ((1  ((end) + 1 - (start))) - 1)
-
-static inline void s3c2416_irq_demux(unsigned int irq, unsigned int len)
-{
-   unsigned int subsrc, submsk;
-   unsigned int end;
-
-   /* read the current pending interrupts, and the mask
-* for what it is available */
-
-   subsrc = __raw_readl(S3C2410_SUBSRCPND);
-   submsk = __raw_readl(S3C2410_INTSUBMSK);
-
-   subsrc  = ~submsk;
-   subsrc = (irq - S3C2410_IRQSUB(0));
-   subsrc  = (1  len)-1;
-
-   end = len + irq;
-
-   for (; irq  end  subsrc; irq++) {
-   if (subsrc  1)
-   generic_handle_irq(irq);
-
-   subsrc = 1;
-   }
-}
-
-/* WDT/AC97 sub interrupts */
-
-static void s3c2416_irq_demux_wdtac97(unsigned int irq, struct irq_desc *desc)
-{
-   s3c2416_irq_demux(IRQ_S3C2443_WDT, 4);
-}
-
-#define INTMSK_WDTAC97 (1UL  (IRQ_WDT - IRQ_EINT0))
-#define SUBMSK_WDTAC97 INTMSK(IRQ_S3C2443_WDT, IRQ_S3C2443_AC97)
-
-static void s3c2416_irq_wdtac97_mask(struct irq_data *data)
-{
-   s3c_irqsub_mask(data-irq, INTMSK_WDTAC97, SUBMSK_WDTAC97);
-}
-
-static void s3c2416_irq_wdtac97_unmask(struct irq_data *data)
-{
-   s3c_irqsub_unmask(data-irq, INTMSK_WDTAC97);
-}
-
-static void s3c2416_irq_wdtac97_ack(struct irq_data *data)
-{
-   s3c_irqsub_maskack(data-irq, INTMSK_WDTAC97, SUBMSK_WDTAC97);
-}
-
-static struct irq_chip s3c2416_irq_wdtac97 = {
-   .irq_mask   = s3c2416_irq_wdtac97_mask,
-  

Re: [PATCH 0/4] 0/4] ARM: dts: add support for hdmi to exynos4412

2013-01-27 Thread Sylwester Nawrocki

Hi,

On 01/25/2013 11:39 AM, Rahul Sharma wrote:

This patch enables hdmi support for Samsung Exynos4412 soc based Origen Board.

This set is base on for next branch at
git.kernel.org/?p=linux/kernel/git/kgene/linux-samsung.git

Rahul Sharma (4):
   ARM: dts: add support for hdmi to exynos4
   ARM: dts: add support for mixer to exynos4
   ARM: dts: add support for hdmi-ddc to exynos4412-origen
   ARM: dts: add support for hdmi-phy to exynos4412

  arch/arm/boot/dts/exynos4.dtsi  | 24 +++-
  arch/arm/boot/dts/exynos4412-origen.dts | 13 +
  arch/arm/boot/dts/exynos4412.dtsi   | 11 +++
  arch/arm/mach-exynos/mach-exynos4-dt.c  |  6 ++


Is the device tree bindings documentation related to this patch
series available somewhere else ?


  4 files changed, 53 insertions(+), 1 deletion(-)
  mode change 100644 =  100755 arch/arm/boot/dts/exynos4.dtsi


Please make sure you don't change the file permissions to random
values.

--

Thanks,
Sylwester
--
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 v4 5/9] ARM: S3C24XX: modify s3c2416 irq init to initialize all irqs

2013-01-27 Thread Heiko Stübner
Previously the irq init used s3c24xx_init_irq and an additional
arch_initcall to add the cpu specific irqs.

To be able to simplyfy the irq init later, create a new function
s3c416_init_irq, which then calls s3c24xx_init_irq but also adds
the cpu specific irqs.

Signed-off-by: Heiko Stuebner he...@sntech.de
---
 arch/arm/mach-s3c24xx/mach-smdk2416.c|2 +-
 arch/arm/plat-s3c24xx/irq.c  |   22 --
 arch/arm/plat-samsung/include/plat/s3c2416.h |1 +
 3 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/arch/arm/mach-s3c24xx/mach-smdk2416.c 
b/arch/arm/mach-s3c24xx/mach-smdk2416.c
index 7de4120..2abb66f 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2416.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2416.c
@@ -250,7 +250,7 @@ MACHINE_START(SMDK2416, SMDK2416)
/* Maintainer: Yauhen Kharuzhy jek...@gmail.com */
.atag_offset= 0x100,
 
-   .init_irq   = s3c24xx_init_irq,
+   .init_irq   = s3c2416_init_irq,
.map_io = smdk2416_map_io,
.init_machine   = smdk2416_machine_init,
.timer  = s3c24xx_timer,
diff --git a/arch/arm/plat-s3c24xx/irq.c b/arch/arm/plat-s3c24xx/irq.c
index 131f747..3763b91 100644
--- a/arch/arm/plat-s3c24xx/irq.c
+++ b/arch/arm/plat-s3c24xx/irq.c
@@ -874,10 +874,11 @@ static void s3c2416_irq_add_second(void)
}
 }
 
-static int s3c2416_irq_add(struct device *dev,
- struct subsys_interface *sif)
+void __init s3c2416_init_irq(void)
 {
-   printk(KERN_INFO S3C2416: IRQ Support\n);
+   pr_info(S3C2416: IRQ Support\n);
+
+   s3c24xx_init_irq();
 
s3c2416_add_sub(IRQ_LCD, s3c2416_irq_demux_lcd, s3c2416_irq_lcd,
IRQ_S3C2443_LCD2, IRQ_S3C2443_LCD4);
@@ -894,21 +895,6 @@ static int s3c2416_irq_add(struct device *dev,
IRQ_S3C2443_WDT, IRQ_S3C2443_AC97);
 
s3c2416_irq_add_second();
-
-   return 0;
 }
 
-static struct subsys_interface s3c2416_irq_interface = {
-   .name   = s3c2416_irq,
-   .subsys = s3c2416_subsys,
-   .add_dev= s3c2416_irq_add,
-};
-
-static int __init s3c2416_irq_init(void)
-{
-   return subsys_interface_register(s3c2416_irq_interface);
-}
-
-arch_initcall(s3c2416_irq_init);
-
 #endif
diff --git a/arch/arm/plat-samsung/include/plat/s3c2416.h 
b/arch/arm/plat-samsung/include/plat/s3c2416.h
index 7178e33..f27399a 100644
--- a/arch/arm/plat-samsung/include/plat/s3c2416.h
+++ b/arch/arm/plat-samsung/include/plat/s3c2416.h
@@ -25,6 +25,7 @@ extern  int s3c2416_baseclk_add(void);
 
 extern void s3c2416_restart(char mode, const char *cmd);
 
+extern void s3c2416_init_irq(void);
 extern struct syscore_ops s3c2416_irq_syscore_ops;
 
 #else
-- 
1.7.10.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 v4 6/9] ARM: S3C24XX: transform s3c2416 irqs into new structure

2013-01-27 Thread Heiko Stübner
Share the common irq code by simply defining a correct mapping declaration
for the s3c2416.

Signed-off-by: Heiko Stuebner he...@sntech.de
---
 arch/arm/plat-s3c24xx/irq.c |  342 +++
 1 file changed, 87 insertions(+), 255 deletions(-)

diff --git a/arch/arm/plat-s3c24xx/irq.c b/arch/arm/plat-s3c24xx/irq.c
index 3763b91..c6d0d57 100644
--- a/arch/arm/plat-s3c24xx/irq.c
+++ b/arch/arm/plat-s3c24xx/irq.c
@@ -352,7 +352,8 @@ static int s3c24xx_irq_map(struct irq_domain *h, unsigned 
int virq,
 handle_edge_irq);
break;
case S3C_IRQTYPE_EDGE:
-   if (irq_data-parent_irq)
+   if (irq_data-parent_irq ||
+   intc-reg_pending == S3C2416_SRCPND2)
irq_set_chip_and_handler(virq, s3c_irq_level_chip,
 handle_edge_irq);
else
@@ -628,273 +629,104 @@ void __init s3c24xx_init_irq(void)
 }
 
 #ifdef CONFIG_CPU_S3C2416
-#define INTMSK(start, end) ((1  ((end) + 1 - (start))) - 1)
-
-static inline void s3c2416_irq_demux(unsigned int irq, unsigned int len)
-{
-   unsigned int subsrc, submsk;
-   unsigned int end;
-
-   /* read the current pending interrupts, and the mask
-* for what it is available */
-
-   subsrc = __raw_readl(S3C2410_SUBSRCPND);
-   submsk = __raw_readl(S3C2410_INTSUBMSK);
-
-   subsrc  = ~submsk;
-   subsrc = (irq - S3C2410_IRQSUB(0));
-   subsrc  = (1  len)-1;
-
-   end = len + irq;
-
-   for (; irq  end  subsrc; irq++) {
-   if (subsrc  1)
-   generic_handle_irq(irq);
-
-   subsrc = 1;
-   }
-}
-
-/* WDT/AC97 sub interrupts */
-
-static void s3c2416_irq_demux_wdtac97(unsigned int irq, struct irq_desc *desc)
-{
-   s3c2416_irq_demux(IRQ_S3C2443_WDT, 4);
-}
-
-#define INTMSK_WDTAC97 (1UL  (IRQ_WDT - IRQ_EINT0))
-#define SUBMSK_WDTAC97 INTMSK(IRQ_S3C2443_WDT, IRQ_S3C2443_AC97)
-
-static void s3c2416_irq_wdtac97_mask(struct irq_data *data)
-{
-   s3c_irqsub_mask(data-irq, INTMSK_WDTAC97, SUBMSK_WDTAC97);
-}
-
-static void s3c2416_irq_wdtac97_unmask(struct irq_data *data)
-{
-   s3c_irqsub_unmask(data-irq, INTMSK_WDTAC97);
-}
-
-static void s3c2416_irq_wdtac97_ack(struct irq_data *data)
-{
-   s3c_irqsub_maskack(data-irq, INTMSK_WDTAC97, SUBMSK_WDTAC97);
-}
-
-static struct irq_chip s3c2416_irq_wdtac97 = {
-   .irq_mask   = s3c2416_irq_wdtac97_mask,
-   .irq_unmask = s3c2416_irq_wdtac97_unmask,
-   .irq_ack= s3c2416_irq_wdtac97_ack,
-};
-
-/* LCD sub interrupts */
-
-static void s3c2416_irq_demux_lcd(unsigned int irq, struct irq_desc *desc)
-{
-   s3c2416_irq_demux(IRQ_S3C2443_LCD1, 4);
-}
-
-#define INTMSK_LCD (1UL  (IRQ_LCD - IRQ_EINT0))
-#define SUBMSK_LCD INTMSK(IRQ_S3C2443_LCD1, IRQ_S3C2443_LCD4)
-
-static void s3c2416_irq_lcd_mask(struct irq_data *data)
-{
-   s3c_irqsub_mask(data-irq, INTMSK_LCD, SUBMSK_LCD);
-}
-
-static void s3c2416_irq_lcd_unmask(struct irq_data *data)
-{
-   s3c_irqsub_unmask(data-irq, INTMSK_LCD);
-}
-
-static void s3c2416_irq_lcd_ack(struct irq_data *data)
-{
-   s3c_irqsub_maskack(data-irq, INTMSK_LCD, SUBMSK_LCD);
-}
-
-static struct irq_chip s3c2416_irq_lcd = {
-   .irq_mask   = s3c2416_irq_lcd_mask,
-   .irq_unmask = s3c2416_irq_lcd_unmask,
-   .irq_ack= s3c2416_irq_lcd_ack,
-};
-
-/* DMA sub interrupts */
-
-static void s3c2416_irq_demux_dma(unsigned int irq, struct irq_desc *desc)
-{
-   s3c2416_irq_demux(IRQ_S3C2443_DMA0, 6);
-}
-
-#define INTMSK_DMA (1UL  (IRQ_S3C2443_DMA - IRQ_EINT0))
-#define SUBMSK_DMA INTMSK(IRQ_S3C2443_DMA0, IRQ_S3C2443_DMA5)
-
-
-static void s3c2416_irq_dma_mask(struct irq_data *data)
-{
-   s3c_irqsub_mask(data-irq, INTMSK_DMA, SUBMSK_DMA);
-}
-
-static void s3c2416_irq_dma_unmask(struct irq_data *data)
-{
-   s3c_irqsub_unmask(data-irq, INTMSK_DMA);
-}
-
-static void s3c2416_irq_dma_ack(struct irq_data *data)
-{
-   s3c_irqsub_maskack(data-irq, INTMSK_DMA, SUBMSK_DMA);
-}
-
-static struct irq_chip s3c2416_irq_dma = {
-   .irq_mask   = s3c2416_irq_dma_mask,
-   .irq_unmask = s3c2416_irq_dma_unmask,
-   .irq_ack= s3c2416_irq_dma_ack,
+static struct s3c_irq_data init_s3c2416base[32] = {
+   { .type = S3C_IRQTYPE_EINT, }, /* EINT0 */
+   { .type = S3C_IRQTYPE_EINT, }, /* EINT1 */
+   { .type = S3C_IRQTYPE_EINT, }, /* EINT2 */
+   { .type = S3C_IRQTYPE_EINT, }, /* EINT3 */
+   { .type = S3C_IRQTYPE_LEVEL, }, /* EINT4to7 */
+   { .type = S3C_IRQTYPE_LEVEL, }, /* EINT8to23 */
+   { .type = S3C_IRQTYPE_NONE, }, /* reserved */
+   { .type = S3C_IRQTYPE_EDGE, }, /* nBATT_FLT */
+   { .type = S3C_IRQTYPE_EDGE, }, /* TICK */
+   { .type = S3C_IRQTYPE_LEVEL, }, /* WDT/AC97 */
+   { .type = S3C_IRQTYPE_EDGE, }, /* TIMER0 */
+   { .type = 

[PATCH v4 7/9] ARM: S3C24XX: move s3c2443 irq code to irq.c

2013-01-27 Thread Heiko Stübner
Prequisite for further optimizations.

Signed-off-by: Heiko Stuebner he...@sntech.de
---
 arch/arm/mach-s3c24xx/Makefile  |2 +-
 arch/arm/mach-s3c24xx/irq-s3c2443.c |  281 ---
 arch/arm/plat-s3c24xx/irq.c |  243 ++
 3 files changed, 244 insertions(+), 282 deletions(-)
 delete mode 100644 arch/arm/mach-s3c24xx/irq-s3c2443.c

diff --git a/arch/arm/mach-s3c24xx/Makefile b/arch/arm/mach-s3c24xx/Makefile
index 68d134f..1d67582 100644
--- a/arch/arm/mach-s3c24xx/Makefile
+++ b/arch/arm/mach-s3c24xx/Makefile
@@ -39,7 +39,7 @@ obj-$(CONFIG_S3C2440_DMA) += dma-s3c2440.o
 obj-$(CONFIG_S3C2440_PLL_1200) += pll-s3c2440-1200.o
 obj-$(CONFIG_S3C2440_PLL_16934400) += pll-s3c2440-16934400.o
 
-obj-$(CONFIG_CPU_S3C2443)  += s3c2443.o irq-s3c2443.o clock-s3c2443.o
+obj-$(CONFIG_CPU_S3C2443)  += s3c2443.o clock-s3c2443.o
 
 # PM
 
diff --git a/arch/arm/mach-s3c24xx/irq-s3c2443.c 
b/arch/arm/mach-s3c24xx/irq-s3c2443.c
deleted file mode 100644
index 5e69109..000
--- a/arch/arm/mach-s3c24xx/irq-s3c2443.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/* linux/arch/arm/mach-s3c2443/irq.c
- *
- * Copyright (c) 2007 Simtec Electronics
- * Ben Dooks b...@simtec.co.uk
- *
- * 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/module.h
-#include linux/interrupt.h
-#include linux/ioport.h
-#include linux/device.h
-#include linux/io.h
-
-#include mach/hardware.h
-#include asm/irq.h
-
-#include asm/mach/irq.h
-
-#include mach/regs-irq.h
-#include mach/regs-gpio.h
-
-#include plat/cpu.h
-#include plat/pm.h
-#include plat/irq.h
-
-#define INTMSK(start, end) ((1  ((end) + 1 - (start))) - 1)
-
-static inline void s3c2443_irq_demux(unsigned int irq, unsigned int len)
-{
-   unsigned int subsrc, submsk;
-   unsigned int end;
-
-   /* read the current pending interrupts, and the mask
-* for what it is available */
-
-   subsrc = __raw_readl(S3C2410_SUBSRCPND);
-   submsk = __raw_readl(S3C2410_INTSUBMSK);
-
-   subsrc  = ~submsk;
-   subsrc = (irq - S3C2410_IRQSUB(0));
-   subsrc  = (1  len)-1;
-
-   end = len + irq;
-
-   for (; irq  end  subsrc; irq++) {
-   if (subsrc  1)
-   generic_handle_irq(irq);
-
-   subsrc = 1;
-   }
-}
-
-/* WDT/AC97 sub interrupts */
-
-static void s3c2443_irq_demux_wdtac97(unsigned int irq, struct irq_desc *desc)
-{
-   s3c2443_irq_demux(IRQ_S3C2443_WDT, 4);
-}
-
-#define INTMSK_WDTAC97 (1UL  (IRQ_WDT - IRQ_EINT0))
-#define SUBMSK_WDTAC97 INTMSK(IRQ_S3C2443_WDT, IRQ_S3C2443_AC97)
-
-static void s3c2443_irq_wdtac97_mask(struct irq_data *data)
-{
-   s3c_irqsub_mask(data-irq, INTMSK_WDTAC97, SUBMSK_WDTAC97);
-}
-
-static void s3c2443_irq_wdtac97_unmask(struct irq_data *data)
-{
-   s3c_irqsub_unmask(data-irq, INTMSK_WDTAC97);
-}
-
-static void s3c2443_irq_wdtac97_ack(struct irq_data *data)
-{
-   s3c_irqsub_maskack(data-irq, INTMSK_WDTAC97, SUBMSK_WDTAC97);
-}
-
-static struct irq_chip s3c2443_irq_wdtac97 = {
-   .irq_mask   = s3c2443_irq_wdtac97_mask,
-   .irq_unmask = s3c2443_irq_wdtac97_unmask,
-   .irq_ack= s3c2443_irq_wdtac97_ack,
-};
-
-/* LCD sub interrupts */
-
-static void s3c2443_irq_demux_lcd(unsigned int irq, struct irq_desc *desc)
-{
-   s3c2443_irq_demux(IRQ_S3C2443_LCD1, 4);
-}
-
-#define INTMSK_LCD (1UL  (IRQ_LCD - IRQ_EINT0))
-#define SUBMSK_LCD INTMSK(IRQ_S3C2443_LCD1, IRQ_S3C2443_LCD4)
-
-static void s3c2443_irq_lcd_mask(struct irq_data *data)
-{
-   s3c_irqsub_mask(data-irq, INTMSK_LCD, SUBMSK_LCD);
-}
-
-static void s3c2443_irq_lcd_unmask(struct irq_data *data)
-{
-   s3c_irqsub_unmask(data-irq, INTMSK_LCD);
-}
-
-static void s3c2443_irq_lcd_ack(struct irq_data *data)
-{
-   s3c_irqsub_maskack(data-irq, INTMSK_LCD, SUBMSK_LCD);
-}
-
-static struct irq_chip s3c2443_irq_lcd = {
-   .irq_mask   = s3c2443_irq_lcd_mask,
-   .irq_unmask = s3c2443_irq_lcd_unmask,
-   .irq_ack= s3c2443_irq_lcd_ack,
-};
-
-/* DMA sub interrupts */
-
-static void s3c2443_irq_demux_dma(unsigned int irq, struct irq_desc *desc)
-{
-   s3c2443_irq_demux(IRQ_S3C2443_DMA0, 6);
-}
-
-#define INTMSK_DMA (1UL  (IRQ_S3C2443_DMA - IRQ_EINT0))

[PATCH v4 9/9] ARM: S3C24XX: transform s3c2443 subirqs into new structure

2013-01-27 Thread Heiko Stübner
Share the common irq code by simply defining a correct mapping declaration
for the s3c2443.

Signed-off-by: Heiko Stuebner he...@sntech.de
---
 arch/arm/plat-s3c24xx/irq.c |  289 +++
 1 file changed, 75 insertions(+), 214 deletions(-)

diff --git a/arch/arm/plat-s3c24xx/irq.c b/arch/arm/plat-s3c24xx/irq.c
index 4cf3c13..969426b 100644
--- a/arch/arm/plat-s3c24xx/irq.c
+++ b/arch/arm/plat-s3c24xx/irq.c
@@ -732,230 +732,91 @@ void __init s3c2416_init_irq(void)
 #endif
 
 #ifdef CONFIG_CPU_S3C2443
-#define INTMSK(start, end) ((1  ((end) + 1 - (start))) - 1)
-
-static inline void s3c2443_irq_demux(unsigned int irq, unsigned int len)
-{
-   unsigned int subsrc, submsk;
-   unsigned int end;
-
-   /* read the current pending interrupts, and the mask
-* for what it is available */
-
-   subsrc = __raw_readl(S3C2410_SUBSRCPND);
-   submsk = __raw_readl(S3C2410_INTSUBMSK);
-
-   subsrc  = ~submsk;
-   subsrc = (irq - S3C2410_IRQSUB(0));
-   subsrc  = (1  len)-1;
-
-   end = len + irq;
-
-   for (; irq  end  subsrc; irq++) {
-   if (subsrc  1)
-   generic_handle_irq(irq);
-
-   subsrc = 1;
-   }
-}
-
-/* WDT/AC97 sub interrupts */
-
-static void s3c2443_irq_demux_wdtac97(unsigned int irq, struct irq_desc *desc)
-{
-   s3c2443_irq_demux(IRQ_S3C2443_WDT, 4);
-}
-
-#define INTMSK_WDTAC97 (1UL  (IRQ_WDT - IRQ_EINT0))
-#define SUBMSK_WDTAC97 INTMSK(IRQ_S3C2443_WDT, IRQ_S3C2443_AC97)
-
-static void s3c2443_irq_wdtac97_mask(struct irq_data *data)
-{
-   s3c_irqsub_mask(data-irq, INTMSK_WDTAC97, SUBMSK_WDTAC97);
-}
-
-static void s3c2443_irq_wdtac97_unmask(struct irq_data *data)
-{
-   s3c_irqsub_unmask(data-irq, INTMSK_WDTAC97);
-}
-
-static void s3c2443_irq_wdtac97_ack(struct irq_data *data)
-{
-   s3c_irqsub_maskack(data-irq, INTMSK_WDTAC97, SUBMSK_WDTAC97);
-}
-
-static struct irq_chip s3c2443_irq_wdtac97 = {
-   .irq_mask   = s3c2443_irq_wdtac97_mask,
-   .irq_unmask = s3c2443_irq_wdtac97_unmask,
-   .irq_ack= s3c2443_irq_wdtac97_ack,
-};
-
-/* LCD sub interrupts */
-
-static void s3c2443_irq_demux_lcd(unsigned int irq, struct irq_desc *desc)
-{
-   s3c2443_irq_demux(IRQ_S3C2443_LCD1, 4);
-}
-
-#define INTMSK_LCD (1UL  (IRQ_LCD - IRQ_EINT0))
-#define SUBMSK_LCD INTMSK(IRQ_S3C2443_LCD1, IRQ_S3C2443_LCD4)
-
-static void s3c2443_irq_lcd_mask(struct irq_data *data)
-{
-   s3c_irqsub_mask(data-irq, INTMSK_LCD, SUBMSK_LCD);
-}
-
-static void s3c2443_irq_lcd_unmask(struct irq_data *data)
-{
-   s3c_irqsub_unmask(data-irq, INTMSK_LCD);
-}
-
-static void s3c2443_irq_lcd_ack(struct irq_data *data)
-{
-   s3c_irqsub_maskack(data-irq, INTMSK_LCD, SUBMSK_LCD);
-}
-
-static struct irq_chip s3c2443_irq_lcd = {
-   .irq_mask   = s3c2443_irq_lcd_mask,
-   .irq_unmask = s3c2443_irq_lcd_unmask,
-   .irq_ack= s3c2443_irq_lcd_ack,
-};
-
-/* DMA sub interrupts */
-
-static void s3c2443_irq_demux_dma(unsigned int irq, struct irq_desc *desc)
-{
-   s3c2443_irq_demux(IRQ_S3C2443_DMA0, 6);
-}
-
-#define INTMSK_DMA (1UL  (IRQ_S3C2443_DMA - IRQ_EINT0))
-#define SUBMSK_DMA INTMSK(IRQ_S3C2443_DMA0, IRQ_S3C2443_DMA5)
-
-static void s3c2443_irq_dma_mask(struct irq_data *data)
-{
-   s3c_irqsub_mask(data-irq, INTMSK_DMA, SUBMSK_DMA);
-}
-
-static void s3c2443_irq_dma_unmask(struct irq_data *data)
-{
-   s3c_irqsub_unmask(data-irq, INTMSK_DMA);
-}
-
-static void s3c2443_irq_dma_ack(struct irq_data *data)
-{
-   s3c_irqsub_maskack(data-irq, INTMSK_DMA, SUBMSK_DMA);
-}
-
-static struct irq_chip s3c2443_irq_dma = {
-   .irq_mask   = s3c2443_irq_dma_mask,
-   .irq_unmask = s3c2443_irq_dma_unmask,
-   .irq_ack= s3c2443_irq_dma_ack,
-};
-
-/* UART3 sub interrupts */
-
-static void s3c2443_irq_demux_uart3(unsigned int irq, struct irq_desc *desc)
-{
-   s3c2443_irq_demux(IRQ_S3C2443_RX3, 3);
-}
-
-#define INTMSK_UART3   (1UL  (IRQ_S3C2443_UART3 - IRQ_EINT0))
-#define SUBMSK_UART3   (0x7  (IRQ_S3C2443_RX3 - S3C2410_IRQSUB(0)))
-
-static void s3c2443_irq_uart3_mask(struct irq_data *data)
-{
-   s3c_irqsub_mask(data-irq, INTMSK_UART3, SUBMSK_UART3);
-}
-
-static void s3c2443_irq_uart3_unmask(struct irq_data *data)
-{
-   s3c_irqsub_unmask(data-irq, INTMSK_UART3);
-}
-
-static void s3c2443_irq_uart3_ack(struct irq_data *data)
-{
-   s3c_irqsub_maskack(data-irq, INTMSK_UART3, SUBMSK_UART3);
-}
-
-static struct irq_chip s3c2443_irq_uart3 = {
-   .irq_mask   = s3c2443_irq_uart3_mask,
-   .irq_unmask = s3c2443_irq_uart3_unmask,
-   .irq_ack= s3c2443_irq_uart3_ack,
+static struct s3c_irq_data init_s3c2443base[32] = {
+   { .type = S3C_IRQTYPE_EINT, }, /* EINT0 */
+   { .type = S3C_IRQTYPE_EINT, }, /* EINT1 */
+   { .type = S3C_IRQTYPE_EINT, }, /* EINT2 */
+   { .type = S3C_IRQTYPE_EINT, }, /* EINT3 */
+   { .type = 

Re: [PATCH 1/4] ARM: dts: add support for hdmi to exynos4

2013-01-27 Thread Sylwester Nawrocki

On 01/25/2013 11:39 AM, Rahul Sharma wrote:

Signed-off-by: Rahul Sharmarahul.sha...@samsung.com


Please provide proper commit text.


Conflicts:
arch/arm/mach-exynos/mach-exynos4-dt.c


And make sure things like this are removed when submitting patches.


---
  arch/arm/boot/dts/exynos4.dtsi | 7 +++
  arch/arm/mach-exynos/mach-exynos4-dt.c | 2 ++
  2 files changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index e1347fc..6c2c79d 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -289,4 +289,11 @@
interrupts =0 34 0;
};
};
+
+   hdmi {
+   compatible = samsung,exynos4-hdmi14;


What -hdmi14 signifies here ? And to which Exynos4 SoC revisions this
compatible property is supposed to apply ?


+   reg =0x12D0 0x7;
+   interrupts =0 95 0;
+   hpd-gpio =gpx3 7 0xf 1 3;
+   };


New bindings need to be documented in Documentation/devicetree/bindings/.

--

Thanks,
Sylwester
--
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 2/4] ARM: dts: add support for mixer to exynos4

2013-01-27 Thread Sylwester Nawrocki

On 01/25/2013 11:39 AM, Rahul Sharma wrote:

diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index 6c2c79d..07cb7d4 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -296,4 +296,12 @@
interrupts =0 95 0;
hpd-gpio =gpx3 7 0xf 1 3;
};
+
+   mixer: mixer {
+   compatible = samsung,exynos4-mixer;


I'm afraid this compatible property it too generic. Is the video mixer IP
really identical an all the Exynos4 series SoCs ?


+   reg =   0x12c1 0x1,
+   0x12c0 0x1;
+   interrupts =0 91 0;
+   samsung,power-domain =pd_tv;
+   };
  };


Is there documentation for these new bindings available somewhere ?

--

Thanks,
Sylwester
--
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 v4 0/9] ARM: S3C24XX: rework irq handling for a later dt usage

2013-01-27 Thread Heiko Stübner
This v4 does not change any code part. The patches are merely rebased
to apply to the next/cleanup-s3c24xx branch as requested.

Heiko Stuebner (9):
  ARM: S3C24XX: transform irq handling into a declarative form
  ARM: S3C24XX: Move irq syscore-ops to irq-pm
  ARM: S3C24XX: Modify s3c_irq_wake to use the hwirq property
  ARM: S3C24XX: move s3c2416 irq init to common irq code
  ARM: S3C24XX: modify s3c2416 irq init to initialize all irqs
  ARM: S3C24XX: transform s3c2416 irqs into new structure
  ARM: S3C24XX: move s3c2443 irq code to irq.c
  ARM: S3C24XX: modify s3c2443 irq init to initialize all irqs
  ARM: S3C24XX: transform s3c2443 subirqs into new structure

 arch/arm/mach-s3c24xx/Makefile   |4 +-
 arch/arm/mach-s3c24xx/common.h   |2 +
 arch/arm/mach-s3c24xx/irq-pm.c   |   41 +-
 arch/arm/mach-s3c24xx/irq-s3c2416.c  |  348 
 arch/arm/mach-s3c24xx/irq-s3c2443.c  |  281 ---
 arch/arm/mach-s3c24xx/mach-smdk2416.c|2 +-
 arch/arm/mach-s3c24xx/mach-smdk2443.c|2 +-
 arch/arm/mach-s3c24xx/s3c2410.c  |4 +-
 arch/arm/mach-s3c24xx/s3c2412.c  |4 +-
 arch/arm/mach-s3c24xx/s3c2416.c  |4 +-
 arch/arm/mach-s3c24xx/s3c2440.c  |4 +-
 arch/arm/mach-s3c24xx/s3c2442.c  |4 +-
 arch/arm/plat-s3c24xx/Kconfig|1 +
 arch/arm/plat-s3c24xx/irq.c  | 1110 +++---
 arch/arm/plat-samsung/include/plat/pm.h  |6 -
 arch/arm/plat-samsung/include/plat/s3c2416.h |1 +
 arch/arm/plat-samsung/include/plat/s3c2443.h |2 +
 17 files changed, 688 insertions(+), 1132 deletions(-)
 delete mode 100644 arch/arm/mach-s3c24xx/irq-s3c2416.c
 delete mode 100644 arch/arm/mach-s3c24xx/irq-s3c2443.c

-- 
1.7.10.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 V2 2/2] thermal: exynos: Use the framework for temperature emulation support

2013-01-27 Thread Amit Daniel Kachhap
This removes the driver specific sysfs support of the temperature
emulation and uses the newly added core thermal framework for thermal
emulation. A platform specific handler is added to support this.

Signed-off-by: Amit Daniel Kachhap amit.dan...@samsung.com
Acked-by: Kukjin Kim kgene@samsung.com
---
Changes in V2:
* Added config option CONFIG_THERMAL_EMULATION instead of
 CONFIG_EXYNOS_THERMAL_EMUL 

This patchset is based on thermal maintainer next tree.
git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git next 

 Documentation/thermal/exynos_thermal_emulation |8 +-
 drivers/thermal/Kconfig|9 --
 drivers/thermal/exynos_thermal.c   |  158 ++--
 3 files changed, 67 insertions(+), 108 deletions(-)

diff --git a/Documentation/thermal/exynos_thermal_emulation 
b/Documentation/thermal/exynos_thermal_emulation
index b73bbfb..36a3e79 100644
--- a/Documentation/thermal/exynos_thermal_emulation
+++ b/Documentation/thermal/exynos_thermal_emulation
@@ -13,11 +13,11 @@ Thermal emulation mode supports software debug for TMU's 
operation. User can set
 manually with software code and TMU will read current temperature from user 
value not from
 sensor's value.
 
-Enabling CONFIG_EXYNOS_THERMAL_EMUL option will make this support in available.
-When it's enabled, sysfs node will be created under
-/sys/bus/platform/devices/'exynos device name'/ with name of 'emulation'.
+Enabling CONFIG_THERMAL_EMULATION option will make this support available.
+When it's enabled, sysfs node will be created as
+/sys/devices/virtual/thermal/thermal_zone'zone id'/emul_temp.
 
-The sysfs node, 'emulation', will contain value 0 for the initial state. When 
you input any
+The sysfs node, 'emul_node', will contain value 0 for the initial state. When 
you input any
 temperature you want to update to sysfs node, it automatically enable 
emulation mode and
 current temperature will be changed into it.
 (Exynos also supports user changable delay time which would be used to delay of
diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
index e4cf7fb..2a79510 100644
--- a/drivers/thermal/Kconfig
+++ b/drivers/thermal/Kconfig
@@ -109,15 +109,6 @@ config EXYNOS_THERMAL
  If you say yes here you get support for TMU (Thermal Management
  Unit) on SAMSUNG EXYNOS series of SoC.
 
-config EXYNOS_THERMAL_EMUL
-   bool EXYNOS TMU emulation mode support
-   depends on EXYNOS_THERMAL
-   help
- Exynos 4412 and 4414 and 5 series has emulation mode on TMU.
- Enable this option will be make sysfs node in exynos thermal platform
- device directory to support emulation mode. With emulation mode sysfs
- node, you can manually input temperature to TMU for simulation 
purpose.
-
 config DB8500_THERMAL
bool DB8500 thermal management
depends on ARCH_U8500
diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
index 327102a..afe9c2a 100644
--- a/drivers/thermal/exynos_thermal.c
+++ b/drivers/thermal/exynos_thermal.c
@@ -99,13 +99,13 @@
 #define IDLE_INTERVAL 1
 #define MCELSIUS   1000
 
-#ifdef CONFIG_EXYNOS_THERMAL_EMUL
+#ifdef CONFIG_THERMAL_EMULATION
 #define EXYNOS_EMUL_TIME   0x57F0
 #define EXYNOS_EMUL_TIME_SHIFT 16
 #define EXYNOS_EMUL_DATA_SHIFT 8
 #define EXYNOS_EMUL_DATA_MASK  0xFF
 #define EXYNOS_EMUL_ENABLE 0x1
-#endif /* CONFIG_EXYNOS_THERMAL_EMUL */
+#endif /* CONFIG_THERMAL_EMULATION */
 
 /* CPU Zone information */
 #define PANIC_ZONE  4
@@ -143,6 +143,7 @@ struct  thermal_cooling_conf {
 struct thermal_sensor_conf {
char name[SENSOR_NAME_LEN];
int (*read_temperature)(void *data);
+   int (*write_emul_temp)(void *data, unsigned long temp);
struct thermal_trip_point_conf trip_data;
struct thermal_cooling_conf cooling_data;
void *private_data;
@@ -366,6 +367,23 @@ static int exynos_get_temp(struct thermal_zone_device 
*thermal,
return 0;
 }
 
+/* Get temperature callback functions for thermal zone */
+static int exynos_set_emul_temp(struct thermal_zone_device *thermal,
+   unsigned long temp)
+{
+   void *data;
+   int ret = -EINVAL;
+
+   if (!th_zone-sensor_conf) {
+   pr_info(Temperature sensor not initialised\n);
+   return -EINVAL;
+   }
+   data = th_zone-sensor_conf-private_data;
+   if (th_zone-sensor_conf-write_emul_temp)
+   ret = th_zone-sensor_conf-write_emul_temp(data, temp);
+   return ret;
+}
+
 /* Get the temperature trend */
 static int exynos_get_trend(struct thermal_zone_device *thermal,
int trip, enum thermal_trend *trend)
@@ -382,6 +400,7 @@ static struct thermal_zone_device_ops const exynos_dev_ops 
= {
.bind = exynos_bind,
.unbind = exynos_unbind,
.get_temp = exynos_get_temp,
+   .set_emul_temp = 

Re: [PATCH 1/2] thermal: sysfs: Add a new sysfs node emul_temp

2013-01-27 Thread amit kachhap
On Mon, Jan 21, 2013 at 7:20 PM, Zhang Rui rui.zh...@intel.com wrote:
 On Wed, 2013-01-16 at 11:30 -0800, amit kachhap wrote:
 Hi Rui,

 Thanks for the review comments,
 On Tue, Jan 15, 2013 at 11:33 PM, Zhang Rui rui.zh...@intel.com wrote:
  Hi, Amit,
 
  On Sun, 2013-01-06 at 16:08 -0800, Amit Daniel Kachhap wrote:
  This patch adds support to set the emulated temperature method in
  thermal zone (sensor). After setting this feature thermal zone must
  report this temperature and not the actual temperature. The actual
  implementation of this emulated temperature is based on sensor
  capability or platform specific. This is useful in debugging different
  temperature threshold and its associated cooling action. Writing 0 on
  this node should disable emulation.
 
  Question:
  will this bring hardware issue? Say, critical temperature reached while
  in emulation mode?
 No emulation does cause any h/w issue.
 
  As this is for debug purpose, I'd prefer to have a seperate Kconfig
  option for this feature.
 Yes agreed. Will re-submit with kconfig option.
 
  Signed-off-by: Amit Daniel Kachhap amit.dan...@samsung.com
  ---
   Documentation/thermal/sysfs-api.txt |   14 ++
   drivers/thermal/thermal_sys.c   |   26 ++
   include/linux/thermal.h |1 +
   3 files changed, 41 insertions(+), 0 deletions(-)
 
  diff --git a/Documentation/thermal/sysfs-api.txt 
  b/Documentation/thermal/sysfs-api.txt
  index 88c0233..e8f2ee4 100644
  --- a/Documentation/thermal/sysfs-api.txt
  +++ b/Documentation/thermal/sysfs-api.txt
  @@ -55,6 +55,8 @@ temperature) and throttle appropriate devices.
.get_trip_type: get the type of certain trip point.
.get_trip_temp: get the temperature above which the certain trip 
  point
will be fired.
  + .set_emul_temp: set the emulation temperature which helps in 
  debugging
  + different threshold temperature points.
 
   1.1.2 void thermal_zone_device_unregister(struct thermal_zone_device *tz)
 
  @@ -153,6 +155,7 @@ Thermal zone device sys I/F, created once it's 
  registered:
   |---trip_point_[0-*]_temp:   Trip point temperature
   |---trip_point_[0-*]_type:   Trip point type
   |---trip_point_[0-*]_hyst:   Hysteresis value for this trip point
  +|---emul_temp:   Emulated temperature set node
 
   Thermal cooling device sys I/F, created once it's registered:
   /sys/class/thermal/cooling_device[0-*]:
  @@ -252,6 +255,17 @@ passive
Valid values: 0 (disabled) or greater than 1000
RW, Optional
 
  +emul_temp
  + Interface to set the emulated temperature method in thermal zone
  + (sensor). After setting this feature thermal zone must report
  + this temperature and not the actual temperature. The actual
  + implementation of this emulated temperature is platform specific.
 
  can we have a pure software temperature emulation method?
  say, the generic thermal layer caches the emulated temperature value,
  and hook it in update_temperature()?
  This is also useful for testing in polling mode, and it does not require
  platform specific callback support. I mean thermal_ops-set_emul_temp is
  optional, but thermal emulation is always available for all platforms.
 Yes It makes sense and we can have pure software emulation and use the
 cached temperature when no platform call is registered. In my case I
 needed this in h/w so to have the same sensor trigger interrupts
 behaviour.

 So the code flow can be like this,

 #ifdef CONFIG_THERMAL_EMULATION
 if (thermal_ops-set_emul_temp)
 then pass emul_temp to platform and use the normal platform
 thermal_ops-get_temp
 else
 Store it locally and use emul_temp  instead of calling platform
 thermal_ops-get_temp
 #endif

 No.
 We should not support emulation is CONFIG_THERMAL_EMULATION is cleared.
 And further more, for pure software emulation, we should check if the
 real temperature reaches critical trip point.
Yes agreed. Submitted the V2 version with your suggestion.

Thanks,
Amit Daniel


 thanks,
 rui
 I will re-submit with this change.

 Thanks,
 Amit
 
  thanks,
  rui
  + This is useful in debugging different temperature threshold and its
  + associated cooling action. Writing 0 on this node should disable
  + emulation.
  + Unit: millidegree Celsius
  + WO, Optional
  +
   *
   * Cooling device attributes *
   *
  diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
  index 8c8ce80..ecdfc7d 100644
  --- a/drivers/thermal/thermal_sys.c
  +++ b/drivers/thermal/thermal_sys.c
  @@ -700,11 +700,31 @@ policy_show(struct device *dev, struct 
  device_attribute *devattr, char *buf)
return sprintf(buf, %s\n, tz-governor-name);
   }
 
  +static ssize_t
  +emul_temp_store(struct device *dev, struct device_attribute *attr,
  +  const char *buf, size_t 

[PATCH V2 1/2] thermal: sysfs: Add a new sysfs node emul_temp for thermal emulation

2013-01-27 Thread Amit Daniel Kachhap
This patch adds support to set the emulated temperature method in
thermal zone (sensor). After setting this feature thermal zone may
report this temperature and not the actual temperature. The emulation
implementation may be based on sensor capability through platform
specific handler or pure software emulation if no platform handler defined.

This is useful in debugging different temperature threshold and its
associated cooling action. Critical threshold's cannot be emulated.
Writing 0 on this node should disable emulation.

Signed-off-by: Amit Daniel Kachhap amit.dan...@samsung.com
Acked-by: Kukjin Kim kgene@samsung.com
---

Changes in V2:
* Added config option for enabling emulation support.
* Added s/w emulation if no platform handler registered.
* skip the critical trip point emulation

This patchset is based on thermal maintainer next tree.
git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git next 

 Documentation/thermal/sysfs-api.txt |   13 ++
 drivers/thermal/Kconfig |8 +++
 drivers/thermal/thermal_sys.c   |   82 ++-
 include/linux/thermal.h |2 +
 4 files changed, 94 insertions(+), 11 deletions(-)

diff --git a/Documentation/thermal/sysfs-api.txt 
b/Documentation/thermal/sysfs-api.txt
index 526d4b9..6859661 100644
--- a/Documentation/thermal/sysfs-api.txt
+++ b/Documentation/thermal/sysfs-api.txt
@@ -55,6 +55,8 @@ temperature) and throttle appropriate devices.
.get_trip_type: get the type of certain trip point.
.get_trip_temp: get the temperature above which the certain trip point
will be fired.
+   .set_emul_temp: set the emulation temperature which helps in debugging
+   different threshold temperature points.
 
 1.1.2 void thermal_zone_device_unregister(struct thermal_zone_device *tz)
 
@@ -153,6 +155,7 @@ Thermal zone device sys I/F, created once it's registered:
 |---trip_point_[0-*]_temp: Trip point temperature
 |---trip_point_[0-*]_type: Trip point type
 |---trip_point_[0-*]_hyst: Hysteresis value for this trip point
+|---emul_temp: Emulated temperature set node
 
 Thermal cooling device sys I/F, created once it's registered:
 /sys/class/thermal/cooling_device[0-*]:
@@ -252,6 +255,16 @@ passive
Valid values: 0 (disabled) or greater than 1000
RW, Optional
 
+emul_temp
+   Interface to set the emulated temperature method in thermal zone
+   (sensor). After setting this temperature, the thermal zone may pass
+   this temperature to platform emulation function if registered or
+   cache it locally. This is useful in debugging different temperature
+   threshold and its associated cooling action. This is write only node
+   and writing 0 on this node should disable emulation.
+   Unit: millidegree Celsius
+   WO, Optional
+
 *
 * Cooling device attributes *
 *
diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
index faf38c5..e4cf7fb 100644
--- a/drivers/thermal/Kconfig
+++ b/drivers/thermal/Kconfig
@@ -78,6 +78,14 @@ config CPU_THERMAL
  and not the ACPI interface.
  If you want this support, you should say Y here.
 
+config THERMAL_EMULATION
+   bool Thermal emulation mode support
+   help
+ Enable this option to make a emul_temp sysfs node in thermal zone
+ directory to support temperature emulation. With emulation sysfs node,
+ user can manually input temperature and test the different trip
+ threshold behaviour for simulation purpose.
+
 config SPEAR_THERMAL
bool SPEAr thermal sensor driver
depends on PLAT_SPEAR
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 0a1bf6b..59ba709 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -378,24 +378,57 @@ static void handle_thermal_trip(struct 
thermal_zone_device *tz, int trip)
monitor_thermal_zone(tz);
 }
 
+static int thermal_zone_get_temp(struct thermal_zone_device *tz,
+   unsigned long *temp)
+{
+   int ret = 0, count;
+   unsigned long crit_temp = -1UL;
+   enum thermal_trip_type type;
+
+   mutex_lock(tz-lock);
+
+   if (tz-ops-get_temp)
+   ret = tz-ops-get_temp(tz, temp);
+   else
+   ret = -EPERM;
+
+   if (!tz-emul_temperature)
+   goto skip_emul;
+
+   for (count = 0; count  tz-trips; count++) {
+   ret = tz-ops-get_trip_type(tz, count, type);
+   if (!ret  type == THERMAL_TRIP_CRITICAL) {
+   ret = tz-ops-get_trip_temp(tz, count, crit_temp);
+   break;
+   }
+   }
+
+   if (ret)
+   goto skip_emul;
+
+   if (*temp  crit_temp)
+   *temp = tz-emul_temperature;
+
+skip_emul:
+   mutex_unlock(tz-lock);
+ 

Re: [PATCH] drivers: cpufreq: exynos: update related_cpus mask to fix hotplug dump

2013-01-27 Thread Viresh Kumar
On Thu, Jan 24, 2013 at 9:40 AM, Inderpal Singh
inderpal.si...@linaro.org wrote:
 commit 7e6087e595d3...cpufreq: Simplify cpufreq_add_dev() started using
 related_cpus mask to check if the current cpu is already managed.

 With above commit hotplug in exynos gives following dump.

 / $ echo 1  /sys/devices/system/cpu/cpu1/online
 CPU1: Booted secondary processor
 [ cut here ]
 WARNING: at fs/sysfs/dir.c:536 sysfs_add_one+0x88/0xbc()
 sysfs: cannot create duplicate filename '/devices/system/cpu/cpu0/cpufreq'
 Modules linked in:
 [c0014560] (unwind_backtrace+0x0/0xf8) from [c0020214] 
 (warn_slowpath_common+0x4c/0x64)
 [c0020214] (warn_slowpath_common+0x4c/0x64) from [c00202c0] 
 (warn_slowpath_fmt+0x30/0x40)
 [c00202c0] (warn_slowpath_fmt+0x30/0x40) from [c00fb548] 
 (sysfs_add_one+0x88/0xbc)
 [c00fb548] (sysfs_add_one+0x88/0xbc) from [c00fc184] 
 (sysfs_do_create_link+0x110/0x208)
 [c00fc184] (sysfs_do_create_link+0x110/0x208) from [c019a868] 
 (cpufreq_add_dev_interface+0x218/0x2b0)
 [c019a868] (cpufreq_add_dev_interface+0x218/0x2b0) from [c019ac0c] 
 (cpufreq_add_dev+0x30c/0x448)
 [c019ac0c] (cpufreq_add_dev+0x30c/0x448) from [c01bdb84] 
 (cpufreq_cpu_callback+0x94/0x9c)
 [c01bdb84] (cpufreq_cpu_callback+0x94/0x9c) from [c0040fac] 
 (notifier_call_chain+0x44/0x84)
 [c0040fac] (notifier_call_chain+0x44/0x84) from [c0023484] 
 (__cpu_notify+0x28/0x44)
 [c0023484] (__cpu_notify+0x28/0x44) from [c01bc320] (_cpu_up+0x104/0x154)
 [c01bc320] (_cpu_up+0x104/0x154) from [c01bc3d4] (cpu_up+0x64/0x84)
 [c01bc3d4] (cpu_up+0x64/0x84) from [c01bafc8] (store_online+0x50/0x78)
 [c01bafc8] (store_online+0x50/0x78) from [c016850c] 
 (dev_attr_store+0x18/0x24)
 [c016850c] (dev_attr_store+0x18/0x24) from [c00fa12c] 
 (sysfs_write_file+0x168/0x198)
 [c00fa12c] (sysfs_write_file+0x168/0x198) from [c00a7424] 
 (vfs_write+0x9c/0x140)
 [c00a7424] (vfs_write+0x9c/0x140) from [c00a76b0] (sys_write+0x3c/0x70)
 [c00a76b0] (sys_write+0x3c/0x70) from [c000e2c0] 
 (ret_fast_syscall+0x0/0x30)
 ---[ end trace 3d002b0ded69f43b ]---

 This patch fixes it by updating the related_cpus mask.

 Tested on Rafael's linux-next.

 Signed-off-by: Inderpal Singh inderpal.si...@linaro.org
 ---
  drivers/cpufreq/exynos-cpufreq.c |1 +
  1 file changed, 1 insertion(+)

 diff --git a/drivers/cpufreq/exynos-cpufreq.c 
 b/drivers/cpufreq/exynos-cpufreq.c
 index 7012ea8..8ba4cdb 100644
 --- a/drivers/cpufreq/exynos-cpufreq.c
 +++ b/drivers/cpufreq/exynos-cpufreq.c
 @@ -238,6 +238,7 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy 
 *policy)
 cpumask_copy(policy-cpus, cpu_online_mask);
 } else {
 policy-shared_type = CPUFREQ_SHARED_TYPE_ANY;
 +   cpumask_setall(policy-related_cpus);
 cpumask_setall(policy-cpus);

This is required for all SMP systems.

Acked-by: Viresh Kumar viresh.ku...@linaro.org
--
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/5] Add DRM FIMD DT support for Exynos4 DT Machines

2013-01-27 Thread Vikas Sajjan
This patch series adds support for DRM FIMD DT for Exynos4 DT Machines,
specifically for Exynos4412 SoC.

Is based on branch for-next
http://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git

Vikas Sajjan (5):
  ARM: dts: Add FIMD node to exynos4
  ARM: dts: Adds lcd pinctrl node entries for SAMSUNG EXYNOS4412 SoC
  ARM: dts: Add FIMD node and display timing node to
exynos4412-origen.dts
  ARM: dts: adds FIMD AUXDATA node entry for exynos4 DT
  ARM: EXYNOS: Enable backlight and PWM support for Exynos4 DT machines

 arch/arm/boot/dts/exynos4.dtsi|7 +++
 arch/arm/boot/dts/exynos4412-origen.dts   |   21 +
 arch/arm/boot/dts/exynos4x12-pinctrl.dtsi |   26 ++
 arch/arm/mach-exynos/Kconfig  |2 ++
 arch/arm/mach-exynos/mach-exynos4-dt.c|4 
 5 files changed, 60 insertions(+)

-- 
1.7.9.5

--
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/5] ARM: dts: Add FIMD node to exynos4

2013-01-27 Thread Vikas Sajjan
This adds common FIMD device node for all Exynos4 SoCs.

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 arch/arm/boot/dts/exynos4.dtsi |7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index e1347fc..96c3b4a 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -289,4 +289,11 @@
interrupts = 0 34 0;
};
};
+
+   fimd@11c0 {
+   compatible = samsung,exynos4-fimd;
+   interrupt-parent = combiner;
+   reg = 0x11c0 0x2;
+   interrupts = 11 1, 11 0, 11 2;
+   };
 };
-- 
1.7.9.5

--
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/5] ARM: dts: Adds lcd pinctrl node entries for SAMSUNG EXYNOS4412 SoC

2013-01-27 Thread Vikas Sajjan
This patch adds the lcd lanel related picntrl nodes for Exynos4412 SoC

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 arch/arm/boot/dts/exynos4x12-pinctrl.dtsi |   26 ++
 1 file changed, 26 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
index 8e6115a..33a549c 100644
--- a/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
@@ -354,6 +354,32 @@
samsung,pin-drv = 0;
};
 
+   lcd_sync: lcd-sync {
+   samsung,pins = gpf0-0, gpf0-1;
+   samsung,pin-function = 2;
+   samsung,pin-pud = 0;
+   samsung,pin-drv = 0;
+   };
+
+   lcd0_data: lcd0-data {
+   samsung,pins = gpf0-4, gpf0-5, gpf0-6, gpf0-7,
+   gpf1-0, gpf1-1, gpf1-2, gpf1-3,
+   gpf1-4, gpf1-5, gpf1-6, gpf1-7,
+   gpf2-0, gpf2-1, gpf2-2, gpf2-3,
+   gpf2-4, gpf2-5, gpf2-6, gpf2-7,
+   gpf3-0, gpf3-1, gpf3-2, gpf3-3;
+   samsung,pin-function = 2;
+   samsung,pin-pud = 0;
+   samsung,pin-drv = 0;
+   };
+
+   lcd_en: lcd-en {
+   samsung,pins = gpf0-3;
+   samsung,pin-function = 2;
+   samsung,pin-pud = 0;
+   samsung,pin-drv = 0;
+   };
+
lcd_clk: lcd-clk {
samsung,pins = gpf0-0, gpf0-1, gpf0-2, gpf0-3;
samsung,pin-function = 2;
-- 
1.7.9.5

--
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] ARM: dts: adds FIMD AUXDATA node entry for exynos4 DT

2013-01-27 Thread Vikas Sajjan
This patch adds the FIMD AUXDATA node

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 arch/arm/mach-exynos/mach-exynos4-dt.c |4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c 
b/arch/arm/mach-exynos/mach-exynos4-dt.c
index ab1dacc..6c9e05f 100644
--- a/arch/arm/mach-exynos/mach-exynos4-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos4-dt.c
@@ -13,6 +13,7 @@
 
 #include linux/of_platform.h
 #include linux/serial_core.h
+#include linux/fb.h
 
 #include asm/mach/arch.h
 #include asm/hardware/gic.h
@@ -80,6 +81,9 @@ static const struct of_dev_auxdata exynos4_auxdata_lookup[] 
__initconst = {
OF_DEV_AUXDATA(arm,pl330, EXYNOS4_PA_MDMA1, dma-pl330.2, NULL),
OF_DEV_AUXDATA(samsung,exynos4210-tmu, EXYNOS4_PA_TMU,
exynos-tmu, NULL),
+   OF_DEV_AUXDATA(samsung,exynos4-fimd, EXYNOS4_PA_FIMD0,
+   exynos4-fb.0, NULL),
+
{},
 };
 
-- 
1.7.9.5

--
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] ARM: EXYNOS: Enable backlight and PWM support for Exynos4 DT machines

2013-01-27 Thread Vikas Sajjan
Enables support for Backlight and PWM on Exynos4 DT machines

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 arch/arm/mach-exynos/Kconfig |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index e103c29..8ecde22 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -416,6 +416,8 @@ config MACH_EXYNOS4_DT
select PINCTRL
select PINCTRL_EXYNOS4
select USE_OF
+   select SAMSUNG_DEV_BACKLIGHT
+   select SAMSUNG_DEV_PWM
help
  Machine support for Samsung Exynos4 machine with device tree enabled.
  Select this if a fdt blob is available for the Exynos4 SoC based 
board.
-- 
1.7.9.5

--
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 1/4] ARM: dts: add support for hdmi to exynos4

2013-01-27 Thread Rahul Sharma
Hi Sylwester,

On Mon, Jan 28, 2013 at 2:24 AM, Sylwester Nawrocki
sylvester.nawro...@gmail.com wrote:
 On 01/25/2013 11:39 AM, Rahul Sharma wrote:

 Signed-off-by: Rahul Sharmarahul.sha...@samsung.com


 Please provide proper commit text.

 Conflicts:
 arch/arm/mach-exynos/mach-exynos4-dt.c


 And make sure things like this are removed when submitting patches.


I will take care.

 ---
   arch/arm/boot/dts/exynos4.dtsi | 7 +++
   arch/arm/mach-exynos/mach-exynos4-dt.c | 2 ++
   2 files changed, 9 insertions(+)

 diff --git a/arch/arm/boot/dts/exynos4.dtsi
 b/arch/arm/boot/dts/exynos4.dtsi
 index e1347fc..6c2c79d 100644
 --- a/arch/arm/boot/dts/exynos4.dtsi
 +++ b/arch/arm/boot/dts/exynos4.dtsi
 @@ -289,4 +289,11 @@
 interrupts =0 34 0;
 };
 };
 +
 +   hdmi {
 +   compatible = samsung,exynos4-hdmi14;


 What -hdmi14 signifies here ? And to which Exynos4 SoC revisions this
 compatible property is supposed to apply ?


-hdmi14 signifies 1.4 compliant Hdmi IP like in Exynos4412, while
Exynos4210 has 1.3
compliant HDMI block. I have done a mistake here. I should have kept
it in 4412.dtsi. OR
I can move it to 4x12.dtsi but not sure whether all 4x12 socs have 1.4 hdmi.


 +   reg =0x12D0 0x7;
 +   interrupts =0 95 0;
 +   hpd-gpio =gpx3 7 0xf 1 3;
 +   };


 New bindings need to be documented in Documentation/devicetree/bindings/.

It is present at Documentation/devicetree/bindings/drm/exynos/hdmi.txt.

Regards,
Rahul Sharma.

 --

 Thanks,
 Sylwester
--
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 0/5] Add DRM FIMD DT support for Exynos4 DT Machines

2013-01-27 Thread Sachin Kamat
Hi Vikas,

You need to CC devicetree-disc...@lists.ozlabs.org for patches adding
new bindings and add documentation related to it.

On 28 January 2013 11:14, Vikas Sajjan vikas.saj...@linaro.org wrote:
 This patch series adds support for DRM FIMD DT for Exynos4 DT Machines,
 specifically for Exynos4412 SoC.

 Is based on branch for-next
 http://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git

 Vikas Sajjan (5):
   ARM: dts: Add FIMD node to exynos4
   ARM: dts: Adds lcd pinctrl node entries for SAMSUNG EXYNOS4412 SoC
   ARM: dts: Add FIMD node and display timing node to
 exynos4412-origen.dts
   ARM: dts: adds FIMD AUXDATA node entry for exynos4 DT
   ARM: EXYNOS: Enable backlight and PWM support for Exynos4 DT machines

  arch/arm/boot/dts/exynos4.dtsi|7 +++
  arch/arm/boot/dts/exynos4412-origen.dts   |   21 +
  arch/arm/boot/dts/exynos4x12-pinctrl.dtsi |   26 ++
  arch/arm/mach-exynos/Kconfig  |2 ++
  arch/arm/mach-exynos/mach-exynos4-dt.c|4 
  5 files changed, 60 insertions(+)

 --
 1.7.9.5




-- 
With warm regards,
Sachin
--
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 2/4] ARM: dts: add support for mixer to exynos4

2013-01-27 Thread Rahul Sharma
On Mon, Jan 28, 2013 at 2:34 AM, Sylwester Nawrocki
sylvester.nawro...@gmail.com wrote:
 On 01/25/2013 11:39 AM, Rahul Sharma wrote:

 diff --git a/arch/arm/boot/dts/exynos4.dtsi
 b/arch/arm/boot/dts/exynos4.dtsi
 index 6c2c79d..07cb7d4 100644
 --- a/arch/arm/boot/dts/exynos4.dtsi
 +++ b/arch/arm/boot/dts/exynos4.dtsi
 @@ -296,4 +296,12 @@
 interrupts =0 95 0;
 hpd-gpio =gpx3 7 0xf 1 3;
 };
 +
 +   mixer: mixer {
 +   compatible = samsung,exynos4-mixer;


 I'm afraid this compatible property it too generic. Is the video mixer IP
 really identical an all the Exynos4 series SoCs ?


It is same in Exynos4210, 4212 and 4412.


 +   reg =   0x12c1 0x1,
 +   0x12c0 0x1;
 +   interrupts =0 91 0;
 +   samsung,power-domain =pd_tv;
 +   };
   };


 Is there documentation for these new bindings available somewhere ?


it is there at Documentation/devicetree/bindings/drm/exynos/mixer.txt.
Probably I
need to add details for power domain node property.

regards,
Rahul Sharma.

 --

 Thanks,
 Sylwester
--
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 0/5] Add DRM FIMD DT support for Exynos4 DT Machines

2013-01-27 Thread Vikas Sajjan
Thanks Sachin. Will add related documentation and resend.

On 28 January 2013 11:56, Sachin Kamat sachin.ka...@linaro.org wrote:
 Hi Vikas,

 You need to CC devicetree-disc...@lists.ozlabs.org for patches adding
 new bindings and add documentation related to it.

 On 28 January 2013 11:14, Vikas Sajjan vikas.saj...@linaro.org wrote:
 This patch series adds support for DRM FIMD DT for Exynos4 DT Machines,
 specifically for Exynos4412 SoC.

 Is based on branch for-next
 http://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git

 Vikas Sajjan (5):
   ARM: dts: Add FIMD node to exynos4
   ARM: dts: Adds lcd pinctrl node entries for SAMSUNG EXYNOS4412 SoC
   ARM: dts: Add FIMD node and display timing node to
 exynos4412-origen.dts
   ARM: dts: adds FIMD AUXDATA node entry for exynos4 DT
   ARM: EXYNOS: Enable backlight and PWM support for Exynos4 DT machines

  arch/arm/boot/dts/exynos4.dtsi|7 +++
  arch/arm/boot/dts/exynos4412-origen.dts   |   21 +
  arch/arm/boot/dts/exynos4x12-pinctrl.dtsi |   26 ++
  arch/arm/mach-exynos/Kconfig  |2 ++
  arch/arm/mach-exynos/mach-exynos4-dt.c|4 
  5 files changed, 60 insertions(+)

 --
 1.7.9.5




 --
 With warm regards,
 Sachin



-- 
Thanks and Regards
 Vikas Sajjan
--
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 1/4] ARM: dts: add support for hdmi to exynos4

2013-01-27 Thread Rahul Sharma
Hi Thomas,

On Fri, Jan 25, 2013 at 11:10 PM, Thomas Abraham
thomas.abra...@linaro.org wrote:
 On 25 January 2013 02:39, Rahul Sharma rahul.sha...@samsung.com wrote:
 Signed-off-by: Rahul Sharma rahul.sha...@samsung.com

 Conflicts:
 arch/arm/mach-exynos/mach-exynos4-dt.c
 ---
  arch/arm/boot/dts/exynos4.dtsi | 7 +++
  arch/arm/mach-exynos/mach-exynos4-dt.c | 2 ++
  2 files changed, 9 insertions(+)

 diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
 index e1347fc..6c2c79d 100644
 --- a/arch/arm/boot/dts/exynos4.dtsi
 +++ b/arch/arm/boot/dts/exynos4.dtsi
 @@ -289,4 +289,11 @@
 interrupts = 0 34 0;
 };
 };
 +
 +   hdmi {
 +   compatible = samsung,exynos4-hdmi14;
 +   reg = 0x12D0 0x7;
 +   interrupts = 0 95 0;
 +   hpd-gpio = gpx3 7 0xf 1 3;

 This is using the older gpio dt bindings but exynos4 has started using
 the pinctrl bindings. So this is not sufficient to do the
 pinmux/pinconfig settings on Exynos4.

 Thanks,
 Thomas.


I have chosen this as exynos5 DT using it in same way and parsed by common code
in driver for exy4 and 5. Secondly, one-time initial configuration is
sufficient for
hdmi hpd-gpio. Please share your opinion.

regards,
Rahul Sharma.

 +   };
  };
 diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c 
 b/arch/arm/mach-exynos/mach-exynos4-dt.c
 index ab1dacc..24f72a5 100644
 --- a/arch/arm/mach-exynos/mach-exynos4-dt.c
 +++ b/arch/arm/mach-exynos/mach-exynos4-dt.c
 @@ -80,6 +80,8 @@ static const struct of_dev_auxdata 
 exynos4_auxdata_lookup[] __initconst = {
 OF_DEV_AUXDATA(arm,pl330, EXYNOS4_PA_MDMA1, dma-pl330.2, NULL),
 OF_DEV_AUXDATA(samsung,exynos4210-tmu, EXYNOS4_PA_TMU,
 exynos-tmu, NULL),
 +   OF_DEV_AUXDATA(samsung,exynos4-hdmi14, EXYNOS4_PA_HDMI,
 +   exynos4-hdmi, NULL),
 {},
  };

 --
 1.8.0

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