Re: [PATCH v5 3/9] ARM: EXYNOS: Move pmu specific headers under "linux/soc/samsung"

2015-11-13 Thread Krzysztof Kozlowski
On 13.11.2015 18:29, Pankaj Dubey wrote:
> Moving Exynos PMU specific header file into "include/linux/soc/samsung"
> thus updated affected files under "mach-exynos" to use new location of
> these header files.
> 
> Signed-off-by: Amit Daniel Kachhap 
> Signed-off-by: Pankaj Dubey 
> ---
>  arch/arm/mach-exynos/exynos.c   | 2 +-
>  arch/arm/mach-exynos/mcpm-exynos.c  | 2 +-
>  arch/arm/mach-exynos/platsmp.c  | 2 +-
>  arch/arm/mach-exynos/pm.c   | 4 ++--
>  arch/arm/mach-exynos/pmu.c  | 6 
> +++---
>  arch/arm/mach-exynos/suspend.c  | 4 ++--
>  {arch/arm/mach-exynos => include/linux/soc/samsung}/exynos-pmu.h| 6 
> +++---
>  .../regs-pmu.h => include/linux/soc/samsung/exynos-regs-pmu.h   | 6 
> +++---
>  8 files changed, 16 insertions(+), 16 deletions(-)
>  rename {arch/arm/mach-exynos => include/linux/soc/samsung}/exynos-pmu.h (81%)
>  rename arch/arm/mach-exynos/regs-pmu.h => 
> include/linux/soc/samsung/exynos-regs-pmu.h (99%)
> 

Reviewed-by: Krzysztof Kozlowski 

Best regards,
Krzysztof

--
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 11/25] drm/exynos: introduce exynos_drm_plane_state structure

2015-11-13 Thread Gustavo Padovan
Hi Marek,

2015-11-10 Marek Szyprowski :

> This patch introduces exynos_drm_plane_state structure, which subclasses
> drm_plane_state and holds precalculated data suitable for configuring
> Exynos hardware.
> 
> Signed-off-by: Marek Szyprowski 
> ---
>  drivers/gpu/drm/exynos/exynos5433_drm_decon.c |  21 ++---
>  drivers/gpu/drm/exynos/exynos7_drm_decon.c|  21 ++---
>  drivers/gpu/drm/exynos/exynos_drm_drv.h   |  56 +++-
>  drivers/gpu/drm/exynos/exynos_drm_fimd.c  |  33 +++
>  drivers/gpu/drm/exynos/exynos_drm_plane.c | 125 
> +++---
>  drivers/gpu/drm/exynos/exynos_mixer.c |  61 +++--
>  6 files changed, 197 insertions(+), 120 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c 
> b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> index a3161b0428b9..27039468364b 100644
> --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> @@ -260,9 +260,10 @@ static void decon_atomic_begin(struct exynos_drm_crtc 
> *crtc,
>  static void decon_update_plane(struct exynos_drm_crtc *crtc,
>  struct exynos_drm_plane *plane)
>  {
> + struct exynos_drm_plane_state *state =
> + to_exynos_plane_state(plane->base.state);
>   struct decon_context *ctx = crtc->ctx;
> - struct drm_plane_state *state = plane->base.state;
> - struct drm_framebuffer *fb = state->fb;
> + struct drm_framebuffer *fb = state->base.fb;
>   unsigned int win = plane->zpos;
>   unsigned int bpp = fb->bits_per_pixel >> 3;
>   unsigned int pitch = fb->pitches[0];
> @@ -272,11 +273,11 @@ static void decon_update_plane(struct exynos_drm_crtc 
> *crtc,
>   if (test_bit(BIT_SUSPENDED, >flags))
>   return;
>  
> - val = COORDINATE_X(plane->crtc_x) | COORDINATE_Y(plane->crtc_y);
> + val = COORDINATE_X(state->crtc.x) | COORDINATE_Y(state->crtc.y);
>   writel(val, ctx->addr + DECON_VIDOSDxA(win));
>  
> - val = COORDINATE_X(plane->crtc_x + plane->crtc_w - 1) |
> - COORDINATE_Y(plane->crtc_y + plane->crtc_h - 1);
> + val = COORDINATE_X(state->crtc.x + state->crtc.w - 1) |
> + COORDINATE_Y(state->crtc.y + state->crtc.h - 1);
>   writel(val, ctx->addr + DECON_VIDOSDxB(win));
>  
>   val = VIDOSD_Wx_ALPHA_R_F(0x0) | VIDOSD_Wx_ALPHA_G_F(0x0) |
> @@ -289,15 +290,15 @@ static void decon_update_plane(struct exynos_drm_crtc 
> *crtc,
>  
>   writel(dma_addr, ctx->addr + DECON_VIDW0xADD0B0(win));
>  
> - val = dma_addr + pitch * plane->crtc_h;
> + val = dma_addr + pitch * state->src.h;
>   writel(val, ctx->addr + DECON_VIDW0xADD1B0(win));
>  
>   if (ctx->out_type != IFTYPE_HDMI)
> - val = BIT_VAL(pitch - plane->crtc_w * bpp, 27, 14)
> - | BIT_VAL(plane->crtc_w * bpp, 13, 0);
> + val = BIT_VAL(pitch - state->crtc.w * bpp, 27, 14)
> + | BIT_VAL(state->crtc.w * bpp, 13, 0);
>   else
> - val = BIT_VAL(pitch - plane->crtc_w * bpp, 29, 15)
> - | BIT_VAL(plane->crtc_w * bpp, 14, 0);
> + val = BIT_VAL(pitch - state->crtc.w * bpp, 29, 15)
> + | BIT_VAL(state->crtc.w * bpp, 14, 0);
>   writel(val, ctx->addr + DECON_VIDW0xADD2(win));
>  
>   decon_win_set_pixfmt(ctx, win, fb);
> diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c 
> b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> index 15e1e165020f..7868d30d8eac 100644
> --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> @@ -399,9 +399,10 @@ static void decon_atomic_begin(struct exynos_drm_crtc 
> *crtc,
>  static void decon_update_plane(struct exynos_drm_crtc *crtc,
>  struct exynos_drm_plane *plane)
>  {
> + struct exynos_drm_plane_state *state =
> + to_exynos_plane_state(plane->base.state);
>   struct decon_context *ctx = crtc->ctx;
> - struct drm_plane_state *state = plane->base.state;
> - struct drm_framebuffer *fb = state->fb;
> + struct drm_framebuffer *fb = state->base.fb;
>   int padding;
>   unsigned long val, alpha;
>   unsigned int last_x;
> @@ -434,22 +435,22 @@ static void decon_update_plane(struct exynos_drm_crtc 
> *crtc,
>   writel(fb->height, ctx->regs + VIDW_WHOLE_Y(win));
>  
>   /* offset from the start of the buffer to read */
> - writel(plane->src_x, ctx->regs + VIDW_OFFSET_X(win));
> - writel(plane->src_y, ctx->regs + VIDW_OFFSET_Y(win));
> + writel(state->src.x, ctx->regs + VIDW_OFFSET_X(win));
> + writel(state->src.y, ctx->regs + VIDW_OFFSET_Y(win));
>  
>   DRM_DEBUG_KMS("start addr = 0x%lx\n",
>   (unsigned long)val);
>   DRM_DEBUG_KMS("ovl_width = %d, ovl_height = %d\n",
> - plane->crtc_w, 

Re: [PATCH 12/25] drm/exynos: mixer: use crtc->state->adjusted_mode instead of crtc->mode

2015-11-13 Thread Gustavo Padovan
Hi Marek,

2015-11-10 Marek Szyprowski :

> This patch replaces usage of crtc->mode with crtc->state->adjusted_mode
> like it is already done in common plane code.
> 
> Signed-off-by: Marek Szyprowski 
> ---
>  drivers/gpu/drm/exynos/exynos_mixer.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Gustavo Padovan 

Gustavo
--
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 14/25] drm/exynos: introduce exynos_drm_plane_config structure

2015-11-13 Thread Gustavo Padovan
Hi Marek,

2015-11-10 Marek Szyprowski :

> This patch adds common structure for keeping plane configuration and
> capabilities data. This patch is inspired by similar code developed by
> Tobias Jakobi.
> 
> Signed-off-by: Marek Szyprowski 
> ---
>  drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 18 +++---
>  drivers/gpu/drm/exynos/exynos7_drm_decon.c| 23 +++-
>  drivers/gpu/drm/exynos/exynos_drm_drv.h   | 22 
>  drivers/gpu/drm/exynos/exynos_drm_fimd.c  | 25 -
>  drivers/gpu/drm/exynos/exynos_drm_plane.c | 34 --
>  drivers/gpu/drm/exynos/exynos_drm_plane.h |  7 ++--
>  drivers/gpu/drm/exynos/exynos_drm_vidi.c  | 25 -
>  drivers/gpu/drm/exynos/exynos_mixer.c | 51 
> ---
>  8 files changed, 131 insertions(+), 74 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c 
> b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> index 27039468364b..3c8b8e0240fe 100644
> --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> @@ -26,7 +26,6 @@
>  #include "exynos_drm_iommu.h"
>  
>  #define WINDOWS_NR   3
> -#define CURSOR_WIN   2
>  #define MIN_FB_WIDTH_FOR_16WORD_BURST128
>  
>  static const char * const decon_clks_name[] = {
> @@ -57,6 +56,7 @@ struct decon_context {
>   struct drm_device   *drm_dev;
>   struct exynos_drm_crtc  *crtc;
>   struct exynos_drm_plane planes[WINDOWS_NR];
> + struct exynos_drm_plane_config  configs[WINDOWS_NR];
>   void __iomem*addr;
>   struct clk  *clks[ARRAY_SIZE(decon_clks_name)];
>   int pipe;
> @@ -72,6 +72,12 @@ static const uint32_t decon_formats[] = {
>   DRM_FORMAT_ARGB,
>  };
>  
> +static const enum drm_plane_type decon_win_types[WINDOWS_NR] = {
> + DRM_PLANE_TYPE_PRIMARY,
> + DRM_PLANE_TYPE_OVERLAY,
> + DRM_PLANE_TYPE_CURSOR,
> +};
> +
>  static inline void decon_set_bits(struct decon_context *ctx, u32 reg, u32 
> mask,
> u32 val)
>  {
> @@ -499,7 +505,6 @@ static int decon_bind(struct device *dev, struct device 
> *master, void *data)
>   struct exynos_drm_private *priv = drm_dev->dev_private;
>   struct exynos_drm_plane *exynos_plane;
>   enum exynos_drm_output_type out_type;
> - enum drm_plane_type type;
>   unsigned int win;
>   int ret;
>  
> @@ -509,10 +514,13 @@ static int decon_bind(struct device *dev, struct device 
> *master, void *data)
>   for (win = ctx->first_win; win < WINDOWS_NR; win++) {
>   int tmp = (win == ctx->first_win) ? 0 : win;
>  
> - type = exynos_plane_get_type(tmp, CURSOR_WIN);
> + ctx->configs[win].pixel_formats = decon_formats;
> + ctx->configs[win].num_pixel_formats = ARRAY_SIZE(decon_formats);
> + ctx->configs[win].zpos = win;
> + ctx->configs[win].type = decon_win_types[tmp];
> +
>   ret = exynos_plane_init(drm_dev, >planes[win],
> - 1 << ctx->pipe, type, decon_formats,
> - ARRAY_SIZE(decon_formats), win);
> + 1 << ctx->pipe, >configs[win]);
>   if (ret)
>   return ret;
>   }
> diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c 
> b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> index 7868d30d8eac..6b28e3f73e4e 100644
> --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> @@ -41,13 +41,13 @@
>  #define MIN_FB_WIDTH_FOR_16WORD_BURST 128
>  
>  #define WINDOWS_NR   2
> -#define CURSOR_WIN   1
>  
>  struct decon_context {
>   struct device   *dev;
>   struct drm_device   *drm_dev;
>   struct exynos_drm_crtc  *crtc;
>   struct exynos_drm_plane planes[WINDOWS_NR];
> + struct exynos_drm_plane_config  configs[WINDOWS_NR];
>   struct clk  *pclk;
>   struct clk  *aclk;
>   struct clk  *eclk;
> @@ -82,6 +82,11 @@ static const uint32_t decon_formats[] = {
>   DRM_FORMAT_BGRA,
>  };
>  
> +static const enum drm_plane_type decon_win_types[WINDOWS_NR] = {
> + DRM_PLANE_TYPE_PRIMARY,
> + DRM_PLANE_TYPE_CURSOR,
> +};
> +
>  static void decon_wait_for_vblank(struct exynos_drm_crtc *crtc)
>  {
>   struct decon_context *ctx = crtc->ctx;
> @@ -672,8 +677,7 @@ static int decon_bind(struct device *dev, struct device 
> *master, void *data)
>   struct decon_context *ctx = dev_get_drvdata(dev);
>   struct drm_device *drm_dev = data;
>   struct exynos_drm_plane *exynos_plane;
> - enum drm_plane_type type;
> - unsigned int zpos;
> + unsigned int i;
>   int ret;
>  
>   ret = 

Re: [PATCH 13/25] drm/exynos: mixer: enable video overlay plane only when VP is available

2015-11-13 Thread Gustavo Padovan
Hi Marek,

2015-11-10 Marek Szyprowski :

> Video overlay plane should be registered only when suitable hardware
> sub-block (Video Processor) is available.
> 
> Signed-off-by: Marek Szyprowski 
> ---
>  drivers/gpu/drm/exynos/exynos_mixer.c | 3 +++
>  1 file changed, 3 insertions(+)

Good catch.

Reviewed-by: Gustavo Padovan 

Gustavo
--
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/25] ARM: dts: exynos4: add rotator nodes

2015-11-13 Thread Marek Szyprowski

Hello,

On 2015-11-13 03:29, Krzysztof Kozlowski wrote:

On 10.11.2015 22:23, Marek Szyprowski wrote:

This patch adds device node for Rotator device to Exynos 4210 and 4x12
device tree files.

Signed-off-by: Marek Szyprowski 
---
  arch/arm/boot/dts/exynos4.dtsi| 10 +-
  arch/arm/boot/dts/exynos4210.dtsi |  8 
  arch/arm/boot/dts/exynos4x12.dtsi |  4 
  3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index 2f31f773b096..3fa575ad7693 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -718,6 +718,15 @@
iommus = <_jpeg>;
};
  
+	rotator: rotator@1281 {

+   compatible = "samsung,exynos4210-rotator";
+   reg = <0x1281 0x1000>;

One more question after looking at second patch. You are mapping size of
0x1000 instead of 0x64. Any particular reason? (it does not really
matter... just wondering)


Nope, it might be just a copy/paste issue I've missed. Do you want to 
unify it to

0x64 or 0x1000?

Best regards
--
Marek Szyprowski, PhD
Samsung R Institute Poland

--
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 v5 4/9] ARM: EXYNOS: split up exynos3250 SoC specific PMU data

2015-11-13 Thread Pankaj Dubey
This patch splits up mach-exynos/pmu.c file, and moves exynos3250 PMU
configuration data and functions handing those data into exynos3250
SoC specific PMU file mach-exynos/exynos3250-pmu.c.

Signed-off-by: Pankaj Dubey 
Reviewed-by: Krzysztof Kozlowski 
---
 arch/arm/mach-exynos/Makefile |   2 +-
 arch/arm/mach-exynos/exynos-pmu.h |  39 +++
 arch/arm/mach-exynos/exynos.c |   2 -
 arch/arm/mach-exynos/exynos3250-pmu.c | 175 
 arch/arm/mach-exynos/pmu.c| 184 +-
 5 files changed, 219 insertions(+), 183 deletions(-)
 create mode 100644 arch/arm/mach-exynos/exynos-pmu.h
 create mode 100644 arch/arm/mach-exynos/exynos3250-pmu.c

diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 2f30676..e869f86 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -9,7 +9,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += 
-I$(srctree)/$(src)/include -I$(srctree)
 
 # Core
 
-obj-$(CONFIG_ARCH_EXYNOS)  += exynos.o pmu.o exynos-smc.o firmware.o
+obj-$(CONFIG_ARCH_EXYNOS)  += exynos.o pmu.o exynos-smc.o firmware.o 
exynos3250-pmu.o
 
 obj-$(CONFIG_EXYNOS_CPU_SUSPEND) += pm.o sleep.o
 obj-$(CONFIG_PM_SLEEP) += suspend.o
diff --git a/arch/arm/mach-exynos/exynos-pmu.h 
b/arch/arm/mach-exynos/exynos-pmu.h
new file mode 100644
index 000..5d09fa3
--- /dev/null
+++ b/arch/arm/mach-exynos/exynos-pmu.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * Header for EXYNOS PMU Driver support
+ *
+ * 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.
+ */
+
+#ifndef __EXYNOS_PMU_H
+#define __EXYNOS_PMU_H
+
+#include 
+
+#define PMU_TABLE_END  (-1U)
+
+struct exynos_pmu_conf {
+   unsigned int offset;
+   u8 val[NUM_SYS_POWERDOWN];
+};
+
+struct exynos_pmu_data {
+   const struct exynos_pmu_conf *pmu_config;
+   const struct exynos_pmu_conf *pmu_config_extra;
+
+   void (*pmu_init)(void);
+   void (*powerdown_conf)(enum sys_powerdown);
+   void (*powerdown_conf_extra)(enum sys_powerdown);
+};
+
+extern void __iomem *pmu_base_addr;
+/* list of all exported SoC specific data */
+extern const struct exynos_pmu_data exynos3250_pmu_data;
+
+extern void pmu_raw_writel(u32 val, u32 offset);
+extern u32 pmu_raw_readl(u32 offset);
+#endif /* __EXYNOS_PMU_H */
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index 5d68ce8..ce368c8 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -33,8 +33,6 @@
 #include "common.h"
 #include "mfc.h"
 
-void __iomem *pmu_base_addr;
-
 static struct map_desc exynos4_iodesc[] __initdata = {
{
.virtual= (unsigned long)S5P_VA_CMU,
diff --git a/arch/arm/mach-exynos/exynos3250-pmu.c 
b/arch/arm/mach-exynos/exynos3250-pmu.c
new file mode 100644
index 000..20b3ab8
--- /dev/null
+++ b/arch/arm/mach-exynos/exynos3250-pmu.c
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) 2011-2015 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com/
+ *
+ * EXYNOS3250 - CPU PMU (Power Management Unit) support
+ *
+ * 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 
+#include 
+
+#include "exynos-pmu.h"
+
+static struct exynos_pmu_conf exynos3250_pmu_config[] = {
+   /* { .offset = offset, .val = { AFTR, W-AFTR, SLEEP } */
+   { EXYNOS3_ARM_CORE0_SYS_PWR_REG,{ 0x0, 0x0, 0x2} },
+   { EXYNOS3_DIS_IRQ_ARM_CORE0_LOCAL_SYS_PWR_REG,  { 0x0, 0x0, 0x0} },
+   { EXYNOS3_DIS_IRQ_ARM_CORE0_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS3_ARM_CORE1_SYS_PWR_REG,{ 0x0, 0x0, 0x2} },
+   { EXYNOS3_DIS_IRQ_ARM_CORE1_LOCAL_SYS_PWR_REG,  { 0x0, 0x0, 0x0} },
+   { EXYNOS3_DIS_IRQ_ARM_CORE1_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS3_ISP_ARM_SYS_PWR_REG,  { 0x1, 0x0, 0x0} },
+   { EXYNOS3_DIS_IRQ_ISP_ARM_LOCAL_SYS_PWR_REG,{ 0x0, 0x0, 0x0} },
+   { EXYNOS3_DIS_IRQ_ISP_ARM_CENTRAL_SYS_PWR_REG,  { 0x0, 0x0, 0x0} },
+   { EXYNOS3_ARM_COMMON_SYS_PWR_REG,   { 0x0, 0x0, 0x2} },
+   { EXYNOS3_ARM_L2_SYS_PWR_REG,   { 0x0, 0x0, 0x3} },
+   { EXYNOS3_CMU_ACLKSTOP_SYS_PWR_REG, { 0x1, 0x1, 0x0} },
+   { EXYNOS3_CMU_SCLKSTOP_SYS_PWR_REG, { 0x1, 0x1, 0x0} },
+   { EXYNOS3_CMU_RESET_SYS_PWR_REG,{ 0x1, 0x1, 0x0} },
+   { EXYNOS3_DRAM_FREQ_DOWN_SYS_PWR_REG,   { 0x1, 0x1, 0x1} },
+   { EXYNOS3_DDRPHY_DLLOFF_SYS_PWR_REG,{ 0x1, 0x1, 0x1} },
+   { 

[PATCH v5 3/9] ARM: EXYNOS: Move pmu specific headers under "linux/soc/samsung"

2015-11-13 Thread Pankaj Dubey
Moving Exynos PMU specific header file into "include/linux/soc/samsung"
thus updated affected files under "mach-exynos" to use new location of
these header files.

Signed-off-by: Amit Daniel Kachhap 
Signed-off-by: Pankaj Dubey 
---
 arch/arm/mach-exynos/exynos.c   | 2 +-
 arch/arm/mach-exynos/mcpm-exynos.c  | 2 +-
 arch/arm/mach-exynos/platsmp.c  | 2 +-
 arch/arm/mach-exynos/pm.c   | 4 ++--
 arch/arm/mach-exynos/pmu.c  | 6 +++---
 arch/arm/mach-exynos/suspend.c  | 4 ++--
 {arch/arm/mach-exynos => include/linux/soc/samsung}/exynos-pmu.h| 6 +++---
 .../regs-pmu.h => include/linux/soc/samsung/exynos-regs-pmu.h   | 6 +++---
 8 files changed, 16 insertions(+), 16 deletions(-)
 rename {arch/arm/mach-exynos => include/linux/soc/samsung}/exynos-pmu.h (81%)
 rename arch/arm/mach-exynos/regs-pmu.h => 
include/linux/soc/samsung/exynos-regs-pmu.h (99%)

diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index 4ffb90e..5d68ce8 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -31,7 +32,6 @@
 
 #include "common.h"
 #include "mfc.h"
-#include "regs-pmu.h"
 
 void __iomem *pmu_base_addr;
 
diff --git a/arch/arm/mach-exynos/mcpm-exynos.c 
b/arch/arm/mach-exynos/mcpm-exynos.c
index 5697819..f086bf6 100644
--- a/arch/arm/mach-exynos/mcpm-exynos.c
+++ b/arch/arm/mach-exynos/mcpm-exynos.c
@@ -16,13 +16,13 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
 #include 
 #include 
 
-#include "regs-pmu.h"
 #include "common.h"
 
 #define EXYNOS5420_CPUS_PER_CLUSTER4
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index 98a2c0c..d5caf30 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -30,7 +31,6 @@
 #include 
 
 #include "common.h"
-#include "regs-pmu.h"
 
 extern void exynos4_secondary_startup(void);
 
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index 9c1506b..b9b9186 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -18,6 +18,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -29,8 +31,6 @@
 #include 
 
 #include "common.h"
-#include "exynos-pmu.h"
-#include "regs-pmu.h"
 
 static inline void __iomem *exynos_boot_vector_addr(void)
 {
diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
index d40f7e9..3974f52 100644
--- a/arch/arm/mach-exynos/pmu.c
+++ b/arch/arm/mach-exynos/pmu.c
@@ -17,10 +17,10 @@
 #include 
 #include 
 
-#include 
+#include 
+#include 
 
-#include "exynos-pmu.h"
-#include "regs-pmu.h"
+#include 
 
 #define PMU_TABLE_END  (-1U)
 
diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c
index 21abd9b..d02f7c3 100644
--- a/arch/arm/mach-exynos/suspend.c
+++ b/arch/arm/mach-exynos/suspend.c
@@ -23,6 +23,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -36,8 +38,6 @@
 #include 
 
 #include "common.h"
-#include "exynos-pmu.h"
-#include "regs-pmu.h"
 
 #define REG_TABLE_END (-1U)
 
diff --git a/arch/arm/mach-exynos/exynos-pmu.h 
b/include/linux/soc/samsung/exynos-pmu.h
similarity index 81%
rename from arch/arm/mach-exynos/exynos-pmu.h
rename to include/linux/soc/samsung/exynos-pmu.h
index a2ab0d5..e2e9de1 100644
--- a/arch/arm/mach-exynos/exynos-pmu.h
+++ b/include/linux/soc/samsung/exynos-pmu.h
@@ -9,8 +9,8 @@
  * published by the Free Software Foundation.
  */
 
-#ifndef __EXYNOS_PMU_H
-#define __EXYNOS_PMU_H
+#ifndef __LINUX_SOC_EXYNOS_PMU_H
+#define __LINUX_SOC_EXYNOS_PMU_H
 
 enum sys_powerdown {
SYS_AFTR,
@@ -21,4 +21,4 @@ enum sys_powerdown {
 
 extern void exynos_sys_powerdown_conf(enum sys_powerdown mode);
 
-#endif /* __EXYNOS_PMU_H */
+#endif /* __LINUX_SOC_EXYNOS_PMU_H */
diff --git a/arch/arm/mach-exynos/regs-pmu.h 
b/include/linux/soc/samsung/exynos-regs-pmu.h
similarity index 99%
rename from arch/arm/mach-exynos/regs-pmu.h
rename to include/linux/soc/samsung/exynos-regs-pmu.h
index 5e4f4c2..d30186e 100644
--- a/arch/arm/mach-exynos/regs-pmu.h
+++ b/include/linux/soc/samsung/exynos-regs-pmu.h
@@ -9,8 +9,8 @@
  * published by the Free Software Foundation.
 */
 
-#ifndef __ASM_ARCH_REGS_PMU_H
-#define __ASM_ARCH_REGS_PMU_H __FILE__
+#ifndef __LINUX_SOC_EXYNOS_REGS_PMU_H
+#define __LINUX_SOC_EXYNOS_REGS_PMU_H __FILE__
 
 #define S5P_CENTRAL_SEQ_CONFIGURATION  0x0200
 
@@ -690,4 +690,4 @@
 | EXYNOS5420_KFC_USE_STANDBY_WFI2  \
 | EXYNOS5420_KFC_USE_STANDBY_WFI3)
 
-#endif /* 

[PATCH v5 2/9] ARM: EXYNOS: Fix potential NULL pointer access in exynos_sys_powerdown_conf

2015-11-13 Thread Pankaj Dubey
If no platform devices binded to the driver but driver itself loaded and
exynos_sys_powerdown_conf is called from
arch/arm/mach-exynos/{suspend.c, pm.c} it will result in NULL pointer access,
to prevent this added check on pmu_context for NULL.

Signed-off-by: Pankaj Dubey 
Reviewed-by: Krzysztof Kozlowski 
---
 arch/arm/mach-exynos/pmu.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
index 64ea7d6..d40f7e9 100644
--- a/arch/arm/mach-exynos/pmu.c
+++ b/arch/arm/mach-exynos/pmu.c
@@ -749,8 +749,12 @@ static void exynos5_powerdown_conf(enum sys_powerdown mode)
 void exynos_sys_powerdown_conf(enum sys_powerdown mode)
 {
unsigned int i;
+   const struct exynos_pmu_data *pmu_data;
+
+   if (!pmu_context)
+   return;
 
-   const struct exynos_pmu_data *pmu_data = pmu_context->pmu_data;
+   pmu_data = pmu_context->pmu_data;
 
if (pmu_data->powerdown_conf)
pmu_data->powerdown_conf(mode);
-- 
2.4.5

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


Re: [PATCH 01/25] ARM: dts: exynos4: add rotator nodes

2015-11-13 Thread Marek Szyprowski

Hello,

On 2015-11-13 03:23, Krzysztof Kozlowski wrote:

On 10.11.2015 22:23, Marek Szyprowski wrote:

This patch adds device node for Rotator device to Exynos 4210 and 4x12
device tree files.

Signed-off-by: Marek Szyprowski 
---
  arch/arm/boot/dts/exynos4.dtsi| 10 +-
  arch/arm/boot/dts/exynos4210.dtsi |  8 
  arch/arm/boot/dts/exynos4x12.dtsi |  4 
  3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index 2f31f773b096..3fa575ad7693 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -718,6 +718,15 @@
iommus = <_jpeg>;
};
  
+	rotator: rotator@1281 {

+   compatible = "samsung,exynos4210-rotator";
+   reg = <0x1281 0x1000>;
+   interrupts = <0 83 0>;
+   clocks = < CLK_ROTATOR>;
+   clock-names = "rotator";
+   iommus = <_rotator>;
+   };
+
hdmi: hdmi@12D0 {
compatible = "samsung,exynos4210-hdmi";
reg = <0x12D0 0x7>;
@@ -945,7 +954,6 @@
interrupts = <5 0>;
clock-names = "sysmmu", "master";
clocks = < CLK_SMMU_ROTATOR>, < CLK_ROTATOR>;
-   power-domains = <_lcd0>;

Hmm I wonder why you changed this. Sysmmu rotator and rotator are
not a part of LCD power domain on Exynos4x12 (or they should not be?)? Why?


On Exynos 4210 rotator (and its SYSMMU) belongs to LCD0 power domain. On
Exynos 4x12 it belong to TOP power domain (which is always on and not
described in DTS).

Best regards
--
Marek Szyprowski, PhD
Samsung R Institute Poland

--
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/25] ARM: dts: exynos4: add rotator nodes

2015-11-13 Thread Krzysztof Kozlowski
On 13.11.2015 17:32, Marek Szyprowski wrote:
> Hello,
> 
> On 2015-11-13 03:29, Krzysztof Kozlowski wrote:
>> On 10.11.2015 22:23, Marek Szyprowski wrote:
>>> This patch adds device node for Rotator device to Exynos 4210 and 4x12
>>> device tree files.
>>>
>>> Signed-off-by: Marek Szyprowski 
>>> ---
>>>   arch/arm/boot/dts/exynos4.dtsi| 10 +-
>>>   arch/arm/boot/dts/exynos4210.dtsi |  8 
>>>   arch/arm/boot/dts/exynos4x12.dtsi |  4 
>>>   3 files changed, 21 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm/boot/dts/exynos4.dtsi
>>> b/arch/arm/boot/dts/exynos4.dtsi
>>> index 2f31f773b096..3fa575ad7693 100644
>>> --- a/arch/arm/boot/dts/exynos4.dtsi
>>> +++ b/arch/arm/boot/dts/exynos4.dtsi
>>> @@ -718,6 +718,15 @@
>>>   iommus = <_jpeg>;
>>>   };
>>>   +rotator: rotator@1281 {
>>> +compatible = "samsung,exynos4210-rotator";
>>> +reg = <0x1281 0x1000>;
>> One more question after looking at second patch. You are mapping size of
>> 0x1000 instead of 0x64. Any particular reason? (it does not really
>> matter... just wondering)
> 
> Nope, it might be just a copy/paste issue I've missed. Do you want to
> unify it to
> 0x64 or 0x1000?

To 0x64, please. That would make it synced with datasheet.

Best regards,
Krzysztof

--
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 v5 7/9] ARM: EXYNOS: split up exynos5420 SoC specific PMU data

2015-11-13 Thread Pankaj Dubey
This patch splits up mach-exynos/pmu.c file, and moves exynos5420,
PMU configuration data and functions handing data into exynos5420
SoC specific PMU file mach-exynos/exynos5420-pmu.c.

Signed-off-by: Pankaj Dubey 
---
 arch/arm/mach-exynos/Makefile |   2 +-
 arch/arm/mach-exynos/exynos-pmu.h |   1 +
 arch/arm/mach-exynos/exynos5420-pmu.c | 280 ++
 arch/arm/mach-exynos/pmu.c| 263 ---
 4 files changed, 282 insertions(+), 264 deletions(-)
 create mode 100644 arch/arm/mach-exynos/exynos5420-pmu.c

diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index bfb23a5..2d58063 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -11,7 +11,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += 
-I$(srctree)/$(src)/include -I$(srctree)
 
 obj-$(CONFIG_ARCH_EXYNOS)  += exynos.o pmu.o exynos-smc.o firmware.o \
exynos3250-pmu.o exynos4-pmu.o \
-   exynos5250-pmu.o
+   exynos5250-pmu.o exynos5420-pmu.o
 
 obj-$(CONFIG_EXYNOS_CPU_SUSPEND) += pm.o sleep.o
 obj-$(CONFIG_PM_SLEEP) += suspend.o
diff --git a/arch/arm/mach-exynos/exynos-pmu.h 
b/arch/arm/mach-exynos/exynos-pmu.h
index 85c858d..a469e36 100644
--- a/arch/arm/mach-exynos/exynos-pmu.h
+++ b/arch/arm/mach-exynos/exynos-pmu.h
@@ -37,6 +37,7 @@ extern const struct exynos_pmu_data exynos4210_pmu_data;
 extern const struct exynos_pmu_data exynos4212_pmu_data;
 extern const struct exynos_pmu_data exynos4412_pmu_data;
 extern const struct exynos_pmu_data exynos5250_pmu_data;
+extern const struct exynos_pmu_data exynos5420_pmu_data;
 
 extern void pmu_raw_writel(u32 val, u32 offset);
 extern u32 pmu_raw_readl(u32 offset);
diff --git a/arch/arm/mach-exynos/exynos5420-pmu.c 
b/arch/arm/mach-exynos/exynos5420-pmu.c
new file mode 100644
index 000..b962fb6
--- /dev/null
+++ b/arch/arm/mach-exynos/exynos5420-pmu.c
@@ -0,0 +1,280 @@
+/*
+ * Copyright (c) 2011-2015 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com/
+ *
+ * EXYNOS5420 - CPU PMU (Power Management Unit) support
+ *
+ * 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 
+#include 
+#include 
+
+#include 
+
+#include "exynos-pmu.h"
+
+static struct exynos_pmu_conf exynos5420_pmu_config[] = {
+   /* { .offset = offset, .val = { AFTR, LPA, SLEEP } */
+   { EXYNOS5_ARM_CORE0_SYS_PWR_REG,{ 0x0, 0x0, 0x0} },
+   { EXYNOS5_DIS_IRQ_ARM_CORE0_LOCAL_SYS_PWR_REG,  { 0x0, 0x0, 0x0} },
+   { EXYNOS5_DIS_IRQ_ARM_CORE0_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5_ARM_CORE1_SYS_PWR_REG,{ 0x0, 0x0, 0x0} },
+   { EXYNOS5_DIS_IRQ_ARM_CORE1_LOCAL_SYS_PWR_REG,  { 0x0, 0x0, 0x0} },
+   { EXYNOS5_DIS_IRQ_ARM_CORE1_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5420_ARM_CORE2_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5420_DIS_IRQ_ARM_CORE2_LOCAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5420_DIS_IRQ_ARM_CORE2_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5420_ARM_CORE3_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5420_DIS_IRQ_ARM_CORE3_LOCAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5420_DIS_IRQ_ARM_CORE3_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5420_KFC_CORE0_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5420_DIS_IRQ_KFC_CORE0_LOCAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5420_DIS_IRQ_KFC_CORE0_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5420_KFC_CORE1_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5420_DIS_IRQ_KFC_CORE1_LOCAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5420_DIS_IRQ_KFC_CORE1_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5420_KFC_CORE2_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5420_DIS_IRQ_KFC_CORE2_LOCAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5420_DIS_IRQ_KFC_CORE2_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5420_KFC_CORE3_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5420_DIS_IRQ_KFC_CORE3_LOCAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5420_DIS_IRQ_KFC_CORE3_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5_ISP_ARM_SYS_PWR_REG,  { 0x1, 0x0, 0x0} },
+   { EXYNOS5_DIS_IRQ_ISP_ARM_LOCAL_SYS_PWR_REG,{ 0x1, 0x0, 0x0} },
+   { EXYNOS5_DIS_IRQ_ISP_ARM_CENTRAL_SYS_PWR_REG,  { 0x1, 0x0, 0x0} },
+   { EXYNOS5420_ARM_COMMON_SYS_PWR_REG,{ 0x0, 0x0, 0x0} },
+   { EXYNOS5420_KFC_COMMON_SYS_PWR_REG,{ 0x0, 0x0, 0x0} },
+   { EXYNOS5_ARM_L2_SYS_PWR_REG,   { 0x0, 0x0, 0x0} },
+   { EXYNOS5420_KFC_L2_SYS_PWR_REG,   

[PATCH v5 9/9] drivers: soc: Add support for Exynos PMU driver

2015-11-13 Thread Pankaj Dubey
This patch moves Exynos PMU driver implementation from "arm/mach-exynos"
to "drivers/soc/samsung". This driver is mainly used for setting misc
bits of register from PMU IP of Exynos SoC which will be required to
configure before Suspend/Resume. Currently all these settings are done
in "arch/arm/mach-exynos/pmu.c" but moving ahead for ARM64 based SoC
support, there is a need of this PMU driver in driver/* folder.

This driver uses existing DT binding information and there should
be no functionality change in the supported platforms.

Signed-off-by: Amit Daniel Kachhap 
Signed-off-by: Pankaj Dubey 
---
 arch/arm/mach-exynos/Kconfig   | 1 +
 arch/arm/mach-exynos/Makefile  | 4 +---
 drivers/soc/samsung/Kconfig| 4 
 drivers/soc/samsung/Makefile   | 4 
 arch/arm/mach-exynos/pmu.c => drivers/soc/samsung/exynos-pmu.c | 0
 {arch/arm/mach-exynos => drivers/soc/samsung}/exynos-pmu.h | 0
 {arch/arm/mach-exynos => drivers/soc/samsung}/exynos3250-pmu.c | 0
 {arch/arm/mach-exynos => drivers/soc/samsung}/exynos4-pmu.c| 0
 {arch/arm/mach-exynos => drivers/soc/samsung}/exynos5250-pmu.c | 0
 {arch/arm/mach-exynos => drivers/soc/samsung}/exynos5420-pmu.c | 0
 10 files changed, 10 insertions(+), 3 deletions(-)
 rename arch/arm/mach-exynos/pmu.c => drivers/soc/samsung/exynos-pmu.c (100%)
 rename {arch/arm/mach-exynos => drivers/soc/samsung}/exynos-pmu.h (100%)
 rename {arch/arm/mach-exynos => drivers/soc/samsung}/exynos3250-pmu.c (100%)
 rename {arch/arm/mach-exynos => drivers/soc/samsung}/exynos4-pmu.c (100%)
 rename {arch/arm/mach-exynos => drivers/soc/samsung}/exynos5250-pmu.c (100%)
 rename {arch/arm/mach-exynos => drivers/soc/samsung}/exynos5420-pmu.c (100%)

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 83c85f5..874cb38 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -16,6 +16,7 @@ menuconfig ARCH_EXYNOS
select ARM_GIC
select COMMON_CLK_SAMSUNG
select EXYNOS_THERMAL
+   select EXYNOS_PMU
select EXYNOS_SROM if PM
select HAVE_ARM_SCU if SMP
select HAVE_S3C2410_I2C if I2C
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 2d58063..34d29df 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -9,9 +9,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += 
-I$(srctree)/$(src)/include -I$(srctree)
 
 # Core
 
-obj-$(CONFIG_ARCH_EXYNOS)  += exynos.o pmu.o exynos-smc.o firmware.o \
-   exynos3250-pmu.o exynos4-pmu.o \
-   exynos5250-pmu.o exynos5420-pmu.o
+obj-$(CONFIG_ARCH_EXYNOS)  += exynos.o exynos-smc.o firmware.o
 
 obj-$(CONFIG_EXYNOS_CPU_SUSPEND) += pm.o sleep.o
 obj-$(CONFIG_PM_SLEEP) += suspend.o
diff --git a/drivers/soc/samsung/Kconfig b/drivers/soc/samsung/Kconfig
index 2833b5b..f545d6c 100644
--- a/drivers/soc/samsung/Kconfig
+++ b/drivers/soc/samsung/Kconfig
@@ -10,4 +10,8 @@ config EXYNOS_SROM
bool
depends on ARM && ARCH_EXYNOS && PM
 
+config EXYNOS_PMU
+   bool
+   depends on ARCH_EXYNOS
+
 endmenu
diff --git a/drivers/soc/samsung/Makefile b/drivers/soc/samsung/Makefile
index 9c554d5..26fb489 100644
--- a/drivers/soc/samsung/Makefile
+++ b/drivers/soc/samsung/Makefile
@@ -1 +1,5 @@
 obj-$(CONFIG_EXYNOS_SROM)  += exynos-srom.o
+ifdef CONFIG_ARM
+obj-$(CONFIG_EXYNOS_PMU)   += exynos-pmu.o exynos3250-pmu.o exynos4-pmu.o \
+   exynos5250-pmu.o exynos5420-pmu.o
+endif
diff --git a/arch/arm/mach-exynos/pmu.c b/drivers/soc/samsung/exynos-pmu.c
similarity index 100%
rename from arch/arm/mach-exynos/pmu.c
rename to drivers/soc/samsung/exynos-pmu.c
diff --git a/arch/arm/mach-exynos/exynos-pmu.h 
b/drivers/soc/samsung/exynos-pmu.h
similarity index 100%
rename from arch/arm/mach-exynos/exynos-pmu.h
rename to drivers/soc/samsung/exynos-pmu.h
diff --git a/arch/arm/mach-exynos/exynos3250-pmu.c 
b/drivers/soc/samsung/exynos3250-pmu.c
similarity index 100%
rename from arch/arm/mach-exynos/exynos3250-pmu.c
rename to drivers/soc/samsung/exynos3250-pmu.c
diff --git a/arch/arm/mach-exynos/exynos4-pmu.c 
b/drivers/soc/samsung/exynos4-pmu.c
similarity index 100%
rename from arch/arm/mach-exynos/exynos4-pmu.c
rename to drivers/soc/samsung/exynos4-pmu.c
diff --git a/arch/arm/mach-exynos/exynos5250-pmu.c 
b/drivers/soc/samsung/exynos5250-pmu.c
similarity index 100%
rename from arch/arm/mach-exynos/exynos5250-pmu.c
rename to drivers/soc/samsung/exynos5250-pmu.c
diff --git a/arch/arm/mach-exynos/exynos5420-pmu.c 
b/drivers/soc/samsung/exynos5420-pmu.c
similarity index 100%
rename from arch/arm/mach-exynos/exynos5420-pmu.c
rename to drivers/soc/samsung/exynos5420-pmu.c
-- 
2.4.5

--
To unsubscribe from this list: send the line 

[PATCH v5 1/9] ARM: EXYNOS: removing redundant code from regs-pmu.h

2015-11-13 Thread Pankaj Dubey
commit 6ec4f8d0d91f ("ARM: EXYNOS: add generic function to calculate
cpu number") introduced exynos_pmu_cpunr to be used by multi-cluster SoC's
e.g Exynos5420, but it's no more used in the codebase and hence removing
this part of code.

Signed-off-by: Pankaj Dubey 
Reviewed-by: Krzysztof Kozlowski 
---
 arch/arm/mach-exynos/pmu.c  | 1 +
 arch/arm/mach-exynos/regs-pmu.h | 9 -
 2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
index 5775154..64ea7d6 100644
--- a/arch/arm/mach-exynos/pmu.c
+++ b/arch/arm/mach-exynos/pmu.c
@@ -17,6 +17,7 @@
 #include 
 #include 
 
+#include 
 
 #include "exynos-pmu.h"
 #include "regs-pmu.h"
diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h
index fba9068..5e4f4c2 100644
--- a/arch/arm/mach-exynos/regs-pmu.h
+++ b/arch/arm/mach-exynos/regs-pmu.h
@@ -484,15 +484,6 @@
 
 #define EXYNOS5420_SWRESET_KFC_SEL 0x3
 
-#include 
-#define MAX_CPUS_IN_CLUSTER4
-
-static inline unsigned int exynos_pmu_cpunr(unsigned int mpidr)
-{
-   return ((MPIDR_AFFINITY_LEVEL(mpidr, 1) * MAX_CPUS_IN_CLUSTER)
-+ MPIDR_AFFINITY_LEVEL(mpidr, 0));
-}
-
 /* Only for EXYNOS5420 */
 #define EXYNOS5420_ISP_ARM_OPTION  0x2488
 #define EXYNOS5420_L2RSTDISABLE_VALUE  BIT(3)
-- 
2.4.5

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


[PATCH v5 0/9] samsung: pmu: split up SoC specific PMU data

2015-11-13 Thread Pankaj Dubey
This patch series is a part of continuation work from following series
[1], [2], [3] and [4]

1: exynos: Move pmu driver to driver/soc folder and add exynos7 support
   http://www.spinics.net/lists/linux-samsung-soc/msg39797.html from Amit 
Daniel Kacchap
2: soc: samsung: pmu: split up SoC specific PMU data
   https://lkml.org/lkml/2015/1/7/12 from me
3: https://lkml.org/lkml/2015/10/26/245
4: https://lkml.org/lkml/2015/11/10/180

In this series I am splitting up SoC specific PMU configuration data into
mach-exynos folder itself, before moving all of them under
drivers/soc/samsung/. Also instead of making all changes in single patch it
has been broken into SoC specific patches to avoid large size of patch.
With this approach there will not be unwanted big churns just after
adding exynos-pmu under drivers/soc/samsung.

All these patches are just refactoring to keep minimal changes while moving
exynos-pmu driver under drivers/soc/samsung/. Support for exynos7 PMU can
be added on top of it, in such a manner that for ARM64 build, ARM related
SoC's PMU will not get compiled and thus unnecessary increasing kernel image 
size.

I have tested on Peach-Pi (Exynos5880) based chromebook for boot
and S2R functionality.

These patches have been prepared on top of Kukjin Kim's for-next and on top of
cherry-picked change from [5].

5: ARM: EXYNOS: Constify local exynos_pmu_data structure
   https://lkml.org/lkml/2015/10/28/917

Changes since v4:
 - In v3 I missed to give -M flag to detect rename, which made patches hard
   to review, so resubmitting patches with rename detector flag.
 - Addressed review comments from Krzysztof.

Changes since v3:
 - Keeping intact copyright dates in existing header files.
 - Addressed review comments from Krzysztof for v3.
 - Removing static inline function from exynos-pmu.h and
   keeping them in PMU driver.
 - Added new patch (2/9) for fixing potential null pointer reference in
   exynos_sys_powerdown_conf.
 - Added new patch (8/9) for rearranging static and non-static function for
   better readability.

Changes since v2:
 - Removed Amit's Samsung id as it's no more valid.
 - Rebased on latest kgene tree.
 - Removed redundant code from regs-pmu.h

Pankaj Dubey (9):
  ARM: EXYNOS: removing redundant code from regs-pmu.h
  ARM: EXYNOS: Fix potential NULL pointer access in
exynos_sys_powerdown_conf
  ARM: EXYNOS: Move pmu specific headers under "linux/soc/samsung"
  ARM: EXYNOS: split up exynos3250 SoC specific PMU data
  ARM: EXYNOS: split up exynos4 SoC specific PMU data
  ARM: EXYNOS: split up exynos5250 SoC specific PMU data
  ARM: EXYNOS: split up exynos5420 SoC specific PMU data
  ARM: EXYNOS: rearrange static and non-static functions of PMU driver
  drivers: soc: Add support for Exynos PMU driver

 arch/arm/mach-exynos/Kconfig   |1 +
 arch/arm/mach-exynos/Makefile  |2 +-
 arch/arm/mach-exynos/exynos.c  |4 +-
 arch/arm/mach-exynos/mcpm-exynos.c |2 +-
 arch/arm/mach-exynos/platsmp.c |2 +-
 arch/arm/mach-exynos/pm.c  |4 +-
 arch/arm/mach-exynos/pmu.c | 1004 
 arch/arm/mach-exynos/suspend.c |4 +-
 drivers/soc/samsung/Kconfig|4 +
 drivers/soc/samsung/Makefile   |4 +
 drivers/soc/samsung/exynos-pmu.c   |  183 
 drivers/soc/samsung/exynos-pmu.h   |   44 +
 drivers/soc/samsung/exynos3250-pmu.c   |  175 
 drivers/soc/samsung/exynos4-pmu.c  |  223 +
 drivers/soc/samsung/exynos5250-pmu.c   |  196 
 drivers/soc/samsung/exynos5420-pmu.c   |  280 ++
 .../linux/soc/samsung}/exynos-pmu.h|6 +-
 .../linux/soc/samsung/exynos-regs-pmu.h|   15 +-
 18 files changed, 1124 insertions(+), 1029 deletions(-)
 delete mode 100644 arch/arm/mach-exynos/pmu.c
 create mode 100644 drivers/soc/samsung/exynos-pmu.c
 create mode 100644 drivers/soc/samsung/exynos-pmu.h
 create mode 100644 drivers/soc/samsung/exynos3250-pmu.c
 create mode 100644 drivers/soc/samsung/exynos4-pmu.c
 create mode 100644 drivers/soc/samsung/exynos5250-pmu.c
 create mode 100644 drivers/soc/samsung/exynos5420-pmu.c
 rename {arch/arm/mach-exynos => include/linux/soc/samsung}/exynos-pmu.h (81%)
 rename arch/arm/mach-exynos/regs-pmu.h => 
include/linux/soc/samsung/exynos-regs-pmu.h (98%)

-- 
2.4.5

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


Re: [PATCH 01/25] ARM: dts: exynos4: add rotator nodes

2015-11-13 Thread Krzysztof Kozlowski
On 13.11.2015 17:31, Marek Szyprowski wrote:
> Hello,
> 
> On 2015-11-13 03:23, Krzysztof Kozlowski wrote:
>> On 10.11.2015 22:23, Marek Szyprowski wrote:
>>> This patch adds device node for Rotator device to Exynos 4210 and 4x12
>>> device tree files.
>>>
>>> Signed-off-by: Marek Szyprowski 
>>> ---
>>>   arch/arm/boot/dts/exynos4.dtsi| 10 +-
>>>   arch/arm/boot/dts/exynos4210.dtsi |  8 
>>>   arch/arm/boot/dts/exynos4x12.dtsi |  4 
>>>   3 files changed, 21 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm/boot/dts/exynos4.dtsi
>>> b/arch/arm/boot/dts/exynos4.dtsi
>>> index 2f31f773b096..3fa575ad7693 100644
>>> --- a/arch/arm/boot/dts/exynos4.dtsi
>>> +++ b/arch/arm/boot/dts/exynos4.dtsi
>>> @@ -718,6 +718,15 @@
>>>   iommus = <_jpeg>;
>>>   };
>>>   +rotator: rotator@1281 {
>>> +compatible = "samsung,exynos4210-rotator";
>>> +reg = <0x1281 0x1000>;
>>> +interrupts = <0 83 0>;
>>> +clocks = < CLK_ROTATOR>;
>>> +clock-names = "rotator";
>>> +iommus = <_rotator>;
>>> +};
>>> +
>>>   hdmi: hdmi@12D0 {
>>>   compatible = "samsung,exynos4210-hdmi";
>>>   reg = <0x12D0 0x7>;
>>> @@ -945,7 +954,6 @@
>>>   interrupts = <5 0>;
>>>   clock-names = "sysmmu", "master";
>>>   clocks = < CLK_SMMU_ROTATOR>, < CLK_ROTATOR>;
>>> -power-domains = <_lcd0>;
>> Hmm I wonder why you changed this. Sysmmu rotator and rotator are
>> not a part of LCD power domain on Exynos4x12 (or they should not be?)?
>> Why?
> 
> On Exynos 4210 rotator (and its SYSMMU) belongs to LCD0 power domain. On
> Exynos 4x12 it belong to TOP power domain (which is always on and not
> described in DTS).

Indeed... The change makes sense but actually for sysmmu rotator should
be separated (especially that this was not mentioned in commit description).

Can you split the sysmmu part?

Best regards,
Krzysztof

--
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 06/25] drm/exynos: fix to calculate offset of each plane for ipp fimc

2015-11-13 Thread Marek Szyprowski

Hello,

On 2015-11-12 16:20, Tobias Jakobi wrote:

Hello,

Marek Szyprowski wrote:

From: Seung-Woo Kim 

NV12 and YUV420 formats are need to calculate offset of each plane
for ipp fimc in a gem buffer. Without proper offset, only Y plane
can be processed, so result shows green frame.
This patch fixes to calculate offset for cbcr planes for NV12 and
YUV420 formats.

Signed-off-by: Seung-Woo Kim 
Signed-off-by: Marek Szyprowski 
---
  drivers/gpu/drm/exynos/exynos_drm_fimc.c | 106 +++
  drivers/gpu/drm/exynos/exynos_drm_ipp.c  |  15 -
  drivers/gpu/drm/exynos/exynos_drm_ipp.h  |   2 +
  3 files changed, 121 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
index c747824f3c98..72a7ca188be5 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
@@ -403,6 +403,97 @@ static void fimc_handle_lastend(struct fimc_context *ctx, 
bool enable)
fimc_write(ctx, cfg, EXYNOS_CIOCTRL);
  }
  
+static int fimc_set_planar_addr(struct drm_exynos_ipp_buf_info *buf_info,

+   u32 fmt, struct drm_exynos_sz *sz)
+{
+   dma_addr_t *base[EXYNOS_DRM_PLANAR_MAX];

I think I've seen this at several other places already, but I never
fully understood it.

Why are we using dma_addr_t* here, instead of just dma_addr_t? I mean in
the following code the pointer is just in the dereferenced form anyway,
so why this added indirection?


This function updates dma addresses stored in struct drm_exynos_ipp_buf_info
*buf_info (it adds offset related to specific pixel format), so using a 
pointer

makes all formulas shorter.


+   uint64_t size[EXYNOS_DRM_PLANAR_MAX];
+   uint64_t ofs[EXYNOS_DRM_PLANAR_MAX];
+   bool bypass = false;
+   uint64_t tsize = 0;
+   int i;
+
+   for_each_ipp_planar(i) {
+   base[i] = _info->base[i];
+   size[i] = buf_info->size[i];
+   ofs[i] = 0;
+   tsize += size[i];
+   }
+
+   if (!tsize) {
+   DRM_INFO("%s:failed to get buffer size.\n", __func__);
+   return 0;
+   }
+
+   switch (fmt) {
+   case DRM_FORMAT_NV12:
+   case DRM_FORMAT_NV21:
+   case DRM_FORMAT_NV16:
+   case DRM_FORMAT_NV61:
+   ofs[0] = sz->hsize * sz->vsize;
+   ofs[1] = ofs[0] >> 1;
+   if (*base[0] && *base[1]) {
+   if (size[0] + size[1] < ofs[0] + ofs[1])
+   goto err_info;
+   bypass = true;
+   }
+   break;
+   case DRM_FORMAT_YUV410:
+   case DRM_FORMAT_YVU410:
+   case DRM_FORMAT_YUV411:
+   case DRM_FORMAT_YVU411:
+   case DRM_FORMAT_YUV420:
+   case DRM_FORMAT_YVU420:
+   case DRM_FORMAT_YUV422:
+   case DRM_FORMAT_YVU422:
+   case DRM_FORMAT_YUV444:
+   case DRM_FORMAT_YVU444:
+   ofs[0] = sz->hsize * sz->vsize;
+   ofs[1] = ofs[2] = ofs[0] >> 2;
+   if (*base[0] && *base[1] && *base[2]) {
+   if (size[0]+size[1]+size[2] < ofs[0]+ofs[1]+ofs[2])
+   goto err_info;
+   bypass = true;
+   }
+   break;
+   case DRM_FORMAT_XRGB:
+   case DRM_FORMAT_ARGB:
+   ofs[0] = sz->hsize * sz->vsize << 2;
+   if (*base[0]) {
+   if (size[0] < ofs[0])
+   goto err_info;
+   }
+   bypass = true;
+   break;
+   default:
+   bypass = true;
+   break;
+   }
+
+   if (!bypass) {
+   *base[1] = *base[0] + ofs[0];
+   if (ofs[1] && ofs[2])
+   *base[2] = *base[1] + ofs[1];
+   }
+
+   DRM_DEBUG_KMS("%s:y[0x%x],cb[0x%x],cr[0x%x]\n", __func__,
+   *base[0], *base[1], *base[2]);
+
+   return 0;
+
+err_info:
+   DRM_ERROR("invalid size for fmt[0x%x]\n", fmt);
+
+   for_each_ipp_planar(i) {
+   base[i] = _info->base[i];
+   size[i] = buf_info->size[i];
+
+   DRM_ERROR("buf[%d] - base[0x%x] sz[%llu] ofs[%llu]\n",
+   i, *base[i], size[i], ofs[i]);
+   }
+
+   return -EINVAL;
+}
  
  static int fimc_src_set_fmt_order(struct fimc_context *ctx, u32 fmt)

  {
@@ -689,6 +780,7 @@ static int fimc_src_set_addr(struct device *dev,
struct drm_exynos_ipp_cmd_node *c_node = ippdrv->c_node;
struct drm_exynos_ipp_property *property;
struct drm_exynos_ipp_config *config;
+   int ret;
  
  	if (!c_node) {

DRM_ERROR("failed to get c_node.\n");
@@ -709,6 +801,12 @@ static int fimc_src_set_addr(struct device *dev,
switch (buf_type) {
case 

RE: [PATCH v4 3/9] ARM: EXYNOS: Move pmu specific headers under "linux/soc/samsung"

2015-11-13 Thread Pankaj Dubey
Hi Krzysztof,

> -Original Message-
> From: Krzysztof Kozlowski [mailto:k.kozlow...@samsung.com]
> Sent: Thursday, November 12, 2015 9:40 AM
> To: Pankaj Dubey; linux-samsung-soc@vger.kernel.org; linux-
> ker...@vger.kernel.org; linux-arm-ker...@lists.infradead.org
> Cc: kgene@samsung.com; thomas...@samsung.com; amitdani...@gmail.com;
> o...@lixom.net; khil...@linaro.org; a...@arndb.de
> Subject: Re: [PATCH v4 3/9] ARM: EXYNOS: Move pmu specific headers under
> "linux/soc/samsung"
> 
> On 10.11.2015 20:42, Pankaj Dubey wrote:
> > Moving Exynos PMU specific header file into "include/linux/soc/samsung"
> > thus updated affected files under "mach-exynos" to use new location of
> > these header files.
> >
> > Signed-off-by: Amit Daniel Kachhap 
> > Signed-off-by: Pankaj Dubey 
> > ---
> >  arch/arm/mach-exynos/exynos-pmu.h   |  24 -
> >  arch/arm/mach-exynos/exynos.c   |   2 +-
> >  arch/arm/mach-exynos/mcpm-exynos.c  |   2 +-
> >  arch/arm/mach-exynos/platsmp.c  |   2 +-
> >  arch/arm/mach-exynos/pm.c   |   4 +-
> >  arch/arm/mach-exynos/pmu.c  |   6 +-
> >  arch/arm/mach-exynos/regs-pmu.h | 693

> >  arch/arm/mach-exynos/suspend.c  |   4 +-
> >  include/linux/soc/samsung/exynos-pmu.h  |  24 +
> >  include/linux/soc/samsung/exynos-regs-pmu.h | 693
> > 
> 
> Did you disable the rename-detection for format-patch? Default rename
detection
> mechanism (50% of similarity) should detect two renames here:
> exynos-pmu.h and exynos-regs-pmu.h
> 

Yes. I missed to enable rename detection while creating patches.
Soon will resubmit patches with addressing your comments to all the patches
reviewed.

Thanks,
Pankaj Dubey

> Best regards,
> Krzysztof
> 
> 
> >  10 files changed, 727 insertions(+), 727 deletions(-)  delete mode
> > 100644 arch/arm/mach-exynos/exynos-pmu.h  delete mode 100644
> > arch/arm/mach-exynos/regs-pmu.h  create mode 100644
> > include/linux/soc/samsung/exynos-pmu.h
> >  create mode 100644 include/linux/soc/samsung/exynos-regs-pmu.h

--
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 v5 5/9] ARM: EXYNOS: split up exynos4 SoC specific PMU data

2015-11-13 Thread Pankaj Dubey
This patch splits up mach-exynos/pmu.c file, and moves exynos4210,
exynos4412 and exynos4212 PMU configuration data and functions handing
data into a common exynos4 SoC specific PMU file mach-exynos/exynos4-pmu.c.

Signed-off-by: Pankaj Dubey 
Reviewed-by: Krzysztof Kozlowski 
---
 arch/arm/mach-exynos/Makefile  |   2 +-
 arch/arm/mach-exynos/exynos-pmu.h  |   3 +
 arch/arm/mach-exynos/exynos4-pmu.c | 223 +
 arch/arm/mach-exynos/pmu.c | 207 --
 4 files changed, 227 insertions(+), 208 deletions(-)
 create mode 100644 arch/arm/mach-exynos/exynos4-pmu.c

diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index e869f86..8969683 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -9,7 +9,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += 
-I$(srctree)/$(src)/include -I$(srctree)
 
 # Core
 
-obj-$(CONFIG_ARCH_EXYNOS)  += exynos.o pmu.o exynos-smc.o firmware.o 
exynos3250-pmu.o
+obj-$(CONFIG_ARCH_EXYNOS)  += exynos.o pmu.o exynos-smc.o firmware.o 
exynos3250-pmu.o exynos4-pmu.o
 
 obj-$(CONFIG_EXYNOS_CPU_SUSPEND) += pm.o sleep.o
 obj-$(CONFIG_PM_SLEEP) += suspend.o
diff --git a/arch/arm/mach-exynos/exynos-pmu.h 
b/arch/arm/mach-exynos/exynos-pmu.h
index 5d09fa3..3d21aad 100644
--- a/arch/arm/mach-exynos/exynos-pmu.h
+++ b/arch/arm/mach-exynos/exynos-pmu.h
@@ -33,6 +33,9 @@ struct exynos_pmu_data {
 extern void __iomem *pmu_base_addr;
 /* list of all exported SoC specific data */
 extern const struct exynos_pmu_data exynos3250_pmu_data;
+extern const struct exynos_pmu_data exynos4210_pmu_data;
+extern const struct exynos_pmu_data exynos4212_pmu_data;
+extern const struct exynos_pmu_data exynos4412_pmu_data;
 
 extern void pmu_raw_writel(u32 val, u32 offset);
 extern u32 pmu_raw_readl(u32 offset);
diff --git a/arch/arm/mach-exynos/exynos4-pmu.c 
b/arch/arm/mach-exynos/exynos4-pmu.c
new file mode 100644
index 000..4b0a79e
--- /dev/null
+++ b/arch/arm/mach-exynos/exynos4-pmu.c
@@ -0,0 +1,223 @@
+/*
+ * Copyright (c) 2011-2015 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com/
+ *
+ * EXYNOS4 - CPU PMU(Power Management Unit) support
+ *
+ * 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 
+#include 
+
+#include "exynos-pmu.h"
+
+static const struct exynos_pmu_conf exynos4210_pmu_config[] = {
+   /* { .offset = offset, .val = { AFTR, LPA, SLEEP } */
+   { S5P_ARM_CORE0_LOWPWR, { 0x0, 0x0, 0x2 } },
+   { S5P_DIS_IRQ_CORE0,{ 0x0, 0x0, 0x0 } },
+   { S5P_DIS_IRQ_CENTRAL0, { 0x0, 0x0, 0x0 } },
+   { S5P_ARM_CORE1_LOWPWR, { 0x0, 0x0, 0x2 } },
+   { S5P_DIS_IRQ_CORE1,{ 0x0, 0x0, 0x0 } },
+   { S5P_DIS_IRQ_CENTRAL1, { 0x0, 0x0, 0x0 } },
+   { S5P_ARM_COMMON_LOWPWR,{ 0x0, 0x0, 0x2 } },
+   { S5P_L2_0_LOWPWR,  { 0x2, 0x2, 0x3 } },
+   { S5P_L2_1_LOWPWR,  { 0x2, 0x2, 0x3 } },
+   { S5P_CMU_ACLKSTOP_LOWPWR,  { 0x1, 0x0, 0x0 } },
+   { S5P_CMU_SCLKSTOP_LOWPWR,  { 0x1, 0x0, 0x0 } },
+   { S5P_CMU_RESET_LOWPWR, { 0x1, 0x1, 0x0 } },
+   { S5P_APLL_SYSCLK_LOWPWR,   { 0x1, 0x0, 0x0 } },
+   { S5P_MPLL_SYSCLK_LOWPWR,   { 0x1, 0x0, 0x0 } },
+   { S5P_VPLL_SYSCLK_LOWPWR,   { 0x1, 0x0, 0x0 } },
+   { S5P_EPLL_SYSCLK_LOWPWR,   { 0x1, 0x1, 0x0 } },
+   { S5P_CMU_CLKSTOP_GPS_ALIVE_LOWPWR, { 0x1, 0x1, 0x0 } },
+   { S5P_CMU_RESET_GPSALIVE_LOWPWR,{ 0x1, 0x1, 0x0 } },
+   { S5P_CMU_CLKSTOP_CAM_LOWPWR,   { 0x1, 0x1, 0x0 } },
+   { S5P_CMU_CLKSTOP_TV_LOWPWR,{ 0x1, 0x1, 0x0 } },
+   { S5P_CMU_CLKSTOP_MFC_LOWPWR,   { 0x1, 0x1, 0x0 } },
+   { S5P_CMU_CLKSTOP_G3D_LOWPWR,   { 0x1, 0x1, 0x0 } },
+   { S5P_CMU_CLKSTOP_LCD0_LOWPWR,  { 0x1, 0x1, 0x0 } },
+   { S5P_CMU_CLKSTOP_LCD1_LOWPWR,  { 0x1, 0x1, 0x0 } },
+   { S5P_CMU_CLKSTOP_MAUDIO_LOWPWR,{ 0x1, 0x1, 0x0 } },
+   { S5P_CMU_CLKSTOP_GPS_LOWPWR,   { 0x1, 0x1, 0x0 } },
+   { S5P_CMU_RESET_CAM_LOWPWR, { 0x1, 0x1, 0x0 } },
+   { S5P_CMU_RESET_TV_LOWPWR,  { 0x1, 0x1, 0x0 } },
+   { S5P_CMU_RESET_MFC_LOWPWR, { 0x1, 0x1, 0x0 } },
+   { S5P_CMU_RESET_G3D_LOWPWR, { 0x1, 0x1, 0x0 } },
+   { S5P_CMU_RESET_LCD0_LOWPWR,{ 0x1, 0x1, 0x0 } },
+   { S5P_CMU_RESET_LCD1_LOWPWR,{ 0x1, 0x1, 0x0 } },
+   { S5P_CMU_RESET_MAUDIO_LOWPWR,  { 0x1, 0x1, 0x0 } },
+   { S5P_CMU_RESET_GPS_LOWPWR, { 0x1, 0x1, 0x0 } 

[PATCH v5 6/9] ARM: EXYNOS: split up exynos5250 SoC specific PMU data

2015-11-13 Thread Pankaj Dubey
This patch splits up mach-exynos/pmu.c file, and moves exynos5250,
PMU configuration data and functions handing data into exynos5250
SoC specific PMU file mach-exynos/exynos5250-pmu.c.

Signed-off-by: Pankaj Dubey 
Reviewed-by: Krzysztof Kozlowski 
---
 arch/arm/mach-exynos/Makefile |   4 +-
 arch/arm/mach-exynos/exynos-pmu.h |   1 +
 arch/arm/mach-exynos/exynos5250-pmu.c | 196 ++
 arch/arm/mach-exynos/pmu.c| 180 ---
 4 files changed, 200 insertions(+), 181 deletions(-)
 create mode 100644 arch/arm/mach-exynos/exynos5250-pmu.c

diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 8969683..bfb23a5 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -9,7 +9,9 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += 
-I$(srctree)/$(src)/include -I$(srctree)
 
 # Core
 
-obj-$(CONFIG_ARCH_EXYNOS)  += exynos.o pmu.o exynos-smc.o firmware.o 
exynos3250-pmu.o exynos4-pmu.o
+obj-$(CONFIG_ARCH_EXYNOS)  += exynos.o pmu.o exynos-smc.o firmware.o \
+   exynos3250-pmu.o exynos4-pmu.o \
+   exynos5250-pmu.o
 
 obj-$(CONFIG_EXYNOS_CPU_SUSPEND) += pm.o sleep.o
 obj-$(CONFIG_PM_SLEEP) += suspend.o
diff --git a/arch/arm/mach-exynos/exynos-pmu.h 
b/arch/arm/mach-exynos/exynos-pmu.h
index 3d21aad..85c858d 100644
--- a/arch/arm/mach-exynos/exynos-pmu.h
+++ b/arch/arm/mach-exynos/exynos-pmu.h
@@ -36,6 +36,7 @@ extern const struct exynos_pmu_data exynos3250_pmu_data;
 extern const struct exynos_pmu_data exynos4210_pmu_data;
 extern const struct exynos_pmu_data exynos4212_pmu_data;
 extern const struct exynos_pmu_data exynos4412_pmu_data;
+extern const struct exynos_pmu_data exynos5250_pmu_data;
 
 extern void pmu_raw_writel(u32 val, u32 offset);
 extern u32 pmu_raw_readl(u32 offset);
diff --git a/arch/arm/mach-exynos/exynos5250-pmu.c 
b/arch/arm/mach-exynos/exynos5250-pmu.c
new file mode 100644
index 000..a6d4188
--- /dev/null
+++ b/arch/arm/mach-exynos/exynos5250-pmu.c
@@ -0,0 +1,196 @@
+/*
+ * Copyright (c) 2011-2015 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com/
+ *
+ * EXYNOS5250 - CPU PMU (Power Management Unit) support
+ *
+ * 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 
+#include 
+
+#include "exynos-pmu.h"
+
+static const struct exynos_pmu_conf exynos5250_pmu_config[] = {
+   /* { .offset = offset, .val = { AFTR, LPA, SLEEP } */
+   { EXYNOS5_ARM_CORE0_SYS_PWR_REG,{ 0x0, 0x0, 0x2} },
+   { EXYNOS5_DIS_IRQ_ARM_CORE0_LOCAL_SYS_PWR_REG,  { 0x0, 0x0, 0x0} },
+   { EXYNOS5_DIS_IRQ_ARM_CORE0_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5_ARM_CORE1_SYS_PWR_REG,{ 0x0, 0x0, 0x2} },
+   { EXYNOS5_DIS_IRQ_ARM_CORE1_LOCAL_SYS_PWR_REG,  { 0x0, 0x0, 0x0} },
+   { EXYNOS5_DIS_IRQ_ARM_CORE1_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} },
+   { EXYNOS5_FSYS_ARM_SYS_PWR_REG, { 0x1, 0x0, 0x0} },
+   { EXYNOS5_DIS_IRQ_FSYS_ARM_CENTRAL_SYS_PWR_REG, { 0x1, 0x1, 0x1} },
+   { EXYNOS5_ISP_ARM_SYS_PWR_REG,  { 0x1, 0x0, 0x0} },
+   { EXYNOS5_DIS_IRQ_ISP_ARM_LOCAL_SYS_PWR_REG,{ 0x0, 0x0, 0x0} },
+   { EXYNOS5_DIS_IRQ_ISP_ARM_CENTRAL_SYS_PWR_REG,  { 0x0, 0x0, 0x0} },
+   { EXYNOS5_ARM_COMMON_SYS_PWR_REG,   { 0x0, 0x0, 0x2} },
+   { EXYNOS5_ARM_L2_SYS_PWR_REG,   { 0x3, 0x3, 0x3} },
+   { EXYNOS5_ARM_L2_OPTION,{ 0x10, 0x10, 0x0 } },
+   { EXYNOS5_CMU_ACLKSTOP_SYS_PWR_REG, { 0x1, 0x0, 0x1} },
+   { EXYNOS5_CMU_SCLKSTOP_SYS_PWR_REG, { 0x1, 0x0, 0x1} },
+   { EXYNOS5_CMU_RESET_SYS_PWR_REG,{ 0x1, 0x1, 0x0} },
+   { EXYNOS5_CMU_ACLKSTOP_SYSMEM_SYS_PWR_REG,  { 0x1, 0x0, 0x1} },
+   { EXYNOS5_CMU_SCLKSTOP_SYSMEM_SYS_PWR_REG,  { 0x1, 0x0, 0x1} },
+   { EXYNOS5_CMU_RESET_SYSMEM_SYS_PWR_REG, { 0x1, 0x1, 0x0} },
+   { EXYNOS5_DRAM_FREQ_DOWN_SYS_PWR_REG,   { 0x1, 0x1, 0x1} },
+   { EXYNOS5_DDRPHY_DLLOFF_SYS_PWR_REG,{ 0x1, 0x1, 0x1} },
+   { EXYNOS5_DDRPHY_DLLLOCK_SYS_PWR_REG,   { 0x1, 0x1, 0x1} },
+   { EXYNOS5_APLL_SYSCLK_SYS_PWR_REG,  { 0x1, 0x0, 0x0} },
+   { EXYNOS5_MPLL_SYSCLK_SYS_PWR_REG,  { 0x1, 0x0, 0x0} },
+   { EXYNOS5_VPLL_SYSCLK_SYS_PWR_REG,  { 0x1, 0x0, 0x0} },
+   { EXYNOS5_EPLL_SYSCLK_SYS_PWR_REG,  { 0x1, 0x1, 0x0} },
+   { EXYNOS5_BPLL_SYSCLK_SYS_PWR_REG,  { 0x1, 0x0, 0x0} },
+   { EXYNOS5_CPLL_SYSCLK_SYS_PWR_REG,  { 0x1, 0x0, 0x0} },
+   { EXYNOS5_MPLLUSER_SYSCLK_SYS_PWR_REG,  { 0x1, 0x0, 0x0} },
+  

[PATCH v5 8/9] ARM: EXYNOS: rearrange static and non-static functions of PMU driver

2015-11-13 Thread Pankaj Dubey
This patch moves exynos_sys_powerdown_conf function above all
static functions, to avoid confusion causing due to mixing of
static-nonstatic-static functions and to improve readability of this
driver.

Signed-off-by: Pankaj Dubey 
Suggested-by: Krzysztof Kozlowski 
---
 arch/arm/mach-exynos/pmu.c | 34 +-
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
index 01cb649..a7741d4 100644
--- a/arch/arm/mach-exynos/pmu.c
+++ b/arch/arm/mach-exynos/pmu.c
@@ -39,23 +39,6 @@ u32 pmu_raw_readl(u32 offset)
return readl_relaxed(pmu_base_addr + offset);
 }
 
-static void exynos_power_off(void)
-{
-   unsigned int tmp;
-
-   pr_info("Power down.\n");
-   tmp = pmu_raw_readl(EXYNOS_PS_HOLD_CONTROL);
-   tmp ^= (1 << 8);
-   pmu_raw_writel(tmp, EXYNOS_PS_HOLD_CONTROL);
-
-   /* Wait a little so we don't give a false warning below */
-   mdelay(100);
-
-   pr_err("Power down failed, please power off system manually.\n");
-   while (1)
-   ;
-}
-
 void exynos_sys_powerdown_conf(enum sys_powerdown mode)
 {
unsigned int i;
@@ -85,6 +68,23 @@ void exynos_sys_powerdown_conf(enum sys_powerdown mode)
}
 }
 
+static void exynos_power_off(void)
+{
+   unsigned int tmp;
+
+   pr_info("Power down.\n");
+   tmp = pmu_raw_readl(EXYNOS_PS_HOLD_CONTROL);
+   tmp ^= (1 << 8);
+   pmu_raw_writel(tmp, EXYNOS_PS_HOLD_CONTROL);
+
+   /* Wait a little so we don't give a false warning below */
+   mdelay(100);
+
+   pr_err("Power down failed, please power off system manually.\n");
+   while (1)
+   ;
+}
+
 static int pmu_restart_notify(struct notifier_block *this,
unsigned long code, void *unused)
 {
-- 
2.4.5

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


Re: [PATCH v5 9/9] drivers: soc: Add support for Exynos PMU driver

2015-11-13 Thread Pankaj Dubey
On 13 November 2015 at 15:58, Krzysztof Kozlowski
 wrote:
>
> On 13.11.2015 18:29, Pankaj Dubey wrote:
> > This patch moves Exynos PMU driver implementation from "arm/mach-exynos"
> > to "drivers/soc/samsung". This driver is mainly used for setting misc
> > bits of register from PMU IP of Exynos SoC which will be required to
> > configure before Suspend/Resume. Currently all these settings are done
> > in "arch/arm/mach-exynos/pmu.c" but moving ahead for ARM64 based SoC
> > support, there is a need of this PMU driver in driver/* folder.
> >
> > This driver uses existing DT binding information and there should
> > be no functionality change in the supported platforms.
> >
> > Signed-off-by: Amit Daniel Kachhap 
> > Signed-off-by: Pankaj Dubey 
> > ---
> >  arch/arm/mach-exynos/Kconfig   | 1 +
> >  arch/arm/mach-exynos/Makefile  | 4 +---
> >  drivers/soc/samsung/Kconfig| 4 
> >  drivers/soc/samsung/Makefile   | 4 
> >  arch/arm/mach-exynos/pmu.c => drivers/soc/samsung/exynos-pmu.c | 0
> >  {arch/arm/mach-exynos => drivers/soc/samsung}/exynos-pmu.h | 0
> >  {arch/arm/mach-exynos => drivers/soc/samsung}/exynos3250-pmu.c | 0
> >  {arch/arm/mach-exynos => drivers/soc/samsung}/exynos4-pmu.c| 0
> >  {arch/arm/mach-exynos => drivers/soc/samsung}/exynos5250-pmu.c | 0
> >  {arch/arm/mach-exynos => drivers/soc/samsung}/exynos5420-pmu.c | 0
> >  10 files changed, 10 insertions(+), 3 deletions(-)
> >  rename arch/arm/mach-exynos/pmu.c => drivers/soc/samsung/exynos-pmu.c 
> > (100%)
> >  rename {arch/arm/mach-exynos => drivers/soc/samsung}/exynos-pmu.h (100%)
> >  rename {arch/arm/mach-exynos => drivers/soc/samsung}/exynos3250-pmu.c 
> > (100%)
> >  rename {arch/arm/mach-exynos => drivers/soc/samsung}/exynos4-pmu.c (100%)
> >  rename {arch/arm/mach-exynos => drivers/soc/samsung}/exynos5250-pmu.c 
> > (100%)
> >  rename {arch/arm/mach-exynos => drivers/soc/samsung}/exynos5420-pmu.c 
> > (100%)
> >
> > diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
> > index 83c85f5..874cb38 100644
> > --- a/arch/arm/mach-exynos/Kconfig
> > +++ b/arch/arm/mach-exynos/Kconfig
> > @@ -16,6 +16,7 @@ menuconfig ARCH_EXYNOS
> >   select ARM_GIC
> >   select COMMON_CLK_SAMSUNG
> >   select EXYNOS_THERMAL
> > + select EXYNOS_PMU
> >   select EXYNOS_SROM if PM
> >   select HAVE_ARM_SCU if SMP
> >   select HAVE_S3C2410_I2C if I2C
> > diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
> > index 2d58063..34d29df 100644
> > --- a/arch/arm/mach-exynos/Makefile
> > +++ b/arch/arm/mach-exynos/Makefile
> > @@ -9,9 +9,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += 
> > -I$(srctree)/$(src)/include -I$(srctree)
> >
> >  # Core
> >
> > -obj-$(CONFIG_ARCH_EXYNOS)+= exynos.o pmu.o exynos-smc.o firmware.o \
> > - exynos3250-pmu.o exynos4-pmu.o \
> > - exynos5250-pmu.o exynos5420-pmu.o
> > +obj-$(CONFIG_ARCH_EXYNOS)+= exynos.o exynos-smc.o firmware.o
> >
> >  obj-$(CONFIG_EXYNOS_CPU_SUSPEND) += pm.o sleep.o
> >  obj-$(CONFIG_PM_SLEEP)   += suspend.o
> > diff --git a/drivers/soc/samsung/Kconfig b/drivers/soc/samsung/Kconfig
> > index 2833b5b..f545d6c 100644
> > --- a/drivers/soc/samsung/Kconfig
> > +++ b/drivers/soc/samsung/Kconfig
> > @@ -10,4 +10,8 @@ config EXYNOS_SROM
> >   bool
> >   depends on ARM && ARCH_EXYNOS && PM
> >
> > +config EXYNOS_PMU
> > + bool
> > + depends on ARCH_EXYNOS
> > +
> >  endmenu
> > diff --git a/drivers/soc/samsung/Makefile b/drivers/soc/samsung/Makefile
> > index 9c554d5..26fb489 100644
> > --- a/drivers/soc/samsung/Makefile
> > +++ b/drivers/soc/samsung/Makefile
> > @@ -1 +1,5 @@
> >  obj-$(CONFIG_EXYNOS_SROM)+= exynos-srom.o
> > +ifdef CONFIG_ARM
> > +obj-$(CONFIG_EXYNOS_PMU) += exynos-pmu.o exynos3250-pmu.o 
> > exynos4-pmu.o \
> > + exynos5250-pmu.o exynos5420-pmu.o
> > +endif
>
> Why ifdef CONFIG_ARM? This already depends on ARCH_EXYNOS. If you want
> to limit to ARMv7 then add the dependency to Kconfig (just like
> EXYNOS_SROM).
>

This is required, so that 32-bit based Exynos SoC's PMU should not get
compiled when we are compiling for ARM64 and vice-versa.

For example: In future, I have plan to add exynos7 PMU support as -

ifdef CONFIG_ARM64
obj-$(CONFIG_EXYNOS_PMU) += exynos-pmu.o exynos7-pmu.o
endif

Thus preventing compilation of ARM64 based SoCs PMU data files when we
are compiling for ARM.

Only exynos-pmu.c will be shared and compiled in both cases.

Thanks,
Pankaj Dubey

>
> Rest looks ok - nice renames.
>
> Best regards,
> Krzysztof
>
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More 

Re: [PATCH v8 1/4] Documentation: dt-bindings: Describe SROMc configuration

2015-11-13 Thread Rob Herring
On Thu, Nov 12, 2015 at 7:12 AM, Pavel Fedin  wrote:
> Add documentation for new subnode properties, allowing bank configuration.
> Based on u-boot implementation, but heavily reworked.
>
> Also, fix size of SROMc mapping in the example.
>
> Signed-off-by: Pavel Fedin 
> Reviewed-by: Krzysztof Kozlowski 

Acked-by: Rob Herring 

One nit below.

> compatible = "samsung,exynos-srom";
> -   reg = <0x1257 0x10>;
> +   reg = <0x1257 0x14>;
> +
> +   ethernet@3 {

This should actually be "ethernet@3,0"

Fields (not cells) in the unit address should be separated by commas.

> +   compatible = "smsc,lan9115";
> +   reg = <3 0 0x1>;   // Bank 3, offset = 0
> +   phy-mode = "mii";
> +   interrupt-parent = <>;
> +   interrupts = <5 8>;
> +   reg-io-width = <2>;
> +   smsc,irq-push-pull;
> +   smsc,force-internal-phy;
> +
> +   samsung,srom-page-mode = <1>;
> +   samsung,srom-timing = <9 12 1 9 1 1>;
> +   };
> };
> --
> 2.4.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 3/3] ASoC: samsung: pass filter function as pointer

2015-11-13 Thread Arnd Bergmann
As we are now passing the filter data as pointers to the drivers,
we can take the final step and also pass the filter function the
same way. I'm keeping this change separate, as there it's less
obvious that this is a net win.

Upsides of this are:

- The ASoC drivers are completely independent from the DMA engine
  implementation, which simplifies the Kconfig logic and in theory
  allows the same sound drivers to be built in a kernel that supports
  different kinds of dmaengine drivers.

- Consistency with other subsystems and drivers

On the other hand, we have a few downsides:

- The s3c24xx-dma driver now needs to be built-in for the ac97 platform
  device to be instantiated on s3c2440.

- samsung_dmaengine_pcm_config cannot be marked 'const' any more
  because the filter function pointer needs to be set at runtime.
  This is safe as long we don't have multiple different DMA engines
  in thet same system at runtime, but is nonetheless ugly.

Signed-off-by: Arnd Bergmann 

diff --git a/arch/arm/mach-s3c64xx/dev-audio.c 
b/arch/arm/mach-s3c64xx/dev-audio.c
index 9a42736ef4ac..b57783371d52 100644
--- a/arch/arm/mach-s3c64xx/dev-audio.c
+++ b/arch/arm/mach-s3c64xx/dev-audio.c
@@ -58,6 +58,7 @@ static struct resource s3c64xx_iis0_resource[] = {
 
 static struct s3c_audio_pdata i2s0_pdata = {
.cfg_gpio = s3c64xx_i2s_cfg_gpio,
+   .dma_filter = pl08x_filter_id,
.dma_playback = DMACH_I2S0_OUT,
.dma_capture = DMACH_I2S0_IN,
 };
@@ -79,6 +80,7 @@ static struct resource s3c64xx_iis1_resource[] = {
 
 static struct s3c_audio_pdata i2s1_pdata = {
.cfg_gpio = s3c64xx_i2s_cfg_gpio,
+   .dma_filter = pl08x_filter_id,
.dma_playback = DMACH_I2S1_OUT,
.dma_capture = DMACH_I2S1_IN,
 };
@@ -100,6 +102,7 @@ static struct resource s3c64xx_iisv4_resource[] = {
 
 static struct s3c_audio_pdata i2sv4_pdata = {
.cfg_gpio = s3c64xx_i2s_cfg_gpio,
+   .dma_filter = pl08x_filter_id,
.dma_playback = DMACH_HSI_I2SV40_TX,
.dma_capture = DMACH_HSI_I2SV40_RX,
.type = {
@@ -150,6 +153,7 @@ static struct resource s3c64xx_pcm0_resource[] = {
 
 static struct s3c_audio_pdata s3c_pcm0_pdata = {
.cfg_gpio = s3c64xx_pcm_cfg_gpio,
+   .dma_filter = pl08x_filter_id,
.dma_capture = DMACH_PCM0_RX,
.dma_playback = DMACH_PCM0_TX,
 };
@@ -171,6 +175,7 @@ static struct resource s3c64xx_pcm1_resource[] = {
 
 static struct s3c_audio_pdata s3c_pcm1_pdata = {
.cfg_gpio = s3c64xx_pcm_cfg_gpio,
+   .dma_filter = pl08x_filter_id,
.dma_playback = DMACH_PCM1_TX,
.dma_capture = DMACH_PCM1_RX,
 };
@@ -205,6 +210,7 @@ static struct resource s3c64xx_ac97_resource[] = {
 
 static struct s3c_audio_pdata s3c_ac97_pdata = {
.dma_playback = DMACH_AC97_PCMOUT,
+   .dma_filter = pl08x_filter_id,
.dma_capture = DMACH_AC97_PCMIN,
.dma_capture_mic = DMACH_AC97_MICIN,
 };
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index e5e91669dd2b..314131a4525d 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -78,6 +78,9 @@ static struct resource s3c_ac97_resource[] = {
 };
 
 static struct s3c_audio_pdata s3c_ac97_pdata = {
+#ifdef CONFIG_S3C24XX_DMAC
+   .dma_filter = s3c24xx_dma_filter,
+#endif
.dma_playback = (void *)DMACH_PCM_OUT,
.dma_capture = (void *)DMACH_PCM_IN,
.dma_capture_mic = (void *)DMACH_MIC_IN,
@@ -572,6 +575,9 @@ static struct resource s3c_iis_resource[] = {
 };
 
 static struct s3c_audio_pdata s3c_iis_platdata = {
+#ifdef CONFIG_S3C24XX_DMAC
+   .dma_filter = s3c24xx_dma_filter,
+#endif
.dma_playback = (void *)DMACH_I2S_OUT,
.dma_capture = (void *)DMACH_I2S_IN,
 };
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index b93b75bf0a2d..e5ee0ce41054 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -431,7 +431,7 @@ config STE_DMA40
  Support for ST-Ericsson DMA40 controller
 
 config S3C24XX_DMAC
-   tristate "Samsung S3C24XX DMA support"
+   bool "Samsung S3C24XX DMA support"
depends on ARCH_S3C24XX
select DMA_ENGINE
select DMA_VIRTUAL_CHANNELS
diff --git a/include/linux/platform_data/asoc-s3c.h 
b/include/linux/platform_data/asoc-s3c.h
index 33f88b4479e4..15bf56ee8af7 100644
--- a/include/linux/platform_data/asoc-s3c.h
+++ b/include/linux/platform_data/asoc-s3c.h
@@ -13,6 +13,9 @@
  */
 #define S3C64XX_AC97_GPD  0
 #define S3C64XX_AC97_GPE  1
+
+#include 
+
 extern void s3c64xx_ac97_setup_gpio(int);
 
 struct samsung_i2s {
@@ -39,6 +42,7 @@ struct samsung_i2s {
  */
 struct s3c_audio_pdata {
int (*cfg_gpio)(struct platform_device *);
+   dma_filter_fn dma_filter;
void *dma_playback;
void *dma_capture;
void *dma_play_sec;
diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig
index 3744c9ed5370..78baa26e938b 100644
--- a/sound/soc/samsung/Kconfig
+++ 

[PATCH 2/3] ASoC: s3c24xx-i2s: pass DMA channels as platform data

2015-11-13 Thread Arnd Bergmann
This is a minor cleanup to make the s3c2412-i2s and s3c24xx-i2s
drivers independent of the mach/dma.h header file and to allow
removing the dependency on the specific dmaengine driver in the
next patch.

As a side not, only the s3c24xx-i2s driver seems to still be
used, while the definition of the s3c2412-i2s platform device was
removed in commit 6d259a25b56d ("ARM: SAMSUNG: use static
declaration when it is not used in other files") after it had
never been referenced since its introduction in f0fba2ad1b6b
("ASoC: multi-component - ASoC Multi-Component Support").

Apparently it should have been used by mach-jive.c, but that
never happened. My patch at this point leaves the current state
unchanged, we can decide whether to fix or delete the jive
driver and s3c2412-i2s another time.

Signed-off-by: Arnd Bergmann 

diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index 3ce234f4c872..e5e91669dd2b 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -571,6 +571,11 @@ static struct resource s3c_iis_resource[] = {
[0] = DEFINE_RES_MEM(S3C24XX_PA_IIS, S3C24XX_SZ_IIS),
 };
 
+static struct s3c_audio_pdata s3c_iis_platdata = {
+   .dma_playback = (void *)DMACH_I2S_OUT,
+   .dma_capture = (void *)DMACH_I2S_IN,
+};
+
 struct platform_device s3c_device_iis = {
.name   = "s3c24xx-iis",
.id = -1,
@@ -579,6 +584,7 @@ struct platform_device s3c_device_iis = {
.dev= {
.dma_mask   = _device_dma_mask,
.coherent_dma_mask  = DMA_BIT_MASK(32),
+   .platform_data  = _iis_platdata,
}
 };
 #endif /* CONFIG_PLAT_S3C24XX */
diff --git a/sound/soc/samsung/s3c2412-i2s.c b/sound/soc/samsung/s3c2412-i2s.c
index 77d27c85a32a..455a0be2278e 100644
--- a/sound/soc/samsung/s3c2412-i2s.c
+++ b/sound/soc/samsung/s3c2412-i2s.c
@@ -33,14 +33,14 @@
 #include "regs-i2s-v2.h"
 #include "s3c2412-i2s.h"
 
+#include 
+
 static struct s3c_dma_params s3c2412_i2s_pcm_stereo_out = {
-   .slave  = (void *)(uintptr_t)DMACH_I2S_OUT,
.ch_name= "tx",
.dma_size   = 4,
 };
 
 static struct s3c_dma_params s3c2412_i2s_pcm_stereo_in = {
-   .slave  = (void *)(uintptr_t)DMACH_I2S_IN,
.ch_name= "rx",
.dma_size   = 4,
 };
@@ -152,6 +152,7 @@ static int s3c2412_iis_dev_probe(struct platform_device 
*pdev)
 {
int ret = 0;
struct resource *res;
+   struct s3c_audio_pdata *pdata = dev_get_platdata(>dev);
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
s3c2412_i2s.regs = devm_ioremap_resource(>dev, res);
@@ -159,7 +160,9 @@ static int s3c2412_iis_dev_probe(struct platform_device 
*pdev)
return PTR_ERR(s3c2412_i2s.regs);
 
s3c2412_i2s_pcm_stereo_out.dma_addr = res->start + S3C2412_IISTXD;
+   s3c2412_i2s_pcm_stereo_out.slave = pdata->dma_playback;
s3c2412_i2s_pcm_stereo_in.dma_addr = res->start + S3C2412_IISRXD;
+   s3c2412_i2s_pcm_stereo_in.slave = pdata->dma_capture;
 
ret = s3c_i2sv2_register_component(>dev, -1,
   _i2s_component,
diff --git a/sound/soc/samsung/s3c24xx-i2s.c b/sound/soc/samsung/s3c24xx-i2s.c
index 9da3a77ea2c7..807dcc0d7421 100644
--- a/sound/soc/samsung/s3c24xx-i2s.c
+++ b/sound/soc/samsung/s3c24xx-i2s.c
@@ -31,14 +31,14 @@
 #include "dma.h"
 #include "s3c24xx-i2s.h"
 
+#include 
+
 static struct s3c_dma_params s3c24xx_i2s_pcm_stereo_out = {
-   .slave  = (void *)(uintptr_t)DMACH_I2S_OUT,
.ch_name= "tx",
.dma_size   = 2,
 };
 
 static struct s3c_dma_params s3c24xx_i2s_pcm_stereo_in = {
-   .slave  = (void *)(uintptr_t)DMACH_I2S_IN,
.ch_name= "rx",
.dma_size   = 2,
 };
@@ -454,6 +454,7 @@ static int s3c24xx_iis_dev_probe(struct platform_device 
*pdev)
 {
int ret = 0;
struct resource *res;
+   struct s3c_audio_pdata *pdata = dev_get_platdata(>dev);
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
@@ -465,7 +466,9 @@ static int s3c24xx_iis_dev_probe(struct platform_device 
*pdev)
return PTR_ERR(s3c24xx_i2s.regs);
 
s3c24xx_i2s_pcm_stereo_out.dma_addr = res->start + S3C2410_IISFIFO;
+   s3c24xx_i2s_pcm_stereo_out.slave = pdata->dma_playback;
s3c24xx_i2s_pcm_stereo_in.dma_addr = res->start + S3C2410_IISFIFO;
+   s3c24xx_i2s_pcm_stereo_in.slave = pdata->dma_capture;
 
ret = devm_snd_soc_register_component(>dev,
_i2s_component, _i2s_dai, 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 1/3] ASoC: samsung: pass DMA channels as pointers

2015-11-13 Thread Arnd Bergmann
ARM64 allmodconfig produces a bunch of warnings when building the
samsung ASoC code:

sound/soc/samsung/dmaengine.c: In function 'samsung_asoc_init_dma_data':
sound/soc/samsung/dmaengine.c:53:32: warning: cast to pointer from integer of 
different size [-Wint-to-pointer-cast]
   playback_data->filter_data = (void *)playback->channel;
sound/soc/samsung/dmaengine.c:60:31: warning: cast to pointer from integer of 
different size [-Wint-to-pointer-cast]
   capture_data->filter_data = (void *)capture->channel;

We could easily shut up the warning by adding an intermediate cast,
but there is a bigger underlying problem: The use of IORESOURCE_DMA
to pass data from platform code to device drivers is dubious to start
with, as what we really want is a pointer that can be passed into
a filter function.

Note that on s3c64xx, the pl08x DMA data is already a pointer, but
gets cast to resource_size_t so we can pass it as a resource, and it
then gets converted back to a pointer. In contrast, the data we pass
for s3c24xx is an index into a device specific table, and we artificially
convert that into a pointer for the filter function.

Signed-off-by: Arnd Bergmann 

diff --git a/arch/arm/mach-s3c64xx/dev-audio.c 
b/arch/arm/mach-s3c64xx/dev-audio.c
index ff780a8d8366..9a42736ef4ac 100644
--- a/arch/arm/mach-s3c64xx/dev-audio.c
+++ b/arch/arm/mach-s3c64xx/dev-audio.c
@@ -54,12 +54,12 @@ static int s3c64xx_i2s_cfg_gpio(struct platform_device 
*pdev)
 
 static struct resource s3c64xx_iis0_resource[] = {
[0] = DEFINE_RES_MEM(S3C64XX_PA_IIS0, SZ_256),
-   [1] = DEFINE_RES_DMA(DMACH_I2S0_OUT),
-   [2] = DEFINE_RES_DMA(DMACH_I2S0_IN),
 };
 
-static struct s3c_audio_pdata i2sv3_pdata = {
+static struct s3c_audio_pdata i2s0_pdata = {
.cfg_gpio = s3c64xx_i2s_cfg_gpio,
+   .dma_playback = DMACH_I2S0_OUT,
+   .dma_capture = DMACH_I2S0_IN,
 };
 
 struct platform_device s3c64xx_device_iis0 = {
@@ -68,15 +68,19 @@ struct platform_device s3c64xx_device_iis0 = {
.num_resources= ARRAY_SIZE(s3c64xx_iis0_resource),
.resource = s3c64xx_iis0_resource,
.dev = {
-   .platform_data = _pdata,
+   .platform_data = _pdata,
},
 };
 EXPORT_SYMBOL(s3c64xx_device_iis0);
 
 static struct resource s3c64xx_iis1_resource[] = {
[0] = DEFINE_RES_MEM(S3C64XX_PA_IIS1, SZ_256),
-   [1] = DEFINE_RES_DMA(DMACH_I2S1_OUT),
-   [2] = DEFINE_RES_DMA(DMACH_I2S1_IN),
+};
+
+static struct s3c_audio_pdata i2s1_pdata = {
+   .cfg_gpio = s3c64xx_i2s_cfg_gpio,
+   .dma_playback = DMACH_I2S1_OUT,
+   .dma_capture = DMACH_I2S1_IN,
 };
 
 struct platform_device s3c64xx_device_iis1 = {
@@ -85,19 +89,19 @@ struct platform_device s3c64xx_device_iis1 = {
.num_resources= ARRAY_SIZE(s3c64xx_iis1_resource),
.resource = s3c64xx_iis1_resource,
.dev = {
-   .platform_data = _pdata,
+   .platform_data = _pdata,
},
 };
 EXPORT_SYMBOL(s3c64xx_device_iis1);
 
 static struct resource s3c64xx_iisv4_resource[] = {
[0] = DEFINE_RES_MEM(S3C64XX_PA_IISV4, SZ_256),
-   [1] = DEFINE_RES_DMA(DMACH_HSI_I2SV40_TX),
-   [2] = DEFINE_RES_DMA(DMACH_HSI_I2SV40_RX),
 };
 
 static struct s3c_audio_pdata i2sv4_pdata = {
.cfg_gpio = s3c64xx_i2s_cfg_gpio,
+   .dma_playback = DMACH_HSI_I2SV40_TX,
+   .dma_capture = DMACH_HSI_I2SV40_RX,
.type = {
.i2s = {
.quirks = QUIRK_PRI_6CHAN,
@@ -142,12 +146,12 @@ static int s3c64xx_pcm_cfg_gpio(struct platform_device 
*pdev)
 
 static struct resource s3c64xx_pcm0_resource[] = {
[0] = DEFINE_RES_MEM(S3C64XX_PA_PCM0, SZ_256),
-   [1] = DEFINE_RES_DMA(DMACH_PCM0_TX),
-   [2] = DEFINE_RES_DMA(DMACH_PCM0_RX),
 };
 
 static struct s3c_audio_pdata s3c_pcm0_pdata = {
.cfg_gpio = s3c64xx_pcm_cfg_gpio,
+   .dma_capture = DMACH_PCM0_RX,
+   .dma_playback = DMACH_PCM0_TX,
 };
 
 struct platform_device s3c64xx_device_pcm0 = {
@@ -163,12 +167,12 @@ EXPORT_SYMBOL(s3c64xx_device_pcm0);
 
 static struct resource s3c64xx_pcm1_resource[] = {
[0] = DEFINE_RES_MEM(S3C64XX_PA_PCM1, SZ_256),
-   [1] = DEFINE_RES_DMA(DMACH_PCM1_TX),
-   [2] = DEFINE_RES_DMA(DMACH_PCM1_RX),
 };
 
 static struct s3c_audio_pdata s3c_pcm1_pdata = {
.cfg_gpio = s3c64xx_pcm_cfg_gpio,
+   .dma_playback = DMACH_PCM1_TX,
+   .dma_capture = DMACH_PCM1_RX,
 };
 
 struct platform_device s3c64xx_device_pcm1 = {
@@ -196,13 +200,14 @@ static int s3c64xx_ac97_cfg_gpe(struct platform_device 
*pdev)
 
 static struct resource s3c64xx_ac97_resource[] = {
[0] = DEFINE_RES_MEM(S3C64XX_PA_AC97, SZ_256),
-   [1] = DEFINE_RES_DMA(DMACH_AC97_PCMOUT),
-   [2] = DEFINE_RES_DMA(DMACH_AC97_PCMIN),
-   [3] = DEFINE_RES_DMA(DMACH_AC97_MICIN),
-   [4] = DEFINE_RES_IRQ(IRQ_AC97),
+   [1] = DEFINE_RES_IRQ(IRQ_AC97),
 };
 
-static struct s3c_audio_pdata s3c_ac97_pdata;

Re: [PATCH] drm/atomic: only run atomic_check() if crtc is active

2015-11-13 Thread Gustavo Padovan
Hi Ville,

2015-11-13 Ville Syrjälä :

> On Fri, Nov 13, 2015 at 11:45:58AM -0200, Gustavo Padovan wrote:
> > From: Gustavo Padovan 
> > 
> > Fixes an regression added by 3ae2436 (drm/exynos/mixer: replace
> > direct cross-driver call with drm mode) and while this regression was
> > caused by a change in the exynos driver it makes sense to add the
> > check on atomic core to benefit other drivers as well.
> > 
> > The whole atomic update fails if the exynos hdmi display is not
> > present/active.  Add a test to only run atomic_check() if the CRTC is
> > active.
> 
> The check must be performed even when the crtc is not active.
> 
> Especially important for the (enabled && !active) case (ie. DPMS off)
> since "DPMS on" must not fail, so any state change while in DPMS off
> must be checked as if the crtc was active.
> 
> But even for the !enabled case we want to do the check so that
> everything gets properly recomputed when fully disabling a crtc.

You are right. I'll fix this locally in exynos for now.

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


Re: [PATCH 2/2] [media] include/media: move platform driver headers to a separate dir

2015-11-13 Thread Mauro Carvalho Chehab
Em Wed, 11 Nov 2015 21:26:31 +0100
Arnd Bergmann  escreveu:

> On Wednesday 11 November 2015 15:14:48 Mauro Carvalho Chehab wrote:
> >  rename include/media/{ => platform}/exynos-fimc.h (100%)
> >  rename include/media/{ => platform}/mmp-camera.h (100%)
> >  rename include/media/{ => platform}/omap1_camera.h (100%)
> >  rename include/media/{ => platform}/omap4iss.h (100%)
> >  rename include/media/{ => platform}/s3c_camif.h (100%)
> >  rename include/media/{ => platform}/s5p_hdmi.h (100%)
> >  rename include/media/{ => platform}/sh_mobile_ceu.h (100%)
> >  rename include/media/{ => platform}/sh_mobile_csi2.h (100%)
> >  rename include/media/{ => platform}/sh_vou.h (100%)
> >  rename include/media/{ => platform}/sii9234.h (100%)
> >  rename include/media/{ => platform}/soc_camera.h (100%)
> >  rename include/media/{ => platform}/soc_camera_platform.h (98%)
> >  rename include/media/{ => platform}/soc_mediabus.h (100%)
> 
> This still seems to be a mix of various things. Some of these are interfaces
> between drivers, while others declare a foo_platform_data structure that
> is used to interface between platform code and the driver.

True. What about calling putting those driver interfaces under
include/media/drv-intf? That also helps moving the headers for other
non-platform drivers too.

> 
> I think the latter should go into include/linux/platform_data/media/*.h 
> instead.

Agreed.

Please see the enclosed patch:


Subject: [PATCH] [media] include/media: move platform driver headers to a
 separate dirs

Let's not mix headers used by the core with those headers that
are needed by some specific platform drivers or by platform data.

This patch was made via this script:
mkdir include/media/platform mkdir include/media/platform_data
(cd include/media/; git mv $(grep -l platform_data *.h|grep -v v4l2) 
platform_data/)
for i in include/media/*.h; do n=`basename $i`;  (for j in $(git grep 
-l $n); do dirname $j; done)|sort|uniq|grep -ve '^.$' > list; num=$(wc -l 
list|cut -d' ' -f1); if [ $num == 1 ]; then if [ "`grep platform list`" != "" 
]; then git mv $i include/media/drv-intf; fi; fi; done
git mv include/media/exynos* include/media/soc_* include/media/sh_* 
include/media/drv-intf/

And some headers were manually adjusted. Then, this script fixed the
address for those new headers:

for i in $(find include/media/ -type f); do n=`basename $i`; git grep 
-l $n; done|sort|uniq >files && (echo "for i in \$(cat files); do cat \$i | 
\\"; cd include/media; for j in platform/ platform_data/; do for i in $(ls $j); 
do echo "perl -ne 's,(include [\\\"\\<]media/)($i)([\\\"\\>]),\1$j\2\3,; print 
\$_' |\\"; done; done; echo "cat > a && mv a \$i; done") >script&& . ./script

Signed-off-by: Mauro Carvalho Chehab 

---

 arch/arm/mach-imx/mach-imx27_visstrim_m10.c  | 2 +-
 arch/arm/mach-imx/mach-mx27_3ds.c| 2 +-
 arch/arm/mach-imx/mach-mx31_3ds.c| 2 +-
 arch/arm/mach-imx/mach-mx35_3ds.c| 2 +-
 arch/arm/mach-imx/mach-pcm037.c  | 2 +-
 arch/arm/mach-imx/mx31moboard-marxbot.c  | 2 +-
 arch/arm/mach-imx/mx31moboard-smartbot.c | 2 +-
 arch/arm/mach-omap1/board-ams-delta.c| 2 +-
 arch/arm/mach-omap1/include/mach/camera.h| 2 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c | 4 ++--
 arch/arm/mach-pxa/em-x270.c  | 2 +-
 arch/arm/mach-pxa/ezx.c  | 2 +-
 arch/arm/mach-pxa/mioa701.c  | 2 +-
 arch/arm/mach-pxa/palmz72.c  | 2 +-
 arch/arm/mach-pxa/pcm990-baseboard.c | 2 +-
 arch/arm/mach-shmobile/board-bockw.c | 2 +-
 arch/arm/plat-samsung/devs.c | 2 +-
 arch/sh/boards/mach-ap325rxa/setup.c | 6 +++---
 arch/sh/boards/mach-ecovec24/setup.c | 6 +++---
 arch/sh/boards/mach-kfr2r09/setup.c  | 4 ++--
 arch/sh/boards/mach-migor/setup.c| 4 ++--
 arch/sh/boards/mach-se/7724/setup.c  | 4 ++--
 drivers/media/common/cx2341x.c   | 2 +-
 drivers/media/common/saa7146/saa7146_core.c  | 2 +-
 drivers/media/common/saa7146/saa7146_fops.c  | 2 +-
 drivers/media/common/saa7146/saa7146_hlp.c   | 2 +-
 drivers/media/common/saa7146/saa7146_i2c.c   | 2 +-
 drivers/media/common/saa7146/saa7146_vbi.c   | 2 +-
 drivers/media/common/saa7146/saa7146_video.c | 2 +-
 drivers/media/i2c/cx25840/cx25840-audio.c| 2 +-
 drivers/media/i2c/cx25840/cx25840-core.c | 2 +-
 drivers/media/i2c/cx25840/cx25840-firmware.c | 2 +-
 drivers/media/i2c/cx25840/cx25840-ir.c   | 2 +-
 

Re: [PATCH 2/2] [media] include/media: move platform driver headers to a separate dir

2015-11-13 Thread Mauro Carvalho Chehab
Em Fri, 13 Nov 2015 22:31:15 +0100
Arnd Bergmann  escreveu:

> On Friday 13 November 2015 17:13:41 Mauro Carvalho Chehab wrote:
> > Em Wed, 11 Nov 2015 21:26:31 +0100
> > Arnd Bergmann  escreveu:
> > 
> 
> >  include/media/{ => drv-intf}/cx2341x.h   | 0
> >  include/media/{ => drv-intf}/cx25840.h   | 0
> >  include/media/{ => drv-intf}/exynos-fimc.h   | 0
> >  include/media/{ => drv-intf}/msp3400.h   | 0
> >  include/media/{ => drv-intf}/s3c_camif.h | 0
> >  include/media/{ => drv-intf}/saa7146.h   | 0
> >  include/media/{ => drv-intf}/saa7146_vv.h| 2 +-
> >  include/media/{ => drv-intf}/sh_mobile_ceu.h | 0
> >  include/media/{ => drv-intf}/sh_mobile_csi2.h| 0
> >  include/media/{ => drv-intf}/sh_vou.h| 0
> >  include/media/{ => drv-intf}/si476x.h| 0
> >  include/media/{ => drv-intf}/soc_mediabus.h  | 0
> >  include/media/{ => drv-intf}/tea575x.h   | 0
> >  include/media/i2c/tw9910.h   | 2 +-
> >  include/media/{ => platform_data}/gpio-ir-recv.h | 0
> >  include/media/{ => platform_data}/ir-rx51.h  | 0
> >  include/media/{ => platform_data}/mmp-camera.h   | 0
> >  include/media/{ => platform_data}/omap1_camera.h | 0
> >  include/media/{ => platform_data}/omap4iss.h | 0
> >  include/media/{ => platform_data}/s5p_hdmi.h | 0
> >  include/media/{ => platform_data}/si4713.h   | 0
> >  include/media/{ => platform_data}/sii9234.h  | 0
> >  include/media/{ => platform_data}/smiapp.h   | 0
> >  include/media/{ => platform_data}/soc_camera.h   | 0
> >  include/media/{ => platform_data}/soc_camera_platform.h  | 2 +-
> >  include/media/{ => platform_data}/timb_radio.h   | 0
> >  include/media/{ => platform_data}/timb_video.h   | 0
> >  sound/pci/es1968.c   | 2 +-
> >  sound/pci/fm801.c| 2 +-
> >  155 files changed, 158 insertions(+), 158 deletions(-)
> 
> As Geert said, include/linux/platform_data/media/ would be nicer for
> consistency with other subsystems.

OK! I have a new series of patches almost ready. I'll be sending it
tomorrow, after addressing your concerns.

> 
> > diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c 
> > b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
> > index ede2bdbb5dd5..44ba1f28bb34 100644
> > --- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
> > +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
> > @@ -33,7 +33,7 @@
> >  #include 
> >  #include 
> >  #include 
> > -#include 
> > +#include 
> >  #include 
> >  #include 
> >  #include 
> 
> This looks like a mistake: the header contains the string 'platform_data',
> but it is not actually a platform data header file in the sense
> that it defines the interface between platform and driver.
> 
> Maybe soc_camera.h is important enough to still leave it as a core
> file in the existing location? Or possibly a separate directory for
> media/soc_camera/*.h

Ok, I'll fix it. 

> 
> > @@ -24,7 +24,7 @@
> >  #include 
> >  #include 
> >  #include 
> > -#include 
> > +#include 
> >  #include 
> >  
> >  #include "cx25840-core.h"
> 
> For this case, I think the original patch to move it into include/media/i2c
> was more logical as it mirrors the file structure. I was mainly talking
> about the platform_data being different from the rest.

cx25840 is not (always) an I2C. On most devices, this is actually an IP
block inside the bridge chipset. 

That's why I didn't include it on patch 1/1. There's one thing to
notice about that, though: while most of the header is describing
the driver interface, it does contain one platform_data in the end:

/* pvr150_workaround activates a workaround for a hardware bug that is
   present in Hauppauge PVR-150 (and possibly PVR-500) cards that have
   certain NTSC tuners (tveeprom tuner model numbers 85, 99 and 112). The
   audio autodetect fails on some channels for these models and the workaround
   is to select the audio standard explicitly. Many thanks to Hauppauge for
   providing this information.
   This platform data only needs to be supplied by the ivtv driver. */
struct cx25840_platform_data {
int pvr150_workaround;
};

While we might split it, I guess it is not worth, specially since
I don't think we'll see any new driver using it.

Also, this is actually a hack used only by the ivtv driver.

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


Re: [PATCH 2/2] [media] include/media: move platform driver headers to a separate dir

2015-11-13 Thread Arnd Bergmann
On Friday 13 November 2015 17:13:41 Mauro Carvalho Chehab wrote:
> Em Wed, 11 Nov 2015 21:26:31 +0100
> Arnd Bergmann  escreveu:
> 

>  include/media/{ => drv-intf}/cx2341x.h   | 0
>  include/media/{ => drv-intf}/cx25840.h   | 0
>  include/media/{ => drv-intf}/exynos-fimc.h   | 0
>  include/media/{ => drv-intf}/msp3400.h   | 0
>  include/media/{ => drv-intf}/s3c_camif.h | 0
>  include/media/{ => drv-intf}/saa7146.h   | 0
>  include/media/{ => drv-intf}/saa7146_vv.h| 2 +-
>  include/media/{ => drv-intf}/sh_mobile_ceu.h | 0
>  include/media/{ => drv-intf}/sh_mobile_csi2.h| 0
>  include/media/{ => drv-intf}/sh_vou.h| 0
>  include/media/{ => drv-intf}/si476x.h| 0
>  include/media/{ => drv-intf}/soc_mediabus.h  | 0
>  include/media/{ => drv-intf}/tea575x.h   | 0
>  include/media/i2c/tw9910.h   | 2 +-
>  include/media/{ => platform_data}/gpio-ir-recv.h | 0
>  include/media/{ => platform_data}/ir-rx51.h  | 0
>  include/media/{ => platform_data}/mmp-camera.h   | 0
>  include/media/{ => platform_data}/omap1_camera.h | 0
>  include/media/{ => platform_data}/omap4iss.h | 0
>  include/media/{ => platform_data}/s5p_hdmi.h | 0
>  include/media/{ => platform_data}/si4713.h   | 0
>  include/media/{ => platform_data}/sii9234.h  | 0
>  include/media/{ => platform_data}/smiapp.h   | 0
>  include/media/{ => platform_data}/soc_camera.h   | 0
>  include/media/{ => platform_data}/soc_camera_platform.h  | 2 +-
>  include/media/{ => platform_data}/timb_radio.h   | 0
>  include/media/{ => platform_data}/timb_video.h   | 0
>  sound/pci/es1968.c   | 2 +-
>  sound/pci/fm801.c| 2 +-
>  155 files changed, 158 insertions(+), 158 deletions(-)

As Geert said, include/linux/platform_data/media/ would be nicer for
consistency with other subsystems.

> diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c 
> b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
> index ede2bdbb5dd5..44ba1f28bb34 100644
> --- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
> +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
> @@ -33,7 +33,7 @@
>  #include 
>  #include 
>  #include 
> -#include 
> +#include 
>  #include 
>  #include 
>  #include 

This looks like a mistake: the header contains the string 'platform_data',
but it is not actually a platform data header file in the sense
that it defines the interface between platform and driver.

Maybe soc_camera.h is important enough to still leave it as a core
file in the existing location? Or possibly a separate directory for
media/soc_camera/*.h

> @@ -24,7 +24,7 @@
>  #include 
>  #include 
>  #include 
> -#include 
> +#include 
>  #include 
>  
>  #include "cx25840-core.h"

For this case, I think the original patch to move it into include/media/i2c
was more logical as it mirrors the file structure. I was mainly talking
about the platform_data being different from the rest.

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


Re: [PATCH 2/2] [media] include/media: move platform driver headers to a separate dir

2015-11-13 Thread Geert Uytterhoeven
On Fri, Nov 13, 2015 at 8:13 PM, Mauro Carvalho Chehab
 wrote:
>> I think the latter should go into include/linux/platform_data/media/*.h 
>> instead.
>
> Agreed.
>
> Please see the enclosed patch:
>
>
> Subject: [PATCH] [media] include/media: move platform driver headers to a
>  separate dirs
>
> Let's not mix headers used by the core with those headers that
> are needed by some specific platform drivers or by platform data.
>
> This patch was made via this script:
> mkdir include/media/platform mkdir include/media/platform_data
> (cd include/media/; git mv $(grep -l platform_data *.h|grep -v v4l2)

I think include/linux/platform_data/media/, like Arnd suggested,
would be better.

Then we can make it a common goal to empty include/linux/platform_data/ ;-)

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
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 v5 7/9] ARM: EXYNOS: split up exynos5420 SoC specific PMU data

2015-11-13 Thread Krzysztof Kozlowski
On 13.11.2015 18:29, Pankaj Dubey wrote:
> This patch splits up mach-exynos/pmu.c file, and moves exynos5420,
> PMU configuration data and functions handing data into exynos5420
> SoC specific PMU file mach-exynos/exynos5420-pmu.c.
> 
> Signed-off-by: Pankaj Dubey 
> ---
>  arch/arm/mach-exynos/Makefile |   2 +-
>  arch/arm/mach-exynos/exynos-pmu.h |   1 +
>  arch/arm/mach-exynos/exynos5420-pmu.c | 280 
> ++
>  arch/arm/mach-exynos/pmu.c| 263 ---
>  4 files changed, 282 insertions(+), 264 deletions(-)
>  create mode 100644 arch/arm/mach-exynos/exynos5420-pmu.c
> 

Reviewed-by: Krzysztof Kozlowski 

Best regards,
Krzysztof

--
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 v5 9/9] drivers: soc: Add support for Exynos PMU driver

2015-11-13 Thread Krzysztof Kozlowski
On 13.11.2015 18:29, Pankaj Dubey wrote:
> This patch moves Exynos PMU driver implementation from "arm/mach-exynos"
> to "drivers/soc/samsung". This driver is mainly used for setting misc
> bits of register from PMU IP of Exynos SoC which will be required to
> configure before Suspend/Resume. Currently all these settings are done
> in "arch/arm/mach-exynos/pmu.c" but moving ahead for ARM64 based SoC
> support, there is a need of this PMU driver in driver/* folder.
> 
> This driver uses existing DT binding information and there should
> be no functionality change in the supported platforms.
> 
> Signed-off-by: Amit Daniel Kachhap 
> Signed-off-by: Pankaj Dubey 
> ---
>  arch/arm/mach-exynos/Kconfig   | 1 +
>  arch/arm/mach-exynos/Makefile  | 4 +---
>  drivers/soc/samsung/Kconfig| 4 
>  drivers/soc/samsung/Makefile   | 4 
>  arch/arm/mach-exynos/pmu.c => drivers/soc/samsung/exynos-pmu.c | 0
>  {arch/arm/mach-exynos => drivers/soc/samsung}/exynos-pmu.h | 0
>  {arch/arm/mach-exynos => drivers/soc/samsung}/exynos3250-pmu.c | 0
>  {arch/arm/mach-exynos => drivers/soc/samsung}/exynos4-pmu.c| 0
>  {arch/arm/mach-exynos => drivers/soc/samsung}/exynos5250-pmu.c | 0
>  {arch/arm/mach-exynos => drivers/soc/samsung}/exynos5420-pmu.c | 0
>  10 files changed, 10 insertions(+), 3 deletions(-)
>  rename arch/arm/mach-exynos/pmu.c => drivers/soc/samsung/exynos-pmu.c (100%)
>  rename {arch/arm/mach-exynos => drivers/soc/samsung}/exynos-pmu.h (100%)
>  rename {arch/arm/mach-exynos => drivers/soc/samsung}/exynos3250-pmu.c (100%)
>  rename {arch/arm/mach-exynos => drivers/soc/samsung}/exynos4-pmu.c (100%)
>  rename {arch/arm/mach-exynos => drivers/soc/samsung}/exynos5250-pmu.c (100%)
>  rename {arch/arm/mach-exynos => drivers/soc/samsung}/exynos5420-pmu.c (100%)
> 
> diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
> index 83c85f5..874cb38 100644
> --- a/arch/arm/mach-exynos/Kconfig
> +++ b/arch/arm/mach-exynos/Kconfig
> @@ -16,6 +16,7 @@ menuconfig ARCH_EXYNOS
>   select ARM_GIC
>   select COMMON_CLK_SAMSUNG
>   select EXYNOS_THERMAL
> + select EXYNOS_PMU
>   select EXYNOS_SROM if PM
>   select HAVE_ARM_SCU if SMP
>   select HAVE_S3C2410_I2C if I2C
> diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
> index 2d58063..34d29df 100644
> --- a/arch/arm/mach-exynos/Makefile
> +++ b/arch/arm/mach-exynos/Makefile
> @@ -9,9 +9,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += 
> -I$(srctree)/$(src)/include -I$(srctree)
>  
>  # Core
>  
> -obj-$(CONFIG_ARCH_EXYNOS)+= exynos.o pmu.o exynos-smc.o firmware.o \
> - exynos3250-pmu.o exynos4-pmu.o \
> - exynos5250-pmu.o exynos5420-pmu.o
> +obj-$(CONFIG_ARCH_EXYNOS)+= exynos.o exynos-smc.o firmware.o
>  
>  obj-$(CONFIG_EXYNOS_CPU_SUSPEND) += pm.o sleep.o
>  obj-$(CONFIG_PM_SLEEP)   += suspend.o
> diff --git a/drivers/soc/samsung/Kconfig b/drivers/soc/samsung/Kconfig
> index 2833b5b..f545d6c 100644
> --- a/drivers/soc/samsung/Kconfig
> +++ b/drivers/soc/samsung/Kconfig
> @@ -10,4 +10,8 @@ config EXYNOS_SROM
>   bool
>   depends on ARM && ARCH_EXYNOS && PM
>  
> +config EXYNOS_PMU
> + bool
> + depends on ARCH_EXYNOS
> +
>  endmenu
> diff --git a/drivers/soc/samsung/Makefile b/drivers/soc/samsung/Makefile
> index 9c554d5..26fb489 100644
> --- a/drivers/soc/samsung/Makefile
> +++ b/drivers/soc/samsung/Makefile
> @@ -1 +1,5 @@
>  obj-$(CONFIG_EXYNOS_SROM)+= exynos-srom.o
> +ifdef CONFIG_ARM
> +obj-$(CONFIG_EXYNOS_PMU) += exynos-pmu.o exynos3250-pmu.o exynos4-pmu.o \
> + exynos5250-pmu.o exynos5420-pmu.o
> +endif

Why ifdef CONFIG_ARM? This already depends on ARCH_EXYNOS. If you want
to limit to ARMv7 then add the dependency to Kconfig (just like
EXYNOS_SROM).

Rest looks ok - nice renames.

Best regards,
Krzysztof

> diff --git a/arch/arm/mach-exynos/pmu.c b/drivers/soc/samsung/exynos-pmu.c
> similarity index 100%
> rename from arch/arm/mach-exynos/pmu.c
> rename to drivers/soc/samsung/exynos-pmu.c
> diff --git a/arch/arm/mach-exynos/exynos-pmu.h 
> b/drivers/soc/samsung/exynos-pmu.h
> similarity index 100%
> rename from arch/arm/mach-exynos/exynos-pmu.h
> rename to drivers/soc/samsung/exynos-pmu.h
> diff --git a/arch/arm/mach-exynos/exynos3250-pmu.c 
> b/drivers/soc/samsung/exynos3250-pmu.c
> similarity index 100%
> rename from arch/arm/mach-exynos/exynos3250-pmu.c
> rename to drivers/soc/samsung/exynos3250-pmu.c
> diff --git a/arch/arm/mach-exynos/exynos4-pmu.c 
> b/drivers/soc/samsung/exynos4-pmu.c
> similarity index 100%
> rename from arch/arm/mach-exynos/exynos4-pmu.c
> rename to drivers/soc/samsung/exynos4-pmu.c
> diff --git a/arch/arm/mach-exynos/exynos5250-pmu.c 
> 

Re: [PATCH v5 8/9] ARM: EXYNOS: rearrange static and non-static functions of PMU driver

2015-11-13 Thread Krzysztof Kozlowski
On 13.11.2015 18:29, Pankaj Dubey wrote:
> This patch moves exynos_sys_powerdown_conf function above all
> static functions, to avoid confusion causing due to mixing of
> static-nonstatic-static functions and to improve readability of this
> driver.
> 
> Signed-off-by: Pankaj Dubey 
> Suggested-by: Krzysztof Kozlowski 
> ---
>  arch/arm/mach-exynos/pmu.c | 34 +-
>  1 file changed, 17 insertions(+), 17 deletions(-)
> 

Reviewed-by: Krzysztof Kozlowski 

Best regards,
Krzysztof

--
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 v5 5/9] ARM: EXYNOS: split up exynos4 SoC specific PMU data

2015-11-13 Thread Krzysztof Kozlowski
On 13.11.2015 18:29, Pankaj Dubey wrote:
> This patch splits up mach-exynos/pmu.c file, and moves exynos4210,
> exynos4412 and exynos4212 PMU configuration data and functions handing
> data into a common exynos4 SoC specific PMU file mach-exynos/exynos4-pmu.c.
> 
> Signed-off-by: Pankaj Dubey 
> Reviewed-by: Krzysztof Kozlowski 
> ---
>  arch/arm/mach-exynos/Makefile  |   2 +-
>  arch/arm/mach-exynos/exynos-pmu.h  |   3 +
>  arch/arm/mach-exynos/exynos4-pmu.c | 223 
> +
>  arch/arm/mach-exynos/pmu.c | 207 --
>  4 files changed, 227 insertions(+), 208 deletions(-)
>  create mode 100644 arch/arm/mach-exynos/exynos4-pmu.c
> 
> diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
> index e869f86..8969683 100644
> --- a/arch/arm/mach-exynos/Makefile
> +++ b/arch/arm/mach-exynos/Makefile
> @@ -9,7 +9,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += 
> -I$(srctree)/$(src)/include -I$(srctree)
>  
>  # Core
>  
> -obj-$(CONFIG_ARCH_EXYNOS)+= exynos.o pmu.o exynos-smc.o firmware.o 
> exynos3250-pmu.o
> +obj-$(CONFIG_ARCH_EXYNOS)+= exynos.o pmu.o exynos-smc.o firmware.o 
> exynos3250-pmu.o exynos4-pmu.o
>  
>  obj-$(CONFIG_EXYNOS_CPU_SUSPEND) += pm.o sleep.o
>  obj-$(CONFIG_PM_SLEEP)   += suspend.o
> diff --git a/arch/arm/mach-exynos/exynos-pmu.h 
> b/arch/arm/mach-exynos/exynos-pmu.h
> index 5d09fa3..3d21aad 100644
> --- a/arch/arm/mach-exynos/exynos-pmu.h
> +++ b/arch/arm/mach-exynos/exynos-pmu.h
> @@ -33,6 +33,9 @@ struct exynos_pmu_data {
>  extern void __iomem *pmu_base_addr;
>  /* list of all exported SoC specific data */
>  extern const struct exynos_pmu_data exynos3250_pmu_data;
> +extern const struct exynos_pmu_data exynos4210_pmu_data;
> +extern const struct exynos_pmu_data exynos4212_pmu_data;
> +extern const struct exynos_pmu_data exynos4412_pmu_data;
>  
>  extern void pmu_raw_writel(u32 val, u32 offset);
>  extern u32 pmu_raw_readl(u32 offset);
> diff --git a/arch/arm/mach-exynos/exynos4-pmu.c 
> b/arch/arm/mach-exynos/exynos4-pmu.c
> new file mode 100644
> index 000..4b0a79e
> --- /dev/null
> +++ b/arch/arm/mach-exynos/exynos4-pmu.c
> @@ -0,0 +1,223 @@
> +/*
> + * Copyright (c) 2011-2015 Samsung Electronics Co., Ltd.
> + *   http://www.samsung.com/
> + *
> + * EXYNOS4 - CPU PMU(Power Management Unit) support
> + *
> + * 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 
> +#include 
> +
> +#include "exynos-pmu.h"
> +
> +static const struct exynos_pmu_conf exynos4210_pmu_config[] = {
> + /* { .offset = offset, .val = { AFTR, LPA, SLEEP } */
> + { S5P_ARM_CORE0_LOWPWR, { 0x0, 0x0, 0x2 } },
> + { S5P_DIS_IRQ_CORE0,{ 0x0, 0x0, 0x0 } },
> + { S5P_DIS_IRQ_CENTRAL0, { 0x0, 0x0, 0x0 } },
> + { S5P_ARM_CORE1_LOWPWR, { 0x0, 0x0, 0x2 } },
> + { S5P_DIS_IRQ_CORE1,{ 0x0, 0x0, 0x0 } },
> + { S5P_DIS_IRQ_CENTRAL1, { 0x0, 0x0, 0x0 } },
> + { S5P_ARM_COMMON_LOWPWR,{ 0x0, 0x0, 0x2 } },
> + { S5P_L2_0_LOWPWR,  { 0x2, 0x2, 0x3 } },
> + { S5P_L2_1_LOWPWR,  { 0x2, 0x2, 0x3 } },
> + { S5P_CMU_ACLKSTOP_LOWPWR,  { 0x1, 0x0, 0x0 } },
> + { S5P_CMU_SCLKSTOP_LOWPWR,  { 0x1, 0x0, 0x0 } },
> + { S5P_CMU_RESET_LOWPWR, { 0x1, 0x1, 0x0 } },
> + { S5P_APLL_SYSCLK_LOWPWR,   { 0x1, 0x0, 0x0 } },
> + { S5P_MPLL_SYSCLK_LOWPWR,   { 0x1, 0x0, 0x0 } },
> + { S5P_VPLL_SYSCLK_LOWPWR,   { 0x1, 0x0, 0x0 } },
> + { S5P_EPLL_SYSCLK_LOWPWR,   { 0x1, 0x1, 0x0 } },
> + { S5P_CMU_CLKSTOP_GPS_ALIVE_LOWPWR, { 0x1, 0x1, 0x0 } },
> + { S5P_CMU_RESET_GPSALIVE_LOWPWR,{ 0x1, 0x1, 0x0 } },
> + { S5P_CMU_CLKSTOP_CAM_LOWPWR,   { 0x1, 0x1, 0x0 } },
> + { S5P_CMU_CLKSTOP_TV_LOWPWR,{ 0x1, 0x1, 0x0 } },
> + { S5P_CMU_CLKSTOP_MFC_LOWPWR,   { 0x1, 0x1, 0x0 } },
> + { S5P_CMU_CLKSTOP_G3D_LOWPWR,   { 0x1, 0x1, 0x0 } },
> + { S5P_CMU_CLKSTOP_LCD0_LOWPWR,  { 0x1, 0x1, 0x0 } },
> + { S5P_CMU_CLKSTOP_LCD1_LOWPWR,  { 0x1, 0x1, 0x0 } },
> + { S5P_CMU_CLKSTOP_MAUDIO_LOWPWR,{ 0x1, 0x1, 0x0 } },
> + { S5P_CMU_CLKSTOP_GPS_LOWPWR,   { 0x1, 0x1, 0x0 } },
> + { S5P_CMU_RESET_CAM_LOWPWR, { 0x1, 0x1, 0x0 } },
> + { S5P_CMU_RESET_TV_LOWPWR,  { 0x1, 0x1, 0x0 } },
> + { S5P_CMU_RESET_MFC_LOWPWR, { 0x1, 0x1, 0x0 } },
> + { S5P_CMU_RESET_G3D_LOWPWR, { 0x1, 0x1, 0x0 } },
> + { S5P_CMU_RESET_LCD0_LOWPWR,{ 0x1, 0x1, 0x0 } },
> + { 

Re: [PATCH] drm/atomic: only run atomic_check() if crtc is active

2015-11-13 Thread Ville Syrjälä
On Fri, Nov 13, 2015 at 11:45:58AM -0200, Gustavo Padovan wrote:
> From: Gustavo Padovan 
> 
> Fixes an regression added by 3ae2436 (drm/exynos/mixer: replace
> direct cross-driver call with drm mode) and while this regression was
> caused by a change in the exynos driver it makes sense to add the
> check on atomic core to benefit other drivers as well.
> 
> The whole atomic update fails if the exynos hdmi display is not
> present/active.  Add a test to only run atomic_check() if the CRTC is
> active.

The check must be performed even when the crtc is not active.

Especially important for the (enabled && !active) case (ie. DPMS off)
since "DPMS on" must not fail, so any state change while in DPMS off
must be checked as if the crtc was active.

But even for the !enabled case we want to do the check so that
everything gets properly recomputed when fully disabling a crtc.

I suppose we might be able to get away with not checking in the
!enabled -> !enabled case. But I doubt that's really a useful
optimization.

> 
> Signed-off-by: Gustavo Padovan 
> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c 
> b/drivers/gpu/drm/drm_atomic_helper.c
> index 0c6f621..7e3cb48 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -510,6 +510,9 @@ drm_atomic_helper_check_planes(struct drm_device *dev,
>   for_each_crtc_in_state(state, crtc, crtc_state, i) {
>   const struct drm_crtc_helper_funcs *funcs;
>  
> + if (!crtc_state->active)
> + continue;
> +
>   funcs = crtc->helper_private;
>  
>   if (!funcs || !funcs->atomic_check)
> -- 
> 2.1.0
> 
> ___
> dri-devel mailing list
> dri-de...@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel OTC
--
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 v2 09/10] dt-bindings: video: exynos5433-decon: add bindings for DECON-TV

2015-11-13 Thread Rob Herring
On Mon, Oct 26, 2015 at 12:59:56PM +0100, Andrzej Hajda wrote:
> DECON-TV(Display and Enhancement Controller for TV) is a variation
> of DECON IP. Its main purpose is to produce video stream for HDMI IP.
> 
> Signed-off-by: Andrzej Hajda 

Acked-by: Rob Herring 

> ---
> Hi Krzysztof,
> 
> I have decided to skip cleanup part as it would require more work,
> not related to this patchset.
> 
> Regards
> Andrzej
> 
>  Documentation/devicetree/bindings/video/exynos5433-decon.txt | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/video/exynos5433-decon.txt 
> b/Documentation/devicetree/bindings/video/exynos5433-decon.txt
> index 3dff78b..c9fd7b3 100644
> --- a/Documentation/devicetree/bindings/video/exynos5433-decon.txt
> +++ b/Documentation/devicetree/bindings/video/exynos5433-decon.txt
> @@ -5,7 +5,8 @@ Exynos series of SoCs which transfers the image data from a 
> video memory
>  buffer to an external LCD interface.
>  
>  Required properties:
> -- compatible: value should be "samsung,exynos5433-decon";
> +- compatible: value should be one of:
> + "samsung,exynos5433-decon", "samsung,exynos5433-decon-tv";
>  - reg: physical base address and length of the DECON registers set.
>  - interrupts: should contain a list of all DECON IP block interrupts in the
> order: VSYNC, LCD_SYSTEM. The interrupt specifier format
> -- 
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" 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 v2 2/4] ARM: dts: exynos4: fix power domain for sysmmu-rotator device

2015-11-13 Thread Marek Szyprowski
Rotator device and it's SYSMMU belongs to different power domains
on various Exynos4 SoC revisions: LCD0 for 4210 and TOP for 4x12. This
patch fixes this by moving power-domains property to exynos4210.dtsi. TOP
power domain is always enabled and it is not represented in DTS.

Signed-off-by: Marek Szyprowski 
---
 arch/arm/boot/dts/exynos4.dtsi| 1 -
 arch/arm/boot/dts/exynos4210.dtsi | 4 
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index 3e01d4d..f3fe611 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -954,7 +954,6 @@
interrupts = <5 0>;
clock-names = "sysmmu", "master";
clocks = < CLK_SMMU_ROTATOR>, < CLK_ROTATOR>;
-   power-domains = <_lcd0>;
#iommu-cells = <0>;
};
 
diff --git a/arch/arm/boot/dts/exynos4210.dtsi 
b/arch/arm/boot/dts/exynos4210.dtsi
index e3048ae..b7474cf2 100644
--- a/arch/arm/boot/dts/exynos4210.dtsi
+++ b/arch/arm/boot/dts/exynos4210.dtsi
@@ -283,3 +283,7 @@
  {
power-domains = <_lcd0>;
 };
+
+_rotator {
+   power-domains = <_lcd0>;
+};
-- 
1.9.2

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


[PATCH v2 1/4] ARM: dts: exynos4: add rotator nodes

2015-11-13 Thread Marek Szyprowski
This patch adds device node for Rotator device to Exynos 4210 and 4x12
device tree files.

Signed-off-by: Marek Szyprowski 
---
 arch/arm/boot/dts/exynos4.dtsi| 9 +
 arch/arm/boot/dts/exynos4210.dtsi | 4 
 arch/arm/boot/dts/exynos4x12.dtsi | 4 
 3 files changed, 17 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index 2f31f77..3e01d4d 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -718,6 +718,15 @@
iommus = <_jpeg>;
};
 
+   rotator: rotator@1281 {
+   compatible = "samsung,exynos4210-rotator";
+   reg = <0x1281 0x64>;
+   interrupts = <0 83 0>;
+   clocks = < CLK_ROTATOR>;
+   clock-names = "rotator";
+   iommus = <_rotator>;
+   };
+
hdmi: hdmi@12D0 {
compatible = "samsung,exynos4210-hdmi";
reg = <0x12D0 0x7>;
diff --git a/arch/arm/boot/dts/exynos4210.dtsi 
b/arch/arm/boot/dts/exynos4210.dtsi
index 3e5ba66..e3048ae 100644
--- a/arch/arm/boot/dts/exynos4210.dtsi
+++ b/arch/arm/boot/dts/exynos4210.dtsi
@@ -279,3 +279,7 @@
< CLK_OUT_CPU>, < CLK_XXTI>, < CLK_XUSBXTI>;
#clock-cells = <1>;
 };
+
+ {
+   power-domains = <_lcd0>;
+};
diff --git a/arch/arm/boot/dts/exynos4x12.dtsi 
b/arch/arm/boot/dts/exynos4x12.dtsi
index b77dac61..148b47a 100644
--- a/arch/arm/boot/dts/exynos4x12.dtsi
+++ b/arch/arm/boot/dts/exynos4x12.dtsi
@@ -339,6 +339,10 @@
compatible = "samsung,exynos4212-jpeg";
 };
 
+ {
+   compatible = "samsung,exynos4212-rotator";
+};
+
  {
compatible = "samsung,exynos4212-mixer";
clock-names = "mixer", "hdmi", "sclk_hdmi", "vp";
-- 
1.9.2

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


[PATCH] drm/atomic: only run atomic_check() if crtc is active

2015-11-13 Thread Gustavo Padovan
From: Gustavo Padovan 

Fixes an regression added by 3ae2436 (drm/exynos/mixer: replace
direct cross-driver call with drm mode) and while this regression was
caused by a change in the exynos driver it makes sense to add the
check on atomic core to benefit other drivers as well.

The whole atomic update fails if the exynos hdmi display is not
present/active.  Add a test to only run atomic_check() if the CRTC is
active.

Signed-off-by: Gustavo Padovan 
---
 drivers/gpu/drm/drm_atomic_helper.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c 
b/drivers/gpu/drm/drm_atomic_helper.c
index 0c6f621..7e3cb48 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -510,6 +510,9 @@ drm_atomic_helper_check_planes(struct drm_device *dev,
for_each_crtc_in_state(state, crtc, crtc_state, i) {
const struct drm_crtc_helper_funcs *funcs;
 
+   if (!crtc_state->active)
+   continue;
+
funcs = crtc->helper_private;
 
if (!funcs || !funcs->atomic_check)
-- 
2.1.0

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


[PATCH v2 4/4] ARM: dts: exynos542x: add rotator node

2015-11-13 Thread Marek Szyprowski
This patch adds device node for Rotator device and it's SYSMMU to Exynos
542x device tree file.

Signed-off-by: Marek Szyprowski 
---
 arch/arm/boot/dts/exynos5420.dtsi | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
b/arch/arm/boot/dts/exynos5420.dtsi
index 1b3d6c7..48a0a55 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -717,6 +717,15 @@
iommus = <_tv>;
};
 
+   rotator: rotator@11C0 {
+   compatible = "samsung,exynos5250-rotator";
+   reg = <0x11C0 0x64>;
+   interrupts = <0 84 0>;
+   clocks = < CLK_ROTATOR>;
+   clock-names = "rotator";
+   iommus = <_rotator>;
+   };
+
gsc_0: video-scaler@13e0 {
compatible = "samsung,exynos5-gsc";
reg = <0x13e0 0x1000>;
@@ -1059,6 +1068,16 @@
#iommu-cells = <0>;
};
 
+   sysmmu_rotator: sysmmu@0x11D4 {
+   compatible = "samsung,exynos-sysmmu";
+   reg = <0x11D4 0x1000>;
+   interrupt-parent = <>;
+   interrupts = <4 0>;
+   clock-names = "sysmmu", "master";
+   clocks = < CLK_SMMU_ROTATOR>, < CLK_ROTATOR>;
+   #iommu-cells = <0>;
+   };
+
sysmmu_jpeg0: sysmmu@0x11F1 {
compatible = "samsung,exynos-sysmmu";
reg = <0x11F1 0x1000>;
-- 
1.9.2

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


[PATCH v2 3/4] ARM: dts: exynos5250: add rotator node

2015-11-13 Thread Marek Szyprowski
This patch adds device node for Rotator device to Exynos 5250 device
tree file.

Signed-off-by: Marek Szyprowski 
---
 arch/arm/boot/dts/exynos5250.dtsi | 9 +
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5250.dtsi 
b/arch/arm/boot/dts/exynos5250.dtsi
index 88b9cf5..33e2d5f 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -269,6 +269,15 @@
iommu-names = "left", "right";
};
 
+   rotator: rotator@11C0 {
+   compatible = "samsung,exynos5250-rotator";
+   reg = <0x11C0 0x64>;
+   interrupts = <0 84 0>;
+   clocks = < CLK_ROTATOR>;
+   clock-names = "rotator";
+   iommus = <_rotator>;
+   };
+
tmu: tmu@1006 {
compatible = "samsung,exynos5250-tmu";
reg = <0x1006 0x100>;
-- 
1.9.2

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


Re: [PATCH 15/25] drm/exynos: add generic check for plane state

2015-11-13 Thread Gustavo Padovan
Hi Marek,

2015-11-10 Marek Szyprowski :

> This patch adds generic check for plane state: pixel format and display
> area dimensions, so drivers can always assume that they get valid plane
> state to set.
> 
> Signed-off-by: Marek Szyprowski 
> ---
>  drivers/gpu/drm/exynos/exynos_drm_drv.h   |  2 ++
>  drivers/gpu/drm/exynos/exynos_drm_plane.c | 51 
> +++
>  2 files changed, 53 insertions(+)

Reviewed-by: Gustavo Padovan 

Gustavo
--
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 16/25] drm/exynos: mixer: use ratio precalculated in exynos_state

2015-11-13 Thread Gustavo Padovan
Hi Marek,

2015-11-10 Marek Szyprowski :

> Common plane code already calculates and checks for supported scalling
> modes, so additional code in mixer driver can be now removed.
> 
> Signed-off-by: Marek Szyprowski 
> ---
>  drivers/gpu/drm/exynos/exynos_mixer.c | 33 +++--
>  1 file changed, 3 insertions(+), 30 deletions(-)

Reviewed-by: Gustavo Padovan 

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