Re: [RFC PATCH] DMA: PL330: Update PL330 DMAC to support runtime PM

2011-07-27 Thread Jassi Brar
On Wed, Jul 27, 2011 at 11:44 AM, Chanwoo Choi cw00.c...@samsung.com wrote:
 This patch update runtime PM for PL330 DMAC to reduce power consumption.

 Signed-off-by: Chanwoo Choi cw00.c...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 ---
 The following patch support runtime PM for PL330 DMAC, but the clock
 of PL330 is always on. If the clock of PL330 is always on, additional power
 (10mA) is consumed.

Yes, we need to do this, but please do it in drivers/dma/pl330.c so that
every platform benefits.

 diff --git a/include/linux/amba/pl330.h b/include/linux/amba/pl330.h
 index 17b0ada..d9a63fd 100644
 --- a/include/linux/amba/pl330.h
 +++ b/include/linux/amba/pl330.h
 @@ -12,6 +12,9 @@
  #ifndef        __AMBA_PL330_H_
  #define        __AMBA_PL330_H_

 +#include linux/dmaengine.h
 +#include linux/interrupt.h
 +
  #include asm/hardware/pl330.h

  struct dma_pl330_peri {
 @@ -42,4 +45,55 @@ struct dma_pl330_platdata {
        unsigned mcbuf_sz;
  };

 +struct dma_pl330_chan {
 +       /* Schedule desc completion */
 +       struct tasklet_struct task;
 +
 +       /* DMA-Engine Channel */
 +       struct dma_chan chan;
 +
 +       /* Last completed cookie */
 +       dma_cookie_t completed;
 +
 +       /* List of to be xfered descriptors */
 +       struct list_head work_list;
 +
 +       /* Pointer to the DMAC that manages this channel,
 +        * NULL if the channel is available to be acquired.
 +        * As the parent, this DMAC also provides descriptors
 +        * to the channel.
 +        */
 +       struct dma_pl330_dmac *dmac;
 +
 +       /* To protect channel manipulation */
 +       spinlock_t lock;
 +
 +       /* Token of a hardware channel thread of PL330 DMAC
 +        * NULL if the channel is available to be acquired.
 +        */
 +       void *pl330_chid;
 +
 +       /* taks for cyclic capability */
 +       struct tasklet_struct *cyclic_task;
 +
 +       bool cyclic;
 +};
 +
 +struct dma_pl330_dmac {
 +       struct pl330_info pif;
 +
 +       /* DMA-Engine Device */
 +       struct dma_device ddma;
 +
 +       /* Pool of descriptors available for the DMAC's channels */
 +       struct list_head desc_pool;
 +       /* To protect desc_pool manipulation */
 +       spinlock_t pool_lock;
 +
 +       /* Peripheral channels connected to this DMAC */
 +       struct dma_pl330_chan peripherals[0]; /* keep at end */
 +
 +       struct clk *clk;
 +};
 +
  #endif /* __AMBA_PL330_H_ */

struct dma_pl330_dmac and struct dma_pl330_chan are internal to the
pl330 dmac driver. Nobody from outside should ever need them.

Thanks,
Jassi
--
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 01/15] DMA: PL330: Add support runtime PM for PL330 DMAC

2011-07-27 Thread Jassi Brar
On Wed, Jul 27, 2011 at 11:01 AM, Boojin Kim boojin@samsung.com wrote:
 Signed-off-by: Boojin Kim boojin@samsung.com
 Cc: Vinod Koul vinod.k...@intel.com
 Cc: Dan Williams dan.j.willi...@intel.com
 Signed-off-by: Kukjin Kim kgene@samsung.com

Acked-by: Jassi Brar jassisinghb...@gmail.com
--
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 V4 06/14] ARM: SAMSUNG: Add common DMA operations

2011-07-27 Thread Jassi Brar
On Wed, Jul 27, 2011 at 10:47 AM, Boojin Kim boojin@samsung.com wrote:
 Jassi Brar wrote:
 Sent: Wednesday, July 27, 2011 10:34 AM
 To: Boojin Kim
 Cc: linux-arm-ker...@lists.infradead.org; linux-samsung-
 s...@vger.kernel.org; Vinod Koul; Dan Williams; Kukjin Kim; Grant
 Likely; Mark Brown
 Subject: Re: [PATCH V4 06/14] ARM: SAMSUNG: Add common DMA operations

 On Tue, Jul 26, 2011 at 3:05 PM, Boojin Kim boojin@samsung.com
 wrote:
  Jassi Brar Wrote:
  Sent: Monday, July 25, 2011 8:52 PM
  To: Boojin Kim
  Cc: linux-arm-ker...@lists.infradead.org; linux-samsung-
  s...@vger.kernel.org; Vinod Koul; Dan Williams; Kukjin Kim; Grant
  Likely; Mark Brown
  Subject: Re: [PATCH V4 06/14] ARM: SAMSUNG: Add common DMA
 operations
 
  On Mon, Jul 25, 2011 at 6:58 AM, Boojin Kim
 boojin@samsung.com
  wrote:
 
   +
   +static bool pl330_filter(struct dma_chan *chan, void *param)
   +{
   +       struct dma_pl330_peri *peri = (struct dma_pl330_peri
 *)chan-
  private;
   +       unsigned dma_ch = (unsigned)param;
   +
   +       if (peri-peri_id != dma_ch)
   +               return false;
   +
   +       return true;
   +}
  This is what I meant... if we keep chan_id for paltform assigned
 IDs,
  these filter functions could simply become
 
  static bool pl330_filter(struct dma_chan *chan, void *param)
  {
          return chan-chan_id == param
  }
 
  And ideally in the long run, we could just drop the filter callback
  and add expected channel ID to the request_channel call.
  The chan_id is set by dmaengine. So, We don't use it to hold the
 user specific
  Id.
 Not for long.
 See  https://lkml.org/lkml/2011/7/26/245


   +
   +static inline int s3c_dma_trigger(unsigned ch)
   +{
   +       return s3c2410_dma_ctrl(ch, S3C2410_DMAOP_START);
   +}
   +
   +static inline int s3c_dma_started(unsigned ch)
   +{
   +       return s3c2410_dma_ctrl(ch, S3C2410_DMAOP_STARTED);
   +}
   +
   +static inline int s3c_dma_flush(unsigned ch)
   +{
   +       return s3c2410_dma_ctrl(ch, S3C2410_DMAOP_FLUSH);
   +}
   +
   +static inline int s3c_dma_stop(unsigned ch)
   +{
   +       return s3c2410_dma_ctrl(ch, S3C2410_DMAOP_STOP);
   +}
   +
   +static struct samsung_dma_ops s3c_dma_ops = {
   +       .request        = s3c_dma_request,
   +       .release        = s3c_dma_release,
   +       .prepare        = s3c_dma_prepare,
   +       .trigger        = s3c_dma_trigger,
   +       .started        = s3c_dma_started,
   +       .flush          = s3c_dma_flush,
   +       .stop           = s3c_dma_stop,
 
  These last 4 should be gnereallized into one callback with OP
 argument.
  I don't have any idea about it. Can you explain it in more detail?

 static int s3c_dma_control(unsigned ch, enum s3c2410_chan_op/*or
 similar*/ op)
  {
         return s3c2410_dma_ctrl(ch, op);
  }

 static struct samsung_dma_ops s3c_dma_ops = {
         .request        = s3c_dma_request,
         .release        = s3c_dma_release,
         .prepare        = s3c_dma_prepare,
         .control        = s3c_dma_control,
 'Struct samsung_dma_ops' is used for both 'S3C-DMA-OPS' for 's3c dma' and
 'DMA-OPS' for 'dmaengine'.
 If I modify Struct samsung_dma_ops as your guide, It gives un-expectable
 effect to DMA-OPS.
 Actually, We don't want the client with 'DMA-OPS' uses 'enum s3c2410_chan_op'
 operation anymore.

 enum s3c2410_chan_op /* or similar */ note 'or similar'

Defining a callback for each value of the argument doesn't make sense.
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC PATCH] DMA: PL330: Update PL330 DMAC to support runtime PM

2011-07-27 Thread Russell King - ARM Linux
On Wed, Jul 27, 2011 at 03:14:27PM +0900, Chanwoo Choi wrote:
 +#ifdef CONFIG_PM_RUNTIME
 + struct dma_pl330_chan *pch;
 + struct dma_pl330_dmac *pdmac;
 +#endif
  
   dma_cap_zero(mask);
   dma_cap_set(info-cap, mask);
  
   chan = dma_request_channel(mask, pl330_filter, (void *)dma_ch);
  
 +#ifdef CONFIG_PM_RUNTIME
 + pch = container_of(chan, struct dma_pl330_chan, chan);
 + pdmac = pch-dmac;
 +
 + pm_runtime_get_sync(pdmac-pif.dev);
 +#endif

This is not the right way to do this.  The pm runtime stuff should be
internal to the PL330 driver.  Take a moment to think about this:

You need to wake it up just before a transfer starts.  You need to
put it back to sleep just after the last transfer has finished.
That gives you a hint where the calls need to be.

That can only be done from within the PL330 driver.
--
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/8] ARM: SAMSUNG: Add common PWM Backlight support

2011-07-27 Thread Banajit Goswami
Hi Dmitry,

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

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

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

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

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

 --
 With best wishes
 Dmitry

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


Re: [PATCH] Improve slave/cyclic DMA engine documentation (was: [PATCH V4 04/14] DMA: PL330: Add DMA_CYCLIC capability)

2011-07-27 Thread Russell King - ARM Linux
On Tue, Jul 26, 2011 at 03:05:33PM +0530, Vinod Koul wrote:
 On Tue, 2011-07-26 at 08:57 +0100, Russell King - ARM Linux wrote:
  Here's an updated patch.
  
  8--
  From: Russell King rmk+ker...@arm.linux.org.uk
  DMAEngine: Improve slave/cyclic documentation
  
  Improve the documentation for the slave and cyclic DMA engine support
  reformatting it for easier reading, adding further APIs, splitting it
  into five steps, and including references to the documentation in
  dmaengine.h.
  
  Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk
  ---
   Documentation/dmaengine.txt |  211 
  ++-
   1 files changed, 146 insertions(+), 65 deletions(-)
  
  diff --git a/Documentation/dmaengine.txt b/Documentation/dmaengine.txt
  index 5a0cb1e..8c2e888 100644
  --- a/Documentation/dmaengine.txt
  +++ b/Documentation/dmaengine.txt
  @@ -10,87 +10,168 @@
   Below is a guide to device driver writers on how to use the Slave-DMA API 
  of the
   DMA Engine. This is applicable only for slave DMA usage only.
   
  -The slave DMA usage consists of following steps
  +The slave DMA usage consists of following steps:
   1. Allocate a DMA slave channel
   2. Set slave and controller specific parameters
   3. Get a descriptor for transaction
   4. Submit the transaction and wait for callback notification
  +5. Issue pending requests
 Thanks Russell,
 
 Applied with change to 4 above. Moved and wait for callback
 notification to 5.

BTW, did you apply this one or the later one with the improved
documentation for dma mapping and fixed interface for slave
transfers etc. ?
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC PATCH] DMA: PL330: Update PL330 DMAC to support runtime PM

2011-07-27 Thread Chanwoo Choi
Russell King - ARM Linux wrote:
 On Wed, Jul 27, 2011 at 03:14:27PM +0900, Chanwoo Choi wrote:
 +#ifdef CONFIG_PM_RUNTIME
 +struct dma_pl330_chan *pch;
 +struct dma_pl330_dmac *pdmac;
 +#endif
  
  dma_cap_zero(mask);
  dma_cap_set(info-cap, mask);
  
  chan = dma_request_channel(mask, pl330_filter, (void *)dma_ch);
  
 +#ifdef CONFIG_PM_RUNTIME
 +pch = container_of(chan, struct dma_pl330_chan, chan);
 +pdmac = pch-dmac;
 +
 +pm_runtime_get_sync(pdmac-pif.dev);
 +#endif
 
 This is not the right way to do this.  The pm runtime stuff should be
 internal to the PL330 driver.  Take a moment to think about this:
 
 You need to wake it up just before a transfer starts.  You need to
 put it back to sleep just after the last transfer has finished.
 That gives you a hint where the calls need to be.
 
 That can only be done from within the PL330 driver.
 

Thanks for your commenthint.

I will repost the patch which support runtime pm of PL330 in internal to the 
PL330 driver.

Regards,
Chanwoo Choi


--
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] Improve slave/cyclic DMA engine documentation (was: [PATCH V4 04/14] DMA: PL330: Add DMA_CYCLIC capability)

2011-07-27 Thread Koul, Vinod
On Wed, 2011-07-27 at 10:01 +0100, Russell King - ARM Linux wrote:
 On Tue, Jul 26, 2011 at 03:05:33PM +0530, Vinod Koul wrote:
  On Tue, 2011-07-26 at 08:57 +0100, Russell King - ARM Linux wrote:
   Here's an updated patch.
   
   8--
   From: Russell King rmk+ker...@arm.linux.org.uk
   DMAEngine: Improve slave/cyclic documentation
   
   Improve the documentation for the slave and cyclic DMA engine support
   reformatting it for easier reading, adding further APIs, splitting it
   into five steps, and including references to the documentation in
   dmaengine.h.
   
   Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk
   ---
Documentation/dmaengine.txt |  211 
   ++-
1 files changed, 146 insertions(+), 65 deletions(-)
   
   diff --git a/Documentation/dmaengine.txt b/Documentation/dmaengine.txt
   index 5a0cb1e..8c2e888 100644
   --- a/Documentation/dmaengine.txt
   +++ b/Documentation/dmaengine.txt
   @@ -10,87 +10,168 @@
Below is a guide to device driver writers on how to use the Slave-DMA 
   API of the
DMA Engine. This is applicable only for slave DMA usage only.

   -The slave DMA usage consists of following steps
   +The slave DMA usage consists of following steps:
1. Allocate a DMA slave channel
2. Set slave and controller specific parameters
3. Get a descriptor for transaction
4. Submit the transaction and wait for callback notification
   +5. Issue pending requests
  Thanks Russell,
  
  Applied with change to 4 above. Moved and wait for callback
  notification to 5.
 
 BTW, did you apply this one or the later one with the improved
 documentation for dma mapping and fixed interface for slave
 transfers etc. ?
I changed it to second one, not pushed yet.
I am rebasing the tree to 3.0. You should see updated version in tree
later in the evening today

-- 
~Vinod

--
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/2] Chained irq fixes

2011-07-27 Thread Marek Szyprowski
Hello,

It looks that the chained IRQ enter/exit functions are missing in more
places. This short patch series fixes all chained irq usage on Exynos4
platform. 

Best regards
Marek Szyprowski
Samsung Poland RD Center


Summary:

Marek Szyprowski (2):
  ARM: Exynos4: add required chained_irq_enter/exit to eint code
  ARM: S5P: add required chained_irq_enter/exit to gpio-int code

 arch/arm/mach-exynos4/irq-eint.c |7 +++
 arch/arm/plat-s5p/irq-gpioint.c  |6 ++
 2 files changed, 13 insertions(+), 0 deletions(-)

-- 
1.7.1.569.g6f426

--
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/2] ARM: Exynos4: add required chained_irq_enter/exit to eint code

2011-07-27 Thread Marek Szyprowski
This patch adds chained IRQ enter/exit functions to external interrupt
handler in order to function correctly on primary controllers with
different methods of flow control.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/mach-exynos4/irq-eint.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-exynos4/irq-eint.c b/arch/arm/mach-exynos4/irq-eint.c
index 9d87d2a..badb8c6 100644
--- a/arch/arm/mach-exynos4/irq-eint.c
+++ b/arch/arm/mach-exynos4/irq-eint.c
@@ -23,6 +23,8 @@
 
 #include mach/regs-gpio.h
 
+#include asm/mach/irq.h
+
 static DEFINE_SPINLOCK(eint_lock);
 
 static unsigned int eint0_15_data[16];
@@ -184,8 +186,11 @@ static inline void exynos4_irq_demux_eint(unsigned int 
start)
 
 static void exynos4_irq_demux_eint16_31(unsigned int irq, struct irq_desc 
*desc)
 {
+   struct irq_chip *chip = irq_get_chip(irq);
+   chained_irq_enter(chip, desc);
exynos4_irq_demux_eint(IRQ_EINT(16));
exynos4_irq_demux_eint(IRQ_EINT(24));
+   chained_irq_exit(chip, desc);
 }
 
 static void exynos4_irq_eint0_15(unsigned int irq, struct irq_desc *desc)
@@ -193,6 +198,7 @@ static void exynos4_irq_eint0_15(unsigned int irq, struct 
irq_desc *desc)
u32 *irq_data = irq_get_handler_data(irq);
struct irq_chip *chip = irq_get_chip(irq);
 
+   chained_irq_enter(chip, desc);
chip-irq_mask(desc-irq_data);
 
if (chip-irq_ack)
@@ -201,6 +207,7 @@ static void exynos4_irq_eint0_15(unsigned int irq, struct 
irq_desc *desc)
generic_handle_irq(*irq_data);
 
chip-irq_unmask(desc-irq_data);
+   chained_irq_exit(chip, desc);
 }
 
 int __init exynos4_init_irq_eint(void)
-- 
1.7.1.569.g6f426

--
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/2] ARM: S5P: add required chained_irq_enter/exit to gpio-int code

2011-07-27 Thread Marek Szyprowski
This patch adds chained IRQ enter/exit functions to gpio interrupt
handler in order to function correctly on primary controllers with
different methods of flow control.

Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 arch/arm/plat-s5p/irq-gpioint.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-s5p/irq-gpioint.c b/arch/arm/plat-s5p/irq-gpioint.c
index 135abda..905711f 100644
--- a/arch/arm/plat-s5p/irq-gpioint.c
+++ b/arch/arm/plat-s5p/irq-gpioint.c
@@ -23,6 +23,8 @@
 #include plat/gpio-core.h
 #include plat/gpio-cfg.h
 
+#include asm/mach/irq.h
+
 #define GPIO_BASE(chip)(((unsigned long)(chip)-base)  
0xF000u)
 
 #define CON_OFFSET 0x700
@@ -81,6 +83,9 @@ static void s5p_gpioint_handler(unsigned int irq, struct 
irq_desc *desc)
int group, pend_offset, mask_offset;
unsigned int pend, mask;
 
+   struct irq_chip *chip = irq_get_chip(irq);
+   chained_irq_enter(chip, desc);
+
for (group = 0; group  bank-nr_groups; group++) {
struct s3c_gpio_chip *chip = bank-chips[group];
if (!chip)
@@ -102,6 +107,7 @@ static void s5p_gpioint_handler(unsigned int irq, struct 
irq_desc *desc)
pend = ~BIT(offset);
}
}
+   chained_irq_exit(chip, desc);
 }
 
 static __init int s5p_gpioint_add(struct s3c_gpio_chip *chip)
-- 
1.7.1.569.g6f426

--
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 V3 0/7] ARM: S5P64X0: Add Framebuffer support

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

  Changes since V1:
- Remove mach/regs-fb.h, instead use plat/regs-fb.h.
- Add common pdata for FB and LCD in SMDK6440 and SMDK6450.
- Modify names(s5p--smdk), max_bpp and refresh rate.
- Modify variable name(cfg--chipid).
- Use __raw_readl, __raw_writel instead of readl and writel.

  Changes since V2:
-Change name of the config-COMMON_FB to SMDK64X0_COMMON_FB.
-Change filename common-fb.h to smdk64x0-common-fb.h.
-Change filename common-fb.c to smdk64x0-common-fb.c.

  [Patch RESEND V3 1/7]
- Add s5p64x0-fb type driver_data(s3c_fb_driverdata).
- Display controller in S5P64X0 supports 3 windows.

  [Patch RESEND V3 2/7]
- Resource definitions(_MEM, _IRQ).

  [Patch RESEND V3 3/7]
- Set s3c_device_fb name as s5p64x0-fb.

  [Patch RESEND V3 4/7]
- GPIO settings for LCD in S5P6440 and S5P6450.
- Select LCD interface (RGB/i80).

  [Patch V3 5/7]
- Creates a file to hold common FB and LCD code.
- Add Basic FB window definition with default_bpp=24.
- Add platform data for FB and LCD.
- platform_device support for LCD.

  [Patch V3 6/7]
- Enables FB support and platform-lcd support for SMDK6440.

  [Patch V3 7/7]
- Enables FB support and platform-lcd support for SMDK6450.

  o To Paul Mundt, Jingoo han
  [Patch RESEND V3 1/7] video: s3c-fb: Add S5P64X0 specific s3c_fb_driverdata

  o To Kukjin Kim
  [Patch RESEND V3 2/7] ARM: S5P64X0: Add register base and IRQ for Framebuffer
  [Patch RESEND V3 3/7] ARM: S5P64X0: Set s3c_device_fb name
  [Patch RESEND V3 4/7] ARM: S5P64X0: Add GPIO and SPCON settings for LCD
  [Patch V3 5/7] ARM: S5P64X0: Add file to hold common Framebuffer and LCD code
  [Patch V3 6/7] ARM: S5P6440: Enable LCD-LTE480 and Framebuffer support
  [Patch V3 7/7] ARM: S5P6450: Enable LCD-LTE480 and Framebuffer support


 arch/arm/mach-s5p64x0/Kconfig  |   17 
 arch/arm/mach-s5p64x0/Makefile |4 +
 arch/arm/mach-s5p64x0/cpu.c|3 +
 arch/arm/mach-s5p64x0/include/mach/irqs.h  |4 +
 arch/arm/mach-s5p64x0/include/mach/map.h   |3 +
 arch/arm/mach-s5p64x0/include/mach/regs-gpio.h |4 +
 .../mach-s5p64x0/include/mach/smdk64x0-common-fb.h |   26 ++
 arch/arm/mach-s5p64x0/mach-smdk6440.c  |5 +
 arch/arm/mach-s5p64x0/mach-smdk6450.c  |5 +
 arch/arm/mach-s5p64x0/setup-fb.c   |   48 ++
 arch/arm/mach-s5p64x0/smdk64x0-common-fb.c |   92 
 arch/arm/plat-samsung/include/plat/fb.h|   14 +++
 drivers/video/s3c-fb.c |   27 ++
 13 files changed, 252 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5p64x0/include/mach/smdk64x0-common-fb.h
 create mode 100644 arch/arm/mach-s5p64x0/setup-fb.c
 create mode 100644 arch/arm/mach-s5p64x0/smdk64x0-common-fb.c

--
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 V3 1/7] video: s3c-fb: Add S5P64X0 specific s3c_fb_driverdata

2011-07-27 Thread Ajay Kumar
This patch:
Adds s3c_fb_driverdata for S5P64X0, which supports 3 windows.
Also, register s5p64x0-fb type driver_data.
Existing s3c_fb_driverdata definitions in s3c-fb.c
supports 5 or 2 windows.

Signed-off-by: Ajay Kumar ajaykumar...@samsung.com
acked-by: Jingoo Han jg1@samsung.com
---
 drivers/video/s3c-fb.c |   27 +++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 4aecf21..0fda252 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -1859,6 +1859,30 @@ static struct s3c_fb_driverdata s3c_fb_data_s3c2443 = {
},
 };
 
+static struct s3c_fb_driverdata s3c_fb_data_s5p64x0 = {
+   .variant = {
+   .nr_windows = 3,
+   .vidtcon= VIDTCON0,
+   .wincon = WINCON(0),
+   .winmap = WINxMAP(0),
+   .keycon = WKEYCON,
+   .osd= VIDOSD_BASE,
+   .osd_stride = 16,
+   .buf_start  = VIDW_BUF_START(0),
+   .buf_size   = VIDW_BUF_SIZE(0),
+   .buf_end= VIDW_BUF_END(0),
+
+   .palette = {
+   [0] = 0x2400,
+   [1] = 0x2800,
+   [2] = 0x2c00,
+   },
+   },
+   .win[0] = s3c_fb_data_s5p_wins[0],
+   .win[1] = s3c_fb_data_s5p_wins[1],
+   .win[2] = s3c_fb_data_s5p_wins[2],
+};
+
 static struct platform_device_id s3c_fb_driver_ids[] = {
{
.name   = s3c-fb,
@@ -1872,6 +1896,9 @@ static struct platform_device_id s3c_fb_driver_ids[] = {
}, {
.name   = s3c2443-fb,
.driver_data= (unsigned long)s3c_fb_data_s3c2443,
+   }, {
+   .name   = s5p64x0-fb,
+   .driver_data= (unsigned long)s3c_fb_data_s5p64x0,
},
{},
 };
-- 
1.7.0.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 V3 2/7] ARM: S5P64X0: Add register base and IRQ for Framebuffer

2011-07-27 Thread Ajay Kumar
This patch adds:
-- Framebuffer register mappings.
-- IRQ number being used.

Signed-off-by: Ajay Kumar ajaykumar...@samsung.com
---
 arch/arm/mach-s5p64x0/include/mach/irqs.h |4 
 arch/arm/mach-s5p64x0/include/mach/map.h  |3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5p64x0/include/mach/irqs.h 
b/arch/arm/mach-s5p64x0/include/mach/irqs.h
index 5837a36..53982db 100644
--- a/arch/arm/mach-s5p64x0/include/mach/irqs.h
+++ b/arch/arm/mach-s5p64x0/include/mach/irqs.h
@@ -87,6 +87,10 @@
 
 #define IRQ_I2S0   IRQ_I2SV40
 
+#define IRQ_LCD_FIFO   IRQ_DISPCON0
+#define IRQ_LCD_VSYNC  IRQ_DISPCON1
+#define IRQ_LCD_SYSTEM IRQ_DISPCON2
+
 /* S5P6450 EINT feature will be added */
 
 /*
diff --git a/arch/arm/mach-s5p64x0/include/mach/map.h 
b/arch/arm/mach-s5p64x0/include/mach/map.h
index 95c9125..c5ef50c 100644
--- a/arch/arm/mach-s5p64x0/include/mach/map.h
+++ b/arch/arm/mach-s5p64x0/include/mach/map.h
@@ -47,6 +47,8 @@
 
 #define S5P64X0_PA_HSMMC(x)(0xED80 + ((x) * 0x10))
 
+#define S5P64X0_PA_FB  0xEE00
+
 #define S5P64X0_PA_I2S 0xF200
 #define S5P6450_PA_I2S10xF280
 #define S5P6450_PA_I2S20xF290
@@ -64,6 +66,7 @@
 #define S3C_PA_IIC1S5P6440_PA_IIC1
 #define S3C_PA_RTC S5P64X0_PA_RTC
 #define S3C_PA_WDT S5P64X0_PA_WDT
+#define S3C_PA_FB  S5P64X0_PA_FB
 
 #define S5P_PA_CHIPID  S5P64X0_PA_CHIPID
 #define S5P_PA_SROMC   S5P64X0_PA_SROMC
-- 
1.7.0.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 V3 3/7] ARM: S5P64X0: Set s3c_device_fb name

2011-07-27 Thread Ajay Kumar
Set s3c_device_fb name as s5p64x0-fb for S5P6440 and S5P6450.

Signed-off-by: Ajay Kumar ajaykumar...@samsung.com
---
 arch/arm/mach-s5p64x0/cpu.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5p64x0/cpu.c b/arch/arm/mach-s5p64x0/cpu.c
index a5c0095..617da3b 100644
--- a/arch/arm/mach-s5p64x0/cpu.c
+++ b/arch/arm/mach-s5p64x0/cpu.c
@@ -38,6 +38,7 @@
 #include plat/s5p6440.h
 #include plat/s5p6450.h
 #include plat/adc-core.h
+#include plat/fb-core.h
 
 /* Initial IO mappings */
 
@@ -108,6 +109,7 @@ void __init s5p6440_map_io(void)
 {
/* initialize any device information early */
s3c_adc_setname(s3c64xx-adc);
+   s3c_fb_setname(s5p64x0-fb);
 
iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc));
iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc));
@@ -117,6 +119,7 @@ void __init s5p6450_map_io(void)
 {
/* initialize any device information early */
s3c_adc_setname(s3c64xx-adc);
+   s3c_fb_setname(s5p64x0-fb);
 
iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc));
iotable_init(s5p6450_iodesc, ARRAY_SIZE(s5p6450_iodesc));
-- 
1.7.0.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 V3 4/7] ARM: S5P64X0: Add GPIO and SPCON settings for LCD

2011-07-27 Thread Ajay Kumar
This patch adds:
-- GPIO lines settings(HSYNC, VSYNC, VCLK and VD) for LCD.
-- Function to select LCD interface (RGB/i80)

Signed-off-by: Ajay Kumar ajaykumar...@samsung.com
---
 arch/arm/mach-s5p64x0/Kconfig  |6 +++
 arch/arm/mach-s5p64x0/Makefile |1 +
 arch/arm/mach-s5p64x0/include/mach/regs-gpio.h |4 ++
 arch/arm/mach-s5p64x0/setup-fb.c   |   48 
 arch/arm/plat-samsung/include/plat/fb.h|   14 +++
 5 files changed, 73 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5p64x0/setup-fb.c

diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig
index 65c7518..4fee745 100644
--- a/arch/arm/mach-s5p64x0/Kconfig
+++ b/arch/arm/mach-s5p64x0/Kconfig
@@ -21,6 +21,12 @@ config CPU_S5P6450
help
  Enable S5P6450 CPU support
 
+config S5P64X0_SETUP_FB
+   bool
+   help
+ Common setup code for S5P64X0 based boards with a LCD display
+ through RGB interface.
+
 config S5P64X0_SETUP_I2C1
bool
help
diff --git a/arch/arm/mach-s5p64x0/Makefile b/arch/arm/mach-s5p64x0/Makefile
index 5f6afdf..487d179 100644
--- a/arch/arm/mach-s5p64x0/Makefile
+++ b/arch/arm/mach-s5p64x0/Makefile
@@ -28,3 +28,4 @@ obj-y += dev-audio.o
 obj-$(CONFIG_S3C64XX_DEV_SPI)  += dev-spi.o
 
 obj-$(CONFIG_S5P64X0_SETUP_I2C1)   += setup-i2c1.o
+obj-$(CONFIG_S5P64X0_SETUP_FB) += setup-fb.o
diff --git a/arch/arm/mach-s5p64x0/include/mach/regs-gpio.h 
b/arch/arm/mach-s5p64x0/include/mach/regs-gpio.h
index 6ce2547..34d4412 100644
--- a/arch/arm/mach-s5p64x0/include/mach/regs-gpio.h
+++ b/arch/arm/mach-s5p64x0/include/mach/regs-gpio.h
@@ -44,4 +44,8 @@
 #define S5P64X0_EINT0MASK  (S5P_VA_GPIO + EINT0MASK_OFFSET)
 #define S5P64X0_EINT0PEND  (S5P_VA_GPIO + EINT0PEND_OFFSET)
 
+#define S5P64X0_SPCON0 (S5P_VA_GPIO + 0x1A0)
+#define S5P64X0_SPCON0_LCD_SEL_MASK(0x3  0)
+#define S5P64X0_SPCON0_LCD_SEL_RGB (0x1  0)
+
 #endif /* __ASM_ARCH_REGS_GPIO_H */
diff --git a/arch/arm/mach-s5p64x0/setup-fb.c b/arch/arm/mach-s5p64x0/setup-fb.c
new file mode 100644
index 000..0d9903a
--- /dev/null
+++ b/arch/arm/mach-s5p64x0/setup-fb.c
@@ -0,0 +1,48 @@
+/* linux/arch/arm/mach-s5p64x0/setup-fb.c
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com/
+ *
+ * Base S5P64X0 GPIO setup information for LCD framebuffer
+ *
+ * GPIO settings for LCD on any other board based on s5p64x0
+ * should go in this file.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include linux/fb.h
+#include linux/gpio.h
+
+#include plat/fb.h
+#include plat/gpio-cfg.h
+
+#include mach/regs-clock.h
+#include mach/regs-gpio.h
+
+void s5p64x0_fb_init(int lcd_interface_type)
+{
+   unsigned int cfg;
+
+   /* select TFT LCD type (RGB I/F) */
+   cfg = __raw_readl(S5P64X0_SPCON0);
+   cfg = ~S5P64X0_SPCON0_LCD_SEL_MASK;
+   cfg |= lcd_interface_type;
+   __raw_writel(cfg, S5P64X0_SPCON0);
+}
+
+void s5p64x0_fb_gpio_setup_24bpp(void)
+{
+   unsigned int chipid;
+
+   chipid = __raw_readl(S5P64X0_SYS_ID)  0xf;
+   if (chipid == 0x4) {
+   s3c_gpio_cfgrange_nopull(S5P6440_GPI(0), 16, S3C_GPIO_SFN(2));
+   s3c_gpio_cfgrange_nopull(S5P6440_GPJ(0), 12, S3C_GPIO_SFN(2));
+   } else if (chipid == 0x5) {
+   s3c_gpio_cfgrange_nopull(S5P6450_GPI(0), 16, S3C_GPIO_SFN(2));
+   s3c_gpio_cfgrange_nopull(S5P6450_GPJ(0), 12, S3C_GPIO_SFN(2));
+   }
+}
diff --git a/arch/arm/plat-samsung/include/plat/fb.h 
b/arch/arm/plat-samsung/include/plat/fb.h
index 01f10e4..bd79c0a 100644
--- a/arch/arm/plat-samsung/include/plat/fb.h
+++ b/arch/arm/plat-samsung/include/plat/fb.h
@@ -109,4 +109,18 @@ extern void s5pv210_fb_gpio_setup_24bpp(void);
  */
 extern void exynos4_fimd0_gpio_setup_24bpp(void);
 
+/**
+ * s5p64x0_fb_init() - Common setup function for LCD
+ *
+ * Select LCD I/F configuration-RGB style or i80 style
+ */
+extern void s5p64x0_fb_init(int lcd_interface_type);
+
+/**
+ * s5p64x0_fb_gpio_setup_24bpp() - Common GPIO setup function for LCD
+ *
+ * Initialise the GPIO for a LCD display on the RGB interface.
+ */
+extern void s5p64x0_fb_gpio_setup_24bpp(void);
+
 #endif /* __PLAT_S3C_FB_H */
-- 
1.7.0.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 V3 6/7] ARM: S5P6440: Enable LCD-LTE480 and Framebuffer support

2011-07-27 Thread Ajay Kumar
This patch enables s3c-fb support and platform-lcd support for SMDK6440.

Signed-off-by: Ajay Kumar ajaykumar...@samsung.com
---
 arch/arm/mach-s5p64x0/Kconfig |3 +++
 arch/arm/mach-s5p64x0/mach-smdk6440.c |5 +
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig
index 00d5873..41a751f 100644
--- a/arch/arm/mach-s5p64x0/Kconfig
+++ b/arch/arm/mach-s5p64x0/Kconfig
@@ -42,6 +42,7 @@ config SMDK64X0_COMMON_FB
 config MACH_SMDK6440
bool SMDK6440
select CPU_S5P6440
+   select S3C_DEV_FB
select S3C_DEV_I2C1
select S3C_DEV_RTC
select S3C_DEV_WDT
@@ -50,7 +51,9 @@ config MACH_SMDK6440
select SAMSUNG_DEV_BACKLIGHT
select SAMSUNG_DEV_PWM
select SAMSUNG_DEV_TS
+   select S5P64X0_SETUP_FB
select S5P64X0_SETUP_I2C1
+   select SMDK64X0_COMMON_FB
help
  Machine support for the Samsung SMDK6440
 
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c 
b/arch/arm/mach-s5p64x0/mach-smdk6440.c
index 346f8df..106bc8f 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6440.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c
@@ -34,6 +34,7 @@
 #include mach/regs-clock.h
 #include mach/i2c.h
 #include mach/regs-gpio.h
+#include mach/smdk64x0-common-fb.h
 
 #include plat/regs-serial.h
 #include plat/gpio-cfg.h
@@ -101,6 +102,8 @@ static struct platform_device *smdk6440_devices[] 
__initdata = {
s3c_device_wdt,
samsung_asoc_dma,
s5p6440_device_iis,
+   s3c_device_fb,
+   smdk64x0_lcd_lte480wv,
 };
 
 static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = {
@@ -165,6 +168,8 @@ static void __init smdk6440_machine_init(void)
ARRAY_SIZE(smdk6440_i2c_devs1));
 
samsung_bl_set(smdk6440_bl_gpio_info, smdk6440_bl_data);
+   s3c_fb_set_platdata(smdk64x0_lcd_pdata);
+   s5p64x0_fb_init(S5P64X0_SPCON0_LCD_SEL_RGB);
 
platform_add_devices(smdk6440_devices, ARRAY_SIZE(smdk6440_devices));
 }
-- 
1.7.0.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 V3 7/7] ARM: S5P6450: Enable LCD-LTE480 and Framebuffer support

2011-07-27 Thread Ajay Kumar
This patch enables s3c-fb support and platform-lcd support for SMDK6450.

Signed-off-by: Ajay Kumar ajaykumar...@samsung.com
---
 arch/arm/mach-s5p64x0/Kconfig |3 +++
 arch/arm/mach-s5p64x0/mach-smdk6450.c |5 +
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig
index 41a751f..43493f1 100644
--- a/arch/arm/mach-s5p64x0/Kconfig
+++ b/arch/arm/mach-s5p64x0/Kconfig
@@ -60,6 +60,7 @@ config MACH_SMDK6440
 config MACH_SMDK6450
bool SMDK6450
select CPU_S5P6450
+   select S3C_DEV_FB
select S3C_DEV_I2C1
select S3C_DEV_RTC
select S3C_DEV_WDT
@@ -68,7 +69,9 @@ config MACH_SMDK6450
select SAMSUNG_DEV_BACKLIGHT
select SAMSUNG_DEV_PWM
select SAMSUNG_DEV_TS
+   select S5P64X0_SETUP_FB
select S5P64X0_SETUP_I2C1
+   select SMDK64X0_COMMON_FB
help
  Machine support for the Samsung SMDK6450
 
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c 
b/arch/arm/mach-s5p64x0/mach-smdk6450.c
index 33f2adf..880421c 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6450.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c
@@ -34,6 +34,7 @@
 #include mach/regs-clock.h
 #include mach/i2c.h
 #include mach/regs-gpio.h
+#include mach/smdk64x0-common-fb.h
 
 #include plat/regs-serial.h
 #include plat/gpio-cfg.h
@@ -119,6 +120,8 @@ static struct platform_device *smdk6450_devices[] 
__initdata = {
s3c_device_wdt,
samsung_asoc_dma,
s5p6450_device_iis0,
+   s3c_device_fb,
+   smdk64x0_lcd_lte480wv,
/* s5p6450_device_spi0 will be added */
 };
 
@@ -184,6 +187,8 @@ static void __init smdk6450_machine_init(void)
ARRAY_SIZE(smdk6450_i2c_devs1));
 
samsung_bl_set(smdk6450_bl_gpio_info, smdk6450_bl_data);
+   s3c_fb_set_platdata(smdk64x0_lcd_pdata);
+   s5p64x0_fb_init(S5P64X0_SPCON0_LCD_SEL_RGB);
 
platform_add_devices(smdk6450_devices, ARRAY_SIZE(smdk6450_devices));
 }
-- 
1.7.0.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] ARM:EXYNOS4:Fix Samsung Power Domain

2011-07-27 Thread Sangwook Lee
Func:samsung_pd_init should be postponed utill end of drivers
registeration because this activates runtime_suspend in advance.

For example,
If PD's runtime_suspend is called, it will power down LCD0_CONF0.
Since this happens before s3cfb driver registers itself,
it makes s3cfb_probe hang up with both Origen and SMDK

Signed-off-by: Sangwook Lee sangwook@linaro.org
---
 arch/arm/plat-samsung/pd.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-samsung/pd.c b/arch/arm/plat-samsung/pd.c
index efe1d56..5ffc737 100644
--- a/arch/arm/plat-samsung/pd.c
+++ b/arch/arm/plat-samsung/pd.c
@@ -92,4 +92,4 @@ static int __init samsung_pd_init(void)
 
return ret;
 }
-arch_initcall(samsung_pd_init);
+late_initcall_sync(samsung_pd_init);
-- 
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


RE: [PATCH] ARM:EXYNOS4:Fix Samsung Power Domain

2011-07-27 Thread Marek Szyprowski
Hello,

On Wednesday, July 27, 2011 2:25 PM Sangwook Lee wrote:

 Func:samsung_pd_init should be postponed utill end of drivers
 registeration because this activates runtime_suspend in advance.
 
 For example,
 If PD's runtime_suspend is called, it will power down LCD0_CONF0.
 Since this happens before s3cfb driver registers itself,
 it makes s3cfb_probe hang up with both Origen and SMDK

Nope. This is completely wrong. Power domain driver should be activated
before any device drivers. If the driver hangs in probe() because the
power domain has been suspended, then it is a bug in that driver. Each
driver should call pm_runtime_get_sync() in it's probe if it supports
runtime pm. If you delay registration of power domain driver, then how
do you want to probe devices that belongs to power domains which has
been disabled by bootloader? Our bootloader disables all power domains
that are not needed at boot time.

Best regards
-- 
Marek Szyprowski
Samsung Poland RD Center



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


[PATCH] arm: exynos4: Add support for dt irq specifier to linux virq conversion

2011-07-27 Thread Thomas Abraham
Exynos4 includes two interrupt controllers - External GIC and External
Interrupt Combiner. External GIC can handle 16 software generated
interrupts (SGI), 16 Private Peripheral Interrupts (PPI) and 128
Shared Peripheral Interrupts (SPI). External Interrupt Combiner manages
32 groups of 8 interrupts each and feeds 32 interrupts as SPI interrupts
to the External GIC controller.

This patch supports conversion of device tree interrupt specifier to
linux virq domain for both the interrupt controllers. The concept of
this patch is derived from Grant's 'simple' irq converter.

This patch is based on Grant's following patchset
[PATCH v3 0/2] Simple irq_domain implementation

Signed-off-by: Thomas Abraham thomas.abra...@linaro.org
---
 Documentation/devicetree/bindings/arm/samsung.txt |   72 +
 arch/arm/mach-exynos4/Makefile|1 +
 arch/arm/mach-exynos4/include/mach/irqs.h |3 +
 arch/arm/mach-exynos4/irqdomain.c |  117 +
 arch/arm/mach-exynos4/mach-exynos4-dt.c   |8 +-
 5 files changed, 196 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/mach-exynos4/irqdomain.c

diff --git a/Documentation/devicetree/bindings/arm/samsung.txt 
b/Documentation/devicetree/bindings/arm/samsung.txt
index 5676bca..878aa01 100644
--- a/Documentation/devicetree/bindings/arm/samsung.txt
+++ b/Documentation/devicetree/bindings/arm/samsung.txt
@@ -6,3 +6,75 @@ Required root node properties:
   - compatible = samsung,smdkv310, samsung,exynos4210'.
   (a) samsung,smdkv310 - for Samsung's SMDKV310 eval board.
   (b) samsung,exynos4210 - for boards based on Exynos4210 processor.
+
+
+Exynos4 Interrupt Controllers
+-
+
+Samsung's Exynos4 architecture includes two interrupt controllers.
+  - External GIC
+  - External Interrupt Combiner.
+
+The external GIC can manage
+  - 16 Software Generated Interrupts (SGI).
+  - 16 Private Peripheral Interrupts (PPI).
+  - 128 Shared Peripheral Interrupts (SPI).
+
+Out of the 128 Shared Peripheral Interrupts (SPI's), 32 interrupts
+are sourced from a interrupt combiner. The interrupt combiner provides
+32 groups of interrupts with a maximum of 8 interrupts combined per
+group.
+
+External GIC properties:
+  - compatible: should be samsung,exynos4-ext-gic.
+  - interrupt-cells: should be 2. The meaning of the cells are
+  * First Cell: Interrupt Number.
+  * Second Cell: Type of Interrupt (0-SPI, 1-SGI, 2-PPI).
+  - reg: The GIC includes a Distributor Interface and CPU Interface and
+hence requires two base addresses. The property format is
+Distributor-Base Distributor-Size, CPU-Base CPU Size
+
+  Example:
+
+   EXT_GIC:interrupt-controller@1049 {
+   compatible = samsung,exynos4-ext-gic;
+   #interrupt-cells = 2;
+   interrupt-controller;
+   reg = 0x1049 0x1000, 0x1048 0x100;
+   };
+
+  Devices using External GIC as the interrupt parent should specify two
+  cells for the interrupts property as shown below.
+
+   watchdog@1006 {
+   compatible = samsung,s3c2410-wdt;
+   reg = 0x1006 0x400;
+   interrupt-parent = EXT_GIC;
+   interrupts = 43 0;
+   };
+
+External Interrupt Combiner properties:
+  - compatible: should be samsung,exynos4-ext-combiner.
+  - interrupt-cells: should be 2. The meaning of the cells are
+  * First Cell: Combiner Group Number.
+  * Second Cell: Interrupt within the group.
+  - reg: Base address and size of interrupt combiner registers.
+
+  Example:
+
+   EXT_COMBINER:interrupt-controller@1044 {
+   compatible = samsung,exynos4-ext-combiner;
+   #interrupt-cells = 2;
+   interrupt-controller;
+   reg = 0x1044 0x200;
+   };
+
+  Devices using External Interrupt Combiner as the interrupt parent should
+  specify two cells for the interrupts property as shown below.
+
+   watchdog@1006 {
+   compatible = samsung,s3c2410-wdt;
+   reg = 0x1006 0x400;
+   interrupt-parent = EXT_COMBINER;
+   interrupts = 4 2;
+   };
diff --git a/arch/arm/mach-exynos4/Makefile b/arch/arm/mach-exynos4/Makefile
index ac91f4f..fd532c7 100644
--- a/arch/arm/mach-exynos4/Makefile
+++ b/arch/arm/mach-exynos4/Makefile
@@ -32,6 +32,7 @@ obj-$(CONFIG_MACH_ARMLEX4210) += mach-armlex4210.o
 obj-$(CONFIG_MACH_UNIVERSAL_C210)  += mach-universal_c210.o
 obj-$(CONFIG_MACH_NURI)+= mach-nuri.o
 obj-$(CONFIG_MACH_EXYNOS4_DT)  += mach-exynos4-dt.o
+obj-$(CONFIG_OF_IRQ)   += irqdomain.o
 
 # device support
 
diff --git a/arch/arm/mach-exynos4/include/mach/irqs.h 
b/arch/arm/mach-exynos4/include/mach/irqs.h
index 934d2a4..c120aad 100644
--- a/arch/arm/mach-exynos4/include/mach/irqs.h
+++ b/arch/arm/mach-exynos4/include/mach/irqs.h
@@ -15,6 +15,9 @@
 

Re: [PATCH v2 0/3] Add device tree support for Samsung's I2C driver

2011-07-27 Thread Ben Dooks
On Fri, Jul 22, 2011 at 03:48:35PM +0530, Thomas Abraham wrote:
 This patchset adds device tree support for Samsung's I2C driver. The
 Exynos4 DT enabled machine is updated to support device tree based probe
 for I2C instance 0 and 1.

I'll look at taking the i2c specific changes for either this or the next
release depending on how I feel.
 
 Changes since v1:
 
 - Addressed all comments from Grant Likely
 - s3c24xx_i2c_is2440 function is simpler now.
 - Consolidated all the scatterd dt support code into a single function.
 - but the dependency on i2c pinmux handler function passed from the
   platform data is retained. It would be removed eventually when the
   new pinmux api is finalized and the i2c driver is modified to
   support the pinmux settings using the pinmux api.
 
 Thomas Abraham (3):
   i2c: s3c2410: Keep a copy of platform data and use it.
   i2c: s3c2410: Add device tree support
   arm: dt: Add device tree support for i2c instance 0 and 1 on exynos4 dt 
 machine
 
  .../devicetree/bindings/i2c/samsung-i2c.txt|   44 +++
  arch/arm/boot/dts/exynos4-smdkv310.dts |   45 +++
  arch/arm/mach-exynos4/Kconfig  |2 +
  arch/arm/mach-exynos4/mach-exynos4-dt.c|   23 
  drivers/i2c/busses/i2c-s3c2410.c   |   58 
 +++-
  5 files changed, 169 insertions(+), 3 deletions(-)
  create mode 100644 Documentation/devicetree/bindings/i2c/samsung-i2c.txt
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-i2c in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Ben Dooks, b...@fluff.org, http://www.fluff.org/ben/

Large Hadron Colada: A large Pina Colada that makes the universe disappear.

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


[PATCH] ARM: S5P64X0: Replace irq_gc_ack() with irq_gc_ack_set_bit()

2011-07-27 Thread Kukjin Kim
According to 'replace irq_gc_ack() with {set,clr}_bit variants',
(commit: 659fb32d1b67476f4ade25e9ea0e2642a5b9c4b5), this should
be fixed.

Signed-off-by: Kukjin Kim kgene@samsung.com
---
 arch/arm/mach-s5p64x0/irq-eint.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-s5p64x0/irq-eint.c b/arch/arm/mach-s5p64x0/irq-eint.c
index 69ed454..fe7380f 100644
--- a/arch/arm/mach-s5p64x0/irq-eint.c
+++ b/arch/arm/mach-s5p64x0/irq-eint.c
@@ -129,7 +129,7 @@ static int s5p64x0_alloc_gc(void)
}
 
ct = gc-chip_types;
-   ct-chip.irq_ack = irq_gc_ack;
+   ct-chip.irq_ack = irq_gc_ack_set_bit;
ct-chip.irq_mask = irq_gc_mask_set_bit;
ct-chip.irq_unmask = irq_gc_mask_clr_bit;
ct-chip.irq_set_type = s5p64x0_irq_eint_set_type;
-- 
1.7.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


[PATCH] serial: samsung: Fix build error

2011-07-27 Thread Kukjin Kim
drivers/tty/serial/samsung.c: In function 's3c24xx_serial_init':
drivers/tty/serial/samsung.c:1237: error: lvalue required as unary '' operand

Cc: Greg Kroah-Hartman gre...@suse.de
Signed-off-by: Kukjin Kim kgene@samsung.com
---
 drivers/tty/serial/samsung.c |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index afc6294..6edafb5 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1225,15 +1225,19 @@ static const struct dev_pm_ops s3c24xx_serial_pm_ops = {
.suspend = s3c24xx_serial_suspend,
.resume = s3c24xx_serial_resume,
 };
+#define SERIAL_SAMSUNG_PM_OPS  (s3c24xx_serial_pm_ops)
+
 #else /* !CONFIG_PM_SLEEP */
-#define s3c24xx_serial_pm_ops  NULL
+
+#define SERIAL_SAMSUNG_PM_OPS  NULL
 #endif /* CONFIG_PM_SLEEP */
 
 int s3c24xx_serial_init(struct platform_driver *drv,
struct s3c24xx_uart_info *info)
 {
dbg(s3c24xx_serial_init(%p,%p)\n, drv, info);
-   drv-driver.pm = s3c24xx_serial_pm_ops;
+
+   drv-driver.pm = SERIAL_SAMSUNG_PM_OPS;
 
return platform_driver_register(drv);
 }
-- 
1.7.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


RE: [PATCH V4 06/14] ARM: SAMSUNG: Add common DMA operations

2011-07-27 Thread Boojin Kim
Jassi Brar wrote:
 Sent: Wednesday, July 27, 2011 4:58 PM
 To: Boojin Kim
 Cc: Kukjin Kim; Vinod Koul; Mark Brown; Grant Likely; linux-samsung-
 s...@vger.kernel.org; Dan Williams; linux-arm-
 ker...@lists.infradead.org
 Subject: Re: [PATCH V4 06/14] ARM: SAMSUNG: Add common DMA operations

 On Wed, Jul 27, 2011 at 10:47 AM, Boojin Kim boojin@samsung.com
 wrote:
  Jassi Brar wrote:
  Sent: Wednesday, July 27, 2011 10:34 AM
  To: Boojin Kim
  Cc: linux-arm-ker...@lists.infradead.org; linux-samsung-
  s...@vger.kernel.org; Vinod Koul; Dan Williams; Kukjin Kim; Grant
  Likely; Mark Brown
  Subject: Re: [PATCH V4 06/14] ARM: SAMSUNG: Add common DMA
 operations
 
  On Tue, Jul 26, 2011 at 3:05 PM, Boojin Kim
 boojin@samsung.com
  wrote:
   Jassi Brar Wrote:
   Sent: Monday, July 25, 2011 8:52 PM
   To: Boojin Kim
   Cc: linux-arm-ker...@lists.infradead.org; linux-samsung-
   s...@vger.kernel.org; Vinod Koul; Dan Williams; Kukjin Kim; Grant
   Likely; Mark Brown
   Subject: Re: [PATCH V4 06/14] ARM: SAMSUNG: Add common DMA
  operations
  
   On Mon, Jul 25, 2011 at 6:58 AM, Boojin Kim
  boojin@samsung.com
   wrote:
  
+
+static bool pl330_filter(struct dma_chan *chan, void *param)
+{
+   struct dma_pl330_peri *peri = (struct dma_pl330_peri
  *)chan-
   private;
+   unsigned dma_ch = (unsigned)param;
+
+   if (peri-peri_id != dma_ch)
+   return false;
+
+   return true;
+}
   This is what I meant... if we keep chan_id for paltform assigned
  IDs,
   these filter functions could simply become
  
   static bool pl330_filter(struct dma_chan *chan, void *param)
   {
   return chan-chan_id == param
   }
  
   And ideally in the long run, we could just drop the filter
 callback
   and add expected channel ID to the request_channel call.
   The chan_id is set by dmaengine. So, We don't use it to hold the
  user specific
   Id.
  Not for long.
  See  https://lkml.org/lkml/2011/7/26/245
 
 
+
+static inline int s3c_dma_trigger(unsigned ch)
+{
+   return s3c2410_dma_ctrl(ch, S3C2410_DMAOP_START);
+}
+
+static inline int s3c_dma_started(unsigned ch)
+{
+   return s3c2410_dma_ctrl(ch, S3C2410_DMAOP_STARTED);
+}
+
+static inline int s3c_dma_flush(unsigned ch)
+{
+   return s3c2410_dma_ctrl(ch, S3C2410_DMAOP_FLUSH);
+}
+
+static inline int s3c_dma_stop(unsigned ch)
+{
+   return s3c2410_dma_ctrl(ch, S3C2410_DMAOP_STOP);
+}
+
+static struct samsung_dma_ops s3c_dma_ops = {
+   .request= s3c_dma_request,
+   .release= s3c_dma_release,
+   .prepare= s3c_dma_prepare,
+   .trigger= s3c_dma_trigger,
+   .started= s3c_dma_started,
+   .flush  = s3c_dma_flush,
+   .stop   = s3c_dma_stop,
  
   These last 4 should be gnereallized into one callback with OP
  argument.
   I don't have any idea about it. Can you explain it in more detail?
 
  static int s3c_dma_control(unsigned ch, enum s3c2410_chan_op/*or
  similar*/ op)
   {
  return s3c2410_dma_ctrl(ch, op);
   }
 
  static struct samsung_dma_ops s3c_dma_ops = {
  .request= s3c_dma_request,
  .release= s3c_dma_release,
  .prepare= s3c_dma_prepare,
  .control= s3c_dma_control,
  'Struct samsung_dma_ops' is used for both 'S3C-DMA-OPS' for 's3c
 dma' and
  'DMA-OPS' for 'dmaengine'.
  If I modify Struct samsung_dma_ops as your guide, It gives un-
 expectable
  effect to DMA-OPS.
  Actually, We don't want the client with 'DMA-OPS' uses 'enum
 s3c2410_chan_op'
  operation anymore.

  enum s3c2410_chan_op /* or similar */ note 'or similar'

 Defining a callback for each value of the argument doesn't make sense.
Yes, The command may not be 'enum s3c2410_chan_op'. But it's very similar with 
'enum s3c2410_chan_op'.
So, It brings same result that I sad.
Actually, I quietly agree with your comment. If the 'struct samsung_dma_ops' 
is only used for 's3c-dma-ops', I would address your comment. But, 'struct 
samsung_dma_ops' is used for all Samsung dma clients. I aim that 'struct 
samsung_dma_ops' provide the DMA clients with 'dmaengine' friendly DMA 
interface without any other command.



--
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 V4 14/14] ARM: SAMSUNG: Remove Samsung specific enum type for dma direction

2011-07-27 Thread Boojin Kim
Grant Likely Wrote:
 Likely
 Sent: Tuesday, July 26, 2011 6:16 AM
 To: Jassi Brar
 Cc: Boojin Kim; linux-arm-ker...@lists.infradead.org; linux-samsung-
 s...@vger.kernel.org; Vinod Koul; Dan Williams; Kukjin Kim; Mark Brown
 Subject: Re: [PATCH V4 14/14] ARM: SAMSUNG: Remove Samsung specific
 enum type for dma direction

 On Mon, Jul 25, 2011 at 05:38:37PM +0530, Jassi Brar wrote:
  On Mon, Jul 25, 2011 at 6:58 AM, Boojin Kim boojin@samsung.com
 wrote:
   This patch removes the samsung specific enum type 's3c2410_dmasrc'
   and uses 'dma_data_direction' instead.
  
   Signed-off-by: Boojin Kim boojin@samsung.com
   Signed-off-by: Kukjin Kim kgene@samsung.com
 
  Acked-by: Jassi Brar jassisinghb...@gmail.com
 
  If this patch was first in the patchset, probably it could have been
  already merged.

 Indeed.  If you move this to the front when you post the next version
 then it can be merged right away.
I tried to move it ahead. But It made some conflicts.
So, I pushed as it is on V5 release.
Sorry.. I would have noticed it before I release V5.


 Acked-by: Grant Likely grant.lik...@secretlab.ca


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