[PATCH v2] ARM: EXYNOS4: Configure MAX8997 PMIC for Origen

2011-08-22 Thread Inderpal Singh
From: Inderpal Singh inderpa...@samsung.com

Configure MAX8997 PMIC and provide platform specific data
for origen.

Signed-off-by: Inderpal Singh inderpal.si...@linaro.org
---
Changes from v1:
- Removed soc-audio
- Used macro for GPIO pin
- irq assigned statically 
- Rectified mismatches in constraints flags
- Removed assigning of array index

 arch/arm/mach-exynos4/mach-origen.c |  390 +++
 1 files changed, 390 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-exynos4/mach-origen.c 
b/arch/arm/mach-exynos4/mach-origen.c
index ed59f86..ccd2a55 100644
--- a/arch/arm/mach-exynos4/mach-origen.c
+++ b/arch/arm/mach-exynos4/mach-origen.c
@@ -14,6 +14,9 @@
 #include linux/platform_device.h
 #include linux/io.h
 #include linux/input.h
+#include linux/i2c.h
+#include linux/regulator/machine.h
+#include linux/mfd/max8997.h
 
 #include asm/mach/arch.h
 #include asm/mach-types.h
@@ -24,6 +27,7 @@
 #include plat/devs.h
 #include plat/sdhci.h
 #include plat/iic.h
+#include plat/gpio-cfg.h
 
 #include mach/map.h
 
@@ -72,6 +76,378 @@ static struct s3c2410_uartcfg origen_uartcfgs[] __initdata 
= {
},
 };
 
+static struct regulator_consumer_supply __initdata ldo3_consumer[] = {
+   REGULATOR_SUPPLY(vdd11, s5p-mipi-csis.0), /* MIPI */
+};
+static struct regulator_consumer_supply __initdata ldo6_consumer[] = {
+   REGULATOR_SUPPLY(vdd18, s5p-mipi-csis.0), /* MIPI */
+};
+static struct regulator_consumer_supply __initdata ldo7_consumer[] = {
+   REGULATOR_SUPPLY(avdd, alc5625), /* Realtek ALC5625 */
+};
+static struct regulator_consumer_supply __initdata ldo8_consumer[] = {
+   REGULATOR_SUPPLY(vdd, s5p-adc), /* ADC */
+};
+static struct regulator_consumer_supply __initdata ldo9_consumer[] = {
+   REGULATOR_SUPPLY(dvdd, swb-a31), /* AR6003 WLAN  CSR 8810 BT */
+};
+static struct regulator_consumer_supply __initdata ldo11_consumer[] = {
+   REGULATOR_SUPPLY(dvdd, alc5625), /* Realtek ALC5625 */
+};
+static struct regulator_consumer_supply __initdata ldo14_consumer[] = {
+   REGULATOR_SUPPLY(avdd18, swb-a31), /* AR6003 WLAN  CSR 8810 BT */
+};
+static struct regulator_consumer_supply __initdata ldo17_consumer[] = {
+   REGULATOR_SUPPLY(vdd33, swb-a31), /* AR6003 WLAN  CSR 8810 BT */
+};
+static struct regulator_consumer_supply __initdata buck1_consumer[] = {
+   REGULATOR_SUPPLY(vdd_arm, NULL), /* CPUFREQ */
+};
+static struct regulator_consumer_supply __initdata buck2_consumer[] = {
+   REGULATOR_SUPPLY(vdd_int, NULL), /* CPUFREQ */
+};
+static struct regulator_consumer_supply __initdata buck3_consumer[] = {
+   REGULATOR_SUPPLY(vdd_g3d, mali_drm), /* G3D */
+};
+static struct regulator_consumer_supply __initdata buck7_consumer[] = {
+   REGULATOR_SUPPLY(vcc, platform-lcd), /* LCD */
+};
+
+static struct regulator_init_data __initdata max8997_ldo1_data = {
+   .constraints= {
+   .name   = VDD_ABB_3.3V,
+   .min_uV = 330,
+   .max_uV = 330,
+   .apply_uV   = 1,
+   .state_mem  = {
+   .disabled   = 1,
+   },
+   },
+};
+
+static struct regulator_init_data __initdata max8997_ldo2_data = {
+   .constraints= {
+   .name   = VDD_ALIVE_1.1V,
+   .min_uV = 110,
+   .max_uV = 110,
+   .apply_uV   = 1,
+   .always_on  = 1,
+   .state_mem  = {
+   .enabled= 1,
+   },
+   },
+};
+
+static struct regulator_init_data __initdata max8997_ldo3_data = {
+   .constraints= {
+   .name   = VMIPI_1.1V,
+   .min_uV = 110,
+   .max_uV = 110,
+   .apply_uV   = 1,
+   .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+   .state_mem  = {
+   .disabled   = 1,
+   },
+   },
+   .num_consumer_supplies  = ARRAY_SIZE(ldo3_consumer),
+   .consumer_supplies  = ldo3_consumer,
+};
+
+static struct regulator_init_data __initdata max8997_ldo4_data = {
+   .constraints= {
+   .name   = VDD_RTC_1.8V,
+   .min_uV = 180,
+   .max_uV = 180,
+   .apply_uV   = 1,
+   .always_on  = 1,
+   .state_mem  = {
+   .disabled   = 1,
+   },
+   },
+};
+
+static struct regulator_init_data __initdata max8997_ldo6_data = {
+   .constraints= {
+   .name   = VMIPI_1.8V,
+   .min_uV = 180,
+   .max_uV = 180,
+   .apply_uV   = 1,
+   .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+   .state_mem  = {
+

Re: [PATCH v3] ARM: Samsung: fix watchdog reset issue with clk_get()

2011-08-22 Thread Tushar Behera

Hi Kyungmin,

On Friday 19 August 2011 04:14 PM, Kyungmin Park wrote:

Interesting. there's no s5p_reset_hook at exynos4.
Anyway, after implement the s5p_reset_hook, it's working without
hacking of v7-fin.

Thanks for the pointer. After adding s5p_reset_hook, tested soft-reboot 
successfully on ORIGEN.



Send it another mail.

Thank you,
Kyungmin Park



--
Tushar Behera
--
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 v6 04/15] DMA: PL330: Add DMA_CYCLIC capability

2011-08-22 Thread Jassi Brar
On Fri, Aug 19, 2011 at 2:24 PM, Boojin Kim boojin@samsung.com wrote:

 @@ -324,6 +362,9 @@ static void pl330_free_chan_resources(struct dma_chan 
 *chan)
        pl330_release_channel(pch-pl330_chid);
        pch-pl330_chid = NULL;

 +       if (pch-cyclic)
 +               list_splice_tail_init(pch-work_list, pch-dmac-desc_pool);
'cyclic' member is 'enum cyclic_mode', please observe the rule and compare
it only against the enum values.


 +static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
 +               struct dma_chan *chan, dma_addr_t dma_addr, size_t len,
 +               size_t period_len, enum dma_data_direction direction)
 +{
 +       struct dma_pl330_desc *desc;
 +       struct dma_pl330_chan *pch = to_pchan(chan);
 +       dma_addr_t dst;
 +       dma_addr_t src;
 +
 +       desc = pl330_get_desc(pch);
 +       if (!desc) {
 +               dev_err(pch-dmac-pif.dev, %s:%d Unable to fetch desc\n,
 +                       __func__, __LINE__);
 +               return NULL;
 +       }
 +
 +       switch (direction) {
 +       case DMA_TO_DEVICE:
 +               desc-rqcfg.src_inc = 1;
 +               desc-rqcfg.dst_inc = 0;
 +               src = dma_addr;
 +               dst = pch-fifo_addr;
 +               break;
 +       case DMA_FROM_DEVICE:
 +               desc-rqcfg.src_inc = 0;
 +               desc-rqcfg.dst_inc = 1;
 +               src = pch-fifo_addr;
 +               dst = dma_addr;
 +               break;
 +       default:
 +               dev_err(pch-dmac-pif.dev, %s:%d Invalid dma direction\n,
 +               __func__, __LINE__);
 +               return NULL;
 +       }
 +
 +       desc-rqcfg.brst_size = pch-burst_sz;
 +       desc-rqcfg.brst_len = 1;
 +
 +       if (!pch-cyclic)
 +               pch-cyclic = CYCLIC_PREP;
The need for check here seems suspicious.
Is it really needed? If not, please remove it.


Re: [PATCH v6 02/15] DMA: PL330: Update PL330 DMA API driver

2011-08-22 Thread Jassi Brar
On Fri, Aug 19, 2011 at 2:24 PM, Boojin Kim boojin@samsung.com wrote:
 This patch updates following 3 items.
 1. Removes unneccessary code.
 2. Add AMBA, PL330 configuration
 3. Change the meaning of 'peri_id' variable
   from PL330 event number to specific dma id by user.

 Signed-off-by: Boojin Kim boojin@samsung.com
 Acked-by: Linus Walleij linus.wall...@linaro.org
 Acked-by: 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 v6 03/15] DMA: PL330: Support DMA_SLAVE_CONFIG command

2011-08-22 Thread Jassi Brar
On Fri, Aug 19, 2011 at 2:24 PM, Boojin Kim boojin@samsung.com wrote:
 Signed-off-by: Boojin Kim boojin@samsung.com
 Acked-by: Linus Walleij linus.wall...@linaro.org
 Acked-by: Vinod Koul vinod.k...@intel.com
 Cc: Dan Williams dan.j.willi...@intel.com
 Signed-off-by: Kukjin Kim kgene@samsung.com
 ---
  drivers/dma/pl330.c |   56 ++
  1 files changed, 42 insertions(+), 14 deletions(-)

 diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
 index d5829c7..59943ec 100644
 --- a/drivers/dma/pl330.c
 +++ b/drivers/dma/pl330.c
 @@ -73,6 +73,7 @@ struct dma_pl330_chan {

        /* For D-to-M and M-to-D channels */
        int burst_sz; /* the peripheral fifo width */
 +       int burst_len; /* the number of burst */
        dma_addr_t fifo_addr;
  };

 @@ -261,25 +262,52 @@ static int pl330_alloc_chan_resources(struct dma_chan 
 *chan)
  static int pl330_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, 
 unsigned long arg)
  {
        struct dma_pl330_chan *pch = to_pchan(chan);
 -       struct dma_pl330_desc *desc;
 +       struct dma_pl330_desc *desc, *_dt;
        unsigned long flags;
 +       struct dma_pl330_dmac *pdmac = pch-dmac;
 +       struct dma_slave_config *slave_config;
 +       LIST_HEAD(list);

 -       /* Only supports DMA_TERMINATE_ALL */
 -       if (cmd != DMA_TERMINATE_ALL)
 -               return -ENXIO;
 -
 -       spin_lock_irqsave(pch-lock, flags);
 -
 -       /* FLUSH the PL330 Channel thread */
 -       pl330_chan_ctrl(pch-pl330_chid, PL330_OP_FLUSH);
 +       switch (cmd) {
 +       case DMA_TERMINATE_ALL:
 +               spin_lock_irqsave(pch-lock, flags);

 -       /* Mark all desc done */
 -       list_for_each_entry(desc, pch-work_list, node)
 -               desc-status = DONE;
 +               /* FLUSH the PL330 Channel thread */
 +               pl330_chan_ctrl(pch-pl330_chid, PL330_OP_FLUSH);

 -       spin_unlock_irqrestore(pch-lock, flags);
 +               /* Mark all desc done */
 +               list_for_each_entry_safe(desc, _dt, pch-work_list , node) {
 +                       desc-status = DONE;
 +                       pch-completed = desc-txd.cookie;
 +                       list_move_tail(desc-node, list);
 +               }

 -       pl330_tasklet((unsigned long) pch);
 +               list_splice_tail_init(list, pdmac-desc_pool);
 +               spin_unlock_irqrestore(pch-lock, flags);
 +               break;
 +       case DMA_SLAVE_CONFIG:
 +               slave_config = (struct dma_slave_config *)arg;
 +
 +               if (slave_config-direction == DMA_TO_DEVICE) {
 +                       if (slave_config-dst_addr)
 +                               pch-fifo_addr = slave_config-dst_addr;
 +                       if (slave_config-dst_addr_width)
 +                               pch-burst_sz = 
 __ffs(slave_config-dst_addr_width);
 +                       if (slave_config-dst_maxburst)
 +                               pch-burst_len = slave_config-dst_maxburst;
 +               } else if (slave_config-direction == DMA_FROM_DEVICE) {
 +                       if (slave_config-src_addr)
 +                               pch-fifo_addr = slave_config-src_addr;
 +                       if (slave_config-src_addr_width)
 +                               pch-burst_sz = 
 __ffs(slave_config-src_addr_width);
 +                       if (slave_config-src_maxburst)
 +                               pch-burst_len = slave_config-src_maxburst;
 +               }
 +               break;
 +       default:
 +               dev_err(pch-dmac-pif.dev, Not supported command.\n);
 +               return -ENXIO;
 +       }

Apart from the alleged purpose Support DMA_SLAVE_CONFIG command
this patch also modifies the behavior of DMA_TERMINATE_ALL.
If the change is intended, please split it into two patches and
explain the reason.
Otherwise, restore the behavior.
--
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 v6 14/15] ASoC: Samsung: Update DMA interface

2011-08-22 Thread Jassi Brar
On Fri, Aug 19, 2011 at 2:24 PM, Boojin Kim boojin@samsung.com wrote:
 This patch adds to support the DMA PL330 driver that uses
 DMA generic API. Samsung sound driver uses DMA generic API
 if architecture supports it. Otherwise, use samsung specific
 S3C-PL330 API driver to transfer PCM data.

 Signed-off-by: Boojin Kim boojin@samsung.com
 Acked-by: Linus Walleij linus.wall...@linaro.org
 Acked-by: Vinod Koul vinod.k...@intel.com
 Cc: Jassi Brar jassisinghb...@gmail.com
 Cc: Liam Girdwood l...@ti.com
 Acked-by: Mark Brown broo...@opensource.wolfsonmicro.com
 [kgene@samsung.com: removed useless variable]
 Signed-off-by: Kukjin Kim kgene@samsung.com
 ---
  arch/arm/mach-s3c2410/include/mach/dma.h       |   10 +-
  arch/arm/mach-s3c64xx/include/mach/dma.h       |    2 +-
  arch/arm/plat-samsung/include/plat/dma-pl330.h |    2 +-
  sound/soc/samsung/ac97.c                       |   10 ++-
  sound/soc/samsung/dma.c                        |  146 
 ++--
  sound/soc/samsung/dma.h                        |    4 +-
  6 files changed, 78 insertions(+), 96 deletions(-)

 diff --git a/arch/arm/mach-s3c2410/include/mach/dma.h 
 b/arch/arm/mach-s3c2410/include/mach/dma.h
 index e61a91f..4e485ba 100644
 --- a/arch/arm/mach-s3c2410/include/mach/dma.h
 +++ b/arch/arm/mach-s3c2410/include/mach/dma.h
 @@ -50,6 +50,11 @@ enum dma_ch {
        DMACH_MAX,              /* the end entry */
  };

 +static inline bool samsung_dma_has_circular(void)
 +{
 +       return false;
 +}
 +
  static inline bool samsung_dma_is_dmadev(void)
  {
        return false;
 @@ -202,9 +207,4 @@ struct s3c2410_dma_chan {

  typedef unsigned long dma_device_t;

 -static inline bool s3c_dma_has_circular(void)
 -{
 -       return false;
 -}
 -
  #endif /* __ASM_ARCH_DMA_H */
 diff --git a/arch/arm/mach-s3c64xx/include/mach/dma.h 
 b/arch/arm/mach-s3c64xx/include/mach/dma.h
 index 49c3a53..74fdf25 100644
 --- a/arch/arm/mach-s3c64xx/include/mach/dma.h
 +++ b/arch/arm/mach-s3c64xx/include/mach/dma.h
 @@ -58,7 +58,7 @@ enum dma_ch {
        DMACH_MAX               /* the end */
  };

 -static __inline__ bool s3c_dma_has_circular(void)
 +static inline bool samsung_dma_has_circular(void)
  {
        return true;
  }
 diff --git a/arch/arm/plat-samsung/include/plat/dma-pl330.h 
 b/arch/arm/plat-samsung/include/plat/dma-pl330.h
 index 9a1dadb..2e55e59 100644
 --- a/arch/arm/plat-samsung/include/plat/dma-pl330.h
 +++ b/arch/arm/plat-samsung/include/plat/dma-pl330.h
 @@ -89,7 +89,7 @@ struct s3c2410_dma_client {
        char    *name;
  };

 -static inline bool s3c_dma_has_circular(void)
 +static inline bool samsung_dma_has_circular(void)
  {
        return true;
  }
 diff --git a/sound/soc/samsung/ac97.c b/sound/soc/samsung/ac97.c
 index f97110e..b4f9b00 100644
 --- a/sound/soc/samsung/ac97.c
 +++ b/sound/soc/samsung/ac97.c
 @@ -271,7 +271,10 @@ static int s3c_ac97_trigger(struct snd_pcm_substream 
 *substream, int cmd,

        writel(ac_glbctrl, s3c_ac97.regs + S3C_AC97_GLBCTRL);

 -       s3c2410_dma_ctrl(dma_data-channel, S3C2410_DMAOP_STARTED);
 +       if (!dma_data-ops)
 +               dma_data-ops = samsung_dma_get_ops();
 +
 +       dma_data-ops-started(dma_data-channel);

        return 0;
  }
 @@ -317,7 +320,10 @@ static int s3c_ac97_mic_trigger(struct snd_pcm_substream 
 *substream,

        writel(ac_glbctrl, s3c_ac97.regs + S3C_AC97_GLBCTRL);

 -       s3c2410_dma_ctrl(dma_data-channel, S3C2410_DMAOP_STARTED);
 +       if (!dma_data-ops)
 +               dma_data-ops = samsung_dma_get_ops();
 +
 +       dma_data-ops-started(dma_data-channel);

        return 0;
  }
 diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c
 index 9465588..851346f 100644
 --- a/sound/soc/samsung/dma.c
 +++ b/sound/soc/samsung/dma.c
 @@ -54,7 +54,6 @@ struct runtime_data {
        spinlock_t lock;
        int state;
        unsigned int dma_loaded;
 -       unsigned int dma_limit;
        unsigned int dma_period;
        dma_addr_t dma_start;
        dma_addr_t dma_pos;
 @@ -62,77 +61,79 @@ struct runtime_data {
        struct s3c_dma_params *params;
  };

 +static void audio_buffdone(void *data);
 +
  /* dma_enqueue
  *
  * place a dma buffer onto the queue for the dma system
  * to handle.
 -*/
 + */
  static void dma_enqueue(struct snd_pcm_substream *substream)
  {
        struct runtime_data *prtd = substream-runtime-private_data;
        dma_addr_t pos = prtd-dma_pos;
        unsigned int limit;
 -       int ret;
 +       struct samsung_dma_prep_info dma_info;

        pr_debug(Entered %s\n, __func__);

 -       if (s3c_dma_has_circular())
 -               limit = (prtd-dma_end - prtd-dma_start) / prtd-dma_period;
 -       else
 -               limit = prtd-dma_limit;
 +       limit = (prtd-dma_end - prtd-dma_start) / prtd-dma_period;

        pr_debug(%s: loaded %d, limit %d\n,
                                __func__, prtd-dma_loaded, limit);

 -       while (prtd-dma_loaded  limit) {
 -               unsigned long len 

Re: [PATCH] DMA: PL330: Merge PL330 drivers

2011-08-22 Thread Jassi Brar
On Mon, Aug 22, 2011 at 10:22 AM, Boojin Kim boojin@samsung.com wrote:
 This patch merges 'arch/arm/common/pl330.c' with 'driver/dma/pl330.c'

 NOTE: this patch is made on following patches.
 - [PATCH v6] To use DMA generic APIs for Samsung DMA
 - [PATCH v4] amba: consolidate PrimeCell magic
This doesn't make sense in changelog. Such notes usually go below
the '---' line below last SOB


 Signed-off-by: Boojin Kim boojin@samsung.com
 ---
  arch/arm/common/Kconfig               |    3 -
  arch/arm/common/Makefile              |    1 -
  arch/arm/common/pl330.c               | 1931 ---
  arch/arm/include/asm/hardware/pl330.h |  217 
  drivers/dma/Kconfig                   |    1 -
  drivers/dma/pl330.c                   | 2036 
 +
  include/linux/amba/pl330.h            |   11 +-
  7 files changed, 2046 insertions(+), 2154 deletions(-)
  delete mode 100644 arch/arm/common/pl330.c
  delete mode 100644 arch/arm/include/asm/hardware/pl330.h



 diff --git a/arch/arm/include/asm/hardware/pl330.h 
 b/arch/arm/include/asm/hardware/pl330.h
 deleted file mode 100644
 index 575fa81..000
 --- a/arch/arm/include/asm/hardware/pl330.h
 +++ /dev/null
 @@ -1,217 +0,0 @@
 -/* linux/include/asm/hardware/pl330.h
 - *
 - * Copyright (C) 2010 Samsung Electronics Co. Ltd.
 - *     Jaswinder Singh jassi.b...@samsung.com

While at it, please also modify the instances of author id to
  'Jassi Brar jassisinghb...@gmail.com
I think we can accommodate the trivial change.
--
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 v6 03/15] DMA: PL330: Support DMA_SLAVE_CONFIG command

2011-08-22 Thread Boojin Kim
Jassi Brar wrote:
 Sent: Monday, August 22, 2011 7:14 PM
 To: Boojin Kim
 Cc: linux-arm-ker...@lists.infradead.org; linux-samsung-
 s...@vger.kernel.org; Vinod Koul; Kukjin Kim; Dan Williams; Mark Brown;
 Grant Likely; Russell King
 Subject: Re: [PATCH v6 03/15] DMA: PL330: Support DMA_SLAVE_CONFIG
 command

 On Fri, Aug 19, 2011 at 2:24 PM, Boojin Kim boojin@samsung.com
 wrote:
  Signed-off-by: Boojin Kim boojin@samsung.com
  Acked-by: Linus Walleij linus.wall...@linaro.org
  Acked-by: Vinod Koul vinod.k...@intel.com
  Cc: Dan Williams dan.j.willi...@intel.com
  Signed-off-by: Kukjin Kim kgene@samsung.com
  ---
   drivers/dma/pl330.c |   56 ++---
 -
   1 files changed, 42 insertions(+), 14 deletions(-)
 
  diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
  index d5829c7..59943ec 100644
  --- a/drivers/dma/pl330.c
  +++ b/drivers/dma/pl330.c
  @@ -73,6 +73,7 @@ struct dma_pl330_chan {
 
 /* For D-to-M and M-to-D channels */
 int burst_sz; /* the peripheral fifo width */
  +   int burst_len; /* the number of burst */
 dma_addr_t fifo_addr;
   };
 
  @@ -261,25 +262,52 @@ static int pl330_alloc_chan_resources(struct
 dma_chan *chan)
   static int pl330_control(struct dma_chan *chan, enum dma_ctrl_cmd
 cmd, unsigned long arg)
   {
 struct dma_pl330_chan *pch = to_pchan(chan);
  -   struct dma_pl330_desc *desc;
  +   struct dma_pl330_desc *desc, *_dt;
 unsigned long flags;
  +   struct dma_pl330_dmac *pdmac = pch-dmac;
  +   struct dma_slave_config *slave_config;
  +   LIST_HEAD(list);
 
  -   /* Only supports DMA_TERMINATE_ALL */
  -   if (cmd != DMA_TERMINATE_ALL)
  -   return -ENXIO;
  -
  -   spin_lock_irqsave(pch-lock, flags);
  -
  -   /* FLUSH the PL330 Channel thread */
  -   pl330_chan_ctrl(pch-pl330_chid, PL330_OP_FLUSH);
  +   switch (cmd) {
  +   case DMA_TERMINATE_ALL:
  +   spin_lock_irqsave(pch-lock, flags);
 
  -   /* Mark all desc done */
  -   list_for_each_entry(desc, pch-work_list, node)
  -   desc-status = DONE;
  +   /* FLUSH the PL330 Channel thread */
  +   pl330_chan_ctrl(pch-pl330_chid, PL330_OP_FLUSH);
 
  -   spin_unlock_irqrestore(pch-lock, flags);
  +   /* Mark all desc done */
  +   list_for_each_entry_safe(desc, _dt, pch-work_list ,
 node) {
  +   desc-status = DONE;
  +   pch-completed = desc-txd.cookie;
  +   list_move_tail(desc-node, list);
  +   }
 
  -   pl330_tasklet((unsigned long) pch);
  +   list_splice_tail_init(list, pdmac-desc_pool);
  +   spin_unlock_irqrestore(pch-lock, flags);
  +   break;
  +   case DMA_SLAVE_CONFIG:
  +   slave_config = (struct dma_slave_config *)arg;
  +
  +   if (slave_config-direction == DMA_TO_DEVICE) {
  +   if (slave_config-dst_addr)
  +   pch-fifo_addr = slave_config-dst_addr;
  +   if (slave_config-dst_addr_width)
  +   pch-burst_sz = __ffs(slave_config-
 dst_addr_width);
  +   if (slave_config-dst_maxburst)
  +   pch-burst_len = slave_config-
 dst_maxburst;
  +   } else if (slave_config-direction == DMA_FROM_DEVICE)
 {
  +   if (slave_config-src_addr)
  +   pch-fifo_addr = slave_config-src_addr;
  +   if (slave_config-src_addr_width)
  +   pch-burst_sz = __ffs(slave_config-
 src_addr_width);
  +   if (slave_config-src_maxburst)
  +   pch-burst_len = slave_config-
 src_maxburst;
  +   }
  +   break;
  +   default:
  +   dev_err(pch-dmac-pif.dev, Not supported
 command.\n);
  +   return -ENXIO;
  +   }

 Apart from the alleged purpose Support DMA_SLAVE_CONFIG command
 this patch also modifies the behavior of DMA_TERMINATE_ALL.
 If the change is intended, please split it into two patches and
 explain the reason.
 Otherwise, restore the behavior.
I will address your comment.



--
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 v6 04/15] DMA: PL330: Add DMA_CYCLIC capability

2011-08-22 Thread Boojin Kim
Jassi Brar wrote:


  @@ -324,6 +362,9 @@ static void pl330_free_chan_resources(struct
 dma_chan *chan)
 pl330_release_channel(pch-pl330_chid);
 pch-pl330_chid = NULL;
 
  +   if (pch-cyclic)
  +   list_splice_tail_init(pch-work_list, pch-dmac-
 desc_pool);
 'cyclic' member is 'enum cyclic_mode', please observe the rule and
 compare
 it only against the enum values.
I will address your comment.



  +static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
  +   struct dma_chan *chan, dma_addr_t dma_addr, size_t len,
  +   size_t period_len, enum dma_data_direction direction)
  +{
  +   struct dma_pl330_desc *desc;
  +   struct dma_pl330_chan *pch = to_pchan(chan);
  +   dma_addr_t dst;
  +   dma_addr_t src;
  +
  +   desc = pl330_get_desc(pch);
  +   if (!desc) {
  +   dev_err(pch-dmac-pif.dev, %s:%d Unable to fetch
 desc\n,
  +   __func__, __LINE__);
  +   return NULL;
  +   }
  +
  +   switch (direction) {
  +   case DMA_TO_DEVICE:
  +   desc-rqcfg.src_inc = 1;
  +   desc-rqcfg.dst_inc = 0;
  +   src = dma_addr;
  +   dst = pch-fifo_addr;
  +   break;
  +   case DMA_FROM_DEVICE:
  +   desc-rqcfg.src_inc = 0;
  +   desc-rqcfg.dst_inc = 1;
  +   src = pch-fifo_addr;
  +   dst = dma_addr;
  +   break;
  +   default:
  +   dev_err(pch-dmac-pif.dev, %s:%d Invalid dma
 direction\n,
  +   __func__, __LINE__);
  +   return NULL;
  +   }
  +
  +   desc-rqcfg.brst_size = pch-burst_sz;
  +   desc-rqcfg.brst_len = 1;
  +
  +   if (!pch-cyclic)
  +   pch-cyclic = CYCLIC_PREP;
 The need for check here seems suspicious.
 Is it really needed? If not, please remove it.
It's required because Cyclic operation is passed from CYCLIC_PREP to 
CYCLIC_TRIGGER.

Thanks
Boojin




--
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 FIMC device on SMDKV310 board

2011-08-22 Thread Sachin Kamat
This patch adds definitions to enable support for s5p-fimc driver on
SMDKV310 board.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 arch/arm/mach-exynos4/Kconfig |4 
 arch/arm/mach-exynos4/mach-smdkv310.c |4 
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig
index e6925de..95f778e 100644
--- a/arch/arm/mach-exynos4/Kconfig
+++ b/arch/arm/mach-exynos4/Kconfig
@@ -135,6 +135,10 @@ config MACH_SMDKC210
 config MACH_SMDKV310
bool SMDKV310
select CPU_EXYNOS4210
+   select S5P_DEV_FIMC0
+   select S5P_DEV_FIMC1
+   select S5P_DEV_FIMC2
+   select S5P_DEV_FIMC3
select S5P_DEV_FIMD0
select S3C_DEV_RTC
select S3C_DEV_WDT
diff --git a/arch/arm/mach-exynos4/mach-smdkv310.c 
b/arch/arm/mach-exynos4/mach-smdkv310.c
index 5f62b2b..4380b02 100644
--- a/arch/arm/mach-exynos4/mach-smdkv310.c
+++ b/arch/arm/mach-exynos4/mach-smdkv310.c
@@ -168,6 +168,10 @@ static struct i2c_board_info i2c_devs1[] __initdata = {
 };
 
 static struct platform_device *smdkv310_devices[] __initdata = {
+   s5p_device_fimc0,
+   s5p_device_fimc1,
+   s5p_device_fimc2,
+   s5p_device_fimc3,
s3c_device_hsmmc0,
s3c_device_hsmmc1,
s3c_device_hsmmc2,
-- 
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: [RFC PATCH 3/4] ARM: EXYNOS4: Add support AFTR mode cpuidle state on EXYNOS4210

2011-08-22 Thread Amit Kachhap
On 21 August 2011 22:48, Russell King - ARM Linux
li...@arm.linux.org.uk wrote:
 On Fri, Aug 19, 2011 at 06:39:59PM +0530, Amit Daniel Kachhap wrote:
 +ENTRY(exynos4_enter_lp)
 +     stmfd   sp!, { r3 - r12, lr }
 +
 +     adr     r0, sleep_save_misc
 +
 +     mrc     p15, 0, r2, c15, c0, 0  @ read power control register
 +     str     r2, [r0], #4
 +
 +     mrc     p15, 0, r2, c15, c0, 1  @ read diagnostic register
 +     str     r2, [r0], #4
 +
 +     ldr     r3, =resume_with_mmu
 +     bl      cpu_suspend
 +
 +     mov     r0, sp
 +     bl      exynos4_cpu_lp
 +
 +     /* Restore original sp */
 +     mov     r0, sp
 +     add     r0, r0, #4
 +     ldr     sp, [r0]
 +
 +     mov     r0, #0
 +     b       early_wakeup

 This is based upon old kernel code.  Clearly hasn't been tested with
 anything later than 3.0.

You are right. I will rebase it to the latest tree in the next
version. The main intention of the patch series (mostly patch 4) is to
collect information or issues on samsung platform with the new common
cpuidle framework.
--
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 2/4] ARM: EXYNOS4: Fix to work with origen boards.

2011-08-22 Thread Amit Kachhap
On 19 August 2011 19:29, Kyungmin Park kmp...@infradead.org wrote:
 On Fri, Aug 19, 2011 at 10:09 PM, Amit Daniel Kachhap
 amit.kach...@linaro.org wrote:
 This adds a function to get the revision id.

 Signed-off-by: Jaecheol Lee jc@samsung.com
 Signed-off-by: Changhwan Youn chaos.y...@samsung.com
 ---
  arch/arm/mach-exynos4/cpu.c              |   10 ++
  arch/arm/plat-s5p/include/plat/exynos4.h |    1 +
  2 files changed, 11 insertions(+), 0 deletions(-)

 diff --git a/arch/arm/mach-exynos4/cpu.c b/arch/arm/mach-exynos4/cpu.c
 index 2d8a40c..8b106b8 100644
 --- a/arch/arm/mach-exynos4/cpu.c
 +++ b/arch/arm/mach-exynos4/cpu.c
 @@ -234,6 +234,16 @@ static int __init exynos4_l2x0_cache_init(void)
  early_initcall(exynos4_l2x0_cache_init);
  #endif

 +int exynos4_subrev(void)
 +{
 +       static int subrev = -1;
 +
 +       if (unlikely(subrev  0))
 +               subrev = readl(S5P_VA_CHIPID)  0xf;
 How about to add the clock control here?
 1. Register chipid clk
 2. Get the chipid clk
 3. Read CHPIID,
 4. Put tht chipid clk.

Nice suggestion. Will do it in the next patch version.  Actually the
main focus of this
patch series was to have a proof of concept of the new cpuidle common code.

Thanks,
Amit Daniel


 Then you can save some power.

 Thank you,
 Kyungmin Park
 +
 +       return subrev;
 +}
 +
  int __init exynos4_init(void)
  {
        printk(KERN_INFO EXYNOS4: Initializing architecture\n);
 diff --git a/arch/arm/plat-s5p/include/plat/exynos4.h 
 b/arch/arm/plat-s5p/include/plat/exynos4.h
 index 907caab..d62f7f7 100644
 --- a/arch/arm/plat-s5p/include/plat/exynos4.h
 +++ b/arch/arm/plat-s5p/include/plat/exynos4.h
 @@ -15,6 +15,7 @@
  extern void exynos4_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
  extern void exynos4_register_clocks(void);
  extern void exynos4_setup_clocks(void);
 +extern int exynos4_subrev(void);

  #ifdef CONFIG_CPU_EXYNOS4210

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


--
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/3] dma: pl330: Simplify platform data for pl330 driver

2011-08-22 Thread Thomas Abraham
The rqtype parameter specified in platform data as part of the
'struct dma_pl330_peri' can be inferred from the direction of the transfer
specified with transfer requests. So the rqtype parameter can be removed
and 'struct dma_pl330_peri' is then left with only one field 'peri_id'
which itself can be moved into 'struct dma_pl330_platdata' and the
entire 'struct dma_pl330_peri' can be eliminated.

This is first step towards adding device tree support for pl330 dma driver.
With rqtype information inferred from transfer requests, it need not be
included in device tree to describe each hardware dma request.

This patchset is based on following tree.
http://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
and branch 'kgene/next/topic-dma-pl330'.

This patchset has been implemented and tested only for Exynos4. If this
patchset is acceptable, then pl330 driver platform data for other samsung
platforms will also be modfied.

Thomas Abraham (3):
  DMA: PL330: Infer transfer direction from transfer request instead of 
platform data
  ARM: SAMSUNG: Modify pl330 channel filter function
  ARM: EXYNOS4: Modify platform data for pl330 driver

 arch/arm/mach-exynos4/dma.c |  220 +++
 arch/arm/plat-samsung/dma-ops.c |4 +-
 drivers/dma/pl330.c |   56 ++
 include/linux/amba/pl330.h  |   14 +--
 4 files changed, 75 insertions(+), 219 deletions(-)

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


[PATCH 3/3] ARM: EXYNOS4: Modify platform data for pl330 driver

2011-08-22 Thread Thomas Abraham
With the 'struct dma_pl330_peri' removed, the platfrom data for dma
driver can be simplified to a simple list of peripheral request ids.

Signed-off-by: Thomas Abraham thomas.abra...@linaro.org
---
 arch/arm/mach-exynos4/dma.c |  220 ---
 1 files changed, 59 insertions(+), 161 deletions(-)

diff --git a/arch/arm/mach-exynos4/dma.c b/arch/arm/mach-exynos4/dma.c
index d57d662..f905114 100644
--- a/arch/arm/mach-exynos4/dma.c
+++ b/arch/arm/mach-exynos4/dma.c
@@ -35,95 +35,40 @@
 
 static u64 dma_dmamask = DMA_BIT_MASK(32);
 
-struct dma_pl330_peri pdma0_peri[28] = {
-   {
-   .peri_id = (u8)DMACH_PCM0_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_PCM0_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_PCM2_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_PCM2_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_MSM_REQ0,
-   }, {
-   .peri_id = (u8)DMACH_MSM_REQ2,
-   }, {
-   .peri_id = (u8)DMACH_SPI0_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_SPI0_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_SPI2_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_SPI2_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_I2S0S_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_I2S0_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_I2S0_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_UART0_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_UART0_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_UART2_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_UART2_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_UART4_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_UART4_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_SLIMBUS0_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_SLIMBUS0_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_SLIMBUS2_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_SLIMBUS2_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_SLIMBUS4_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_SLIMBUS4_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_AC97_MICIN,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_AC97_PCMIN,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_AC97_PCMOUT,
-   .rqtype = MEMTODEV,
-   },
+u8 pdma0_peri[] = {
+   DMACH_PCM0_RX,
+   DMACH_PCM0_TX,
+   DMACH_PCM2_RX,
+   DMACH_PCM2_TX,
+   DMACH_MSM_REQ0,
+   DMACH_MSM_REQ2,
+   DMACH_SPI0_RX,
+   DMACH_SPI0_TX,
+   DMACH_SPI2_RX,
+   DMACH_SPI2_TX,
+   DMACH_I2S0S_TX,
+   DMACH_I2S0_RX,
+   DMACH_I2S0_TX,
+   DMACH_UART0_RX,
+   DMACH_UART0_TX,
+   DMACH_UART2_RX,
+   DMACH_UART2_TX,
+   DMACH_UART4_RX,
+   DMACH_UART4_TX,
+   DMACH_SLIMBUS0_RX,
+   DMACH_SLIMBUS0_TX,
+   DMACH_SLIMBUS2_RX,
+   DMACH_SLIMBUS2_TX,
+   DMACH_SLIMBUS4_RX,
+   DMACH_SLIMBUS4_TX,
+   DMACH_AC97_MICIN,
+   DMACH_AC97_PCMIN,
+   DMACH_AC97_PCMOUT,
 };
 
 struct dma_pl330_platdata exynos4_pdma0_pdata = {
.nr_valid_peri = ARRAY_SIZE(pdma0_peri),
-   .peri = pdma0_peri,
+   .peri_id = pdma0_peri,
 };
 
 struct amba_device exynos4_device_pdma0 = {
@@ -142,86 +87,37 @@ struct amba_device exynos4_device_pdma0 = {
.periphid = 0x00041330,
 };
 
-struct dma_pl330_peri pdma1_peri[25] = {
-   {
-   .peri_id = (u8)DMACH_PCM0_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_PCM0_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_PCM1_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_PCM1_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_MSM_REQ1,
-   }, {
-   .peri_id = (u8)DMACH_MSM_REQ3,
-   }, {
-   .peri_id = (u8)DMACH_SPI1_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_SPI1_TX,
-   .rqtype = 

[PATCH 2/3] ARM: SAMSUNG: Modify pl330 channel filter function

2011-08-22 Thread Thomas Abraham
With the change in dma channels private data information, the pl330
channel filter function is modified to look for a simple u8 value
instead of the now unused 'struct dma_pl330_peri' value.

Signed-off-by: Thomas Abraham thomas.abra...@linaro.org
---
 arch/arm/plat-samsung/dma-ops.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-samsung/dma-ops.c b/arch/arm/plat-samsung/dma-ops.c
index 6e3d9ab..4f1430b 100644
--- a/arch/arm/plat-samsung/dma-ops.c
+++ b/arch/arm/plat-samsung/dma-ops.c
@@ -19,8 +19,8 @@
 
 static inline bool pl330_filter(struct dma_chan *chan, void *param)
 {
-   struct dma_pl330_peri *peri = chan-private;
-   return peri-peri_id == (unsigned)param;
+   u8 *peri_id = chan-private;
+   return *peri_id == (unsigned)param;
 }
 
 static unsigned samsung_dmadev_request(enum dma_ch dma_ch,
-- 
1.6.6.rc2

--
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/3] DMA: PL330: Infer transfer direction from transfer request instead of platform data

2011-08-22 Thread Thomas Abraham
The transfer direction for a channel can be inferred from the transfer
request and the need for specifying transfer direction in platfrom data
can be eliminated. So the structure definition 'struct dma_pl330_peri'
is no longer required.

With the 'struct dma_pl330_peri' removed, the dma controller transfer
capabilities cannot be inferred any longer. Hence, the dma controller
capabilities is specified using platforme data.

Cc: Jassi Brar jassisinghb...@gmail.com
Cc: Boojin Kim boojin@samsung.com
Signed-off-by: Thomas Abraham thomas.abra...@linaro.org
---
 drivers/dma/pl330.c|   56 
 include/linux/amba/pl330.h |   14 +++
 2 files changed, 14 insertions(+), 56 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 3a0baac..6592b9a 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -507,7 +507,7 @@ pluck_desc(struct dma_pl330_dmac *pdmac)
 static struct dma_pl330_desc *pl330_get_desc(struct dma_pl330_chan *pch)
 {
struct dma_pl330_dmac *pdmac = pch-dmac;
-   struct dma_pl330_peri *peri = pch-chan.private;
+   u8 *peri_id = pch-chan.private;
struct dma_pl330_desc *desc;
 
/* Pluck one desc from the pool of DMAC */
@@ -531,14 +531,7 @@ static struct dma_pl330_desc *pl330_get_desc(struct 
dma_pl330_chan *pch)
desc-pchan = pch;
desc-txd.cookie = 0;
async_tx_ack(desc-txd);
-
-   if (peri) {
-   desc-req.rqtype = peri-rqtype;
-   desc-req.peri = pch-chan.chan_id;
-   } else {
-   desc-req.rqtype = MEMTOMEM;
-   desc-req.peri = 0;
-   }
+   desc-req.peri = (peri_id) ? pch-chan.chan_id : 0;
 
dma_async_tx_descriptor_init(desc-txd, pch-chan);
 
@@ -625,12 +618,14 @@ static struct dma_async_tx_descriptor 
*pl330_prep_dma_cyclic(
case DMA_TO_DEVICE:
desc-rqcfg.src_inc = 1;
desc-rqcfg.dst_inc = 0;
+   desc-req.rqtype = MEMTODEV;
src = dma_addr;
dst = pch-fifo_addr;
break;
case DMA_FROM_DEVICE:
desc-rqcfg.src_inc = 0;
desc-rqcfg.dst_inc = 1;
+   desc-req.rqtype = DEVTOMEM;
src = pch-fifo_addr;
dst = dma_addr;
break;
@@ -657,16 +652,12 @@ pl330_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t 
dst,
 {
struct dma_pl330_desc *desc;
struct dma_pl330_chan *pch = to_pchan(chan);
-   struct dma_pl330_peri *peri = chan-private;
struct pl330_info *pi;
int burst;
 
if (unlikely(!pch || !len))
return NULL;
 
-   if (peri  peri-rqtype != MEMTOMEM)
-   return NULL;
-
pi = pch-dmac-pif;
 
desc = __pl330_prep_dma_memcpy(pch, dst, src, len);
@@ -675,6 +666,7 @@ pl330_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dst,
 
desc-rqcfg.src_inc = 1;
desc-rqcfg.dst_inc = 1;
+   desc-req.rqtype = MEMTOMEM;
 
/* Select max possible burst size */
burst = pi-pcfg.data_bus_width / 8;
@@ -703,25 +695,14 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct 
scatterlist *sgl,
 {
struct dma_pl330_desc *first, *desc = NULL;
struct dma_pl330_chan *pch = to_pchan(chan);
-   struct dma_pl330_peri *peri = chan-private;
struct scatterlist *sg;
unsigned long flags;
int i;
dma_addr_t addr;
 
-   if (unlikely(!pch || !sgl || !sg_len || !peri))
+   if (unlikely(!pch || !sgl || !sg_len))
return NULL;
 
-   /* Make sure the direction is consistent */
-   if ((direction == DMA_TO_DEVICE 
-   peri-rqtype != MEMTODEV) ||
-   (direction == DMA_FROM_DEVICE 
-   peri-rqtype != DEVTOMEM)) {
-   dev_err(pch-dmac-pif.dev, %s:%d Invalid Direction\n,
-   __func__, __LINE__);
-   return NULL;
-   }
-
addr = pch-fifo_addr;
 
first = NULL;
@@ -761,11 +742,13 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct 
scatterlist *sgl,
if (direction == DMA_TO_DEVICE) {
desc-rqcfg.src_inc = 1;
desc-rqcfg.dst_inc = 0;
+   desc-req.rqtype = MEMTODEV;
fill_px(desc-px,
addr, sg_dma_address(sg), sg_dma_len(sg));
} else {
desc-rqcfg.src_inc = 0;
desc-rqcfg.dst_inc = 1;
+   desc-req.rqtype = DEVTOMEM;
fill_px(desc-px,
sg_dma_address(sg), addr, sg_dma_len(sg));
}
@@ -872,27 +855,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id 
*id)
 
for (i = 0; i  num_chan; i++) {
pch = pdmac-peripherals[i];

[RESEND][PATCH 0/3] dma: pl330: Simplify platform data for pl330 driver

2011-08-22 Thread Thomas Abraham
The rqtype parameter specified in platform data as part of the
'struct dma_pl330_peri' can be infered from the direction of the transfer
specified with transfer requests. So the rqtype parameter can be removed
and 'struct dma_pl330_peri' is then left with only one field 'peri_id'
which itself can be moved into 'struct dma_pl330_platdata' and the
entire 'struct dma_pl330_peri' can be eliminated.

This is first step towards adding device tree support for pl330 dma driver.
With rqtype information inferred from transfer requests, it need not be
included in device tree to describe each hardware dma request.

This patchset is based on following tree.
http://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
and branch 'kgene/next/topic-dma-pl330'.

This patchset has been implemented and tested only for Exynos4. If this
patchset is acceptable, then pl330 driver platform data for other samsung
platforms will also be modfied.

Thomas Abraham (3):
  DMA: PL330: Infer transfer direction from transfer request instead of 
platform data
  ARM: SAMSUNG: Modify pl330 channel filter function
  ARM: EXYNOS4: Modify platform data for pl330 driver

 arch/arm/mach-exynos4/dma.c |  220 +++
 arch/arm/plat-samsung/dma-ops.c |4 +-
 drivers/dma/pl330.c |   56 ++
 include/linux/amba/pl330.h  |   14 +--
 4 files changed, 75 insertions(+), 219 deletions(-)

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


[PATCH 3/3] ARM: EXYNOS4: Modify platform data for pl330 driver

2011-08-22 Thread Thomas Abraham
With the 'struct dma_pl330_peri' removed, the platfrom data for dma
driver can be simplified to a simple list of peripheral request ids.

Signed-off-by: Thomas Abraham thomas.abra...@linaro.org
---
 arch/arm/mach-exynos4/dma.c |  220 ---
 1 files changed, 59 insertions(+), 161 deletions(-)

diff --git a/arch/arm/mach-exynos4/dma.c b/arch/arm/mach-exynos4/dma.c
index d57d662..f905114 100644
--- a/arch/arm/mach-exynos4/dma.c
+++ b/arch/arm/mach-exynos4/dma.c
@@ -35,95 +35,40 @@
 
 static u64 dma_dmamask = DMA_BIT_MASK(32);
 
-struct dma_pl330_peri pdma0_peri[28] = {
-   {
-   .peri_id = (u8)DMACH_PCM0_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_PCM0_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_PCM2_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_PCM2_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_MSM_REQ0,
-   }, {
-   .peri_id = (u8)DMACH_MSM_REQ2,
-   }, {
-   .peri_id = (u8)DMACH_SPI0_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_SPI0_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_SPI2_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_SPI2_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_I2S0S_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_I2S0_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_I2S0_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_UART0_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_UART0_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_UART2_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_UART2_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_UART4_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_UART4_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_SLIMBUS0_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_SLIMBUS0_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_SLIMBUS2_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_SLIMBUS2_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_SLIMBUS4_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_SLIMBUS4_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_AC97_MICIN,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_AC97_PCMIN,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_AC97_PCMOUT,
-   .rqtype = MEMTODEV,
-   },
+u8 pdma0_peri[] = {
+   DMACH_PCM0_RX,
+   DMACH_PCM0_TX,
+   DMACH_PCM2_RX,
+   DMACH_PCM2_TX,
+   DMACH_MSM_REQ0,
+   DMACH_MSM_REQ2,
+   DMACH_SPI0_RX,
+   DMACH_SPI0_TX,
+   DMACH_SPI2_RX,
+   DMACH_SPI2_TX,
+   DMACH_I2S0S_TX,
+   DMACH_I2S0_RX,
+   DMACH_I2S0_TX,
+   DMACH_UART0_RX,
+   DMACH_UART0_TX,
+   DMACH_UART2_RX,
+   DMACH_UART2_TX,
+   DMACH_UART4_RX,
+   DMACH_UART4_TX,
+   DMACH_SLIMBUS0_RX,
+   DMACH_SLIMBUS0_TX,
+   DMACH_SLIMBUS2_RX,
+   DMACH_SLIMBUS2_TX,
+   DMACH_SLIMBUS4_RX,
+   DMACH_SLIMBUS4_TX,
+   DMACH_AC97_MICIN,
+   DMACH_AC97_PCMIN,
+   DMACH_AC97_PCMOUT,
 };
 
 struct dma_pl330_platdata exynos4_pdma0_pdata = {
.nr_valid_peri = ARRAY_SIZE(pdma0_peri),
-   .peri = pdma0_peri,
+   .peri_id = pdma0_peri,
 };
 
 struct amba_device exynos4_device_pdma0 = {
@@ -142,86 +87,37 @@ struct amba_device exynos4_device_pdma0 = {
.periphid = 0x00041330,
 };
 
-struct dma_pl330_peri pdma1_peri[25] = {
-   {
-   .peri_id = (u8)DMACH_PCM0_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_PCM0_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_PCM1_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_PCM1_TX,
-   .rqtype = MEMTODEV,
-   }, {
-   .peri_id = (u8)DMACH_MSM_REQ1,
-   }, {
-   .peri_id = (u8)DMACH_MSM_REQ3,
-   }, {
-   .peri_id = (u8)DMACH_SPI1_RX,
-   .rqtype = DEVTOMEM,
-   }, {
-   .peri_id = (u8)DMACH_SPI1_TX,
-   .rqtype = 

Re: [PATCH 2/3] ARM: SAMSUNG: Modify pl330 channel filter function

2011-08-22 Thread Russell King - ARM Linux
On Tue, Aug 23, 2011 at 03:29:44AM +0530, Thomas Abraham wrote:
 With the change in dma channels private data information, the pl330
 channel filter function is modified to look for a simple u8 value
 instead of the now unused 'struct dma_pl330_peri' value.
 
 Signed-off-by: Thomas Abraham thomas.abra...@linaro.org
 ---
  arch/arm/plat-samsung/dma-ops.c |4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/arch/arm/plat-samsung/dma-ops.c b/arch/arm/plat-samsung/dma-ops.c
 index 6e3d9ab..4f1430b 100644
 --- a/arch/arm/plat-samsung/dma-ops.c
 +++ b/arch/arm/plat-samsung/dma-ops.c
 @@ -19,8 +19,8 @@
  
  static inline bool pl330_filter(struct dma_chan *chan, void *param)
  {
 - struct dma_pl330_peri *peri = chan-private;
 - return peri-peri_id == (unsigned)param;
 + u8 *peri_id = chan-private;
 + return *peri_id == (unsigned)param;
  }

As a word of warning - this will fail horribly if you have mixed DMA
engines in the system.  While we wait for a better scheme, we really
need to sort out these filter functions properly and stop poking
about in data which may not be what we expect.

One solution to that is to move pl330_filter() into drivers/dma/pl330.c
and have it check chan-device-dev-driver == pl330_driver.driver
_before_ we start accessing chan-private.

That's not a comment against your patch - you're not really changing
the brokenness of this function.  It would be good to see a follow up
patch fixing it properly though.
--
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 1/4] ARM: SAMSUNG: Add support for detecting CPU at runtime

2011-08-22 Thread Kukjin Kim
The soc_is_[name]() can be used to distinguish cpu at runtime.

This patch was originally from Changhwan Youn chaos.y...@samsung.com

Acked-by: Changhwan Youn chaos.y...@samsung.com
Cc: Ben Dooks ben-li...@fluff.org
Signed-off-by: Kukjin Kim kgene@samsung.com
---
Changes since v1:
- soc_is_xxx() is used instead of cpu_is_xxx()

 arch/arm/mach-s3c64xx/cpu.c  |   18 +++
 arch/arm/plat-s3c24xx/cpu.c  |8 +--
 arch/arm/plat-s5p/cpu.c  |   26 -
 arch/arm/plat-samsung/include/plat/cpu.h |   87 +-
 arch/arm/plat-samsung/init.c |1 +
 5 files changed, 110 insertions(+), 30 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/cpu.c b/arch/arm/mach-s3c64xx/cpu.c
index 374e45e..7b665f3 100644
--- a/arch/arm/mach-s3c64xx/cpu.c
+++ b/arch/arm/mach-s3c64xx/cpu.c
@@ -43,16 +43,16 @@ static const char name_s3c6410[] = S3C6410;
 
 static struct cpu_table cpu_ids[] __initdata = {
{
-   .idcode = 0x3640,
-   .idmask = 0xf000,
+   .idcode = S3C6400_CPU_ID,
+   .idmask = S3C64XX_CPU_MASK,
.map_io = s3c6400_map_io,
.init_clocks= s3c6400_init_clocks,
.init_uarts = s3c6400_init_uarts,
.init   = s3c6400_init,
.name   = name_s3c6400,
}, {
-   .idcode = 0x36410100,
-   .idmask = 0xff00,
+   .idcode = S3C6410_CPU_ID,
+   .idmask = S3C64XX_CPU_MASK,
.map_io = s3c6410_map_io,
.init_clocks= s3c6410_init_clocks,
.init_uarts = s3c6410_init_uarts,
@@ -140,22 +140,20 @@ void __init s3c6400_common_init_uarts(struct 
s3c2410_uartcfg *cfg, int no)
 
 void __init s3c64xx_init_io(struct map_desc *mach_desc, int size)
 {
-   unsigned long idcode;
-
/* initialise the io descriptors we need for initialisation */
iotable_init(s3c_iodesc, ARRAY_SIZE(s3c_iodesc));
iotable_init(mach_desc, size);
 
-   idcode = __raw_readl(S3C_VA_SYS + 0x118);
-   if (!idcode) {
+   samsung_cpu_id = __raw_readl(S3C_VA_SYS + 0x118);
+   if (!samsung_cpu_id) {
/* S3C6400 has the ID register in a different place,
 * and needs a write before it can be read. */
 
__raw_writel(0x0, S3C_VA_SYS + 0xA1C);
-   idcode = __raw_readl(S3C_VA_SYS + 0xA1C);
+   samsung_cpu_id = __raw_readl(S3C_VA_SYS + 0xA1C);
}
 
-   s3c_init_cpu(idcode, cpu_ids, ARRAY_SIZE(cpu_ids));
+   s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
 }
 
 static __init int s3c64xx_sysdev_init(void)
diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c
index c1fc6c6..ead21a4 100644
--- a/arch/arm/plat-s3c24xx/cpu.c
+++ b/arch/arm/plat-s3c24xx/cpu.c
@@ -215,19 +215,17 @@ static void s3c24xx_pm_restart(char mode, const char *cmd)
 
 void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)
 {
-   unsigned long idcode = 0x0;
-
/* initialise the io descriptors we need for initialisation */
iotable_init(mach_desc, size);
iotable_init(s3c_iodesc, ARRAY_SIZE(s3c_iodesc));
 
if (cpu_architecture() = CPU_ARCH_ARMv5) {
-   idcode = s3c24xx_read_idcode_v5();
+   samsung_cpu_id = s3c24xx_read_idcode_v5();
} else {
-   idcode = s3c24xx_read_idcode_v4();
+   samsung_cpu_id = s3c24xx_read_idcode_v4();
}
 
arm_pm_restart = s3c24xx_pm_restart;
 
-   s3c_init_cpu(idcode, cpu_ids, ARRAY_SIZE(cpu_ids));
+   s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
 }
diff --git a/arch/arm/plat-s5p/cpu.c b/arch/arm/plat-s5p/cpu.c
index bbc2aa7..3ef6734 100644
--- a/arch/arm/plat-s5p/cpu.c
+++ b/arch/arm/plat-s5p/cpu.c
@@ -36,40 +36,40 @@ static const char name_exynos4210[] = EXYNOS4210;
 
 static struct cpu_table cpu_ids[] __initdata = {
{
-   .idcode = 0x56440100,
-   .idmask = 0xf000,
+   .idcode = S5P6440_CPU_ID,
+   .idmask = S5P64XX_CPU_MASK,
.map_io = s5p6440_map_io,
.init_clocks= s5p6440_init_clocks,
.init_uarts = s5p6440_init_uarts,
.init   = s5p64x0_init,
.name   = name_s5p6440,
}, {
-   .idcode = 0x3645,
-   .idmask = 0xf000,
+   .idcode = S5P6450_CPU_ID,
+   .idmask = S5P64XX_CPU_MASK,
.map_io = s5p6450_map_io,
.init_clocks= s5p6450_init_clocks,
.init_uarts = s5p6450_init_uarts,
.init   = s5p64x0_init,

[PATCH V2 2/4] ARM: S5P64X0: Use soc_is_s5p64x0() to distinguish cpu at runtime

2011-08-22 Thread Kukjin Kim
Signed-off-by: Kukjin Kim kgene@samsung.com
---
Changes since v1:
- soc_is_s5p64x0() is used instead of cpu_is_s5p64x0()

 arch/arm/mach-s5p64x0/dev-spi.c  |8 +++-
 arch/arm/mach-s5p64x0/dma.c  |7 ++-
 arch/arm/mach-s5p64x0/gpiolib.c  |7 ++-
 arch/arm/mach-s5p64x0/irq-eint.c |3 ++-
 4 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/arch/arm/mach-s5p64x0/dev-spi.c b/arch/arm/mach-s5p64x0/dev-spi.c
index ac825e8..1fd9c79 100644
--- a/arch/arm/mach-s5p64x0/dev-spi.c
+++ b/arch/arm/mach-s5p64x0/dev-spi.c
@@ -21,6 +21,7 @@
 #include mach/regs-clock.h
 #include mach/spi-clocks.h
 
+#include plat/cpu.h
 #include plat/s3c64xx-spi.h
 #include plat/gpio-cfg.h
 
@@ -185,11 +186,8 @@ struct platform_device s5p64x0_device_spi1 = {
 
 void __init s5p64x0_spi_set_info(int cntrlr, int src_clk_nr, int num_cs)
 {
-   unsigned int id;
struct s3c64xx_spi_info *pd;
 
-   id = __raw_readl(S5P64X0_SYS_ID)  0xFF000;
-
/* Reject invalid configuration */
if (!num_cs || src_clk_nr  0
|| src_clk_nr  S5P64X0_SPI_SRCCLK_SCLK) {
@@ -199,7 +197,7 @@ void __init s5p64x0_spi_set_info(int cntrlr, int 
src_clk_nr, int num_cs)
 
switch (cntrlr) {
case 0:
-   if (id == 0x5)
+   if (soc_is_s5p6450())
pd = s5p6450_spi0_pdata;
else
pd = s5p6440_spi0_pdata;
@@ -207,7 +205,7 @@ void __init s5p64x0_spi_set_info(int cntrlr, int 
src_clk_nr, int num_cs)
s5p64x0_device_spi0.dev.platform_data = pd;
break;
case 1:
-   if (id == 0x5)
+   if (soc_is_s5p6450())
pd = s5p6450_spi1_pdata;
else
pd = s5p6440_spi1_pdata;
diff --git a/arch/arm/mach-s5p64x0/dma.c b/arch/arm/mach-s5p64x0/dma.c
index d7ad944..0e5b3e6 100644
--- a/arch/arm/mach-s5p64x0/dma.c
+++ b/arch/arm/mach-s5p64x0/dma.c
@@ -28,6 +28,7 @@
 #include mach/irqs.h
 #include mach/regs-clock.h
 
+#include plat/cpu.h
 #include plat/devs.h
 #include plat/s3c-pl330-pdata.h
 
@@ -133,11 +134,7 @@ static struct platform_device s5p64x0_device_pdma = {
 
 static int __init s5p64x0_dma_init(void)
 {
-   unsigned int id;
-
-   id = __raw_readl(S5P64X0_SYS_ID)  0xFF000;
-
-   if (id == 0x5)
+   if (soc_is_s5p6450())
s5p64x0_device_pdma.dev.platform_data = s5p6450_pdma_pdata;
else
s5p64x0_device_pdma.dev.platform_data = s5p6440_pdma_pdata;
diff --git a/arch/arm/mach-s5p64x0/gpiolib.c b/arch/arm/mach-s5p64x0/gpiolib.c
index e7fb3b0..700dac6 100644
--- a/arch/arm/mach-s5p64x0/gpiolib.c
+++ b/arch/arm/mach-s5p64x0/gpiolib.c
@@ -19,6 +19,7 @@
 #include mach/regs-gpio.h
 #include mach/regs-clock.h
 
+#include plat/cpu.h
 #include plat/gpio-core.h
 #include plat/gpio-cfg.h
 #include plat/gpio-cfg-helpers.h
@@ -473,14 +474,10 @@ static void __init s5p64x0_gpio_add_rbank_4bit2(struct 
s3c_gpio_chip *chip,
 
 static int __init s5p64x0_gpiolib_init(void)
 {
-   unsigned int chipid;
-
-   chipid = __raw_readl(S5P64X0_SYS_ID);
-
s5p64x0_gpiolib_set_cfg(s5p64x0_gpio_cfgs,
ARRAY_SIZE(s5p64x0_gpio_cfgs));
 
-   if ((chipid  0xff000) == 0x5) {
+   if (soc_is_s5p6450()) {
samsung_gpiolib_add_2bit_chips(s5p6450_gpio_2bit,
ARRAY_SIZE(s5p6450_gpio_2bit));
 
diff --git a/arch/arm/mach-s5p64x0/irq-eint.c b/arch/arm/mach-s5p64x0/irq-eint.c
index 69ed454..94104c4 100644
--- a/arch/arm/mach-s5p64x0/irq-eint.c
+++ b/arch/arm/mach-s5p64x0/irq-eint.c
@@ -17,6 +17,7 @@
 #include linux/irq.h
 #include linux/io.h
 
+#include plat/cpu.h
 #include plat/regs-irqtype.h
 #include plat/gpio-cfg.h
 
@@ -67,7 +68,7 @@ static int s5p64x0_irq_eint_set_type(struct irq_data *data, 
unsigned int type)
__raw_writel(ctrl, S5P64X0_EINT0CON0);
 
/* Configure the GPIO pin for 6450 or 6440 based on CPU ID */
-   if (0x5 == (__raw_readl(S5P64X0_SYS_ID)  0xFF000))
+   if (soc_is_s5p6450())
s3c_gpio_cfgpin(S5P6450_GPN(offs), S3C_GPIO_SFN(2));
else
s3c_gpio_cfgpin(S5P6440_GPN(offs), S3C_GPIO_SFN(2));
-- 
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 1/4] S3C2443: Move i2s clock definitions to common code

2011-08-22 Thread Kukjin Kim
Heiko Stübner wrote:
 
 Am Sonntag 21 August 2011, 19:13:32 schrieb Russell King - ARM Linux:
  On Sat, Aug 20, 2011 at 06:01:29PM +0200, Heiko Stübner wrote:
   +/* i2s-ref
   + *
   + * i2s bus reference clock, selectable from external, esysclk or
epllref
   + *
   + * Note, this used to be two clocks, but was compressed into one.
   +*/
   +
   +struct clk *clk_i2s_srclist[] = {
   + [0] = clk_i2s_eplldiv.clk,
   + [1] = clk_i2s_ext,
   + [2] = clk_epllref.clk,
   + [3] = clk_epllref.clk,
   +};
 
  Is there any reason not to make this static (have you run your patch
  through checkpatch.pl ?)
 Yep I did run all of them through checkpatch (after beeing scolded last
time)
 and it didn't report anything.
 

Hmm...as a note, happened following with checkpatch.pl :(

ERROR: need consistent spacing around '*' (ctx:WxV)
#35: FILE: arch/arm/mach-s3c2416/clock.c:57:
+   .sources = (struct clk *[]) {
   ^

total: 1 errors, 0 warnings, 38 lines checked

PATCH 34 S3C2416 Add HSSPI clock sourced from EPLL.txt has style problems,
please review.

Thanks.

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


 But for this move of code I simply grabbed the code fragments and put them
 into their new location (i.e. it was this way in mach-s3c2443/clock.c) and
 should have probably taken a closer look at what I'm moving.
 
 So it seems you are right, it should probably be static as everything else
is
 also static.
 
 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


Re: [PATCH v6 04/15] DMA: PL330: Add DMA_CYCLIC capability

2011-08-22 Thread Jassi Brar
On Mon, Aug 22, 2011 at 5:33 PM, Boojin Kim boojin@samsung.com wrote:

  +static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
  +               struct dma_chan *chan, dma_addr_t dma_addr, size_t len,
  +               size_t period_len, enum dma_data_direction direction)
  +{
  +       struct dma_pl330_desc *desc;
  +       struct dma_pl330_chan *pch = to_pchan(chan);
  +       dma_addr_t dst;
  +       dma_addr_t src;
  +
  +       desc = pl330_get_desc(pch);
  +       if (!desc) {
  +               dev_err(pch-dmac-pif.dev, %s:%d Unable to fetch
 desc\n,
  +                       __func__, __LINE__);
  +               return NULL;
  +       }
  +
  +       switch (direction) {
  +       case DMA_TO_DEVICE:
  +               desc-rqcfg.src_inc = 1;
  +               desc-rqcfg.dst_inc = 0;
  +               src = dma_addr;
  +               dst = pch-fifo_addr;
  +               break;
  +       case DMA_FROM_DEVICE:
  +               desc-rqcfg.src_inc = 0;
  +               desc-rqcfg.dst_inc = 1;
  +               src = pch-fifo_addr;
  +               dst = dma_addr;
  +               break;
  +       default:
  +               dev_err(pch-dmac-pif.dev, %s:%d Invalid dma
 direction\n,
  +               __func__, __LINE__);
  +               return NULL;
  +       }
  +
  +       desc-rqcfg.brst_size = pch-burst_sz;
  +       desc-rqcfg.brst_len = 1;
  +
  +       if (!pch-cyclic)
  +               pch-cyclic = CYCLIC_PREP;
 The need for check here seems suspicious.
 Is it really needed? If not, please remove it.
 It's required because Cyclic operation is passed from CYCLIC_PREP to
 CYCLIC_TRIGGER.
I don't see why you need to differentiate between PREP and TRIGGER in
cyclic mode. I think, you should simply have 'bool cyclic' instead of enum.
--
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/1] ARM: EXYNOS4: Add PWM backlight support on Origen

2011-08-22 Thread Sachin Kamat
From: Giridhar Maruthy giridhar.maru...@linaro.org

This patch adds support for LCD backlight using PWM timer on
Origen board.

Signed-off-by: Giridhar Maruthy giridhar.maru...@linaro.org
Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 arch/arm/mach-exynos4/Kconfig   |2 ++
 arch/arm/mach-exynos4/mach-origen.c |   16 
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig
index e6925de..3e9138e 100644
--- a/arch/arm/mach-exynos4/Kconfig
+++ b/arch/arm/mach-exynos4/Kconfig
@@ -230,6 +230,8 @@ config MACH_ORIGEN
select S3C_DEV_RTC
select S3C_DEV_WDT
select S3C_DEV_HSMMC2
+   select SAMSUNG_DEV_BACKLIGHT
+   select SAMSUNG_DEV_PWM
select EXYNOS4_SETUP_SDHCI
help
  Machine support for ORIGEN based on Samsung EXYNOS4210
diff --git a/arch/arm/mach-exynos4/mach-origen.c 
b/arch/arm/mach-exynos4/mach-origen.c
index ed59f86..b871815 100644
--- a/arch/arm/mach-exynos4/mach-origen.c
+++ b/arch/arm/mach-exynos4/mach-origen.c
@@ -14,6 +14,7 @@
 #include linux/platform_device.h
 #include linux/io.h
 #include linux/input.h
+#include linux/pwm_backlight.h
 
 #include asm/mach/arch.h
 #include asm/mach-types.h
@@ -24,6 +25,8 @@
 #include plat/devs.h
 #include plat/sdhci.h
 #include plat/iic.h
+#include plat/gpio-cfg.h
+#include plat/backlight.h
 
 #include mach/map.h
 
@@ -85,6 +88,17 @@ static struct platform_device *origen_devices[] __initdata = 
{
s3c_device_wdt,
 };
 
+/* LCD Backlight data */
+static struct samsung_bl_gpio_info origen_bl_gpio_info = {
+   .no = EXYNOS4_GPD0(0),
+   .func = S3C_GPIO_SFN(2),
+};
+
+static struct platform_pwm_backlight_data origen_bl_data = {
+   .pwm_id = 0,
+   .pwm_period_ns = 1000,
+};
+
 static void __init origen_map_io(void)
 {
s5p_init_io(NULL, 0, S5P_VA_CHIPID);
@@ -96,6 +110,8 @@ static void __init origen_machine_init(void)
 {
s3c_sdhci2_set_platdata(origen_hsmmc2_pdata);
platform_add_devices(origen_devices, ARRAY_SIZE(origen_devices));
+
+   samsung_bl_set(origen_bl_gpio_info, origen_bl_data);
 }
 
 MACHINE_START(ORIGEN, ORIGEN)
-- 
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