[PATCH] pwm: sysfs: get return value from pwm_apply_state()

2016-06-07 Thread Yoshihiro Shimoda
From: Ryo Kodama 

This patch adds to check the return value from pwm_apply_state()
used in enable_store(). The error of enable_store() doesn't work
if the return value doesn't received.

Signed-off-by: Ryo Kodama 
Signed-off-by: Yoshihiro Shimoda 
---
 drivers/pwm/sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/sysfs.c b/drivers/pwm/sysfs.c
index d985992..01695d4 100644
--- a/drivers/pwm/sysfs.c
+++ b/drivers/pwm/sysfs.c
@@ -152,7 +152,7 @@ static ssize_t enable_store(struct device *child,
goto unlock;
}
 
-   pwm_apply_state(pwm, );
+   ret = pwm_apply_state(pwm, );
 
 unlock:
mutex_unlock(>lock);
-- 
1.9.1



[PATCH 1/2] ARM: shmobile: pm-rmobile: Postpone call to pm_genpd_init()

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

All local setup of the generic_pm_domain structure should have been
completed before calling pm_genpd_init().

Signed-off-by: Geert Uytterhoeven 
Reviewed-by: Ulf Hansson 
Signed-off-by: Simon Horman 
---
 arch/arm/mach-shmobile/pm-rmobile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/pm-rmobile.c 
b/arch/arm/mach-shmobile/pm-rmobile.c
index c0b05e9e6442..45a195501b78 100644
--- a/arch/arm/mach-shmobile/pm-rmobile.c
+++ b/arch/arm/mach-shmobile/pm-rmobile.c
@@ -131,13 +131,13 @@ static void rmobile_init_pm_domain(struct 
rmobile_pm_domain *rmobile_pd)
struct dev_power_governor *gov = rmobile_pd->gov;
 
genpd->flags = GENPD_FLAG_PM_CLK;
-   pm_genpd_init(genpd, gov ? : _qos_governor, false);
genpd->dev_ops.active_wakeup= rmobile_pd_active_wakeup;
genpd->power_off= rmobile_pd_power_down;
genpd->power_on = rmobile_pd_power_up;
genpd->attach_dev   = cpg_mstp_attach_dev;
genpd->detach_dev   = cpg_mstp_detach_dev;
__rmobile_pd_power_up(rmobile_pd, false);
+   pm_genpd_init(genpd, gov ? : _qos_governor, false);
 }
 
 static int rmobile_pd_suspend_busy(void)
-- 
2.1.4



[PATCH 2/2] ARM: shmobile: rcar-gen2: Use ICRAM1 for jump stub on all SoCs

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Currently the different SoCs in the R-Car Gen2 family use different
types of on-chip RAM for the jump stub:
  - R-Car H2 uses Media RAM,
  - R-Car M2-W uses another type of optional On-chip RAM, as it doesn't
have Media RAM,
  - R-Car M2-N uses Inter Connect RAM in Magnus Damm's "ARM: shmobile:
r8a7793 boot address update".

As all R-Car Gen2 SoCs have 4 KiB of Inter Connect RAM, consolidate the
code by always using that.

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/mach-shmobile/pm-rcar-gen2.c | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-shmobile/pm-rcar-gen2.c 
b/arch/arm/mach-shmobile/pm-rcar-gen2.c
index 691ac166a277..61361dac6068 100644
--- a/arch/arm/mach-shmobile/pm-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/pm-rcar-gen2.c
@@ -26,8 +26,7 @@
 #define CA7RESCNT  0x0044
 
 /* On-chip RAM */
-#define MERAM  0xe808
-#define RAM0xe630
+#define ICRAM1 0xe63c  /* Inter Connect RAM1 (4 KiB) */
 
 /* SYSC */
 #define SYSCIER 0x0c
@@ -58,7 +57,7 @@ void __init rcar_gen2_pm_init(void)
struct device_node *np, *cpus;
bool has_a7 = false;
bool has_a15 = false;
-   phys_addr_t boot_vector_addr = 0;
+   phys_addr_t boot_vector_addr = ICRAM1;
u32 syscier = 0;
 
if (once++)
@@ -75,14 +74,10 @@ void __init rcar_gen2_pm_init(void)
has_a7 = true;
}
 
-   if (of_machine_is_compatible("renesas,r8a7790")) {
-   boot_vector_addr = MERAM;
+   if (of_machine_is_compatible("renesas,r8a7790"))
syscier = 0x013111ef;
-
-   } else if (of_machine_is_compatible("renesas,r8a7791")) {
-   boot_vector_addr = RAM;
+   else if (of_machine_is_compatible("renesas,r8a7791"))
syscier = 0x00111003;
-   }
 
/* RAM for jump stub, because BAR requires 256KB aligned address */
p = ioremap_nocache(boot_vector_addr, shmobile_boot_size);
-- 
2.1.4



[PATCH 2/3] soc: renesas: Add r8a7796 SYSC PM Domain Binding Definitions

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Signed-off-by: Geert Uytterhoeven 
Acked-by: Laurent Pinchart 
Signed-off-by: Simon Horman 
---
 include/dt-bindings/power/r8a7796-sysc.h | 36 
 1 file changed, 36 insertions(+)
 create mode 100644 include/dt-bindings/power/r8a7796-sysc.h

diff --git a/include/dt-bindings/power/r8a7796-sysc.h 
b/include/dt-bindings/power/r8a7796-sysc.h
new file mode 100644
index ..5b4daab44daa
--- /dev/null
+++ b/include/dt-bindings/power/r8a7796-sysc.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2016 Glider bvba
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ */
+#ifndef __DT_BINDINGS_POWER_R8A7796_SYSC_H__
+#define __DT_BINDINGS_POWER_R8A7796_SYSC_H__
+
+/*
+ * These power domain indices match the numbers of the interrupt bits
+ * representing the power areas in the various Interrupt Registers
+ * (e.g. SYSCISR, Interrupt Status Register)
+ */
+
+#define R8A7796_PD_CA57_CPU00
+#define R8A7796_PD_CA57_CPU11
+#define R8A7796_PD_CA53_CPU05
+#define R8A7796_PD_CA53_CPU16
+#define R8A7796_PD_CA53_CPU27
+#define R8A7796_PD_CA53_CPU38
+#define R8A7796_PD_CA57_SCU12
+#define R8A7796_PD_CR7 13
+#define R8A7796_PD_A3VC14
+#define R8A7796_PD_3DG_A   17
+#define R8A7796_PD_3DG_B   18
+#define R8A7796_PD_CA53_SCU21
+#define R8A7796_PD_A3IR24
+#define R8A7796_PD_A2VC0   25
+#define R8A7796_PD_A2VC1   26
+
+/* Always-on power area */
+#define R8A7796_PD_ALWAYS_ON   32
+
+#endif /* __DT_BINDINGS_POWER_R8A7796_SYSC_H__ */
-- 
2.1.4



[PATCH 3/3] soc: renesas: rcar-sysc: Add support for R-Car M3-W power areas

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Signed-off-by: Geert Uytterhoeven 
Acked-by: Laurent Pinchart 
Signed-off-by: Simon Horman 
---
 drivers/soc/renesas/Makefile   |  1 +
 drivers/soc/renesas/r8a7796-sysc.c | 48 ++
 drivers/soc/renesas/rcar-sysc.c|  3 +++
 drivers/soc/renesas/rcar-sysc.h|  1 +
 4 files changed, 53 insertions(+)
 create mode 100644 drivers/soc/renesas/r8a7796-sysc.c

diff --git a/drivers/soc/renesas/Makefile b/drivers/soc/renesas/Makefile
index 151fcd3f025b..cd85cd5e6a01 100644
--- a/drivers/soc/renesas/Makefile
+++ b/drivers/soc/renesas/Makefile
@@ -5,3 +5,4 @@ obj-$(CONFIG_ARCH_R8A7791)  += rcar-sysc.o r8a7791-sysc.o
 obj-$(CONFIG_ARCH_R8A7793) += rcar-sysc.o r8a7791-sysc.o
 obj-$(CONFIG_ARCH_R8A7794) += rcar-sysc.o r8a7794-sysc.o
 obj-$(CONFIG_ARCH_R8A7795) += rcar-sysc.o r8a7795-sysc.o
+obj-$(CONFIG_ARCH_R8A7796) += rcar-sysc.o r8a7796-sysc.o
diff --git a/drivers/soc/renesas/r8a7796-sysc.c 
b/drivers/soc/renesas/r8a7796-sysc.c
new file mode 100644
index ..f700c842b9e1
--- /dev/null
+++ b/drivers/soc/renesas/r8a7796-sysc.c
@@ -0,0 +1,48 @@
+/*
+ * Renesas R-Car M3-W System Controller
+ *
+ * Copyright (C) 2016 Glider bvba
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ */
+
+#include 
+#include 
+
+#include 
+
+#include "rcar-sysc.h"
+
+static const struct rcar_sysc_area r8a7796_areas[] __initconst = {
+   { "always-on",  0, 0, R8A7796_PD_ALWAYS_ON, -1, PD_ALWAYS_ON },
+   { "ca57-scu",   0x1c0, 0, R8A7796_PD_CA57_SCU,  R8A7796_PD_ALWAYS_ON,
+ PD_SCU },
+   { "ca57-cpu0",   0x80, 0, R8A7796_PD_CA57_CPU0, R8A7796_PD_CA57_SCU,
+ PD_CPU_NOCR },
+   { "ca57-cpu1",   0x80, 1, R8A7796_PD_CA57_CPU1, R8A7796_PD_CA57_SCU,
+ PD_CPU_NOCR },
+   { "ca53-scu",   0x140, 0, R8A7796_PD_CA53_SCU,  R8A7796_PD_ALWAYS_ON,
+ PD_SCU },
+   { "ca53-cpu0",  0x200, 0, R8A7796_PD_CA53_CPU0, R8A7796_PD_CA53_SCU,
+ PD_CPU_NOCR },
+   { "ca53-cpu1",  0x200, 1, R8A7796_PD_CA53_CPU1, R8A7796_PD_CA53_SCU,
+ PD_CPU_NOCR },
+   { "ca53-cpu2",  0x200, 2, R8A7796_PD_CA53_CPU2, R8A7796_PD_CA53_SCU,
+ PD_CPU_NOCR },
+   { "ca53-cpu3",  0x200, 3, R8A7796_PD_CA53_CPU3, R8A7796_PD_CA53_SCU,
+ PD_CPU_NOCR },
+   { "cr7",0x240, 0, R8A7796_PD_CR7,   R8A7796_PD_ALWAYS_ON },
+   { "a3vc",   0x380, 0, R8A7796_PD_A3VC,  R8A7796_PD_ALWAYS_ON },
+   { "a2vc0",  0x3c0, 0, R8A7796_PD_A2VC0, R8A7796_PD_A3VC },
+   { "a2vc1",  0x3c0, 1, R8A7796_PD_A2VC1, R8A7796_PD_A3VC },
+   { "3dg-a",  0x100, 0, R8A7796_PD_3DG_A, R8A7796_PD_ALWAYS_ON },
+   { "3dg-b",  0x100, 1, R8A7796_PD_3DG_B, R8A7796_PD_3DG_A },
+   { "a3ir",   0x180, 0, R8A7796_PD_A3IR,  R8A7796_PD_ALWAYS_ON },
+};
+
+const struct rcar_sysc_info r8a7796_sysc_info __initconst = {
+   .areas = r8a7796_areas,
+   .num_areas = ARRAY_SIZE(r8a7796_areas),
+};
diff --git a/drivers/soc/renesas/rcar-sysc.c b/drivers/soc/renesas/rcar-sysc.c
index 79dbc770895f..fc997d4d2a4a 100644
--- a/drivers/soc/renesas/rcar-sysc.c
+++ b/drivers/soc/renesas/rcar-sysc.c
@@ -303,6 +303,9 @@ static const struct of_device_id rcar_sysc_matches[] = {
 #ifdef CONFIG_ARCH_R8A7795
{ .compatible = "renesas,r8a7795-sysc", .data = _sysc_info },
 #endif
+#ifdef CONFIG_ARCH_R8A7796
+   { .compatible = "renesas,r8a7796-sysc", .data = _sysc_info },
+#endif
{ /* sentinel */ }
 };
 
diff --git a/drivers/soc/renesas/rcar-sysc.h b/drivers/soc/renesas/rcar-sysc.h
index 5e766174c2f4..4ac3d7bf7f38 100644
--- a/drivers/soc/renesas/rcar-sysc.h
+++ b/drivers/soc/renesas/rcar-sysc.h
@@ -55,4 +55,5 @@ extern const struct rcar_sysc_info r8a7790_sysc_info;
 extern const struct rcar_sysc_info r8a7791_sysc_info;
 extern const struct rcar_sysc_info r8a7794_sysc_info;
 extern const struct rcar_sysc_info r8a7795_sysc_info;
+extern const struct rcar_sysc_info r8a7796_sysc_info;
 #endif /* __SOC_RENESAS_RCAR_SYSC_H__ */
-- 
2.1.4



[PATCH 1/3] soc: renesas: rcar-sysc: Document r8a7796 support

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Signed-off-by: Geert Uytterhoeven 
Acked-by: Laurent Pinchart 
Acked-by: Rob Herring 
Signed-off-by: Simon Horman 
---
 Documentation/devicetree/bindings/power/renesas,rcar-sysc.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/power/renesas,rcar-sysc.txt 
b/Documentation/devicetree/bindings/power/renesas,rcar-sysc.txt
index b74e4d4785ab..0725fb37a973 100644
--- a/Documentation/devicetree/bindings/power/renesas,rcar-sysc.txt
+++ b/Documentation/devicetree/bindings/power/renesas,rcar-sysc.txt
@@ -14,6 +14,7 @@ Required properties:
   - "renesas,r8a7793-sysc" (R-Car M2-N)
   - "renesas,r8a7794-sysc" (R-Car E2)
   - "renesas,r8a7795-sysc" (R-Car H3)
+  - "renesas,r8a7796-sysc" (R-Car M3-W)
   - reg: Address start and address range for the device.
   - #power-domain-cells: Must be 1.
 
-- 
2.1.4



[GIT PULL] Renesas ARM Based SoC R-Car SYSC Updates for v4.8

2016-06-07 Thread Simon Horman
Hi Olof, Hi Kevin, Hi Arnd,

Please consider these Renesas ARM based SoC R-Car SYSC updates for v4.8.

There are follow-up DT changes that depend on this driver which I hope
will be ready to send to you in the v4.8 development cycle.


The following changes since commit 1a695a905c18548062509178b98bc91e67510864:

  Linux 4.7-rc1 (2016-05-29 09:29:24 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git 
tags/renesas-rcar-sysc-for-v4.8

for you to fetch changes up to e0c98b9171eecf1745eda08de86081db8ec41d51:

  soc: renesas: rcar-sysc: Add support for R-Car M3-W power areas (2016-06-06 
10:14:21 +0900)


Renesas ARM Based SoC R-Car SYSC Updates for v4.8

e0c98b9171ee soc: renesas: rcar-sysc: Add support for R-Car M3-W power areas
74699228b99d soc: renesas: Add r8a7796 SYSC PM Domain Binding Definitions
2ff1bf77e4d4 soc: renesas: rcar-sysc: Document r8a7796 support


Geert Uytterhoeven (3):
  soc: renesas: rcar-sysc: Document r8a7796 support
  soc: renesas: Add r8a7796 SYSC PM Domain Binding Definitions
  soc: renesas: rcar-sysc: Add support for R-Car M3-W power areas

 .../bindings/power/renesas,rcar-sysc.txt   |  1 +
 drivers/soc/renesas/Makefile   |  1 +
 drivers/soc/renesas/r8a7796-sysc.c | 48 ++
 drivers/soc/renesas/rcar-sysc.c|  3 ++
 drivers/soc/renesas/rcar-sysc.h|  1 +
 include/dt-bindings/power/r8a7796-sysc.h   | 36 
 6 files changed, 90 insertions(+)
 create mode 100644 drivers/soc/renesas/r8a7796-sysc.c
 create mode 100644 include/dt-bindings/power/r8a7796-sysc.h


[GIT PULL] Renesas ARM Based SoC Updates for v4.8

2016-06-07 Thread Simon Horman
Hi Olof, Hi Kevin, Hi Arnd,

Please consider these Renesas ARM based SoC updates for v4.8.


The following changes since commit 1a695a905c18548062509178b98bc91e67510864:

  Linux 4.7-rc1 (2016-05-29 09:29:24 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git 
tags/renesas-soc-for-v4.8

for you to fetch changes up to c94bc815f3c757df402d6f6a3e8d855b9168e6af:

  ARM: shmobile: rcar-gen2: Use ICRAM1 for jump stub on all SoCs (2016-05-30 
09:39:43 +0900)


Renesas ARM Based SoC Updates for v4.8

* Use ICRAM1 for jump stub on R-Car Gen 2 SoCs
* Postpone call to pm_genpd_init


Geert Uytterhoeven (2):
  ARM: shmobile: pm-rmobile: Postpone call to pm_genpd_init()
  ARM: shmobile: rcar-gen2: Use ICRAM1 for jump stub on all SoCs

 arch/arm/mach-shmobile/pm-rcar-gen2.c | 13 -
 arch/arm/mach-shmobile/pm-rmobile.c   |  2 +-
 2 files changed, 5 insertions(+), 10 deletions(-)


[PATCH 18/30] ARM: dts: sh73a0: Fix W=1 dtc warnings

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Warning (unit_address_vs_reg): Node /cache-controller has a reg or ranges 
property, but no unit name

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/sh73a0.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/sh73a0.dtsi b/arch/arm/boot/dts/sh73a0.dtsi
index c4f434cdec60..032fe2f14b16 100644
--- a/arch/arm/boot/dts/sh73a0.dtsi
+++ b/arch/arm/boot/dts/sh73a0.dtsi
@@ -55,7 +55,7 @@
  <0xf100 0x100>;
};
 
-   L2: cache-controller {
+   L2: cache-controller@f010 {
compatible = "arm,pl310-cache";
reg = <0xf010 0x1000>;
interrupts = ;
-- 
2.1.4



[PATCH 24/30] ARM: dts: koelsch: Fix W=1 dtc warnings

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Warning (unit_address_vs_reg): Node /regulator@0 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@1 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@2 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@3 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@4 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@5 has a unit name, but no reg 
property

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r8a7791-koelsch.dts | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts 
b/arch/arm/boot/dts/r8a7791-koelsch.dts
index da59c2844b8a..20fbc8c36a78 100644
--- a/arch/arm/boot/dts/r8a7791-koelsch.dts
+++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
@@ -170,7 +170,7 @@
};
};
 
-   vcc_sdhi0: regulator@0 {
+   vcc_sdhi0: regulator-vcc-sdhi0 {
compatible = "regulator-fixed";
 
regulator-name = "SDHI0 Vcc";
@@ -181,7 +181,7 @@
enable-active-high;
};
 
-   vccq_sdhi0: regulator@1 {
+   vccq_sdhi0: regulator-vccq-sdhi0 {
compatible = "regulator-gpio";
 
regulator-name = "SDHI0 VccQ";
@@ -194,7 +194,7 @@
  180 0>;
};
 
-   vcc_sdhi1: regulator@2 {
+   vcc_sdhi1: regulator-vcc-sdhi1 {
compatible = "regulator-fixed";
 
regulator-name = "SDHI1 Vcc";
@@ -205,7 +205,7 @@
enable-active-high;
};
 
-   vccq_sdhi1: regulator@3 {
+   vccq_sdhi1: regulator-vccq-sdhi1 {
compatible = "regulator-gpio";
 
regulator-name = "SDHI1 VccQ";
@@ -218,7 +218,7 @@
  180 0>;
};
 
-   vcc_sdhi2: regulator@4 {
+   vcc_sdhi2: regulator-vcc-sdhi2 {
compatible = "regulator-fixed";
 
regulator-name = "SDHI2 Vcc";
@@ -229,7 +229,7 @@
enable-active-high;
};
 
-   vccq_sdhi2: regulator@5 {
+   vccq_sdhi2: regulator-vccq-sdhi2 {
compatible = "regulator-gpio";
 
regulator-name = "SDHI2 VccQ";
-- 
2.1.4



[PATCH 30/30] ARM: dts: silk: Fix W=1 dtc warnings

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Warning (unit_address_vs_reg): Node /regulator@0 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@3 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@4 has a unit name, but no reg 
property

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r8a7794-silk.dts | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7794-silk.dts 
b/arch/arm/boot/dts/r8a7794-silk.dts
index 56d98d5b2185..b8c7a63c5ec4 100644
--- a/arch/arm/boot/dts/r8a7794-silk.dts
+++ b/arch/arm/boot/dts/r8a7794-silk.dts
@@ -32,7 +32,7 @@
reg = <0 0x4000 0 0x4000>;
};
 
-   d3_3v: regulator@0 {
+   d3_3v: regulator-d3-3v {
compatible = "regulator-fixed";
regulator-name = "D3.3V";
regulator-min-microvolt = <330>;
@@ -41,7 +41,7 @@
regulator-always-on;
};
 
-   vcc_sdhi1: regulator@3 {
+   vcc_sdhi1: regulator-vcc-sdhi1 {
compatible = "regulator-fixed";
 
regulator-name = "SDHI1 Vcc";
@@ -52,7 +52,7 @@
enable-active-high;
};
 
-   vccq_sdhi1: regulator@4 {
+   vccq_sdhi1: regulator-vccq-sdhi1 {
compatible = "regulator-gpio";
 
regulator-name = "SDHI1 VccQ";
-- 
2.1.4



[PATCH 08/30] ARM: dts: r8a7794: Reference both DMA controllers

2016-06-07 Thread Simon Horman
From: Niklas Söderlund 

R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can choose which one to
use.

Signed-off-by: Niklas Söderlund 
Reviewed-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r8a7794.dtsi | 119 ++---
 1 file changed, 75 insertions(+), 44 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7794.dtsi b/arch/arm/boot/dts/r8a7794.dtsi
index f334a3a715f2..ad1df8317575 100644
--- a/arch/arm/boot/dts/r8a7794.dtsi
+++ b/arch/arm/boot/dts/r8a7794.dtsi
@@ -302,8 +302,9 @@
interrupts = ;
clocks = <_clks R8A7794_CLK_SCIFA0>;
clock-names = "fck";
-   dmas = < 0x21>, < 0x22>;
-   dma-names = "tx", "rx";
+   dmas = < 0x21>, < 0x22>,
+  < 0x21>, < 0x22>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7794_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -315,8 +316,9 @@
interrupts = ;
clocks = <_clks R8A7794_CLK_SCIFA1>;
clock-names = "fck";
-   dmas = < 0x25>, < 0x26>;
-   dma-names = "tx", "rx";
+   dmas = < 0x25>, < 0x26>,
+  < 0x25>, < 0x26>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7794_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -328,8 +330,9 @@
interrupts = ;
clocks = <_clks R8A7794_CLK_SCIFA2>;
clock-names = "fck";
-   dmas = < 0x27>, < 0x28>;
-   dma-names = "tx", "rx";
+   dmas = < 0x27>, < 0x28>,
+  < 0x27>, < 0x28>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7794_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -341,8 +344,9 @@
interrupts = ;
clocks = <_clks R8A7794_CLK_SCIFA3>;
clock-names = "fck";
-   dmas = < 0x1b>, < 0x1c>;
-   dma-names = "tx", "rx";
+   dmas = < 0x1b>, < 0x1c>,
+  < 0x1b>, < 0x1c>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7794_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -354,8 +358,9 @@
interrupts = ;
clocks = <_clks R8A7794_CLK_SCIFA4>;
clock-names = "fck";
-   dmas = < 0x1f>, < 0x20>;
-   dma-names = "tx", "rx";
+   dmas = < 0x1f>, < 0x20>,
+  < 0x1f>, < 0x20>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7794_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -367,8 +372,9 @@
interrupts = ;
clocks = <_clks R8A7794_CLK_SCIFA5>;
clock-names = "fck";
-   dmas = < 0x23>, < 0x24>;
-   dma-names = "tx", "rx";
+   dmas = < 0x23>, < 0x24>,
+  < 0x23>, < 0x24>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7794_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -380,8 +386,9 @@
interrupts = ;
clocks = <_clks R8A7794_CLK_SCIFB0>;
clock-names = "fck";
-   dmas = < 0x3d>, < 0x3e>;
-   dma-names = "tx", "rx";
+   dmas = < 0x3d>, < 0x3e>,
+  < 0x3d>, < 0x3e>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7794_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -393,8 +400,9 @@
interrupts = ;
clocks = <_clks R8A7794_CLK_SCIFB1>;
clock-names = "fck";
-   dmas = < 0x19>, < 0x1a>;
-   dma-names = "tx", "rx";
+   dmas = < 0x19>, < 0x1a>,
+  < 0x19>, < 0x1a>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7794_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -406,8 +414,9 @@
interrupts = ;
clocks = <_clks R8A7794_CLK_SCIFB2>;
clock-names = "fck";
-   dmas = < 0x1d>, < 0x1e>;
-   dma-names = "tx", "rx";
+   dmas = < 0x1d>, < 0x1e>,
+  < 0x1d>, < 0x1e>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7794_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -420,8 +429,9 @@
clocks = <_clks R8A7794_CLK_SCIF0>, <_clk>,
 <_clk>;

[PATCH 14/30] ARM: dts: r8a7790: Fix W=1 dtc warnings

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Warning (unit_address_vs_reg): Node /cache-controller@0 has a unit name, but no 
reg property
Warning (unit_address_vs_reg): Node /cache-controller@1 has a unit name, but no 
reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,dvc/dvc@0 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,dvc/dvc@1 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,mix/mix@0 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,mix/mix@1 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ctu/ctu@0 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ctu/ctu@1 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ctu/ctu@2 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ctu/ctu@3 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ctu/ctu@4 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ctu/ctu@5 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ctu/ctu@6 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ctu/ctu@7 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,src/src@0 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,src/src@1 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,src/src@2 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,src/src@3 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,src/src@4 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,src/src@5 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,src/src@6 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,src/src@7 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,src/src@8 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,src/src@9 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ssi/ssi@0 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ssi/ssi@1 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ssi/ssi@2 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ssi/ssi@3 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ssi/ssi@4 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ssi/ssi@5 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ssi/ssi@6 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ssi/ssi@7 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ssi/ssi@8 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ssi/ssi@9 has a 
unit name, but no reg property

Move the cache-controller nodes under the cpus node, and make their unit
names and reg properties match the MPIDR values.

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r8a7790.dtsi | 94 +-
 1 file changed, 48 insertions(+), 46 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 97f4c1dc3ae8..9997e7dfabe2 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -127,6 +127,22 @@
power-domains = < R8A7790_PD_CA7_CPU3>;
next-level-cache = <_CA7>;
};
+
+   L2_CA15: cache-controller@0 {
+   compatible = "cache";
+   reg = <0>;
+   power-domains = < R8A7790_PD_CA15_SCU>;
+   cache-unified;
+   cache-level = <2>;
+   };
+
+   L2_CA7: cache-controller@100 {
+   compatible = "cache";
+   reg = <0x100>;
+   power-domains = < 

[PATCH 09/30] ARM: dts: r8a7794: Remove nonexistent thermal sensor clock

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

According to the latest information, there is no thermal IP block
present on the r8a7794 SoC.

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 include/dt-bindings/clock/r8a7794-clock.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/dt-bindings/clock/r8a7794-clock.h 
b/include/dt-bindings/clock/r8a7794-clock.h
index 4d3ecd626c1f..a3491ba2f6ec 100644
--- a/include/dt-bindings/clock/r8a7794-clock.h
+++ b/include/dt-bindings/clock/r8a7794-clock.h
@@ -67,7 +67,6 @@
 #define R8A7794_CLK_IRQC   7
 
 /* MSTP5 */
-#define R8A7794_CLK_THERMAL22
 #define R8A7794_CLK_PWM23
 
 /* MSTP7 */
-- 
2.1.4



[PATCH 27/30] ARM: dts: lager: Fix W=1 dtc warnings

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Warning (unit_address_vs_reg): Node /keyboard/button@1 has a unit name, but no 
reg property
Warning (unit_address_vs_reg): Node /keyboard/button@2 has a unit name, but no 
reg property
Warning (unit_address_vs_reg): Node /keyboard/button@3 has a unit name, but no 
reg property
Warning (unit_address_vs_reg): Node /keyboard/button@4 has a unit name, but no 
reg property
Warning (unit_address_vs_reg): Node /fixedregulator@0 has a unit name, but no 
reg property
Warning (unit_address_vs_reg): Node /regulator@1 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@2 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@3 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@4 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /i2c@8 has a unit name, but no reg property

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r8a7790-lager.dts | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7790-lager.dts 
b/arch/arm/boot/dts/r8a7790-lager.dts
index 749ba02b6a53..9d20ace33b01 100644
--- a/arch/arm/boot/dts/r8a7790-lager.dts
+++ b/arch/arm/boot/dts/r8a7790-lager.dts
@@ -76,28 +76,28 @@
keyboard {
compatible = "gpio-keys";
 
-   button@1 {
+   one {
linux,code = ;
label = "SW2-1";
wakeup-source;
debounce-interval = <20>;
gpios = < 14 GPIO_ACTIVE_LOW>;
};
-   button@2 {
+   two {
linux,code = ;
label = "SW2-2";
wakeup-source;
debounce-interval = <20>;
gpios = < 24 GPIO_ACTIVE_LOW>;
};
-   button@3 {
+   three {
linux,code = ;
label = "SW2-3";
wakeup-source;
debounce-interval = <20>;
gpios = < 26 GPIO_ACTIVE_LOW>;
};
-   button@4 {
+   four {
linux,code = ;
label = "SW2-4";
wakeup-source;
@@ -119,7 +119,7 @@
};
};
 
-   fixedregulator3v3: fixedregulator@0 {
+   fixedregulator3v3: regulator-3v3 {
compatible = "regulator-fixed";
regulator-name = "fixed-3.3V";
regulator-min-microvolt = <330>;
@@ -128,7 +128,7 @@
regulator-always-on;
};
 
-   vcc_sdhi0: regulator@1 {
+   vcc_sdhi0: regulator-vcc-sdhi0 {
compatible = "regulator-fixed";
 
regulator-name = "SDHI0 Vcc";
@@ -139,7 +139,7 @@
enable-active-high;
};
 
-   vccq_sdhi0: regulator@2 {
+   vccq_sdhi0: regulator-vccq-sdhi0 {
compatible = "regulator-gpio";
 
regulator-name = "SDHI0 VccQ";
@@ -152,7 +152,7 @@
  180 0>;
};
 
-   vcc_sdhi2: regulator@3 {
+   vcc_sdhi2: regulator-vcc-sdhi2 {
compatible = "regulator-fixed";
 
regulator-name = "SDHI2 Vcc";
@@ -163,7 +163,7 @@
enable-active-high;
};
 
-   vccq_sdhi2: regulator@4 {
+   vccq_sdhi2: regulator-vccq-sdhi2 {
compatible = "regulator-gpio";
 
regulator-name = "SDHI2 VccQ";
@@ -263,7 +263,7 @@
 * instantiate the slave device at runtime according to the 
documentation.
 * You can then communicate with the slave via IIC3.
 */
-   i2cexio: i2c@8 {
+   i2cexio: i2c-8 {
compatible = "i2c-demux-pinctrl";
i2c-parent = <>, <>;
i2c-bus-name = "i2c-exio";
-- 
2.1.4



[PATCH 29/30] ARM: dts: porter: Fix W=1 dtc warnings

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Warning (unit_address_vs_reg): Node /regulator@0 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@1 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@2 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@3 has a unit name, but no reg 
property

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r8a7791-porter.dts | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791-porter.dts 
b/arch/arm/boot/dts/r8a7791-porter.dts
index 6a1bb1a8209b..e9151e946da8 100644
--- a/arch/arm/boot/dts/r8a7791-porter.dts
+++ b/arch/arm/boot/dts/r8a7791-porter.dts
@@ -46,7 +46,7 @@
reg = <2 0x 0 0x4000>;
};
 
-   vcc_sdhi0: regulator@0 {
+   vcc_sdhi0: regulator-vcc-sdhi0 {
compatible = "regulator-fixed";
 
regulator-name = "SDHI0 Vcc";
@@ -55,7 +55,7 @@
regulator-always-on;
};
 
-   vccq_sdhi0: regulator@1 {
+   vccq_sdhi0: regulator-vccq-sdhi0 {
compatible = "regulator-gpio";
 
regulator-name = "SDHI0 VccQ";
@@ -68,7 +68,7 @@
  180 0>;
};
 
-   vcc_sdhi2: regulator@2 {
+   vcc_sdhi2: regulator-vcc-sdhi2 {
compatible = "regulator-fixed";
 
regulator-name = "SDHI2 Vcc";
@@ -77,7 +77,7 @@
regulator-always-on;
};
 
-   vccq_sdhi2: regulator@3 {
+   vccq_sdhi2: regulator-vccq-sdhi2 {
compatible = "regulator-gpio";
 
regulator-name = "SDHI2 VccQ";
-- 
2.1.4



[PATCH 25/30] ARM: dts: kzm9d: Fix W=1 dtc warnings

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Warning (unit_address_vs_reg): Node /memory has a reg or ranges property, but 
no unit name
Warning (unit_address_vs_reg): Node /pfc@e0140200/serial@e103 has a unit 
name, but no reg property
Warning (unit_address_vs_reg): Node /gpio_keys/button@1 has a unit name, but no 
reg property
Warning (unit_address_vs_reg): Node /gpio_keys/button@2 has a unit name, but no 
reg property
Warning (unit_address_vs_reg): Node /gpio_keys/button@3 has a unit name, but no 
reg property
Warning (unit_address_vs_reg): Node /gpio_keys/button@4 has a unit name, but no 
reg property
Warning (unit_address_vs_reg): Node /regulator@0 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@1 has a unit name, but no reg 
property

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/emev2-kzm9d.dts | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/emev2-kzm9d.dts 
b/arch/arm/boot/dts/emev2-kzm9d.dts
index a35b851e1cd7..9eb86f8f32c5 100644
--- a/arch/arm/boot/dts/emev2-kzm9d.dts
+++ b/arch/arm/boot/dts/emev2-kzm9d.dts
@@ -18,7 +18,7 @@
model = "EMEV2 KZM9D Board";
compatible = "renesas,kzm9d", "renesas,emev2";
 
-   memory {
+   memory@4000 {
device_type = "memory";
reg = <0x4000 0x800>;
};
@@ -33,28 +33,28 @@
#address-cells = <1>;
#size-cells = <0>;
 
-   button@1 {
+   one {
debounce_interval = <50>;
wakeup-source;
label = "DSW2-1";
linux,code = ;
gpios = < 14 GPIO_ACTIVE_HIGH>;
};
-   button@2 {
+   two {
debounce_interval = <50>;
wakeup-source;
label = "DSW2-2";
linux,code = ;
gpios = < 15 GPIO_ACTIVE_HIGH>;
};
-   button@3 {
+   three {
debounce_interval = <50>;
wakeup-source;
label = "DSW2-3";
linux,code = ;
gpios = < 16 GPIO_ACTIVE_HIGH>;
};
-   button@4 {
+   four {
debounce_interval = <50>;
wakeup-source;
label = "DSW2-4";
@@ -63,7 +63,7 @@
};
};
 
-   reg_1p8v: regulator@0 {
+   reg_1p8v: regulator-1p8v {
compatible = "regulator-fixed";
regulator-name = "fixed-1.8V";
regulator-min-microvolt = <180>;
@@ -72,7 +72,7 @@
regulator-boot-on;
};
 
-   reg_3p3v: regulator@1 {
+   reg_3p3v: regulator-3p3v {
compatible = "regulator-fixed";
regulator-name = "fixed-3.3V";
regulator-min-microvolt = <330>;
@@ -104,7 +104,7 @@
 };
 
  {
-   uart1_pins: serial@e103 {
+   uart1_pins: uart1 {
groups = "uart1_ctrl", "uart1_data";
function = "uart1";
};
-- 
2.1.4



[PATCH 28/30] ARM: dts: marzen: Fix W=1 dtc warnings

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Warning (unit_address_vs_reg): Node /memory has a reg or ranges property, but 
no unit name
Warning (unit_address_vs_reg): Node /fixedregulator@0 has a unit name, but no 
reg property

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r8a7779-marzen.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7779-marzen.dts 
b/arch/arm/boot/dts/r8a7779-marzen.dts
index b795da6f5503..cec79a6347c0 100644
--- a/arch/arm/boot/dts/r8a7779-marzen.dts
+++ b/arch/arm/boot/dts/r8a7779-marzen.dts
@@ -28,12 +28,12 @@
stdout-path = 
};
 
-   memory {
+   memory@6000 {
device_type = "memory";
reg = <0x6000 0x4000>;
};
 
-   fixedregulator3v3: fixedregulator@0 {
+   fixedregulator3v3: regulator-3v3 {
compatible = "regulator-fixed";
regulator-name = "fixed-3.3V";
regulator-min-microvolt = <330>;
-- 
2.1.4



[PATCH 20/30] ARM: dts: armadillo800eva: Fix W=1 dtc warnings

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Warning (unit_address_vs_reg): Node /memory has a reg or ranges property, but 
no unit name
Warning (unit_address_vs_reg): Node /regulator@0 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@1 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@2 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@3 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /i2c@2 has a unit name, but no reg property

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r8a7740-armadillo800eva.dts | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7740-armadillo800eva.dts 
b/arch/arm/boot/dts/r8a7740-armadillo800eva.dts
index 2c82dab2b6f4..162049516685 100644
--- a/arch/arm/boot/dts/r8a7740-armadillo800eva.dts
+++ b/arch/arm/boot/dts/r8a7740-armadillo800eva.dts
@@ -28,12 +28,12 @@
stdout-path = 
};
 
-   memory {
+   memory@4000 {
device_type = "memory";
reg = <0x4000 0x2000>;
};
 
-   reg_3p3v: regulator@0 {
+   reg_3p3v: regulator-3p3v {
compatible = "regulator-fixed";
regulator-name = "fixed-3.3V";
regulator-min-microvolt = <330>;
@@ -42,7 +42,7 @@
regulator-boot-on;
};
 
-   vcc_sdhi0: regulator@1 {
+   vcc_sdhi0: regulator-vcc-sdhi0 {
compatible = "regulator-fixed";
 
regulator-name = "SDHI0 Vcc";
@@ -53,7 +53,7 @@
enable-active-high;
};
 
-   vccq_sdhi0: regulator@2 {
+   vccq_sdhi0: regulator-vccq-sdhi0 {
compatible = "regulator-gpio";
 
regulator-name = "SDHI0 VccQ";
@@ -69,7 +69,7 @@
enable-active-high;
};
 
-   reg_5p0v: regulator@3 {
+   reg_5p0v: regulator-5p0v {
compatible = "regulator-fixed";
regulator-name = "fixed-5.0V";
regulator-min-microvolt = <500>;
@@ -127,7 +127,7 @@
};
};
 
-   i2c2: i2c@2 {
+   i2c2: i2c-2 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "i2c-gpio";
-- 
2.1.4



[PATCH 16/30] ARM: dts: r8a7793: Fix W=1 dtc warnings

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Warning (unit_address_vs_reg): Node /cache-controller@0 has a unit name, but no 
reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,dvc/dvc@0 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,dvc/dvc@1 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,src/src@0 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,src/src@1 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,src/src@2 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,src/src@3 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,src/src@4 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,src/src@5 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,src/src@6 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,src/src@7 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,src/src@8 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,src/src@9 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ssi/ssi@0 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ssi/ssi@1 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ssi/ssi@2 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ssi/ssi@3 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ssi/ssi@4 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ssi/ssi@5 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ssi/ssi@6 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ssi/ssi@7 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ssi/ssi@8 has a 
unit name, but no reg property
Warning (unit_address_vs_reg): Node /sound@ec50/rcar_sound,ssi/ssi@9 has a 
unit name, but no reg property

Move the cache-controller node under the cpus node, and make its unit
name and reg property match the MPIDR values.

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r8a7793.dtsi | 59 +-
 1 file changed, 30 insertions(+), 29 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7793.dtsi b/arch/arm/boot/dts/r8a7793.dtsi
index 5f50e9b5d804..9b55c1c6ee31 100644
--- a/arch/arm/boot/dts/r8a7793.dtsi
+++ b/arch/arm/boot/dts/r8a7793.dtsi
@@ -55,6 +55,14 @@
   < 375000 100>;
next-level-cache = <_CA15>;
};
+
+   L2_CA15: cache-controller@0 {
+   compatible = "cache";
+   reg = <0>;
+   power-domains = < R8A7793_PD_CA15_SCU>;
+   cache-unified;
+   cache-level = <2>;
+   };
};
 
thermal-zones {
@@ -76,13 +84,6 @@
};
};
 
-   L2_CA15: cache-controller@0 {
-   compatible = "cache";
-   power-domains = < R8A7793_PD_CA15_SCU>;
-   cache-unified;
-   cache-level = <2>;
-   };
-
gic: interrupt-controller@f1001000 {
compatible = "arm,gic-400";
#interrupt-cells = <3>;
@@ -1369,63 +1370,63 @@
status = "disabled";
 
rcar_sound,dvc {
-   dvc0: dvc@0 {
+   dvc0: dvc-0 {
dmas = < 0xbc>;
dma-names = "tx";
};
-   dvc1: dvc@1 {
+   dvc1: dvc-1 {
dmas = < 0xbe>;
dma-names = "tx";
};
};
 
rcar_sound,src {
-   src0: src@0 {
+   src0: src-0 {
interrupts = ;
dmas = < 0x85>, < 0x9a>;
dma-names = "rx", "tx";
};
-   src1: src@1 {
+   src1: src-1 {
interrupts = ;
dmas 

[PATCH 12/30] ARM: dts: r8a7740: Fix W=1 dtc warnings

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Warning (unit_address_vs_reg): Node /cache-controller has a reg or ranges 
property, but no unit name

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r8a7740.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r8a7740.dtsi b/arch/arm/boot/dts/r8a7740.dtsi
index 39b2f88ad151..159e04eb1b9e 100644
--- a/arch/arm/boot/dts/r8a7740.dtsi
+++ b/arch/arm/boot/dts/r8a7740.dtsi
@@ -39,7 +39,7 @@
  <0xc200 0x1000>;
};
 
-   L2: cache-controller {
+   L2: cache-controller@f010 {
compatible = "arm,pl310-cache";
reg = <0xf010 0x1000>;
interrupts = ;
-- 
2.1.4



[PATCH 22/30] ARM: dts: genmai: Fix W=1 dtc warnings

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Warning (unit_address_vs_reg): Node /memory has a reg or ranges property, but 
no unit name

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r7s72100-genmai.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/r7s72100-genmai.dts 
b/arch/arm/boot/dts/r7s72100-genmai.dts
index a9da7a89fc4b..05ba9953b4d8 100644
--- a/arch/arm/boot/dts/r7s72100-genmai.dts
+++ b/arch/arm/boot/dts/r7s72100-genmai.dts
@@ -25,7 +25,7 @@
stdout-path = 
};
 
-   memory {
+   memory@800 {
device_type = "memory";
reg = <0x0800 0x0800>;
};
-- 
2.1.4



[PATCH 26/30] ARM: dts: kzm9g: Fix W=1 dtc warnings

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Warning (unit_address_vs_reg): Node /memory has a reg or ranges property, but 
no unit name
Warning (unit_address_vs_reg): Node /regulator@0 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@1 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@2 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@3 has a unit name, but no reg 
property

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/sh73a0-kzm9g.dts | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/dts/sh73a0-kzm9g.dts 
b/arch/arm/boot/dts/sh73a0-kzm9g.dts
index 9881adf1734e..36567cbf2e1c 100644
--- a/arch/arm/boot/dts/sh73a0-kzm9g.dts
+++ b/arch/arm/boot/dts/sh73a0-kzm9g.dts
@@ -43,12 +43,12 @@
stdout-path = 
};
 
-   memory {
+   memory@4000 {
device_type = "memory";
reg = <0x4000 0x2000>;
};
 
-   reg_1p8v: regulator@0 {
+   reg_1p8v: regulator-1p8v {
compatible = "regulator-fixed";
regulator-name = "fixed-1.8V";
regulator-min-microvolt = <180>;
@@ -57,7 +57,7 @@
regulator-boot-on;
};
 
-   reg_3p3v: regulator@1 {
+   reg_3p3v: regulator-3p3v {
compatible = "regulator-fixed";
regulator-name = "fixed-3.3V";
regulator-min-microvolt = <330>;
@@ -66,7 +66,7 @@
regulator-boot-on;
};
 
-   vmmc_sdhi0: regulator@2 {
+   vmmc_sdhi0: regulator-vmmc-sdhi0 {
compatible = "regulator-fixed";
regulator-name = "SDHI0 Vcc";
regulator-min-microvolt = <330>;
@@ -75,7 +75,7 @@
enable-active-high;
};
 
-   vmmc_sdhi2: regulator@3 {
+   vmmc_sdhi2: regulator-vmmc-sdhi2 {
compatible = "regulator-fixed";
regulator-name = "SDHI2 Vcc";
regulator-min-microvolt = <330>;
-- 
2.1.4



[PATCH 17/30] ARM: dts: r8a7794: Fix W=1 dtc warnings

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Warning (unit_address_vs_reg): Node /cache-controller@1 has a unit name, but no 
reg property

Move the cache-controller node under the cpus node, and make its unit
name and reg property match the MPIDR value.

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r8a7794.dtsi | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7794.dtsi b/arch/arm/boot/dts/r8a7794.dtsi
index ad1df8317575..685f986cf962 100644
--- a/arch/arm/boot/dts/r8a7794.dtsi
+++ b/arch/arm/boot/dts/r8a7794.dtsi
@@ -55,13 +55,14 @@
power-domains = < R8A7794_PD_CA7_CPU1>;
next-level-cache = <_CA7>;
};
-   };
 
-   L2_CA7: cache-controller@1 {
-   compatible = "cache";
-   power-domains = < R8A7794_PD_CA7_SCU>;
-   cache-unified;
-   cache-level = <2>;
+   L2_CA7: cache-controller@0 {
+   compatible = "cache";
+   reg = <0>;
+   power-domains = < R8A7794_PD_CA7_SCU>;
+   cache-unified;
+   cache-level = <2>;
+   };
};
 
gic: interrupt-controller@f1001000 {
-- 
2.1.4



[PATCH 07/30] ARM: dts: r8a7793: Reference both DMA controllers

2016-06-07 Thread Simon Horman
From: Niklas Söderlund 

R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can choose which one to
use.

Signed-off-by: Niklas Söderlund 
Reviewed-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r8a7793.dtsi | 130 -
 1 file changed, 78 insertions(+), 52 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7793.dtsi b/arch/arm/boot/dts/r8a7793.dtsi
index 76c8435f283c..5f50e9b5d804 100644
--- a/arch/arm/boot/dts/r8a7793.dtsi
+++ b/arch/arm/boot/dts/r8a7793.dtsi
@@ -473,8 +473,9 @@
reg = <0 0xe60b 0 0x425>;
interrupts = ;
clocks = <_clks R8A7793_CLK_IICDVFS>;
-   dmas = < 0x77>, < 0x78>;
-   dma-names = "tx", "rx";
+   dmas = < 0x77>, < 0x78>,
+  < 0x77>, < 0x78>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7793_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -486,8 +487,9 @@
reg = <0 0xe650 0 0x425>;
interrupts = ;
clocks = <_clks R8A7793_CLK_IIC0>;
-   dmas = < 0x61>, < 0x62>;
-   dma-names = "tx", "rx";
+   dmas = < 0x61>, < 0x62>,
+  < 0x61>, < 0x62>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7793_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -499,8 +501,9 @@
reg = <0 0xe651 0 0x425>;
interrupts = ;
clocks = <_clks R8A7793_CLK_IIC1>;
-   dmas = < 0x65>, < 0x66>;
-   dma-names = "tx", "rx";
+   dmas = < 0x65>, < 0x66>,
+  < 0x65>, < 0x66>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7793_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -515,8 +518,9 @@
reg = <0 0xee10 0 0x328>;
interrupts = ;
clocks = <_clks R8A7793_CLK_SDHI0>;
-   dmas = < 0xcd>, < 0xce>;
-   dma-names = "tx", "rx";
+   dmas = < 0xcd>, < 0xce>,
+  < 0xcd>, < 0xce>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7793_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -526,8 +530,9 @@
reg = <0 0xee14 0 0x100>;
interrupts = ;
clocks = <_clks R8A7793_CLK_SDHI1>;
-   dmas = < 0xc1>, < 0xc2>;
-   dma-names = "tx", "rx";
+   dmas = < 0xc1>, < 0xc2>,
+  < 0xc1>, < 0xc2>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7793_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -537,8 +542,9 @@
reg = <0 0xee16 0 0x100>;
interrupts = ;
clocks = <_clks R8A7793_CLK_SDHI2>;
-   dmas = < 0xd3>, < 0xd4>;
-   dma-names = "tx", "rx";
+   dmas = < 0xd3>, < 0xd4>,
+  < 0xd3>, < 0xd4>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7793_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -548,8 +554,9 @@
reg = <0 0xee20 0 0x80>;
interrupts = ;
clocks = <_clks R8A7793_CLK_MMCIF0>;
-   dmas = < 0xd1>, < 0xd2>;
-   dma-names = "tx", "rx";
+   dmas = < 0xd1>, < 0xd2>,
+  < 0xd1>, < 0xd2>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7793_PD_ALWAYS_ON>;
reg-io-width = <4>;
status = "disabled";
@@ -563,8 +570,9 @@
interrupts = ;
clocks = <_clks R8A7793_CLK_SCIFA0>;
clock-names = "fck";
-   dmas = < 0x21>, < 0x22>;
-   dma-names = "tx", "rx";
+   dmas = < 0x21>, < 0x22>,
+  < 0x21>, < 0x22>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7793_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -576,8 +584,9 @@
interrupts = ;
clocks = <_clks R8A7793_CLK_SCIFA1>;
clock-names = "fck";
-   dmas = < 0x25>, < 0x26>;
-   dma-names = "tx", "rx";
+   dmas = < 0x25>, < 0x26>,
+  < 0x25>, < 0x26>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7793_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -589,8 +598,9 @@
interrupts = 

[PATCH 19/30] ARM: dts: ape6evm: Fix W=1 dtc warnings

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Warning (unit_address_vs_reg): Node /regulator@0 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@1 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@2 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@3 has a unit name, but no reg 
property

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r8a73a4-ape6evm.dts | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/r8a73a4-ape6evm.dts 
b/arch/arm/boot/dts/r8a73a4-ape6evm.dts
index 93ace33e3e36..740e5d23f7c7 100644
--- a/arch/arm/boot/dts/r8a73a4-ape6evm.dts
+++ b/arch/arm/boot/dts/r8a73a4-ape6evm.dts
@@ -36,7 +36,7 @@
reg = <2 0x 0 0x4000>;
};
 
-   vcc_mmc0: regulator@0 {
+   vcc_mmc0: regulator-mmc0 {
compatible = "regulator-fixed";
regulator-name = "MMC0 Vcc";
regulator-min-microvolt = <280>;
@@ -44,7 +44,7 @@
regulator-always-on;
};
 
-   vcc_sdhi0: regulator@1 {
+   vcc_sdhi0: regulator-sdhi0 {
compatible = "regulator-fixed";
 
regulator-name = "SDHI0 Vcc";
@@ -56,7 +56,7 @@
};
 
/* Common 1.8V and 3.3V rails, used by several devices on APE6EVM */
-   ape6evm_fixed_1v8: regulator@2 {
+   ape6evm_fixed_1v8: regulator-1v8 {
compatible = "regulator-fixed";
regulator-name = "1V8";
regulator-min-microvolt = <180>;
@@ -64,7 +64,7 @@
regulator-always-on;
};
 
-   ape6evm_fixed_3v3: regulator@3 {
+   ape6evm_fixed_3v3: regulator-3v3 {
compatible = "regulator-fixed";
regulator-name = "3V3";
regulator-min-microvolt = <330>;
-- 
2.1.4



[PATCH 23/30] ARM: dts: gose: Fix W=1 dtc warnings

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Warning (unit_address_vs_reg): Node /regulator@0 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@1 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@2 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@3 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@4 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@5 has a unit name, but no reg 
property

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r8a7793-gose.dts | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7793-gose.dts 
b/arch/arm/boot/dts/r8a7793-gose.dts
index 0ebc3ee34923..f748360ee857 100644
--- a/arch/arm/boot/dts/r8a7793-gose.dts
+++ b/arch/arm/boot/dts/r8a7793-gose.dts
@@ -158,7 +158,7 @@
};
};
 
-   vcc_sdhi0: regulator@0 {
+   vcc_sdhi0: regulator-vcc-sdhi0 {
compatible = "regulator-fixed";
 
regulator-name = "SDHI0 Vcc";
@@ -169,7 +169,7 @@
enable-active-high;
};
 
-   vccq_sdhi0: regulator@1 {
+   vccq_sdhi0: regulator-vccq-sdhi0 {
compatible = "regulator-gpio";
 
regulator-name = "SDHI0 VccQ";
@@ -182,7 +182,7 @@
  180 0>;
};
 
-   vcc_sdhi1: regulator@2 {
+   vcc_sdhi1: regulator-vcc-sdhi1 {
compatible = "regulator-fixed";
 
regulator-name = "SDHI1 Vcc";
@@ -193,7 +193,7 @@
enable-active-high;
};
 
-   vccq_sdhi1: regulator@3 {
+   vccq_sdhi1: regulator-vccq-sdhi1 {
compatible = "regulator-gpio";
 
regulator-name = "SDHI1 VccQ";
@@ -206,7 +206,7 @@
  180 0>;
};
 
-   vcc_sdhi2: regulator@4 {
+   vcc_sdhi2: regulator-vcc-sdhi2 {
compatible = "regulator-fixed";
 
regulator-name = "SDHI2 Vcc";
@@ -217,7 +217,7 @@
enable-active-high;
};
 
-   vccq_sdhi2: regulator@5 {
+   vccq_sdhi2: regulator-vccq-sdhi2 {
compatible = "regulator-gpio";
 
regulator-name = "SDHI2 VccQ";
-- 
2.1.4



[PATCH 11/30] ARM: dts: r8a73a4: Fix W=1 dtc warnings

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Warning (unit_address_vs_reg): Node /cache-controller@0 has a unit name, but no 
reg property
Warning (unit_address_vs_reg): Node /cache-controller@1 has a unit name, but no 
reg property

Move the cache-controller nodes under the cpus node, and make their
unit names and reg properties match the MPIDR values.

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r8a73a4.dtsi | 34 ++
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/arch/arm/boot/dts/r8a73a4.dtsi b/arch/arm/boot/dts/r8a73a4.dtsi
index 6954912a3753..ca8672778fe0 100644
--- a/arch/arm/boot/dts/r8a73a4.dtsi
+++ b/arch/arm/boot/dts/r8a73a4.dtsi
@@ -31,6 +31,24 @@
power-domains = <_a2sl>;
next-level-cache = <_CA15>;
};
+
+   L2_CA15: cache-controller@0 {
+   compatible = "cache";
+   reg = <0>;
+   clocks = <_clocks R8A73A4_CLK_Z>;
+   power-domains = <_a3sm>;
+   cache-unified;
+   cache-level = <2>;
+   };
+
+   L2_CA7: cache-controller@100 {
+   compatible = "cache";
+   reg = <0x100>;
+   clocks = <_clocks R8A73A4_CLK_Z2>;
+   power-domains = <_a3km>;
+   cache-unified;
+   cache-level = <2>;
+   };
};
 
ptm {
@@ -46,22 +64,6 @@
 ;
};
 
-   L2_CA15: cache-controller@0 {
-   compatible = "cache";
-   clocks = <_clocks R8A73A4_CLK_Z>;
-   power-domains = <_a3sm>;
-   cache-unified;
-   cache-level = <2>;
-   };
-
-   L2_CA7: cache-controller@1 {
-   compatible = "cache";
-   clocks = <_clocks R8A73A4_CLK_Z2>;
-   power-domains = <_a3km>;
-   cache-unified;
-   cache-level = <2>;
-   };
-
dbsc1: memory-controller@e679 {
compatible = "renesas,dbsc-r8a73a4";
reg = <0 0xe679 0 0x1>;
-- 
2.1.4



[PATCH 05/30] ARM: dts: r8a7790: Reference both DMA controllers

2016-06-07 Thread Simon Horman
From: Niklas Söderlund 

R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can choose which one to
use.

Signed-off-by: Niklas Söderlund 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r8a7790.dtsi | 130 -
 1 file changed, 78 insertions(+), 52 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 3b9e98be2f7b..97f4c1dc3ae8 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -517,8 +517,9 @@
reg = <0 0xe650 0 0x425>;
interrupts = ;
clocks = <_clks R8A7790_CLK_IIC0>;
-   dmas = < 0x61>, < 0x62>;
-   dma-names = "tx", "rx";
+   dmas = < 0x61>, < 0x62>,
+  < 0x61>, < 0x62>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7790_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -530,8 +531,9 @@
reg = <0 0xe651 0 0x425>;
interrupts = ;
clocks = <_clks R8A7790_CLK_IIC1>;
-   dmas = < 0x65>, < 0x66>;
-   dma-names = "tx", "rx";
+   dmas = < 0x65>, < 0x66>,
+  < 0x65>, < 0x66>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7790_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -543,8 +545,9 @@
reg = <0 0xe652 0 0x425>;
interrupts = ;
clocks = <_clks R8A7790_CLK_IIC2>;
-   dmas = < 0x69>, < 0x6a>;
-   dma-names = "tx", "rx";
+   dmas = < 0x69>, < 0x6a>,
+  < 0x69>, < 0x6a>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7790_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -556,8 +559,9 @@
reg = <0 0xe60b 0 0x425>;
interrupts = ;
clocks = <_clks R8A7790_CLK_IICDVFS>;
-   dmas = < 0x77>, < 0x78>;
-   dma-names = "tx", "rx";
+   dmas = < 0x77>, < 0x78>,
+  < 0x77>, < 0x78>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7790_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -567,8 +571,9 @@
reg = <0 0xee20 0 0x80>;
interrupts = ;
clocks = <_clks R8A7790_CLK_MMCIF0>;
-   dmas = < 0xd1>, < 0xd2>;
-   dma-names = "tx", "rx";
+   dmas = < 0xd1>, < 0xd2>,
+  < 0xd1>, < 0xd2>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7790_PD_ALWAYS_ON>;
reg-io-width = <4>;
status = "disabled";
@@ -580,8 +585,9 @@
reg = <0 0xee22 0 0x80>;
interrupts = ;
clocks = <_clks R8A7790_CLK_MMCIF1>;
-   dmas = < 0xe1>, < 0xe2>;
-   dma-names = "tx", "rx";
+   dmas = < 0xe1>, < 0xe2>,
+  < 0xe1>, < 0xe2>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7790_PD_ALWAYS_ON>;
reg-io-width = <4>;
status = "disabled";
@@ -598,8 +604,9 @@
reg = <0 0xee10 0 0x328>;
interrupts = ;
clocks = <_clks R8A7790_CLK_SDHI0>;
-   dmas = < 0xcd>, < 0xce>;
-   dma-names = "tx", "rx";
+   dmas = < 0xcd>, < 0xce>,
+  < 0xcd>, < 0xce>;
+   dma-names = "tx", "rx", "tx", "rx";
max-frequency = <19500>;
power-domains = < R8A7790_PD_ALWAYS_ON>;
status = "disabled";
@@ -610,8 +617,9 @@
reg = <0 0xee12 0 0x328>;
interrupts = ;
clocks = <_clks R8A7790_CLK_SDHI1>;
-   dmas = < 0xc9>, < 0xca>;
-   dma-names = "tx", "rx";
+   dmas = < 0xc9>, < 0xca>,
+  < 0xc9>, < 0xca>;
+   dma-names = "tx", "rx", "tx", "rx";
max-frequency = <19500>;
power-domains = < R8A7790_PD_ALWAYS_ON>;
status = "disabled";
@@ -622,8 +630,9 @@
reg = <0 0xee14 0 0x100>;
interrupts = ;
clocks = <_clks R8A7790_CLK_SDHI2>;
-   dmas = < 0xc1>, < 0xc2>;
-   dma-names = "tx", "rx";
+   dmas = < 0xc1>, < 0xc2>,
+  < 0xc1>, < 0xc2>;
+   dma-names = "tx", "rx", "tx", "rx";
max-frequency = <9750>;
power-domains = < R8A7790_PD_ALWAYS_ON>;
   

[PATCH 04/30] ARM: dts: r8a7790: Correct unit names for cpu nodes

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Make the unit names for the cpu nodes match their reg properties.

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r8a7790.dtsi | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 83cf23cd26bb..3b9e98be2f7b 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -92,7 +92,7 @@
next-level-cache = <_CA15>;
};
 
-   cpu4: cpu@4 {
+   cpu4: cpu@100 {
device_type = "cpu";
compatible = "arm,cortex-a7";
reg = <0x100>;
@@ -101,7 +101,7 @@
next-level-cache = <_CA7>;
};
 
-   cpu5: cpu@5 {
+   cpu5: cpu@101 {
device_type = "cpu";
compatible = "arm,cortex-a7";
reg = <0x101>;
@@ -110,7 +110,7 @@
next-level-cache = <_CA7>;
};
 
-   cpu6: cpu@6 {
+   cpu6: cpu@102 {
device_type = "cpu";
compatible = "arm,cortex-a7";
reg = <0x102>;
@@ -119,7 +119,7 @@
next-level-cache = <_CA7>;
};
 
-   cpu7: cpu@7 {
+   cpu7: cpu@103 {
device_type = "cpu";
compatible = "arm,cortex-a7";
reg = <0x103>;
-- 
2.1.4



[PATCH 06/30] ARM: dts: r8a7791: Reference both DMA controllers

2016-06-07 Thread Simon Horman
From: Niklas Söderlund 

R-Car Gen2 have two DMA controllers, which are equivalent. Add
references to both dmac0 and dmac1 so the driver can choose which one to
use.

Signed-off-by: Niklas Söderlund 
Reviewed-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r8a7791.dtsi | 145 -
 1 file changed, 87 insertions(+), 58 deletions(-)

diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index db67e342c585..2f924146d381 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -514,8 +514,9 @@
reg = <0 0xe60b 0 0x425>;
interrupts = ;
clocks = <_clks R8A7791_CLK_IICDVFS>;
-   dmas = < 0x77>, < 0x78>;
-   dma-names = "tx", "rx";
+   dmas = < 0x77>, < 0x78>,
+  < 0x77>, < 0x78>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7791_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -527,8 +528,9 @@
reg = <0 0xe650 0 0x425>;
interrupts = ;
clocks = <_clks R8A7791_CLK_IIC0>;
-   dmas = < 0x61>, < 0x62>;
-   dma-names = "tx", "rx";
+   dmas = < 0x61>, < 0x62>,
+  < 0x61>, < 0x62>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7791_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -540,8 +542,9 @@
reg = <0 0xe651 0 0x425>;
interrupts = ;
clocks = <_clks R8A7791_CLK_IIC1>;
-   dmas = < 0x65>, < 0x66>;
-   dma-names = "tx", "rx";
+   dmas = < 0x65>, < 0x66>,
+  < 0x65>, < 0x66>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7791_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -556,8 +559,9 @@
reg = <0 0xee20 0 0x80>;
interrupts = ;
clocks = <_clks R8A7791_CLK_MMCIF0>;
-   dmas = < 0xd1>, < 0xd2>;
-   dma-names = "tx", "rx";
+   dmas = < 0xd1>, < 0xd2>,
+  < 0xd1>, < 0xd2>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7791_PD_ALWAYS_ON>;
reg-io-width = <4>;
status = "disabled";
@@ -569,8 +573,9 @@
reg = <0 0xee10 0 0x328>;
interrupts = ;
clocks = <_clks R8A7791_CLK_SDHI0>;
-   dmas = < 0xcd>, < 0xce>;
-   dma-names = "tx", "rx";
+   dmas = < 0xcd>, < 0xce>,
+  < 0xcd>, < 0xce>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7791_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -580,8 +585,9 @@
reg = <0 0xee14 0 0x100>;
interrupts = ;
clocks = <_clks R8A7791_CLK_SDHI1>;
-   dmas = < 0xc1>, < 0xc2>;
-   dma-names = "tx", "rx";
+   dmas = < 0xc1>, < 0xc2>,
+  < 0xc1>, < 0xc2>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7791_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -591,8 +597,9 @@
reg = <0 0xee16 0 0x100>;
interrupts = ;
clocks = <_clks R8A7791_CLK_SDHI2>;
-   dmas = < 0xd3>, < 0xd4>;
-   dma-names = "tx", "rx";
+   dmas = < 0xd3>, < 0xd4>,
+  < 0xd3>, < 0xd4>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7791_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -604,8 +611,9 @@
interrupts = ;
clocks = <_clks R8A7791_CLK_SCIFA0>;
clock-names = "fck";
-   dmas = < 0x21>, < 0x22>;
-   dma-names = "tx", "rx";
+   dmas = < 0x21>, < 0x22>,
+  < 0x21>, < 0x22>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7791_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -617,8 +625,9 @@
interrupts = ;
clocks = <_clks R8A7791_CLK_SCIFA1>;
clock-names = "fck";
-   dmas = < 0x25>, < 0x26>;
-   dma-names = "tx", "rx";
+   dmas = < 0x25>, < 0x26>,
+  < 0x25>, < 0x26>;
+   dma-names = "tx", "rx", "tx", "rx";
power-domains = < R8A7791_PD_ALWAYS_ON>;
status = "disabled";
};
@@ -630,8 +639,9 @@
interrupts = 

[PATCH 4/9] arm64: dts: r8a7795: Add RWDT node

2016-06-07 Thread Simon Horman
From: Wolfram Sang 

This patch adds the RWDT device node for r8a7795.

Signed-off-by: Takeshi Kihara 
Signed-off-by: Wolfram Sang 
Reviewed-by: Geert Uytterhoeven 
Acked-by: Guenter Roeck 
Signed-off-by: Simon Horman 
---
 arch/arm64/boot/dts/renesas/r8a7795.dtsi | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a7795.dtsi 
b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
index f8c7e331fdc6..ba87e03969ee 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
@@ -164,6 +164,14 @@
(GIC_CPU_MASK_SIMPLE(4) | 
IRQ_TYPE_LEVEL_HIGH)>;
};
 
+   wdt0: watchdog@e602 {
+   compatible = "renesas,r8a7795-wdt", 
"renesas,rcar-gen3-wdt";
+   reg = <0 0xe602 0 0x0c>;
+   clocks = < CPG_MOD 402>;
+   power-domains = <>;
+   status = "disabled";
+   };
+
gpio0: gpio@e605 {
compatible = "renesas,gpio-r8a7795",
 "renesas,gpio-rcar";
-- 
2.1.4



[PATCH 8/9] arm64: dts: salvator-x: Fix W=1 dtc warnings

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Warning (unit_address_vs_reg): Node /regulator@1 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@2 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@3 has a unit name, but no reg 
property
Warning (unit_address_vs_reg): Node /regulator@4 has a unit name, but no reg 
property

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts 
b/arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts
index 84082922edb2..98f02631a0f0 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts
+++ b/arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts
@@ -62,7 +62,7 @@
clock-frequency = <24576000>;
};
 
-   vcc_sdhi0: regulator@1 {
+   vcc_sdhi0: regulator-vcc-sdhi0 {
compatible = "regulator-fixed";
 
regulator-name = "SDHI0 Vcc";
@@ -73,7 +73,7 @@
enable-active-high;
};
 
-   vccq_sdhi0: regulator@2 {
+   vccq_sdhi0: regulator-vccq-sdhi0 {
compatible = "regulator-gpio";
 
regulator-name = "SDHI0 VccQ";
@@ -86,7 +86,7 @@
  180 0>;
};
 
-   vcc_sdhi3: regulator@3 {
+   vcc_sdhi3: regulator-vcc-sdhi3 {
compatible = "regulator-fixed";
 
regulator-name = "SDHI3 Vcc";
@@ -97,7 +97,7 @@
enable-active-high;
};
 
-   vccq_sdhi3: regulator@4 {
+   vccq_sdhi3: regulator-vccq-sdhi3 {
compatible = "regulator-gpio";
 
regulator-name = "SDHI3 VccQ";
-- 
2.1.4



[PATCH 7/9] arm64: dts: r8a7795: Fix W=1 dtc warnings

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

Warning (unit_address_vs_reg): Node /cache-controller@0 has a unit name, but no 
reg property
Warning (unit_address_vs_reg): Node /cache-controller@1 has a unit name, but no 
reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,dvc/dvc@0 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,dvc/dvc@1 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,src/src@0 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,src/src@1 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,src/src@2 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,src/src@3 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,src/src@4 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,src/src@5 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,src/src@6 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,src/src@7 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,src/src@8 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,src/src@9 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,ssi/ssi@0 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,ssi/ssi@1 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,ssi/ssi@2 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,ssi/ssi@3 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,ssi/ssi@4 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,ssi/ssi@5 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,ssi/ssi@6 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,ssi/ssi@7 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,ssi/ssi@8 
has a unit name, but no reg property
Warning (unit_address_vs_reg): Node /soc/sound@ec50/rcar_sound,ssi/ssi@9 
has a unit name, but no reg property

Move the cache-controller nodes under the cpus node, and make their unit
names and reg properties match the MPIDR values.

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm64/boot/dts/renesas/r8a7795.dtsi | 70 
 1 file changed, 36 insertions(+), 34 deletions(-)

diff --git a/arch/arm64/boot/dts/renesas/r8a7795.dtsi 
b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
index bf38df355006..a4f4ec8daa21 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
@@ -69,20 +69,22 @@
next-level-cache = <_CA57>;
enable-method = "psci";
};
-   };
 
-   L2_CA57: cache-controller@0 {
-   compatible = "cache";
-   power-domains = < R8A7795_PD_CA57_SCU>;
-   cache-unified;
-   cache-level = <2>;
-   };
+   L2_CA57: cache-controller@0 {
+   compatible = "cache";
+   reg = <0>;
+   power-domains = < R8A7795_PD_CA57_SCU>;
+   cache-unified;
+   cache-level = <2>;
+   };
 
-   L2_CA53: cache-controller@1 {
-   compatible = "cache";
-   power-domains = < R8A7795_PD_CA53_SCU>;
-   cache-unified;
-   cache-level = <2>;
+   L2_CA53: cache-controller@100 {
+   compatible = "cache";
+   reg = <0x100>;
+   power-domains = < R8A7795_PD_CA53_SCU>;
+   cache-unified;
+   cache-level = <2>;
+   };
};
 
extal_clk: extal {
@@ -896,63 +898,63 @@
status = "disabled";
 
rcar_sound,dvc {
-   dvc0: dvc@0 {
+   dvc0: dvc-0 {
dmas = < 0xbc>;
dma-names = "tx";
};
-   dvc1: dvc@1 {
+   

[PATCH 9/9] arm64: dts: r8a7795: Drop 0x from unit address of gic

2016-06-07 Thread Simon Horman
Drop 0x from unit address of gic as this is the desired form for
a unit address.

Signed-off-by: Simon Horman 
Acked-by: Geert Uytterhoeven 
---
 arch/arm64/boot/dts/renesas/r8a7795.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/renesas/r8a7795.dtsi 
b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
index a4f4ec8daa21..04eb0bc65634 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
@@ -153,7 +153,7 @@
#size-cells = <2>;
ranges;
 
-   gic: interrupt-controller@0xf101 {
+   gic: interrupt-controller@f101 {
compatible = "arm,gic-400";
#interrupt-cells = <3>;
#address-cells = <0>;
-- 
2.1.4



[PATCH 01/30] ARM: dts: r8a7793: Add MMCIF0

2016-06-07 Thread Simon Horman
From: Ulrich Hecht 

Same as on r8a7791.

Signed-off-by: Ulrich Hecht 
Acked-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm/boot/dts/r8a7793.dtsi | 13 +
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/r8a7793.dtsi b/arch/arm/boot/dts/r8a7793.dtsi
index 1dd6d202cd4c..76c8435f283c 100644
--- a/arch/arm/boot/dts/r8a7793.dtsi
+++ b/arch/arm/boot/dts/r8a7793.dtsi
@@ -543,6 +543,19 @@
status = "disabled";
};
 
+   mmcif0: mmc@ee20 {
+   compatible = "renesas,mmcif-r8a7793", "renesas,sh-mmcif";
+   reg = <0 0xee20 0 0x80>;
+   interrupts = ;
+   clocks = <_clks R8A7793_CLK_MMCIF0>;
+   dmas = < 0xd1>, < 0xd2>;
+   dma-names = "tx", "rx";
+   power-domains = < R8A7793_PD_ALWAYS_ON>;
+   reg-io-width = <4>;
+   status = "disabled";
+   max-frequency = <9750>;
+   };
+
scifa0: serial@e6c4 {
compatible = "renesas,scifa-r8a7793",
 "renesas,rcar-gen2-scifa", "renesas,scifa";
-- 
2.1.4



[PATCH 1/9] arm64: dts: salvator-x: SCIF1 supports RTS/CTS hardware flow control

2016-06-07 Thread Simon Horman
From: Geert Uytterhoeven 

On the Salvator-X development board, the RTS and CTS pins of debug
serial-1 port SCIF1 are wired to the CP2102 Serial-USB bridge.  Reflect
this in the DTS by adding the "uart-has-rtscts" property to the scif1
device node.

Signed-off-by: Geert Uytterhoeven 
Signed-off-by: Simon Horman 
---
 arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts 
b/arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts
index 9f561c943f6f..76bc94a528aa 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts
+++ b/arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts
@@ -208,6 +208,7 @@
pinctrl-0 = <_pins>;
pinctrl-names = "default";
 
+   uart-has-rtscts;
status = "okay";
 };
 
-- 
2.1.4



Re: [PATCH] ASoC: rsnd: adg :: AUDIO-CLKOUTn can synchronizes with L/R clock.

2016-06-07 Thread Kuninori Morimoto

Hi Mark

> > AUDIO-CLKOUTn can synchronizes with L/R clock, and Salvator board
> > needs it. Otherwise, specific frequency sound will be noisy.
> 
> Why would a user not want these clocks to be synchronous?  A lot of
> CODECs will at least have better performance if their master clock is
> synchronous to the audio clocks so it'd be a better default, is there an
> advantage to not doing it?

I'm now confusing. We can set system clock on audio card, for example
simple-card case, it is called as "system-clock-frequency".
In my understanding, this "system clock" and above "master clock" are same 
clock.
but "system clock" is fixed rate (= not related to audio clock in many cases).
Because of this, some codec doesn't request synchronous between
master clock <-> audio clock, but, some codec requests synchronous it.
Am I wrong ??


Re: [PATCH v2 06/11] iommu/ipmmu-vmsa: Teach xlate() to skip disabled iommus

2016-06-07 Thread Laurent Pinchart
Hi Magnus,

Thank you for the patch.

I agree with the comment that Geert made on v1, and I haven't seen you 
replying to it or addressing it.

Quoting Geert,

"I think this should be handled in drivers/iommu/of_iommu.c:of_iommu_init()
instead, cfr. commit 3e5dd6f6e690048d ("clk: Ignore disabled DT clock
providers")."

On Monday 06 Jun 2016 12:58:22 Magnus Damm wrote:
> From: Magnus Damm 
> 
> The ->xlate() call gets invoked even though the iommu
> device has status = "disabled" in DT, so make sure we
> skip over disabled devices.
> 
> In my mind it would make sense to have this at some
> shared level, but I guess some users may want to
> configure the iommu regardless of DT state.
> 
> Signed-off-by: Magnus Damm 
> ---
> 
>  Changes since V1:
>  - Reworked slightly to fit on top of updated patch order
> 
>  drivers/iommu/ipmmu-vmsa.c |8 +++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> --- 0017/drivers/iommu/ipmmu-vmsa.c
> +++ work/drivers/iommu/ipmmu-vmsa.c   2016-06-06 10:58:18.530607110 +0900
> @@ -1001,7 +1001,13 @@ static struct iommu_group *ipmmu_device_
>  static int ipmmu_of_xlate_dma(struct device *dev,
> struct of_phandle_args *spec)
>  {
> - /* dummy callback to satisfy of_iommu_configure() */
> + /* If the IPMMU device is disabled in DT then return error
> +  * to make sure the of_iommu code does not install ops
> +  * even though the iommu device is disabled
> +  */
> + if (!of_device_is_available(spec->np))
> + return -ENODEV;
> +
>   return 0;
>  }

-- 
Regards,

Laurent Pinchart



Re: [PATCH 0/9] clocksource/drivers/clksrc-of: Improve error handling

2016-06-07 Thread Daniel Lezcano

On 06/07/2016 11:54 AM, Geert Uytterhoeven wrote:

Hi Daniel,


Hi Geert,

[ ... ]


Using "earlycon keep_bootcon" on koelsch (this doesn't help on arm64)
reveals it's stuck at:

 clocksource_probe: no matching clocksources found
 sched_clock: 32 bits at 100 Hz, resolution 1000ns, wraps every
2147483647500ns
 Calibrating delay loop...



Ok, so the "renesas,cmt-48-gen2" is not impacted by the changes because 
it uses the platform approach. Very likely, the issue is coming from the 
arch_arm_timer failing somewhere.


Or I added a regression and the timer is wrongly returning an error, or 
the error is always there and now it is caught.


Can you give the traces before 'clocksource_probe: no matching 
clocksources found' ?


  -- Daniel

--
  Linaro.org │ Open source software for ARM SoCs

Follow Linaro:   Facebook |
 Twitter |
 Blog



Re: [PATCH v3 00/06] iommu/ipmmu-vmsa: IPMMU multi-arch update V3

2016-06-07 Thread Geert Uytterhoeven
Hi Magnus,

On Thu, Jun 2, 2016 at 5:55 PM, Magnus Damm  wrote:
> iommu/ipmmu-vmsa: IPMMU multi-arch update V3
>
> [PATCH v3 01/06] iommu/ipmmu-vmsa: Remove platform data handling
> [PATCH v3 02/06] iommu/ipmmu-vmsa: Rework interrupt code and use bitmap for 
> context
> [PATCH v3 03/06] iommu/ipmmu-vmsa: Break out utlb parsing code
> [PATCH v3 04/06] iommu/ipmmu-vmsa: Break out domain allocation code
> [PATCH v3 05/06] iommu/ipmmu-vmsa: Add new IOMMU_DOMAIN_DMA ops
> [PATCH v3 06/06] iommu/ipmmu-vmsa: Drop LPAE Kconfig dependency
>
> These patches update the IPMMU driver with a couple of changes
> to support build on multiple architectures. In the process of
> doing so the interrupt code gets reworked and the foundation
> for supporting multiple contexts are added.
>
> In this version of the series the patch order has been reworked
> to make simplify review. Thanks to Laurent for his suggestions!
>
> The 32-bit ARM logic has intentionally been changed as little as possible
> to avoid breakage. Once CONFIG_IOMMU_DMA can be used it may be good time
> to revisit the init ordering for the 32-bit SoCs. There is room for
> improvement for sure like Robin Murphy kindly pointed out.

When IPMMU_VMSA is enabled on 32-bit ARM, the system crashes during boot.
I saw this first on r8a73a4/ape6evm, where my local config had it enabled.
After enabling IOMMU support and IPMMU_VMSA in my config for r8a7791/koelsch,
koelsch crashes during boot, too, although the failure mode is different.

Unfortunately I've lost all collected crash logs in a power failure due to the
bad weather. So you may beat me to reproduce this.

I did verify in time that the crashes do not happen with a similar config on
renesas-drivers-2016-05-31-v4.7-rc1, which contained the previous version of
your patch set.

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


Re: [PATCH 07/13] ARM: dts: r8a7792: initial SoC device tree

2016-06-07 Thread Sergei Shtylyov

On 06/07/2016 10:13 AM, Geert Uytterhoeven wrote:

[...]


And that the system behaves sanely on suspend/resume.


   I'd be thankful if you told me how to test that. :-)


System suspend:

echo mem > /sys/power/state


   Oh. I know that one! :-)


System resume: You're gonna need a "wakeup-source" in your DTS, e.g. gpio-keys.
Serial should work too, echo "enabled" to the corresponding wakeup
file in /sys first.


   I'm afraid I couldn't find that file. All I saw were RPM controls...


In case of issues, try "echo 0 > /sys/module/printk/parameters/console_suspend".


   There's no problems suspending, it's the resuming that's a problem for me.


Good luck!


   As usual, there was no luck. :-)

WBR, Sergei



renesas-drivers-2016-06-07-v4.7-rc2

2016-06-07 Thread Geert Uytterhoeven
I have pushed renesas-drivers-2016-06-07-v4.7-rc2 to
https://git.kernel.org/cgit/linux/kernel/git/geert/renesas-drivers.git

This tree is meant to ease development of platform support and drivers
for Renesas ARM SoCs. It is created by merging (a) the for-next branches
of various subsystem trees and (b) branches with driver code submitted
or planned for submission to maintainers into the development branch of
Simon Horman's renesas.git tree.

Today's version is based on renesas-devel-20160606-v4.7-rc2.

Included branches with driver code:
  - clk-renesas-for-v4.8
  - topic/rcar-dmac-residue-v1
  - topic/rcar-dmac-hamza-v3
  - topic/ipmmu-multi-arch-v3
  - topic/r8a7795-ipmmu-v2
  - topic/r8a7796-ipmmu-v1
  - topic/salvator-x-ipmmu-rfc-v3-rebased4
  - topic/scif-hwflow-v3
  - topic/scif-fifo-v1
  - 
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git#topic/r8a7796-v3
  - topic/r8a7796-sysc-dt-v1
  - 
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git#topic/sdr104-v3
  - git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git#staging/ks7010
  - 
git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git#renesas/topic/pretimeout
  - topic/h3-pfc-set-voltage-v1-rebased1
  - https://git.ragnatech.se/linux#rcar-vin-for-renesas-drivers
  - git://linuxtv.org/pinchartl/media.git#for/renesas-drivers
  - git://linuxtv.org/pinchartl/media.git#vsp1/functions
  - topic/fcpf-v1-rebased1

Included fixes:
  - Revert "clocksources: Switch back to the clksrc table"

Included subsystem trees:
  - git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git#linux-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git#clk-next
  - 
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git#for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git#for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git#for-next
  - git://git.infradead.org/users/dedekind/l2-mtd-2.6.git#master
  - git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git#master
  - git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git#tty-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git#i2c/for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git#for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git#master
  - git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git#usb-next
  - git://people.freedesktop.org/~airlied/linux#drm-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git#next
  - git://linuxtv.org/mchehab/media-next.git#master
  - git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git#mmc-next
  - git://git.linaro.org/people/ulf.hansson/mmc.git#next
  - 
git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm.git#for-next
  - git://git.linaro.org/people/daniel.lezcano/linux.git#clockevents/next
  - git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git#testing/next
  - git://git.kernel.org/pub/scm/linux/kernel/git/djbw/dmaengine.git#next
  - git://git.infradead.org/users/vkoul/slave-dma.git#next
  - 
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git#staging-next
  - 
git://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-arm.git#for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git#next
  - git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git#for-next
  - git://git.infradead.org/users/jcooper/linux.git#irqchip/for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git#for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git#for-next
  - git://git.infradead.org/battery-2.6.git#master
  - git://www.linux-watchdog.org/linux-watchdog-next.git#master
  - git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git#for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git#for-next
  - git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git#for-next/core
  - git://anongit.freedesktop.org/drm-intel#topic/drm-misc
  - git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git#next
  - git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git#next
  - 
git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal.git#next

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


[PATCH] pinctrl: sh-pfc: fix warnings by include core.h

2016-06-07 Thread Ben Dooks
Fix warnings about emev2_pinmux_info and r8a7779_pinmux_info
by using core.h instead of sh_pfc.h in these files. This gives
the declarations of the two structures and removes the following
warnings:

drivers/pinctrl/sh-pfc/pfc-emev2.c:1695:30: warning: symbol 'emev2_pinmux_info' 
was not declared. Should it be static?
drivers/pinctrl/sh-pfc/pfc-r8a7779.c:3888:30: warning: symbol 
'r8a7779_pinmux_info' was not declared. Should it be static?

Signed-off-by: Ben Dooks 
---
Cc: Linus Walleij 
Cc: Alessandro Rubini 
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-g...@vger.kernel.org
---
 drivers/pinctrl/sh-pfc/pfc-emev2.c   | 2 +-
 drivers/pinctrl/sh-pfc/pfc-r8a7779.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/sh-pfc/pfc-emev2.c 
b/drivers/pinctrl/sh-pfc/pfc-emev2.c
index 1cbbe04..f943854 100644
--- a/drivers/pinctrl/sh-pfc/pfc-emev2.c
+++ b/drivers/pinctrl/sh-pfc/pfc-emev2.c
@@ -10,7 +10,7 @@
 #include 
 #include 
 
-#include "sh_pfc.h"
+#include "core.h"
 
 #define CPU_ALL_PORT(fn, pfx, sfx) \
PORT_10(0,  fn, pfx, sfx),  PORT_90(0,  fn, pfx, sfx),  \
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7779.c 
b/drivers/pinctrl/sh-pfc/pfc-r8a7779.c
index 5bef934..098d01e 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a7779.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a7779.c
@@ -21,7 +21,7 @@
 
 #include 
 
-#include "sh_pfc.h"
+#include "core.h"
 
 #define CPU_ALL_PORT(fn, sfx)  \
PORT_GP_32(0, fn, sfx), \
-- 
2.8.1



Re: [PATCH v2 01/20] drm/atomic: Fix remaining places where !funcs->best_encoder is valid

2016-06-07 Thread Daniel Vetter
On Tue, Jun 07, 2016 at 01:47:56PM +0200, Boris Brezillon wrote:
> Adapt drm_pick_crtcs() and update_connector_routing() to fallback to
> drm_atomic_helper_best_encoder() if funcs->best_encoder() is NULL so
> that DRM drivers can leave this hook unassigned if they know they want
> to use drm_atomic_helper_best_encoder().
> 
> Update the vtables documentation accordingly.
> 
> Signed-off-by: Boris Brezillon 

Applied to drm-misc, thanks. I think I'll wait with the driver patches
until next week or so.
-Daniel

> ---
>  drivers/gpu/drm/drm_atomic_helper.c  |  4 +++-
>  drivers/gpu/drm/drm_fb_helper.c  | 13 -
>  include/drm/drm_modeset_helper_vtables.h | 10 --
>  3 files changed, 23 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c 
> b/drivers/gpu/drm/drm_atomic_helper.c
> index f6a3350..849d029 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -300,8 +300,10 @@ update_connector_routing(struct drm_atomic_state *state,
>   if (funcs->atomic_best_encoder)
>   new_encoder = funcs->atomic_best_encoder(connector,
>connector_state);
> - else
> + else if (funcs->best_encoder)
>   new_encoder = funcs->best_encoder(connector);
> + else
> + new_encoder = drm_atomic_helper_best_encoder(connector);
>  
>   if (!new_encoder) {
>   DRM_DEBUG_ATOMIC("No suitable encoder found for 
> [CONNECTOR:%d:%s]\n",
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 7c2eb75..d44389a 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -2000,7 +2000,18 @@ static int drm_pick_crtcs(struct drm_fb_helper 
> *fb_helper,
>   my_score++;
>  
>   connector_funcs = connector->helper_private;
> - encoder = connector_funcs->best_encoder(connector);
> +
> + /*
> +  * If the DRM device implements atomic hooks and ->best_encoder() is
> +  * NULL we fallback to the default drm_atomic_helper_best_encoder()
> +  * helper.
> +  */
> + if (fb_helper->dev->mode_config.funcs->atomic_commit &&
> + !connector_funcs->best_encoder)
> + encoder = drm_atomic_helper_best_encoder(connector);
> + else
> + encoder = connector_funcs->best_encoder(connector);
> +
>   if (!encoder)
>   goto out;
>  
> diff --git a/include/drm/drm_modeset_helper_vtables.h 
> b/include/drm/drm_modeset_helper_vtables.h
> index d4619dc..4e7a53b 100644
> --- a/include/drm/drm_modeset_helper_vtables.h
> +++ b/include/drm/drm_modeset_helper_vtables.h
> @@ -736,6 +736,11 @@ struct drm_connector_helper_funcs {
>* inspect dynamic configuration state should instead use
>* @atomic_best_encoder.
>*
> +  * You can leave this function to NULL if the connector is only
> +  * attached to a single encoder and you are using the atomic helpers.
> +  * In this case, the core will call drm_atomic_helper_best_encoder()
> +  * for you.
> +  *
>* RETURNS:
>*
>* Encoder that should be used for the given connector and connector
> @@ -752,8 +757,9 @@ struct drm_connector_helper_funcs {
>* need to select the best encoder depending upon the desired
>* configuration and can't select it statically.
>*
> -  * This function is used by drm_atomic_helper_check_modeset() and either
> -  * this or @best_encoder is required.
> +  * This function is used by drm_atomic_helper_check_modeset().
> +  * If it is not implemented, the core will fallback to @best_encoder
> +  * (or drm_atomic_helper_best_encoder() if @best_encoder is NULL).
>*
>* NOTE:
>*
> -- 
> 2.7.4
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


Re: [PATCH v1 00/25] PCI: Request host bridge window resources

2016-06-07 Thread Arnd Bergmann
On Tuesday, June 7, 2016 8:11:05 AM CEST Bjorn Helgaas wrote:
> > 
> > What do you think is the correct behavior here, should the driver only
> > request the PIO range with parent=ioport_resource, or should it also
> > request the MMIO window for the I/O ports with parent=iomem_resource?
> > In the latter case, any idea how that can be generalized?
> 
> I think it should request both because I think iomem_resource should
> contain everything in the memory map.  This would be required if we ever
> did any significant reassignment of top-level devices, e.g., ACPI devices.

Ok. Should we try to pass the mmio resource for the I/O window to
the devm_request_pci_bus_resources() function along with the other
arguments then?

As far as I can tell, it should not go into the resource list
because it is not something the PCI core code should access the
way it handles the other resources.

Arnd


Re: [PATCH v1 00/25] PCI: Request host bridge window resources

2016-06-07 Thread Bjorn Helgaas
On Tue, Jun 07, 2016 at 10:21:36AM +0200, Arnd Bergmann wrote:
> On Monday, June 6, 2016 6:04:44 PM CEST Bjorn Helgaas wrote:
> > Several host bridge drivers (designware and all derivatives, iproc,
> > xgene, xilinx, and xilinx-nwl) don't request the MMIO and I/O port
> > windows they forward downstream to the PCI bus.
> > 
> > That means the PCI core can't request resources for PCI bridge
> > windows and PCI BARs.
> > 
> > Several other drivers (altera, generic, mvebu, rcar, tegra) do request
> > the windows, but use some duplicated code to do it.
> > 
> > This adds a new devm_request_pci_bus_resources() interface and changes
> > these drivers to use it.  It also fixes several error paths where we failed
> > to free the resource list allocated by of_pci_get_host_bridge_resources().
> > 
> > Tegra guys, please take a look at "PCI: tegra: Remove top-level resource
> > from hierarchy" in particular.  Removing the top-level resource definitely
> > makes /proc/iomem look uglier (although it will look more like that of
> > other drivers).  A short-term fix could be to include device information in
> > the resource name.  I think a better long-term fix would be to make the DT
> > or platform device core request all the resources from the DT.
> > 
> > Comments welcome.  I expect we'll trip over something here, so I marked
> > this "v1" and I don't plan to put it into -next for a while.
> > 
> > This is on my pci/host-request-windows branch, which you can pull or view
> > at 
> > https://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/log/?h=pci/host-request-windows
> 
> This looks very nice. There is one related aspect that I have been
> grumbling about for a while, but I don't know what the driver is
> actually supposed to do there:
> 
> For the IORESOURCE_IO resources, some drivers request the MMIO address
> that the window is mapped into, some drivers request the PIO range, and
> some of them request both. I also believe the resource that gets put
> into the bridge resources list is not always the same one (or maybe
> that got fixed by now).
> 
> What do you think is the correct behavior here, should the driver only
> request the PIO range with parent=ioport_resource, or should it also
> request the MMIO window for the I/O ports with parent=iomem_resource?
> In the latter case, any idea how that can be generalized?

I think it should request both because I think iomem_resource should
contain everything in the memory map.  This would be required if we ever
did any significant reassignment of top-level devices, e.g., ACPI devices.
For example, on ia64, we do this:

  /proc/ioports:
  -3fff : PCI Bus :00
  4000-9fff : PCI Bus :80
  a000-bfff : PCI Bus :a0
  c000- : PCI Bus :c0

  /proc/iomem:
  8000-9fff : PCI Bus :00
  a000-cfff : PCI Bus :80
  d000-dfff : PCI Bus :a0
  e000-fdff : PCI Bus :c0
  8000400-80103fe : PCI Bus :00
  c000400-c0103fe : PCI Bus :80
  d000400-d0103fe : PCI Bus :a0
  e000400-e0103fe : PCI Bus :c0
  3fc00-3fcff : PCI Bus :00 I/O Ports -3fff
  3fd00-3fe7f : PCI Bus :80 I/O Ports 4000-9fff
  3fe80-3feff : PCI Bus :a0 I/O Ports a000-bfff
  3ff00-3 : PCI Bus :c0 I/O Ports c000-

> Another aspect is that we already have the
> gen_pci_parse_request_of_pci_ranges() function that does the same as your
> new devm_request_pci_bus_resources() and then a few other things. I
> have been wondering whether we could move that function into common
> code convert drivers to use that wherever possible, but I guess we can
> always do that as a follow-up after this series.

Oh, I didn't notice that; thanks for pointing it out.  That should be
consolidated somehow.  It also checks to be sure there is a
non-prefetchable memory resource.  A few other drivers also do that, but
most don't.  I suppose that will mostly catch DT errors.

Bjorn


[PATCH v2 07/20] drm: mediatek: Rely on the default ->best_encoder() behavior

2016-06-07 Thread Boris Brezillon
We have a 1:1 relationship between connectors and encoders and the
driver is relying on the atomic helpers: we can drop the custom
->best_encoder() implementation and let the core call
drm_atomic_helper_best_encoder() for us.

Signed-off-by: Boris Brezillon 
---
 drivers/gpu/drm/mediatek/mtk_dsi.c | 9 -
 1 file changed, 9 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c 
b/drivers/gpu/drm/mediatek/mtk_dsi.c
index 2d808e5..7343ffc 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -575,14 +575,6 @@ static int mtk_dsi_connector_get_modes(struct 
drm_connector *connector)
return drm_panel_get_modes(dsi->panel);
 }
 
-static struct drm_encoder *mtk_dsi_connector_best_encoder(
-   struct drm_connector *connector)
-{
-   struct mtk_dsi *dsi = connector_to_dsi(connector);
-
-   return >encoder;
-}
-
 static const struct drm_encoder_helper_funcs mtk_dsi_encoder_helper_funcs = {
.mode_fixup = mtk_dsi_encoder_mode_fixup,
.mode_set = mtk_dsi_encoder_mode_set,
@@ -603,7 +595,6 @@ static const struct drm_connector_funcs 
mtk_dsi_connector_funcs = {
 static const struct drm_connector_helper_funcs
mtk_dsi_connector_helper_funcs = {
.get_modes = mtk_dsi_connector_get_modes,
-   .best_encoder = mtk_dsi_connector_best_encoder,
 };
 
 static int mtk_drm_attach_bridge(struct drm_bridge *bridge,
-- 
2.7.4



[PATCH v2 04/20] drm: exynos: Rely on the default ->best_encoder() behavior

2016-06-07 Thread Boris Brezillon
We have 1:1 relationship between connectors and encoders and the driver
is relying on the atomic helpers: we can drop the custom ->best_encoder()
implementations and let the core call drm_atomic_helper_best_encoder()
for us.

Signed-off-by: Boris Brezillon 
---
 drivers/gpu/drm/exynos/exynos_drm_dpi.c  | 9 -
 drivers/gpu/drm/exynos/exynos_drm_dsi.c  | 9 -
 drivers/gpu/drm/exynos/exynos_drm_vidi.c | 8 
 drivers/gpu/drm/exynos/exynos_hdmi.c | 8 
 4 files changed, 34 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_dpi.c 
b/drivers/gpu/drm/exynos/exynos_drm_dpi.c
index 5e38e74..ad6b73c 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dpi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dpi.c
@@ -93,17 +93,8 @@ static int exynos_dpi_get_modes(struct drm_connector 
*connector)
return 0;
 }
 
-static struct drm_encoder *
-exynos_dpi_best_encoder(struct drm_connector *connector)
-{
-   struct exynos_dpi *ctx = connector_to_dpi(connector);
-
-   return >encoder;
-}
-
 static const struct drm_connector_helper_funcs 
exynos_dpi_connector_helper_funcs = {
.get_modes = exynos_dpi_get_modes,
-   .best_encoder = exynos_dpi_best_encoder,
 };
 
 static int exynos_dpi_create_connector(struct drm_encoder *encoder)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c 
b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
index 601ecf8..e07cb1f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
@@ -1566,17 +1566,8 @@ static int exynos_dsi_get_modes(struct drm_connector 
*connector)
return 0;
 }
 
-static struct drm_encoder *
-exynos_dsi_best_encoder(struct drm_connector *connector)
-{
-   struct exynos_dsi *dsi = connector_to_dsi(connector);
-
-   return >encoder;
-}
-
 static const struct drm_connector_helper_funcs 
exynos_dsi_connector_helper_funcs = {
.get_modes = exynos_dsi_get_modes,
-   .best_encoder = exynos_dsi_best_encoder,
 };
 
 static int exynos_dsi_create_connector(struct drm_encoder *encoder)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c 
b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index 608b0af..e8f6c92 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -378,16 +378,8 @@ static int vidi_get_modes(struct drm_connector *connector)
return drm_add_edid_modes(connector, edid);
 }
 
-static struct drm_encoder *vidi_best_encoder(struct drm_connector *connector)
-{
-   struct vidi_context *ctx = ctx_from_connector(connector);
-
-   return >encoder;
-}
-
 static const struct drm_connector_helper_funcs vidi_connector_helper_funcs = {
.get_modes = vidi_get_modes,
-   .best_encoder = vidi_best_encoder,
 };
 
 static int vidi_create_connector(struct drm_encoder *encoder)
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c 
b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 58de5a4..1625d7c 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -937,17 +937,9 @@ static int hdmi_mode_valid(struct drm_connector *connector,
return MODE_OK;
 }
 
-static struct drm_encoder *hdmi_best_encoder(struct drm_connector *connector)
-{
-   struct hdmi_context *hdata = connector_to_hdmi(connector);
-
-   return >encoder;
-}
-
 static const struct drm_connector_helper_funcs hdmi_connector_helper_funcs = {
.get_modes = hdmi_get_modes,
.mode_valid = hdmi_mode_valid,
-   .best_encoder = hdmi_best_encoder,
 };
 
 static int hdmi_create_connector(struct drm_encoder *encoder)
-- 
2.7.4



[PATCH v2 05/20] drm: fsl-dcu: Rely on the default ->best_encoder() behavior

2016-06-07 Thread Boris Brezillon
We have a 1:1 relationship between connectors and encoders and the
driver is relying on the atomic helpers: we can drop the custom
->best_encoder() and let the core call drm_atomic_helper_best_encoder()
for us.

Signed-off-by: Boris Brezillon 
---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 9 -
 1 file changed, 9 deletions(-)

diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c 
b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
index 98c998d..0b0989e 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
@@ -102,14 +102,6 @@ static const struct drm_connector_funcs 
fsl_dcu_drm_connector_funcs = {
.reset = drm_atomic_helper_connector_reset,
 };
 
-static struct drm_encoder *
-fsl_dcu_drm_connector_best_encoder(struct drm_connector *connector)
-{
-   struct fsl_dcu_drm_connector *fsl_con = to_fsl_dcu_connector(connector);
-
-   return fsl_con->encoder;
-}
-
 static int fsl_dcu_drm_connector_get_modes(struct drm_connector *connector)
 {
struct fsl_dcu_drm_connector *fsl_connector;
@@ -136,7 +128,6 @@ static int fsl_dcu_drm_connector_mode_valid(struct 
drm_connector *connector,
 }
 
 static const struct drm_connector_helper_funcs connector_helper_funcs = {
-   .best_encoder = fsl_dcu_drm_connector_best_encoder,
.get_modes = fsl_dcu_drm_connector_get_modes,
.mode_valid = fsl_dcu_drm_connector_mode_valid,
 };
-- 
2.7.4



[PATCH v2 03/20] drm: atmel-hlcdc: Rely on the default ->best_encoder() behavior

2016-06-07 Thread Boris Brezillon
We have a 1:1 relationship between connectors and encoders and the
driver is relying on the atomic helpers: we can drop the custom
->best_encoder() and let the core call drm_atomic_helper_best_encoder()
for us.

Signed-off-by: Boris Brezillon 
---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c | 12 
 1 file changed, 12 deletions(-)

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c 
b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c
index 3d34fc4..6119b50 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c
@@ -113,21 +113,9 @@ static int atmel_hlcdc_rgb_mode_valid(struct drm_connector 
*connector,
return atmel_hlcdc_dc_mode_valid(rgb->dc, mode);
 }
 
-
-
-static struct drm_encoder *
-atmel_hlcdc_rgb_best_encoder(struct drm_connector *connector)
-{
-   struct atmel_hlcdc_rgb_output *rgb =
-   drm_connector_to_atmel_hlcdc_rgb_output(connector);
-
-   return >encoder;
-}
-
 static const struct drm_connector_helper_funcs 
atmel_hlcdc_panel_connector_helper_funcs = {
.get_modes = atmel_hlcdc_panel_get_modes,
.mode_valid = atmel_hlcdc_rgb_mode_valid,
-   .best_encoder = atmel_hlcdc_rgb_best_encoder,
 };
 
 static enum drm_connector_status
-- 
2.7.4



[PATCH v2 00/20] drm/atomic: Provide default ->best_encoder() behavior

2016-06-07 Thread Boris Brezillon
Hello,

This patch series aims at replacing all dummy ->best_encoder()
implementations where we have a 1:1 relationship between encoders
and connectors.
The core already provides the drm_atomic_helper_best_encoder()
function which is taking the first encoder attached to the
connector (after making sure only one encoder was attached to the
connector), but it's not automatically used, and drivers wanting
to rely on this default behavior have to explicitly assign their
->best_encoder() hook to drm_atomic_helper_best_encoder().

The first patch fixes remaining places where
drm_atomic_helper_best_encoder() should be called when ->best_encoder()
is NULL, so that drivers using the atomic helpers can get rid of the
explicit ->best_encoder assignment if they need to rely on the default
drm_atomic_helper_best_encoder() implementation.

The following patches are killing all open coded ->best_encoder()
implementations that could be replaced by
drm_atomic_helper_best_encoder().

All modifications have been compile tested except for the changed on
the intel driver.
I've also tested on an atmel board, but I recommend waiting for DRM
driver maintainers feedback before applying the associated changes.

Note that once patch 1 is applied, the other patches can be applied
independently.

Best Regards,

Boris

Changes since v1:
- remove useless ->encoder backpointers in some implementations
- documented the default behavior in the vtable doc
- added R-b/A-b tags

Boris Brezillon (20):
  drm/atomic: Fix remaining places where !funcs->best_encoder is valid
  drm: arc: Rely on the default ->best_encoder() behavior
  drm: atmel-hlcdc: Rely on the default ->best_encoder() behavior
  drm: exynos: Rely on the default ->best_encoder() behavior
  drm: fsl-dcu: Rely on the default ->best_encoder() behavior
  drm: i915: Rely on the default ->best_encoder() behavior where
appropriate
  drm: mediatek: Rely on the default ->best_encoder() behavior
  drm: msm: Rely on the default ->best_encoder() behavior where
appropriate
  drm: rcar-du: Rely on the default ->best_encoder() behavior
  drm: rockchip: Rely on the default ->best_encoder() behavior
  drm: sti: Rely on the default ->best_encoder() behavior
  drm: sun4i: Rely on the default ->best_encoder() behavior
  drm: tegra: Rely on the default ->best_encoder() behavior
  drm: vc4: Rely on the default ->best_encoder() behavior
  drm: virtgpu: Rely on the default ->best_encoder() behavior
  drm: omap: Rely on the default ->best_encoder() behavior
  drm/bridge: anx78xx: Rely on the default ->best_encoder() behavior
  drm/bridge: ptn3460: Rely on the default ->best_encoder() behavior
  drm/bridge: ps8622: Rely on the default ->best_encoder() behavior
  drm/bridge: dw-hdmi: Use drm_atomic_helper_best_encoder()

 drivers/gpu/drm/arc/arcpgu_hdmi.c  | 18 --
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c   | 12 
 drivers/gpu/drm/bridge/analogix-anx78xx.c  |  8 
 drivers/gpu/drm/bridge/dw-hdmi.c   | 11 +--
 drivers/gpu/drm/bridge/nxp-ptn3460.c   |  8 
 drivers/gpu/drm/bridge/parade-ps8622.c | 10 --
 drivers/gpu/drm/drm_atomic_helper.c|  4 +++-
 drivers/gpu/drm/drm_fb_helper.c| 13 -
 drivers/gpu/drm/exynos/exynos_drm_dpi.c|  9 -
 drivers/gpu/drm/exynos/exynos_drm_dsi.c|  9 -
 drivers/gpu/drm/exynos/exynos_drm_vidi.c   |  8 
 drivers/gpu/drm/exynos/exynos_hdmi.c   |  8 
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c  |  9 -
 drivers/gpu/drm/i915/intel_crt.c   |  1 -
 drivers/gpu/drm/i915/intel_display.c   |  8 
 drivers/gpu/drm/i915/intel_dp.c|  1 -
 drivers/gpu/drm/i915/intel_drv.h   |  1 -
 drivers/gpu/drm/i915/intel_dsi.c   |  1 -
 drivers/gpu/drm/i915/intel_dvo.c   |  1 -
 drivers/gpu/drm/i915/intel_hdmi.c  |  1 -
 drivers/gpu/drm/i915/intel_lvds.c  |  1 -
 drivers/gpu/drm/i915/intel_sdvo.c  |  1 -
 drivers/gpu/drm/i915/intel_tv.c|  1 -
 drivers/gpu/drm/mediatek/mtk_dsi.c |  9 -
 drivers/gpu/drm/msm/edp/edp_connector.c| 10 --
 drivers/gpu/drm/msm/hdmi/hdmi_connector.c  |  8 
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_connector.c |  9 -
 drivers/gpu/drm/omapdrm/omap_connector.c   | 10 --
 drivers/gpu/drm/rcar-du/rcar_du_encoder.c  | 12 
 drivers/gpu/drm/rcar-du/rcar_du_encoder.h  |  3 ---
 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c  |  1 -
 drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c  |  1 -
 drivers/gpu/drm/rcar-du/rcar_du_vgacon.c   |  3 ---
 drivers/gpu/drm/rockchip/dw-mipi-dsi.c |  9 -
 

[PATCH v2 08/20] drm: msm: Rely on the default ->best_encoder() behavior where appropriate

2016-06-07 Thread Boris Brezillon
For all outputs except DSI we have a 1:1 relationship between connectors
and encoders and the driver is relying on the atomic helpers: we can
drop the custom ->best_encoder() and let the core call
drm_atomic_helper_best_encoder() for us.

Signed-off-by: Boris Brezillon 
---
 drivers/gpu/drm/msm/edp/edp_connector.c| 10 --
 drivers/gpu/drm/msm/hdmi/hdmi_connector.c  |  8 
 drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_connector.c |  9 -
 3 files changed, 27 deletions(-)

diff --git a/drivers/gpu/drm/msm/edp/edp_connector.c 
b/drivers/gpu/drm/msm/edp/edp_connector.c
index 72360cd..5960628 100644
--- a/drivers/gpu/drm/msm/edp/edp_connector.c
+++ b/drivers/gpu/drm/msm/edp/edp_connector.c
@@ -91,15 +91,6 @@ static int edp_connector_mode_valid(struct drm_connector 
*connector,
return MODE_OK;
 }
 
-static struct drm_encoder *
-edp_connector_best_encoder(struct drm_connector *connector)
-{
-   struct edp_connector *edp_connector = to_edp_connector(connector);
-
-   DBG("");
-   return edp_connector->edp->encoder;
-}
-
 static const struct drm_connector_funcs edp_connector_funcs = {
.dpms = drm_atomic_helper_connector_dpms,
.detect = edp_connector_detect,
@@ -113,7 +104,6 @@ static const struct drm_connector_funcs edp_connector_funcs 
= {
 static const struct drm_connector_helper_funcs edp_connector_helper_funcs = {
.get_modes = edp_connector_get_modes,
.mode_valid = edp_connector_mode_valid,
-   .best_encoder = edp_connector_best_encoder,
 };
 
 /* initialize connector */
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c 
b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
index b15d726..a2515b4 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c
@@ -406,13 +406,6 @@ static int msm_hdmi_connector_mode_valid(struct 
drm_connector *connector,
return 0;
 }
 
-static struct drm_encoder *
-msm_hdmi_connector_best_encoder(struct drm_connector *connector)
-{
-   struct hdmi_connector *hdmi_connector = to_hdmi_connector(connector);
-   return hdmi_connector->hdmi->encoder;
-}
-
 static const struct drm_connector_funcs hdmi_connector_funcs = {
.dpms = drm_atomic_helper_connector_dpms,
.detect = hdmi_connector_detect,
@@ -426,7 +419,6 @@ static const struct drm_connector_funcs 
hdmi_connector_funcs = {
 static const struct drm_connector_helper_funcs msm_hdmi_connector_helper_funcs 
= {
.get_modes = msm_hdmi_connector_get_modes,
.mode_valid = msm_hdmi_connector_mode_valid,
-   .best_encoder = msm_hdmi_connector_best_encoder,
 };
 
 /* initialize connector */
diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_connector.c 
b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_connector.c
index 2648cd7..353429b 100644
--- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_connector.c
+++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_connector.c
@@ -90,14 +90,6 @@ static int mdp4_lvds_connector_mode_valid(struct 
drm_connector *connector,
return MODE_OK;
 }
 
-static struct drm_encoder *
-mdp4_lvds_connector_best_encoder(struct drm_connector *connector)
-{
-   struct mdp4_lvds_connector *mdp4_lvds_connector =
-   to_mdp4_lvds_connector(connector);
-   return mdp4_lvds_connector->encoder;
-}
-
 static const struct drm_connector_funcs mdp4_lvds_connector_funcs = {
.dpms = drm_atomic_helper_connector_dpms,
.detect = mdp4_lvds_connector_detect,
@@ -111,7 +103,6 @@ static const struct drm_connector_funcs 
mdp4_lvds_connector_funcs = {
 static const struct drm_connector_helper_funcs 
mdp4_lvds_connector_helper_funcs = {
.get_modes = mdp4_lvds_connector_get_modes,
.mode_valid = mdp4_lvds_connector_mode_valid,
-   .best_encoder = mdp4_lvds_connector_best_encoder,
 };
 
 /* initialize connector */
-- 
2.7.4



[PATCH v2 09/20] drm: rcar-du: Rely on the default ->best_encoder() behavior

2016-06-07 Thread Boris Brezillon
All outputs have a 1:1 relationship between connectors and encoders,
and the driver is relying on the atomic helpers: we can drop the custom
->best_encoder() implementations and let the core call
drm_atomic_helper_best_encoder() for us.

Signed-off-by: Boris Brezillon 
Reviewed-by: Laurent Pinchart 
---
 drivers/gpu/drm/rcar-du/rcar_du_encoder.c | 12 
 drivers/gpu/drm/rcar-du/rcar_du_encoder.h |  3 ---
 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c |  1 -
 drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c |  1 -
 drivers/gpu/drm/rcar-du/rcar_du_vgacon.c  |  3 ---
 5 files changed, 20 deletions(-)

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c 
b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
index 4e939e4..55149e9 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
@@ -27,18 +27,6 @@
 #include "rcar_du_vgacon.h"
 
 /* 
-
- * Common connector functions
- */
-
-struct drm_encoder *
-rcar_du_connector_best_encoder(struct drm_connector *connector)
-{
-   struct rcar_du_connector *rcon = to_rcar_connector(connector);
-
-   return rcar_encoder_to_drm_encoder(rcon->encoder);
-}
-
-/* 
-
  * Encoder
  */
 
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.h 
b/drivers/gpu/drm/rcar-du/rcar_du_encoder.h
index 719b6f2a..a8669c3 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.h
+++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.h
@@ -49,9 +49,6 @@ struct rcar_du_connector {
 #define to_rcar_connector(c) \
container_of(c, struct rcar_du_connector, connector)
 
-struct drm_encoder *
-rcar_du_connector_best_encoder(struct drm_connector *connector);
-
 int rcar_du_encoder_init(struct rcar_du_device *rcdu,
 enum rcar_du_encoder_type type,
 enum rcar_du_output output,
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c 
b/drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c
index 6c92714..612b4d5 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c
@@ -52,7 +52,6 @@ static int rcar_du_hdmi_connector_mode_valid(struct 
drm_connector *connector,
 static const struct drm_connector_helper_funcs connector_helper_funcs = {
.get_modes = rcar_du_hdmi_connector_get_modes,
.mode_valid = rcar_du_hdmi_connector_mode_valid,
-   .best_encoder = rcar_du_connector_best_encoder,
 };
 
 static enum drm_connector_status
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c 
b/drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c
index e905f5d..6afd0af 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c
@@ -59,7 +59,6 @@ static int rcar_du_lvds_connector_get_modes(struct 
drm_connector *connector)
 
 static const struct drm_connector_helper_funcs connector_helper_funcs = {
.get_modes = rcar_du_lvds_connector_get_modes,
-   .best_encoder = rcar_du_connector_best_encoder,
 };
 
 static enum drm_connector_status
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vgacon.c 
b/drivers/gpu/drm/rcar-du/rcar_du_vgacon.c
index 9d7e5c9..8d6125c 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_vgacon.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_vgacon.c
@@ -28,7 +28,6 @@ static int rcar_du_vga_connector_get_modes(struct 
drm_connector *connector)
 
 static const struct drm_connector_helper_funcs connector_helper_funcs = {
.get_modes = rcar_du_vga_connector_get_modes,
-   .best_encoder = rcar_du_connector_best_encoder,
 };
 
 static enum drm_connector_status
@@ -79,7 +78,5 @@ int rcar_du_vga_connector_init(struct rcar_du_device *rcdu,
if (ret < 0)
return ret;
 
-   rcon->encoder = renc;
-
return 0;
 }
-- 
2.7.4



[PATCH v2 11/20] drm: sti: Rely on the default ->best_encoder() behavior

2016-06-07 Thread Boris Brezillon
All outputs have a 1:1 relationship between connectors and encoders
and the driver is relying on the atomic helpers: we can drop the custom
->best_encoder() implementations and let the core call
drm_atomic_helper_best_encoder() for us.

Signed-off-by: Boris Brezillon 
---
 drivers/gpu/drm/sti/sti_dvo.c  | 10 --
 drivers/gpu/drm/sti/sti_hda.c  | 10 --
 drivers/gpu/drm/sti/sti_hdmi.c | 10 --
 3 files changed, 30 deletions(-)

diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
index 25f7663..d5627d1 100644
--- a/drivers/gpu/drm/sti/sti_dvo.c
+++ b/drivers/gpu/drm/sti/sti_dvo.c
@@ -384,20 +384,10 @@ static int sti_dvo_connector_mode_valid(struct 
drm_connector *connector,
return MODE_OK;
 }
 
-struct drm_encoder *sti_dvo_best_encoder(struct drm_connector *connector)
-{
-   struct sti_dvo_connector *dvo_connector
-   = to_sti_dvo_connector(connector);
-
-   /* Best encoder is the one associated during connector creation */
-   return dvo_connector->encoder;
-}
-
 static const
 struct drm_connector_helper_funcs sti_dvo_connector_helper_funcs = {
.get_modes = sti_dvo_connector_get_modes,
.mode_valid = sti_dvo_connector_mode_valid,
-   .best_encoder = sti_dvo_best_encoder,
 };
 
 static enum drm_connector_status
diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c
index f7d3464..c4649f5 100644
--- a/drivers/gpu/drm/sti/sti_hda.c
+++ b/drivers/gpu/drm/sti/sti_hda.c
@@ -676,20 +676,10 @@ static int sti_hda_connector_mode_valid(struct 
drm_connector *connector,
return MODE_OK;
 }
 
-struct drm_encoder *sti_hda_best_encoder(struct drm_connector *connector)
-{
-   struct sti_hda_connector *hda_connector
-   = to_sti_hda_connector(connector);
-
-   /* Best encoder is the one associated during connector creation */
-   return hda_connector->encoder;
-}
-
 static const
 struct drm_connector_helper_funcs sti_hda_connector_helper_funcs = {
.get_modes = sti_hda_connector_get_modes,
.mode_valid = sti_hda_connector_mode_valid,
-   .best_encoder = sti_hda_best_encoder,
 };
 
 static enum drm_connector_status
diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
index 6ef0715..dc9ab6e 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.c
+++ b/drivers/gpu/drm/sti/sti_hdmi.c
@@ -897,20 +897,10 @@ static int sti_hdmi_connector_mode_valid(struct 
drm_connector *connector,
return MODE_OK;
 }
 
-struct drm_encoder *sti_hdmi_best_encoder(struct drm_connector *connector)
-{
-   struct sti_hdmi_connector *hdmi_connector
-   = to_sti_hdmi_connector(connector);
-
-   /* Best encoder is the one associated during connector creation */
-   return hdmi_connector->encoder;
-}
-
 static const
 struct drm_connector_helper_funcs sti_hdmi_connector_helper_funcs = {
.get_modes = sti_hdmi_connector_get_modes,
.mode_valid = sti_hdmi_connector_mode_valid,
-   .best_encoder = sti_hdmi_best_encoder,
 };
 
 /* get detection status of display device */
-- 
2.7.4



[PATCH v2 15/20] drm: virtgpu: Rely on the default ->best_encoder() behavior

2016-06-07 Thread Boris Brezillon
The virtgpu output exposes a 1:1 relationship between connectors and
encoders and the driver is relying on the atomic helpers: we can drop
the custom ->best_encoder() implementation and let the core call
drm_atomic_helper_best_encoder() for us.

Signed-off-by: Boris Brezillon 
---
 drivers/gpu/drm/virtio/virtgpu_display.c | 10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c 
b/drivers/gpu/drm/virtio/virtgpu_display.c
index d4305da..4d41dcb 100644
--- a/drivers/gpu/drm/virtio/virtgpu_display.c
+++ b/drivers/gpu/drm/virtio/virtgpu_display.c
@@ -341,15 +341,6 @@ static int virtio_gpu_conn_mode_valid(struct drm_connector 
*connector,
return MODE_BAD;
 }
 
-static struct drm_encoder*
-virtio_gpu_best_encoder(struct drm_connector *connector)
-{
-   struct virtio_gpu_output *virtio_gpu_output =
-   drm_connector_to_virtio_gpu_output(connector);
-
-   return _gpu_output->enc;
-}
-
 static const struct drm_encoder_helper_funcs virtio_gpu_enc_helper_funcs = {
.mode_set   = virtio_gpu_enc_mode_set,
.enable = virtio_gpu_enc_enable,
@@ -359,7 +350,6 @@ static const struct drm_encoder_helper_funcs 
virtio_gpu_enc_helper_funcs = {
 static const struct drm_connector_helper_funcs virtio_gpu_conn_helper_funcs = {
.get_modes= virtio_gpu_conn_get_modes,
.mode_valid   = virtio_gpu_conn_mode_valid,
-   .best_encoder = virtio_gpu_best_encoder,
 };
 
 static enum drm_connector_status virtio_gpu_conn_detect(
-- 
2.7.4



[PATCH v2 12/20] drm: sun4i: Rely on the default ->best_encoder() behavior

2016-06-07 Thread Boris Brezillon
All outputs have a 1:1 relationship between connectors and encoders
and the driver is relying on the atomic helpers: we can drop the custom
->best_encoder() implementations and let the core call
drm_atomic_helper_best_encoder() for us.

Signed-off-by: Boris Brezillon 
---
 drivers/gpu/drm/sun4i/sun4i_rgb.c | 10 --
 drivers/gpu/drm/sun4i/sun4i_tv.c  |  9 -
 2 files changed, 19 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c 
b/drivers/gpu/drm/sun4i/sun4i_rgb.c
index ab64948..442cfe2 100644
--- a/drivers/gpu/drm/sun4i/sun4i_rgb.c
+++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c
@@ -90,19 +90,9 @@ static int sun4i_rgb_mode_valid(struct drm_connector 
*connector,
return MODE_OK;
 }
 
-static struct drm_encoder *
-sun4i_rgb_best_encoder(struct drm_connector *connector)
-{
-   struct sun4i_rgb *rgb =
-   drm_connector_to_sun4i_rgb(connector);
-
-   return >encoder;
-}
-
 static struct drm_connector_helper_funcs sun4i_rgb_con_helper_funcs = {
.get_modes  = sun4i_rgb_get_modes,
.mode_valid = sun4i_rgb_mode_valid,
-   .best_encoder   = sun4i_rgb_best_encoder,
 };
 
 static enum drm_connector_status
diff --git a/drivers/gpu/drm/sun4i/sun4i_tv.c b/drivers/gpu/drm/sun4i/sun4i_tv.c
index bc047f9..b841478 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tv.c
@@ -526,18 +526,9 @@ static int sun4i_tv_comp_mode_valid(struct drm_connector 
*connector,
return MODE_OK;
 }
 
-static struct drm_encoder *
-sun4i_tv_comp_best_encoder(struct drm_connector *connector)
-{
-   struct sun4i_tv *tv = drm_connector_to_sun4i_tv(connector);
-
-   return >encoder;
-}
-
 static struct drm_connector_helper_funcs sun4i_tv_comp_connector_helper_funcs 
= {
.get_modes  = sun4i_tv_comp_get_modes,
.mode_valid = sun4i_tv_comp_mode_valid,
-   .best_encoder   = sun4i_tv_comp_best_encoder,
 };
 
 static enum drm_connector_status
-- 
2.7.4



[PATCH v2 19/20] drm/bridge: ps8622: Rely on the default ->best_encoder() behavior

2016-06-07 Thread Boris Brezillon
We have a 1:1 relationship between connectors and encoders, and the driver
is relying on the atomic helpers: we can drop the custom ->best_encoder(),
and let the core call drm_atomic_helper_best_encoder() for us.

Signed-off-by: Boris Brezillon 
---
 drivers/gpu/drm/bridge/parade-ps8622.c | 10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/gpu/drm/bridge/parade-ps8622.c 
b/drivers/gpu/drm/bridge/parade-ps8622.c
index be881e9..5cd8dd7 100644
--- a/drivers/gpu/drm/bridge/parade-ps8622.c
+++ b/drivers/gpu/drm/bridge/parade-ps8622.c
@@ -474,18 +474,8 @@ static int ps8622_get_modes(struct drm_connector 
*connector)
return drm_panel_get_modes(ps8622->panel);
 }
 
-static struct drm_encoder *ps8622_best_encoder(struct drm_connector *connector)
-{
-   struct ps8622_bridge *ps8622;
-
-   ps8622 = connector_to_ps8622(connector);
-
-   return ps8622->bridge.encoder;
-}
-
 static const struct drm_connector_helper_funcs ps8622_connector_helper_funcs = 
{
.get_modes = ps8622_get_modes,
-   .best_encoder = ps8622_best_encoder,
 };
 
 static enum drm_connector_status ps8622_detect(struct drm_connector *connector,
-- 
2.7.4



[PATCH v2 17/20] drm/bridge: anx78xx: Rely on the default ->best_encoder() behavior

2016-06-07 Thread Boris Brezillon
We have a 1:1 relationship between connectors and encoders, and the driver
is relying on the atomic helpers: we can drop the custom ->best_encoder(),
and let the core call drm_atomic_helper_best_encoder() for us.

Signed-off-by: Boris Brezillon 
---
 drivers/gpu/drm/bridge/analogix-anx78xx.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/drivers/gpu/drm/bridge/analogix-anx78xx.c 
b/drivers/gpu/drm/bridge/analogix-anx78xx.c
index d087b05..f9f03bc 100644
--- a/drivers/gpu/drm/bridge/analogix-anx78xx.c
+++ b/drivers/gpu/drm/bridge/analogix-anx78xx.c
@@ -986,16 +986,8 @@ unlock:
return num_modes;
 }
 
-static struct drm_encoder *anx78xx_best_encoder(struct drm_connector 
*connector)
-{
-   struct anx78xx *anx78xx = connector_to_anx78xx(connector);
-
-   return anx78xx->bridge.encoder;
-}
-
 static const struct drm_connector_helper_funcs anx78xx_connector_helper_funcs 
= {
.get_modes = anx78xx_get_modes,
-   .best_encoder = anx78xx_best_encoder,
 };
 
 static enum drm_connector_status anx78xx_detect(struct drm_connector 
*connector,
-- 
2.7.4



[PATCH v2 14/20] drm: vc4: Rely on the default ->best_encoder() behavior

2016-06-07 Thread Boris Brezillon
All outputs have a 1:1 relationship between connectors and encoders and
the driver is relying on the atomic helpers: we can drop the custom
->best_encoder() implementations and let the core call
drm_atomic_helper_best_encoder() for us.

Signed-off-by: Boris Brezillon 
---
 drivers/gpu/drm/vc4/vc4_dpi.c  | 9 -
 drivers/gpu/drm/vc4/vc4_hdmi.c | 9 -
 2 files changed, 18 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
index 9817dbf..dba1114 100644
--- a/drivers/gpu/drm/vc4/vc4_dpi.c
+++ b/drivers/gpu/drm/vc4/vc4_dpi.c
@@ -208,14 +208,6 @@ static int vc4_dpi_connector_get_modes(struct 
drm_connector *connector)
return 0;
 }
 
-static struct drm_encoder *
-vc4_dpi_connector_best_encoder(struct drm_connector *connector)
-{
-   struct vc4_dpi_connector *dpi_connector =
-   to_vc4_dpi_connector(connector);
-   return dpi_connector->encoder;
-}
-
 static const struct drm_connector_funcs vc4_dpi_connector_funcs = {
.dpms = drm_atomic_helper_connector_dpms,
.detect = vc4_dpi_connector_detect,
@@ -228,7 +220,6 @@ static const struct drm_connector_funcs 
vc4_dpi_connector_funcs = {
 
 static const struct drm_connector_helper_funcs vc4_dpi_connector_helper_funcs 
= {
.get_modes = vc4_dpi_connector_get_modes,
-   .best_encoder = vc4_dpi_connector_best_encoder,
 };
 
 static struct drm_connector *vc4_dpi_connector_init(struct drm_device *dev,
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index fd2644d..68df91c 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -208,14 +208,6 @@ static int vc4_hdmi_connector_get_modes(struct 
drm_connector *connector)
return ret;
 }
 
-static struct drm_encoder *
-vc4_hdmi_connector_best_encoder(struct drm_connector *connector)
-{
-   struct vc4_hdmi_connector *hdmi_connector =
-   to_vc4_hdmi_connector(connector);
-   return hdmi_connector->encoder;
-}
-
 static const struct drm_connector_funcs vc4_hdmi_connector_funcs = {
.dpms = drm_atomic_helper_connector_dpms,
.detect = vc4_hdmi_connector_detect,
@@ -228,7 +220,6 @@ static const struct drm_connector_funcs 
vc4_hdmi_connector_funcs = {
 
 static const struct drm_connector_helper_funcs vc4_hdmi_connector_helper_funcs 
= {
.get_modes = vc4_hdmi_connector_get_modes,
-   .best_encoder = vc4_hdmi_connector_best_encoder,
 };
 
 static struct drm_connector *vc4_hdmi_connector_init(struct drm_device *dev,
-- 
2.7.4



[PATCH v2 16/20] drm: omap: Rely on the default ->best_encoder() behavior

2016-06-07 Thread Boris Brezillon
We have a 1:1 relationship between connectors and encoders and the
driver is relying on the atomic helpers: we can drop the custom
->best_encoder() implementation and let the core call
drm_atomic_helper_best_encoder() for us.

Signed-off-by: Boris Brezillon 
Reviewed-by: Laurent Pinchart 
---
 drivers/gpu/drm/omapdrm/omap_connector.c | 10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c 
b/drivers/gpu/drm/omapdrm/omap_connector.c
index ce2d67b..137fe69 100644
--- a/drivers/gpu/drm/omapdrm/omap_connector.c
+++ b/drivers/gpu/drm/omapdrm/omap_connector.c
@@ -32,7 +32,6 @@
 struct omap_connector {
struct drm_connector base;
struct omap_dss_device *dssdev;
-   struct drm_encoder *encoder;
bool hdmi_mode;
 };
 
@@ -256,13 +255,6 @@ static int omap_connector_mode_valid(struct drm_connector 
*connector,
return ret;
 }
 
-struct drm_encoder *omap_connector_attached_encoder(
-   struct drm_connector *connector)
-{
-   struct omap_connector *omap_connector = to_omap_connector(connector);
-   return omap_connector->encoder;
-}
-
 static const struct drm_connector_funcs omap_connector_funcs = {
.dpms = drm_atomic_helper_connector_dpms,
.reset = drm_atomic_helper_connector_reset,
@@ -276,7 +268,6 @@ static const struct drm_connector_funcs 
omap_connector_funcs = {
 static const struct drm_connector_helper_funcs omap_connector_helper_funcs = {
.get_modes = omap_connector_get_modes,
.mode_valid = omap_connector_mode_valid,
-   .best_encoder = omap_connector_attached_encoder,
 };
 
 /* initialize connector */
@@ -296,7 +287,6 @@ struct drm_connector *omap_connector_init(struct drm_device 
*dev,
goto fail;
 
omap_connector->dssdev = dssdev;
-   omap_connector->encoder = encoder;
 
connector = _connector->base;
 
-- 
2.7.4



[PATCH v2 20/20] drm/bridge: dw-hdmi: Use drm_atomic_helper_best_encoder()

2016-06-07 Thread Boris Brezillon
We have a 1:1 relationship between connectors and encoders, which means
we can rely on the drm_atomic_helper_best_encoder() behavior.

We still have to explicitly assign ->best_encoder() to
drm_atomic_helper_best_encoder(), because the automated fallback to
drm_atomic_helper_best_encoder() when ->best_encoder() is NULL is only
available when the DRM device is using the atomic helpers, and this bridge
is compatible with non-atomic and atomic devices.

Signed-off-by: Boris Brezillon 
---
 drivers/gpu/drm/bridge/dw-hdmi.c | 11 +--
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/bridge/dw-hdmi.c b/drivers/gpu/drm/bridge/dw-hdmi.c
index c9d9412..70b1f7d 100644
--- a/drivers/gpu/drm/bridge/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/dw-hdmi.c
@@ -1476,15 +1476,6 @@ dw_hdmi_connector_mode_valid(struct drm_connector 
*connector,
return mode_status;
 }
 
-static struct drm_encoder *dw_hdmi_connector_best_encoder(struct drm_connector
-  *connector)
-{
-   struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi,
-connector);
-
-   return hdmi->encoder;
-}
-
 static void dw_hdmi_connector_destroy(struct drm_connector *connector)
 {
drm_connector_unregister(connector);
@@ -1525,7 +1516,7 @@ static const struct drm_connector_funcs 
dw_hdmi_atomic_connector_funcs = {
 static const struct drm_connector_helper_funcs dw_hdmi_connector_helper_funcs 
= {
.get_modes = dw_hdmi_connector_get_modes,
.mode_valid = dw_hdmi_connector_mode_valid,
-   .best_encoder = dw_hdmi_connector_best_encoder,
+   .best_encoder = drm_atomic_helper_best_encoder,
 };
 
 static const struct drm_bridge_funcs dw_hdmi_bridge_funcs = {
-- 
2.7.4



[PATCH v2 18/20] drm/bridge: ptn3460: Rely on the default ->best_encoder() behavior

2016-06-07 Thread Boris Brezillon
We have a 1:1 relationship between connectors and encoders, and the driver
is relying on the atomic helpers: we can drop the custom ->best_encoder(),
and let the core call drm_atomic_helper_best_encoder() for us.

Signed-off-by: Boris Brezillon 
---
 drivers/gpu/drm/bridge/nxp-ptn3460.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/drivers/gpu/drm/bridge/nxp-ptn3460.c 
b/drivers/gpu/drm/bridge/nxp-ptn3460.c
index 7ecd59f..93f3dac 100644
--- a/drivers/gpu/drm/bridge/nxp-ptn3460.c
+++ b/drivers/gpu/drm/bridge/nxp-ptn3460.c
@@ -235,16 +235,8 @@ out:
return num_modes;
 }
 
-static struct drm_encoder *ptn3460_best_encoder(struct drm_connector 
*connector)
-{
-   struct ptn3460_bridge *ptn_bridge = connector_to_ptn3460(connector);
-
-   return ptn_bridge->bridge.encoder;
-}
-
 static const struct drm_connector_helper_funcs ptn3460_connector_helper_funcs 
= {
.get_modes = ptn3460_get_modes,
-   .best_encoder = ptn3460_best_encoder,
 };
 
 static enum drm_connector_status ptn3460_detect(struct drm_connector 
*connector,
-- 
2.7.4



[PATCH v2 10/20] drm: rockchip: Rely on the default ->best_encoder() behavior

2016-06-07 Thread Boris Brezillon
All outputs have a 1:1 relationship between connectors and encoders
and the driver is relying on the atomic helpers: we can drop the custom
->best_encoder() implementations  and let the core call
drm_atomic_helper_best_encoder() for us.

Signed-off-by: Boris Brezillon 
Acked-by: Mark Yao 
---
 drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 9 -
 drivers/gpu/drm/rockchip/inno_hdmi.c   | 9 -
 2 files changed, 18 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c 
b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
index dedc65b..ca22e5e 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
@@ -964,18 +964,9 @@ static enum drm_mode_status dw_mipi_dsi_mode_valid(
return mode_status;
 }
 
-static struct drm_encoder *dw_mipi_dsi_connector_best_encoder(
-   struct drm_connector *connector)
-{
-   struct dw_mipi_dsi *dsi = con_to_dsi(connector);
-
-   return >encoder;
-}
-
 static struct drm_connector_helper_funcs dw_mipi_dsi_connector_helper_funcs = {
.get_modes = dw_mipi_dsi_connector_get_modes,
.mode_valid = dw_mipi_dsi_mode_valid,
-   .best_encoder = dw_mipi_dsi_connector_best_encoder,
 };
 
 static enum drm_connector_status
diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c 
b/drivers/gpu/drm/rockchip/inno_hdmi.c
index f8b4feb..006260d 100644
--- a/drivers/gpu/drm/rockchip/inno_hdmi.c
+++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
@@ -579,14 +579,6 @@ inno_hdmi_connector_mode_valid(struct drm_connector 
*connector,
return MODE_OK;
 }
 
-static struct drm_encoder *
-inno_hdmi_connector_best_encoder(struct drm_connector *connector)
-{
-   struct inno_hdmi *hdmi = to_inno_hdmi(connector);
-
-   return >encoder;
-}
-
 static int
 inno_hdmi_probe_single_connector_modes(struct drm_connector *connector,
   uint32_t maxX, uint32_t maxY)
@@ -613,7 +605,6 @@ static struct drm_connector_funcs inno_hdmi_connector_funcs 
= {
 static struct drm_connector_helper_funcs inno_hdmi_connector_helper_funcs = {
.get_modes = inno_hdmi_connector_get_modes,
.mode_valid = inno_hdmi_connector_mode_valid,
-   .best_encoder = inno_hdmi_connector_best_encoder,
 };
 
 static int inno_hdmi_register(struct drm_device *drm, struct inno_hdmi *hdmi)
-- 
2.7.4



[PATCH v2 13/20] drm: tegra: Rely on the default ->best_encoder() behavior

2016-06-07 Thread Boris Brezillon
All outputs have a 1:1 relationship between connectors and encoders
and the driver is relying on the atomic helpers: we can drop the custom
->best_encoder() implementation and let the core call
drm_atomic_helper_best_encoder() for us.

Signed-off-by: Boris Brezillon 
---
 drivers/gpu/drm/tegra/drm.h| 2 --
 drivers/gpu/drm/tegra/dsi.c| 1 -
 drivers/gpu/drm/tegra/hdmi.c   | 1 -
 drivers/gpu/drm/tegra/output.c | 8 
 drivers/gpu/drm/tegra/rgb.c| 1 -
 drivers/gpu/drm/tegra/sor.c| 1 -
 6 files changed, 14 deletions(-)

diff --git a/drivers/gpu/drm/tegra/drm.h b/drivers/gpu/drm/tegra/drm.h
index f52d6cb2..0ddcce1 100644
--- a/drivers/gpu/drm/tegra/drm.h
+++ b/drivers/gpu/drm/tegra/drm.h
@@ -239,8 +239,6 @@ int tegra_output_init(struct drm_device *drm, struct 
tegra_output *output);
 void tegra_output_exit(struct tegra_output *output);
 
 int tegra_output_connector_get_modes(struct drm_connector *connector);
-struct drm_encoder *
-tegra_output_connector_best_encoder(struct drm_connector *connector);
 enum drm_connector_status
 tegra_output_connector_detect(struct drm_connector *connector, bool force);
 void tegra_output_connector_destroy(struct drm_connector *connector);
diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c
index d1239eb..099cccb 100644
--- a/drivers/gpu/drm/tegra/dsi.c
+++ b/drivers/gpu/drm/tegra/dsi.c
@@ -794,7 +794,6 @@ tegra_dsi_connector_mode_valid(struct drm_connector 
*connector,
 static const struct drm_connector_helper_funcs 
tegra_dsi_connector_helper_funcs = {
.get_modes = tegra_output_connector_get_modes,
.mode_valid = tegra_dsi_connector_mode_valid,
-   .best_encoder = tegra_output_connector_best_encoder,
 };
 
 static const struct drm_encoder_funcs tegra_dsi_encoder_funcs = {
diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
index b7ef492..2fdb879 100644
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -806,7 +806,6 @@ static const struct drm_connector_helper_funcs
 tegra_hdmi_connector_helper_funcs = {
.get_modes = tegra_output_connector_get_modes,
.mode_valid = tegra_hdmi_connector_mode_valid,
-   .best_encoder = tegra_output_connector_best_encoder,
 };
 
 static const struct drm_encoder_funcs tegra_hdmi_encoder_funcs = {
diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c
index 46664b6..1480f6a 100644
--- a/drivers/gpu/drm/tegra/output.c
+++ b/drivers/gpu/drm/tegra/output.c
@@ -42,14 +42,6 @@ int tegra_output_connector_get_modes(struct drm_connector 
*connector)
return err;
 }
 
-struct drm_encoder *
-tegra_output_connector_best_encoder(struct drm_connector *connector)
-{
-   struct tegra_output *output = connector_to_output(connector);
-
-   return >encoder;
-}
-
 enum drm_connector_status
 tegra_output_connector_detect(struct drm_connector *connector, bool force)
 {
diff --git a/drivers/gpu/drm/tegra/rgb.c b/drivers/gpu/drm/tegra/rgb.c
index e246334..a131b44 100644
--- a/drivers/gpu/drm/tegra/rgb.c
+++ b/drivers/gpu/drm/tegra/rgb.c
@@ -112,7 +112,6 @@ tegra_rgb_connector_mode_valid(struct drm_connector 
*connector,
 static const struct drm_connector_helper_funcs 
tegra_rgb_connector_helper_funcs = {
.get_modes = tegra_output_connector_get_modes,
.mode_valid = tegra_rgb_connector_mode_valid,
-   .best_encoder = tegra_output_connector_best_encoder,
 };
 
 static const struct drm_encoder_funcs tegra_rgb_encoder_funcs = {
diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index 757c6e8..34958d7 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -1087,7 +1087,6 @@ tegra_sor_connector_mode_valid(struct drm_connector 
*connector,
 static const struct drm_connector_helper_funcs 
tegra_sor_connector_helper_funcs = {
.get_modes = tegra_sor_connector_get_modes,
.mode_valid = tegra_sor_connector_mode_valid,
-   .best_encoder = tegra_output_connector_best_encoder,
 };
 
 static const struct drm_encoder_funcs tegra_sor_encoder_funcs = {
-- 
2.7.4



Re: [PATCH 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48

2016-06-07 Thread Sergei Shtylyov

Hello.

On 6/7/2016 6:39 AM, Magnus Damm wrote:


From: Magnus Damm 

Bump up the maximum numbers of micro-TLBS to 48.

Each IPMMU device instance get micro-TLB assignment via
the "iommus" property in DT. Older SoCs tend to use a
maximum number of 32 micro-TLBd per IPMMU instance however


   Micro-TLBs?


newer SoCs such as r8a7796 make use of up to 48 micro-TLBs.

At this point no SoC specific handling is done to validate
the maximum number of micro-TLBs, and because of that the
DT information is assumed to be within correct range for
each particular SoC.

If needed in the future SoC specific feature flags can be
added to handle the maximum number of micro-TLBs without
requiring DT changes, however at this point this does not
seem necessary.

Signed-off-by: Magnus Damm 

[...]

MBR, Sergei



Re: [PATCH] ASoC: rsnd: adg :: AUDIO-CLKOUTn can synchronizes with L/R clock.

2016-06-07 Thread Mark Brown
On Tue, Jun 07, 2016 at 06:21:33AM +, Kuninori Morimoto wrote:
> From: Kuninori Morimoto 
> 
> AUDIO-CLKOUTn can synchronizes with L/R clock, and Salvator board
> needs it. Otherwise, specific frequency sound will be noisy.

Why would a user not want these clocks to be synchronous?  A lot of
CODECs will at least have better performance if their master clock is
synchronous to the audio clocks so it'd be a better default, is there an
advantage to not doing it?


signature.asc
Description: PGP signature


Re: [PATCH v3 0/6] Add R8A7794/SILK sound DT support

2016-06-07 Thread Sergei Shtylyov

Hello.

On 6/7/2016 3:37 AM, Simon Horman wrote:


  Here's the set of 6 patches against Simon Horman's 'renesas.git' repo,
'renesas-devel-20160509-v4.6-rc7' tag. I'm adding the sound device tree support
for the R8A7794 SoC based SILK board.

[1/6] ARM: dts: r8a7794: add audio clocks
[2/6] ARM: dts: r8a7794: add MSTP5 clocks
[3/6] ARM: dts: r8a7794: add MSTP10 clocks
[4/6] ARM: dts: r8a7794: add Audio-DMAC support
[5/6] ARM: dts: r8a7794: add sound support
[6/6] ARM: dts: silk: add sound support


  Oops, forgot to mention that patch #5 depends on the R-Car sound patch
posted yesterday in order to get interpreted as intended (it uses a disabled
SRC node).


  Simon, that patch has already hit Linus' tree but this series seems to be
stuck. Please merge!


Hi Sergei,

there seem to be some outstanding review comments for v3 of this patchset.


   Indeed, seeing them now. Sorry for bothering you...


Could you address them and repost?


   I will. :-)


Thanks!


MBR, Sergei



Re: [PATCH 0/9] clocksource/drivers/clksrc-of: Improve error handling

2016-06-07 Thread Geert Uytterhoeven
Hi Daniel,

On Wed, Jun 1, 2016 at 10:34 AM, Daniel Lezcano
 wrote:
> The macro CLOCKSOURCE_OF_DECLARE is widely used in the timer drivers.
>
> Basically, this macro is defined to insert in a table a tuple name,function.
> This function is an init function called when the name matches the DT node and
> its signature is:
>
> typedef void (*of_init_fn_1)(struct device_node *);
>
> It does not return an error code.
>
> That results in the clocksource-probe not being able to figure out if the 
> driver
> was correctly initialized or not, the different drivers to act as they were 
> the
> only ones on the system (panic, instead of failing gracefully), and duplicated
> code for error reporting.
>
> This series initiates the logic change and centralize the error handling in 
> the
> clocksource probe code.
>
> In order to do the changes little by little, a new macro was introduced:
>
>  CLOCKSOURCE_OF_DECLARE_RET()

As I have no other thread to reply to, I'm using this related one.

commit bcbe219f9306da478b77e705a7273843c2660d7b
Author: Daniel Lezcano 
Date:   Tue Jun 7 00:27:44 2016 +0200

clocksources: Switch back to the clksrc table

Signed-off-by: Daniel Lezcano 

in clockevents/clockevents/next breaks the boot on e.g. r8a7791/koelsch
(arm32) and r8a7795/salvator-x (arm64).

Using "earlycon keep_bootcon" on koelsch (this doesn't help on arm64)
reveals it's stuck at:

clocksource_probe: no matching clocksources found
sched_clock: 32 bits at 100 Hz, resolution 1000ns, wraps every
2147483647500ns
Calibrating delay loop...

With the above commit reverted, it works again:

Architected cp15 timer(s) running at 10.00MHz (virt).
clocksource: arch_sys_counter: mask: 0xff max_cycles:
0x24e6a1710, max_idle_ns: 440795202120 ns
sched_clock: 56 bits at 10MHz, resolution 100ns, wraps every 4398046511100ns
Switching to timer-based delay loop, resolution 100ns
Calibrating delay loop (skipped), value calculated using timer
frequency.. 20.00 BogoMIPS (lpj=10)

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


Re: [PATCH v1 00/25] PCI: Request host bridge window resources

2016-06-07 Thread Arnd Bergmann
On Monday, June 6, 2016 6:04:44 PM CEST Bjorn Helgaas wrote:
> Several host bridge drivers (designware and all derivatives, iproc,
> xgene, xilinx, and xilinx-nwl) don't request the MMIO and I/O port
> windows they forward downstream to the PCI bus.
> 
> That means the PCI core can't request resources for PCI bridge
> windows and PCI BARs.
> 
> Several other drivers (altera, generic, mvebu, rcar, tegra) do request
> the windows, but use some duplicated code to do it.
> 
> This adds a new devm_request_pci_bus_resources() interface and changes
> these drivers to use it.  It also fixes several error paths where we failed
> to free the resource list allocated by of_pci_get_host_bridge_resources().
> 
> Tegra guys, please take a look at "PCI: tegra: Remove top-level resource
> from hierarchy" in particular.  Removing the top-level resource definitely
> makes /proc/iomem look uglier (although it will look more like that of
> other drivers).  A short-term fix could be to include device information in
> the resource name.  I think a better long-term fix would be to make the DT
> or platform device core request all the resources from the DT.
> 
> Comments welcome.  I expect we'll trip over something here, so I marked
> this "v1" and I don't plan to put it into -next for a while.
> 
> This is on my pci/host-request-windows branch, which you can pull or view
> at 
> https://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/log/?h=pci/host-request-windows

This looks very nice. There is one related aspect that I have been
grumbling about for a while, but I don't know what the driver is
actually supposed to do there:

For the IORESOURCE_IO resources, some drivers request the MMIO address
that the window is mapped into, some drivers request the PIO range, and
some of them request both. I also believe the resource that gets put
into the bridge resources list is not always the same one (or maybe
that got fixed by now).

What do you think is the correct behavior here, should the driver only
request the PIO range with parent=ioport_resource, or should it also
request the MMIO window for the I/O ports with parent=iomem_resource?
In the latter case, any idea how that can be generalized?

Another aspect is that we already have the
gen_pci_parse_request_of_pci_ranges() function that does the same as your
new devm_request_pci_bus_resources() and then a few other things. I
have been wondering whether we could move that function into common
code convert drivers to use that wherever possible, but I guess we can
always do that as a follow-up after this series.

Arnd



Re: [PATCH v2 2/4] clk: renesas: Add r8a7796 CPG Core Clock Definitions

2016-06-07 Thread Geert Uytterhoeven
Hi Dirk,

On Tue, Jun 7, 2016 at 9:53 AM, Dirk Behme  wrote:
> I think I just want to discuss if we have a clever idea to further improve
> one detail. That is, if we have a clever idea to avoid the copy & paste
> between the family members using anything like a hierarchical way of
> defining the clocks in r8a779x-cpg-mssr.h.
>
>> Given the small amount of work needed to bootstrap r8a7796, I
>> think they still hold on their promises.
>
> Well, regarding the r8a779x-cpg-mssr.h the small amount of work needed isn't
> a really good argument if you are good with cp & sed for the copy & paste
> done ;)

They're not really created by cp & sed, as they must match the table in the
datasheet (the latter may have been created by copy & paste though :-)

> What I fear we end up the way we are doing the copy & paste
> r8a779x-cpg-mssr.h is having 5 or 6 or even more of these files, all > 90%
> identical. And once you have to change anything, you either have to change
> all these files. Or you miss anything, ending up with subtle bugs when one
> SoC does behave differently than an other one.

The point is these files are stable ABI: no single value can be changed.
No value can be reused. Only new values can be appended at the bottom
(if a newer revision of the datasheet documents more clocks than the old
 version, which happens from time to time).

IMHO a hierarchical way of defining the clocks has more opportunity of
accidentally referring to a clock that doesn't exist on a particular SoC.

Furthermore, r8a779x-cpg-mssr.h is not a good name to be part of a DT binding,
due to the wildcard.
A future SoC may will match r8a779x and even be called (R-Car 3?),
while using a completely different CPG block.

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


[PATCHv8 0/6] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-06-07 Thread Niklas Söderlund
Hi,

This series tries to solve the problem with DMA with device registers
(MMIO registers) that are behind an IOMMU for the rcar-dmac driver. A
recent patch '9575632 (dmaengine: make slave address physical)'
clarifies that DMA slave address provided by clients is the physical
address. This puts the task of mapping the DMA slave address from a
phys_addr_t to a dma_addr_t on the DMA engine.

Without an IOMMU this is easy since the phys_addr_t and dma_addr_t are
the same and no special care is needed. However if you have a IOMMU you
need to map the DMA slave phys_addr_t to a dma_addr_t using something
like this.

This series is based on top of v4.7-rc1. And I'm hoping to be able to collect a 
Ack from Russell King on patch 4/6 that adds the ARM specific part and then be 
able to take the whole series through the dmaengine tree. If this is not the 
best route I'm more then happy to do it another way.

It's tested on a Koelsch with CONFIG_IPMMU_VMSA and by enabling the
ipmmu_ds node in r8a7791.dtsi. I verified operation by interacting with
/dev/mmcblk1, i2c and the serial console which are devices behind the
iommu.

Furthermore I have audited to the best of my ability all call paths
involved to make sure that the dma_addr_t obtained from
dma_map_resource() to is not used in a way where it would be expected
for the mapping to be RAM (have a struct page). Many thanks to Christoph
Hellwig and Laurent Pinchart for there input in this effort.

  * drivers/dma/sh/rcar-dmac.c
Once the phys_addr_t is mapped to a dma_addr_t using
dma_map_resource() it is only used to check that the transferee do not
cross 4GB boundaries and then only directly written to HW registers.

  * drivers/iommu/iommu.c
- iommu_map()
  Check that it's align to min page size or return -EINVAL then calls
  domain->ops->map()

  * drivers/iommu/ipmmu-vmsa.c
- ipmmu_map()
  No logic only calls domain->ops->map()

  * drivers/iommu/io-pgtable-arm.c
- arm_lpae_map()
  No logic only calls __arm_lpae_map()
- __arm_lpae_map()
  No logic only calls arm_lpae_init_pte()
- arm_lpae_init_pte()
  Used to get a pte:
pte |= pfn_to_iopte(paddr >> data->pg_shift, data);

  * drivers/iommu/io-pgtable-arm-v7s.c
- arm_v7s_map()
  No logic only calls __arm_v7s_map()
- __arm_v7s_map()
  No logic only calls arm_v7s_init_pte()
- arm_v7s_init_pte
  Used to get a pte:
pte |= paddr & ARM_V7S_LVL_MASK(lvl);

  * ARM dma-mapping
- dma_unmap_*
  Only valid unmap is dma_unmap_resource() all others are an invalid
  use case.
- dma_sync_single_*
  Invalid use case, memory that is mapped is device memory
- dma_common_mmap() and dma_mmap_attrs()
  Invalid use case
- dma_common_get_sgtable() and dma_get_sgtable_attrs()
  Invalid use case, only for dma_alloc_* allocated memory,
- dma_mapping_error()
  OK

* Changes since v7
- Use size_t instead of int for length in arm_iommu_map_resource() and 
  arm_iommu_unmap_resource().
- Fix bug in arm_iommu_map_resource() where wrong variable where passed to 
  __alloc_iova(). Thanks to Russell King for pointing out both errors.

* Changes since v6
- Use offset_in_page() and __pfn_to_phys(). This fixed a bug in the
  lib/dma-debug.c. Thanks to Konrad Rzeszutek Wilk for finding it and Robin
  Murphy for suggesting offset_in_page().
- Rebased on top of v4.7-rc1.
- Dropped DT patches which enabled the IPMMU on Renesas Koelsch and Lager. Will
  post them separately at a later time.

* Changes since v5
- Add dma-debug work which adds a new mapping type for the resource
  mapping which correctly can be translated to a physical address.
- Drop patches from Robin Murphy since they now are accepted in the
  iommu repository and base the series on that tree instead.
- Add a review tag from Laurent.

* Changes since v4
- Move the mapping from phys_addr_t to dma_addr_t from slave_config to the
  prepare calls. This way we know the direction of the mapping and don't have
  to use DMA_BIDIRECTIONAL. Thanks Vinod for suggesting this.
- To be clear that the data type for slave addresses are changed add a patch
  that only changes the data type to phys_addr_t.
- Fixed up commit messages.

* Changes since v3
- Folded in a fix from Robin to his patch.
- Added a check to make sure dma_map_resource can not be used to map RAM as
  pointed out by Robin. I use BUG_ON to enforce this. It might not be the best
  method but I saw no other good way since DMA_ERROR_CODE might not be defined
  on all platforms.
- Added comment about that DTS changes will disable 2 DMA channels due to a HW
  (?) bug in the DMAC.
- Dropped the use of dma_attrs, no longer needed.
- Collected Acked-by and Reviewed-by from Laurent.
- Various indentation fix ups.

* Changes since v2
- Drop patch to add dma_{map,unmap}_page_attrs.
- Add dma_{map,unmap}_resource to handle the mapping without involving a
  'struct page'. Thanks Laurent and Robin for pointing 

[PATCHv8 4/6] arm: dma-mapping: add {map,unmap}_resource for iommu ops

2016-06-07 Thread Niklas Söderlund
Add methods to map/unmap device resources addresses for dma_map_ops that
are IOMMU aware. This is needed to map a device MMIO register from a
physical address.

Signed-off-by: Niklas Söderlund 
Reviewed-by: Laurent Pinchart 
---
 arch/arm/mm/dma-mapping.c | 63 +++
 1 file changed, 63 insertions(+)

diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index ff7ed56..7e9c8eb 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -1951,6 +1951,63 @@ static void arm_iommu_unmap_page(struct device *dev, 
dma_addr_t handle,
__free_iova(mapping, iova, len);
 }
 
+/**
+ * arm_iommu_map_resource - map a device resource for DMA
+ * @dev: valid struct device pointer
+ * @phys_addr: physical address of resource
+ * @size: size of resource to map
+ * @dir: DMA transfer direction
+ */
+static dma_addr_t arm_iommu_map_resource(struct device *dev,
+   phys_addr_t phys_addr, size_t size,
+   enum dma_data_direction dir, struct dma_attrs *attrs)
+{
+   struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev);
+   dma_addr_t dma_addr;
+   int ret, prot;
+   phys_addr_t addr = phys_addr & PAGE_MASK;
+   unsigned int offset = phys_addr & ~PAGE_MASK;
+   size_t len = PAGE_ALIGN(size + offset);
+
+   dma_addr = __alloc_iova(mapping, len);
+   if (dma_addr == DMA_ERROR_CODE)
+   return dma_addr;
+
+   prot = __dma_direction_to_prot(dir) | IOMMU_MMIO;
+
+   ret = iommu_map(mapping->domain, dma_addr, addr, len, prot);
+   if (ret < 0)
+   goto fail;
+
+   return dma_addr + offset;
+fail:
+   __free_iova(mapping, dma_addr, len);
+   return DMA_ERROR_CODE;
+}
+
+/**
+ * arm_iommu_unmap_resource - unmap a device DMA resource
+ * @dev: valid struct device pointer
+ * @dma_handle: DMA address to resource
+ * @size: size of resource to map
+ * @dir: DMA transfer direction
+ */
+static void arm_iommu_unmap_resource(struct device *dev, dma_addr_t dma_handle,
+   size_t size, enum dma_data_direction dir,
+   struct dma_attrs *attrs)
+{
+   struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev);
+   dma_addr_t iova = dma_handle & PAGE_MASK;
+   unsigned int offset = dma_handle & ~PAGE_MASK;
+   size_t len = PAGE_ALIGN(size + offset);
+
+   if (!iova)
+   return;
+
+   iommu_unmap(mapping->domain, iova, len);
+   __free_iova(mapping, iova, len);
+}
+
 static void arm_iommu_sync_single_for_cpu(struct device *dev,
dma_addr_t handle, size_t size, enum dma_data_direction dir)
 {
@@ -1994,6 +2051,9 @@ struct dma_map_ops iommu_ops = {
.unmap_sg   = arm_iommu_unmap_sg,
.sync_sg_for_cpu= arm_iommu_sync_sg_for_cpu,
.sync_sg_for_device = arm_iommu_sync_sg_for_device,
+
+   .map_resource   = arm_iommu_map_resource,
+   .unmap_resource = arm_iommu_unmap_resource,
 };
 
 struct dma_map_ops iommu_coherent_ops = {
@@ -2007,6 +2067,9 @@ struct dma_map_ops iommu_coherent_ops = {
 
.map_sg = arm_coherent_iommu_map_sg,
.unmap_sg   = arm_coherent_iommu_unmap_sg,
+
+   .map_resource   = arm_iommu_map_resource,
+   .unmap_resource = arm_iommu_unmap_resource,
 };
 
 /**
-- 
2.8.2



[PATCHv8 5/6] dmaengine: rcar-dmac: group slave configuration

2016-06-07 Thread Niklas Söderlund
Group slave address and transfer size in own structs for source and
destination. This is in preparation for hooking up the dma-mapping API
to the slave addresses.

Signed-off-by: Niklas Söderlund 
Reviewed-by: Laurent Pinchart 
---
 drivers/dma/sh/rcar-dmac.c | 38 ++
 1 file changed, 22 insertions(+), 16 deletions(-)

diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index dfb1792..b0c3bb2 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -118,14 +118,22 @@ struct rcar_dmac_desc_page {
sizeof(struct rcar_dmac_xfer_chunk))
 
 /*
+ * struct rcar_dmac_chan_slave - Slave configuration
+ * @slave_addr: slave memory address
+ * @xfer_size: size (in bytes) of hardware transfers
+ */
+struct rcar_dmac_chan_slave {
+   phys_addr_t slave_addr;
+   unsigned int xfer_size;
+};
+
+/*
  * struct rcar_dmac_chan - R-Car Gen2 DMA Controller Channel
  * @chan: base DMA channel object
  * @iomem: channel I/O memory base
  * @index: index of this channel in the controller
- * @src_xfer_size: size (in bytes) of hardware transfers on the source side
- * @dst_xfer_size: size (in bytes) of hardware transfers on the destination 
side
- * @src_slave_addr: slave source memory address
- * @dst_slave_addr: slave destination memory address
+ * @src: slave memory address and size on the source side
+ * @dst: slave memory address and size on the destination side
  * @mid_rid: hardware MID/RID for the DMA client using this channel
  * @lock: protects the channel CHCR register and the desc members
  * @desc.free: list of free descriptors
@@ -142,10 +150,8 @@ struct rcar_dmac_chan {
void __iomem *iomem;
unsigned int index;
 
-   unsigned int src_xfer_size;
-   unsigned int dst_xfer_size;
-   dma_addr_t src_slave_addr;
-   dma_addr_t dst_slave_addr;
+   struct rcar_dmac_chan_slave src;
+   struct rcar_dmac_chan_slave dst;
int mid_rid;
 
spinlock_t lock;
@@ -793,13 +799,13 @@ static void rcar_dmac_chan_configure_desc(struct 
rcar_dmac_chan *chan,
case DMA_DEV_TO_MEM:
chcr = RCAR_DMACHCR_DM_INC | RCAR_DMACHCR_SM_FIXED
 | RCAR_DMACHCR_RS_DMARS;
-   xfer_size = chan->src_xfer_size;
+   xfer_size = chan->src.xfer_size;
break;
 
case DMA_MEM_TO_DEV:
chcr = RCAR_DMACHCR_DM_FIXED | RCAR_DMACHCR_SM_INC
 | RCAR_DMACHCR_RS_DMARS;
-   xfer_size = chan->dst_xfer_size;
+   xfer_size = chan->dst.xfer_size;
break;
 
case DMA_MEM_TO_MEM:
@@ -1038,7 +1044,7 @@ rcar_dmac_prep_slave_sg(struct dma_chan *chan, struct 
scatterlist *sgl,
}
 
dev_addr = dir == DMA_DEV_TO_MEM
-? rchan->src_slave_addr : rchan->dst_slave_addr;
+? rchan->src.slave_addr : rchan->dst.slave_addr;
return rcar_dmac_chan_prep_sg(rchan, sgl, sg_len, dev_addr,
  dir, flags, false);
 }
@@ -1093,7 +1099,7 @@ rcar_dmac_prep_dma_cyclic(struct dma_chan *chan, 
dma_addr_t buf_addr,
}
 
dev_addr = dir == DMA_DEV_TO_MEM
-? rchan->src_slave_addr : rchan->dst_slave_addr;
+? rchan->src.slave_addr : rchan->dst.slave_addr;
desc = rcar_dmac_chan_prep_sg(rchan, sgl, sg_len, dev_addr,
  dir, flags, true);
 
@@ -1110,10 +1116,10 @@ static int rcar_dmac_device_config(struct dma_chan 
*chan,
 * We could lock this, but you shouldn't be configuring the
 * channel, while using it...
 */
-   rchan->src_slave_addr = cfg->src_addr;
-   rchan->dst_slave_addr = cfg->dst_addr;
-   rchan->src_xfer_size = cfg->src_addr_width;
-   rchan->dst_xfer_size = cfg->dst_addr_width;
+   rchan->src.slave_addr = cfg->src_addr;
+   rchan->dst.slave_addr = cfg->dst_addr;
+   rchan->src.xfer_size = cfg->src_addr_width;
+   rchan->dst.xfer_size = cfg->dst_addr_width;
 
return 0;
 }
-- 
2.8.2



[PATCHv8 6/6] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-06-07 Thread Niklas Söderlund
Enable slave transfers to a device behind a IPMMU by mapping the slave
addresses using the dma-mapping API.

Signed-off-by: Niklas Söderlund 
---
 drivers/dma/sh/rcar-dmac.c | 82 +-
 1 file changed, 74 insertions(+), 8 deletions(-)

diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index b0c3bb2..8592598 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -128,6 +128,18 @@ struct rcar_dmac_chan_slave {
 };
 
 /*
+ * struct rcar_dmac_chan_map - Map of slave device phys to dma address
+ * @addr: slave dma address
+ * @dir: direction of mapping
+ * @slave: slave configuration that is mapped
+ */
+struct rcar_dmac_chan_map {
+   dma_addr_t addr;
+   enum dma_data_direction dir;
+   struct rcar_dmac_chan_slave slave;
+};
+
+/*
  * struct rcar_dmac_chan - R-Car Gen2 DMA Controller Channel
  * @chan: base DMA channel object
  * @iomem: channel I/O memory base
@@ -152,6 +164,7 @@ struct rcar_dmac_chan {
 
struct rcar_dmac_chan_slave src;
struct rcar_dmac_chan_slave dst;
+   struct rcar_dmac_chan_map map;
int mid_rid;
 
spinlock_t lock;
@@ -1027,13 +1040,65 @@ rcar_dmac_prep_dma_memcpy(struct dma_chan *chan, 
dma_addr_t dma_dest,
  DMA_MEM_TO_MEM, flags, false);
 }
 
+static int rcar_dmac_map_slave_addr(struct dma_chan *chan,
+   enum dma_transfer_direction dir)
+{
+   struct rcar_dmac_chan *rchan = to_rcar_dmac_chan(chan);
+   struct rcar_dmac_chan_map *map = >map;
+   phys_addr_t dev_addr;
+   size_t dev_size;
+   enum dma_data_direction dev_dir;
+
+   if (dir == DMA_DEV_TO_MEM) {
+   dev_addr = rchan->src.slave_addr;
+   dev_size = rchan->src.xfer_size;
+   dev_dir = DMA_TO_DEVICE;
+   } else {
+   dev_addr = rchan->dst.slave_addr;
+   dev_size = rchan->dst.xfer_size;
+   dev_dir = DMA_FROM_DEVICE;
+   }
+
+   /* Reuse current map if possible. */
+   if (dev_addr == map->slave.slave_addr &&
+   dev_size == map->slave.xfer_size &&
+   dev_dir == map->dir)
+   return 0;
+
+   /* Remove old mapping if present. */
+   if (map->slave.xfer_size)
+   dma_unmap_resource(chan->device->dev, map->addr,
+  map->slave.xfer_size, map->dir, NULL);
+   map->slave.xfer_size = 0;
+
+   /* Create new slave address map. */
+   map->addr = dma_map_resource(chan->device->dev, dev_addr, dev_size,
+dev_dir, NULL);
+
+   if (dma_mapping_error(chan->device->dev, map->addr)) {
+   dev_err(chan->device->dev,
+   "chan%u: failed to map %zx@%pap", rchan->index,
+   dev_size, _addr);
+   return -EIO;
+   }
+
+   dev_dbg(chan->device->dev, "chan%u: map %zx@%pap to %pad dir: %s\n",
+   rchan->index, dev_size, _addr, >addr,
+   dev_dir == DMA_TO_DEVICE ? "DMA_TO_DEVICE" : "DMA_FROM_DEVICE");
+
+   map->slave.slave_addr = dev_addr;
+   map->slave.xfer_size = dev_size;
+   map->dir = dev_dir;
+
+   return 0;
+}
+
 static struct dma_async_tx_descriptor *
 rcar_dmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
unsigned int sg_len, enum dma_transfer_direction dir,
unsigned long flags, void *context)
 {
struct rcar_dmac_chan *rchan = to_rcar_dmac_chan(chan);
-   dma_addr_t dev_addr;
 
/* Someone calling slave DMA on a generic channel? */
if (rchan->mid_rid < 0 || !sg_len) {
@@ -1043,9 +1108,10 @@ rcar_dmac_prep_slave_sg(struct dma_chan *chan, struct 
scatterlist *sgl,
return NULL;
}
 
-   dev_addr = dir == DMA_DEV_TO_MEM
-? rchan->src.slave_addr : rchan->dst.slave_addr;
-   return rcar_dmac_chan_prep_sg(rchan, sgl, sg_len, dev_addr,
+   if (rcar_dmac_map_slave_addr(chan, dir))
+   return NULL;
+
+   return rcar_dmac_chan_prep_sg(rchan, sgl, sg_len, rchan->map.addr,
  dir, flags, false);
 }
 
@@ -1059,7 +1125,6 @@ rcar_dmac_prep_dma_cyclic(struct dma_chan *chan, 
dma_addr_t buf_addr,
struct rcar_dmac_chan *rchan = to_rcar_dmac_chan(chan);
struct dma_async_tx_descriptor *desc;
struct scatterlist *sgl;
-   dma_addr_t dev_addr;
unsigned int sg_len;
unsigned int i;
 
@@ -1071,6 +1136,9 @@ rcar_dmac_prep_dma_cyclic(struct dma_chan *chan, 
dma_addr_t buf_addr,
return NULL;
}
 
+   if (rcar_dmac_map_slave_addr(chan, dir))
+   return NULL;
+
sg_len = buf_len / period_len;
if (sg_len > RCAR_DMAC_MAX_SG_LEN) {
dev_err(chan->device->dev,
@@ -1098,9 +1166,7 @@ 

[PATCHv8 1/6] dma-mapping: add {map,unmap}_resource to dma_map_ops

2016-06-07 Thread Niklas Söderlund
Add methods to handle mapping of device resources from a physical
address. This is needed for example to be able to map MMIO FIFO
registers to a IOMMU.

Signed-off-by: Niklas Söderlund 
Reviewed-by: Laurent Pinchart 
---
 include/linux/dma-mapping.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index c980a92..a11ff9d 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -49,6 +49,12 @@ struct dma_map_ops {
 struct scatterlist *sg, int nents,
 enum dma_data_direction dir,
 struct dma_attrs *attrs);
+   dma_addr_t (*map_resource)(struct device *dev, phys_addr_t phys_addr,
+  size_t size, enum dma_data_direction dir,
+  struct dma_attrs *attrs);
+   void (*unmap_resource)(struct device *dev, dma_addr_t dma_handle,
+  size_t size, enum dma_data_direction dir,
+  struct dma_attrs *attrs);
void (*sync_single_for_cpu)(struct device *dev,
dma_addr_t dma_handle, size_t size,
enum dma_data_direction dir);
-- 
2.8.2



[PATCHv8 3/6] dma-mapping: add dma_{map,unmap}_resource

2016-06-07 Thread Niklas Söderlund
Map/Unmap a device MMIO resource from a physical address. If no dma_map_ops
method is available the operation is a no-op.

Signed-off-by: Niklas Söderlund 
---
 Documentation/DMA-API.txt   | 22 +-
 include/linux/dma-mapping.h | 36 
 2 files changed, 53 insertions(+), 5 deletions(-)

diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt
index 45ef3f2..c7e5f99 100644
--- a/Documentation/DMA-API.txt
+++ b/Documentation/DMA-API.txt
@@ -277,14 +277,26 @@ and  parameters are provided to do partial page 
mapping, it is
 recommended that you never use these unless you really know what the
 cache width is.
 
+dma_addr_t
+dma_map_resource(struct device *dev, phys_addr_t phys_addr, size_t size,
+enum dma_data_direction dir, struct dma_attrs *attrs)
+
+void
+dma_unmap_resource(struct device *dev, dma_addr_t addr, size_t size,
+  enum dma_data_direction dir, struct dma_attrs *attrs)
+
+API for mapping and unmapping for MMIO resources. All the notes and
+warnings for the other mapping APIs apply here. The API should only be
+used to map device MMIO resources, mapping of RAM is not permitted.
+
 int
 dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
 
-In some circumstances dma_map_single() and dma_map_page() will fail to create
-a mapping. A driver can check for these errors by testing the returned
-DMA address with dma_mapping_error(). A non-zero return value means the mapping
-could not be created and the driver should take appropriate action (e.g.
-reduce current DMA mapping usage or delay and try again later).
+In some circumstances dma_map_single(), dma_map_page() and dma_map_resource()
+will fail to create a mapping. A driver can check for these errors by testing
+the returned DMA address with dma_mapping_error(). A non-zero return value
+means the mapping could not be created and the driver should take appropriate
+action (e.g. reduce current DMA mapping usage or delay and try again later).
 
int
dma_map_sg(struct device *dev, struct scatterlist *sg,
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index a11ff9d..4c381ba 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -218,6 +218,42 @@ static inline void dma_unmap_page(struct device *dev, 
dma_addr_t addr,
debug_dma_unmap_page(dev, addr, size, dir, false);
 }
 
+static inline dma_addr_t dma_map_resource(struct device *dev,
+ phys_addr_t phys_addr,
+ size_t size,
+ enum dma_data_direction dir,
+ struct dma_attrs *attrs)
+{
+   struct dma_map_ops *ops = get_dma_ops(dev);
+   unsigned long pfn = __phys_to_pfn(phys_addr);
+   dma_addr_t addr;
+
+   BUG_ON(!valid_dma_direction(dir));
+
+   /* Don't allow RAM to be mapped */
+   BUG_ON(pfn_valid(pfn));
+
+   addr = phys_addr;
+   if (ops->map_resource)
+   addr = ops->map_resource(dev, phys_addr, size, dir, attrs);
+
+   debug_dma_map_resource(dev, phys_addr, size, dir, addr);
+
+   return addr;
+}
+
+static inline void dma_unmap_resource(struct device *dev, dma_addr_t addr,
+ size_t size, enum dma_data_direction dir,
+ struct dma_attrs *attrs)
+{
+   struct dma_map_ops *ops = get_dma_ops(dev);
+
+   BUG_ON(!valid_dma_direction(dir));
+   if (ops->unmap_resource)
+   ops->unmap_resource(dev, addr, size, dir, attrs);
+   debug_dma_unmap_resource(dev, addr, size, dir);
+}
+
 static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t addr,
   size_t size,
   enum dma_data_direction dir)
-- 
2.8.2



Re: [PATCH v2 2/4] clk: renesas: Add r8a7796 CPG Core Clock Definitions

2016-06-07 Thread Dirk Behme

Hi Geert,

On 06.06.2016 14:59, Geert Uytterhoeven wrote:

Hi Dirk,

On Mon, Jun 6, 2016 at 2:03 PM, Dirk Behme  wrote:

On 30.05.2016 18:36, Dirk Behme wrote:

On 30.05.2016 18:28, Geert Uytterhoeven wrote:

Add all R-Car M3-W Clock Pulse Generator Core Clock Outputs, as listed
in Table 8.2b ("List of Clocks [R-Car M3-W]") of the R-Car Gen3
datasheet (rev. 0.51 + Errata for Rev051 Mar 31 2016).

Note that internal CPG clocks (S0, S1, S2, S3, SDSRC, and SSPSRC) are
not included, as they are used as internal clock sources only, and never
referenced from DT.

Signed-off-by: Geert Uytterhoeven 
Tested-by: Simon Horman 
---
v2:
   - Add Tested-by.
---
  include/dt-bindings/clock/r8a7796-cpg-mssr.h | 69

  1 file changed, 69 insertions(+)
  create mode 100644 include/dt-bindings/clock/r8a7796-cpg-mssr.h

diff --git a/include/dt-bindings/clock/r8a7796-cpg-mssr.h
b/include/dt-bindings/clock/r8a7796-cpg-mssr.h
new file mode 100644
index ..1e5942695f0dd057
--- /dev/null
+++ b/include/dt-bindings/clock/r8a7796-cpg-mssr.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2016 Renesas Electronics Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+#ifndef __DT_BINDINGS_CLOCK_R8A7796_CPG_MSSR_H__
+#define __DT_BINDINGS_CLOCK_R8A7796_CPG_MSSR_H__
+
+#include 
+
+/* r8a7796 CPG Core Clocks */
+#define R8A7796_CLK_Z0


[...]


I think we recently started a discussion to find a more clever way to
avoid re-defining (copy & paste) all this R-Car3 clocks  (compare [1])
where they are the same over the R-Car3 family while still being able to
deal with the differences.

Best regards

Dirk

[1]

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/dt-bindings/clock/r8a7795-cpg-mssr.h


What's the status of the discussion I mentioned above?


As mentioned in that thread,the CPGs in r8a7795 and r8a7796 provide
slightly different sets of clocks. Future members of the R-Car Gen3
family may provide the same or different sets of clocks, we don't know.

As Magnus already mentions, we try to stay as close as possible to the
datasheet (which is unfortunately a moving target, too).

For CPG Core Clocks, the datasheet only provides us with a list of named
clocks.  There are no fixed numbers. So either we refer to clocks by
name, or by coming up with our own numbering scheme (which has to be a
stable set of numbers, i.e. append only).

For MSSR (Module) Clocks, the datasheet does provide us with numbers
(MSTP register index + bit index inside the register).

The way the CPG/MSSR drivers handles these clocks was heavily influenced
by the experience we gained with the Common Clock Framework and DT on
R-Car Gen2.

R-Car Gen2 described all clocks and their registers in DT. The goal
(utopia?) here was to handle all SoCs from the family with a single
driver, provided it was fed with the right description in DT.

For CPG Core Clocks, this lead to a mix of:
  - Nodes for fixed factor clocks,
  - Nodes for variable factor clocks, specifying a register to operate
on,
  - Special CPG clocks that couldn't be handled by the above, using a
common (family-specific) list of definitions for clocks, that had to
be extended constantly.

For MSSR Clocks (called "MSTP" for historical reasons), each set of 32
clocks had its own node, with multiple registers, and three separate
arrays for parent clocks, clock indices, and clock names, that had to be
kept in sync. The clock indices were defines, using numbers from the
datasheet, but they were still easy to abuse (which register does the
define apply to?).

As the CCF was quite new and best practices were still under
development, all of this was difficult to define up-front.
Due to the complexity, it was also hard to review and maintain, leading
to many errors.
The arbitrary (grown organically) offsets for the various MSSR-related
registers also made it hard to ever add module reset support.

Hence the call for a new framework, designed in close collaboration with the
clock maintainer, and implemented in the CPG/MSSR driver.
The goals were:
  - Make the DT part user friendly, reviewer friendly, and maintainer
friendly, as it provides a stable ABI, and thus must be obviously
correct from the beginning,
  - Hide complexity and internals in the driver, as this can be reworked
and extended at any time, without breaking the DT ABI,
  - Hence, describe CPG/MSSR as a single simple block in DT,
  - Support both new and existing SoCs (PoC was done for r8a7791),
  - Allow for adding module reset support (the "SR" part) later.

Hence for the CPG Core Clocks, we wanted a simple append-only list of
defines for all clocks (and only those, as 

Re: [PATCH 0/3] iommu/ipmmu-vmsa: Initial r8a7796 support

2016-06-07 Thread Geert Uytterhoeven
Hi Magnus,

On Tue, Jun 7, 2016 at 5:39 AM, Magnus Damm  wrote:
> iommu/ipmmu-vmsa: Initial r8a7796 support
>
> [PATCH 1/3] iommu/ipmmu-vmsa: Add r8a7796 DT binding
> [PATCH 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48
> [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code
>
> This series adds r8a7796 support to the IPMMU driver. The DT binding
> gets updated, maximum number of micro-TLBs are increased and the
> driver is adjusted to match on the new DT binding.

Thanks for your series!

For your convenience, I've queued it up in topic/r8a7796-ipmmu-v1 at
https://git.kernel.org/cgit/linux/kernel/git/geert/renesas-drivers.git, and
will include it in next renesas-drivers release.

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


Re: [PATCH 07/13] ARM: dts: r8a7792: initial SoC device tree

2016-06-07 Thread Geert Uytterhoeven
Hi Sergei,

On Tue, Jun 7, 2016 at 12:26 AM, Sergei Shtylyov
 wrote:
>> With regards to SMP. Have you checked to make sure CPU hotplug works
>> on all CPUs?
>
>How to test the CPU hotplug? I've now added the SMP support and made sure
> both CPUs are online and serve IRQs...

Off/online all CPUs:

for i in /sys/*/*/cpu/cpu[0-9]*; do echo 0 > $i/online; echo 1 >
$i/online; done

Offline all CPUs:

for i in /sys/*/*/cpu/cpu[0-9]*; do echo 0 > $i/online; done; cat
/proc/cpuinfo

Online all CPUs:

   for i in /sys/*/*/cpu/cpu[0-9]*; do echo 1 > $i/online; done; cat
/proc/cpuinfo

>> And that the system behaves sanely on suspend/resume.
>
>I'd be thankful if you told me how to test that. :-)

System suspend:

echo mem > /sys/power/state

System resume: You're gonna need a "wakeup-source" in your DTS, e.g. gpio-keys.
Serial should work too, echo "enabled" to the corresponding wakeup
file in /sys first.

In case of issues, try "echo 0 > /sys/module/printk/parameters/console_suspend".

Good luck!

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


[PATCH] ASoC: rsnd: adg :: AUDIO-CLKOUTn can synchronizes with L/R clock.

2016-06-07 Thread Kuninori Morimoto
From: Kuninori Morimoto 

AUDIO-CLKOUTn can synchronizes with L/R clock, and Salvator board
needs it. Otherwise, specific frequency sound will be noisy.

Signed-off-by: Kuninori Morimoto 
---
 .../devicetree/bindings/sound/renesas,rsnd.txt |  2 ++
 sound/soc/sh/rcar/adg.c| 18 ++
 2 files changed, 20 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt 
b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt
index c7b29df..065d9c8 100644
--- a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt
+++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt
@@ -373,6 +373,8 @@ Optional properties:
 - #clock-cells : it must be 0 if your system has audio_clkout
  it must be 1 if your system has 
audio_clkout0/1/2/3
 - clock-frequency  : for all audio_clkout0/1/2/3
+- clkout-lr-synchronous: boolean property. it indicates that 
audio_clkoutn
+ synchronizes with lr-clock.
 
 SSI subnode properties:
 - interrupts   : Should contain SSI interrupt for PIO transfer
diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
index c4c51a4..1586271 100644
--- a/sound/soc/sh/rcar/adg.c
+++ b/sound/soc/sh/rcar/adg.c
@@ -33,11 +33,15 @@ struct rsnd_adg {
struct clk *clkout[CLKOUTMAX];
struct clk_onecell_data onecell;
struct rsnd_mod mod;
+   u32 flags;
 
int rbga_rate_for_441khz; /* RBGA */
int rbgb_rate_for_48khz;  /* RBGB */
 };
 
+#define LRCLK_SYNC (1 << 0)
+#define adg_mode_flags(adg)(adg->flags)
+
 #define for_each_rsnd_clk(pos, adg, i) \
for (i = 0; \
 (i < CLKMAX) &&\
@@ -355,6 +359,16 @@ found_clock:
 
rsnd_adg_set_ssi_clk(ssi_mod, data);
 
+   if (adg_mode_flags(adg) & LRCLK_SYNC) {
+   struct rsnd_mod *adg_mod = rsnd_mod_get(adg);
+   u32 ckr = 0;
+
+   if (0 == (rate % 8000))
+   ckr = 0x8000;
+
+   rsnd_mod_bset(adg_mod, SSICKR, 0x8000, ckr);
+   }
+
dev_dbg(dev, "ADG: %s[%d] selects 0x%x for %d\n",
rsnd_mod_name(ssi_mod), rsnd_mod_id(ssi_mod),
data, rate);
@@ -532,6 +546,7 @@ int rsnd_adg_probe(struct rsnd_priv *priv)
 {
struct rsnd_adg *adg;
struct device *dev = rsnd_priv_to_dev(priv);
+   struct device_node *np = dev->of_node;
 
adg = devm_kzalloc(dev, sizeof(*adg), GFP_KERNEL);
if (!adg) {
@@ -545,6 +560,9 @@ int rsnd_adg_probe(struct rsnd_priv *priv)
rsnd_adg_get_clkin(priv, adg);
rsnd_adg_get_clkout(priv, adg);
 
+   if (of_get_property(np, "clkout-lr-synchronous", NULL))
+   adg->flags = LRCLK_SYNC;
+
priv->adg = adg;
 
return 0;
-- 
1.9.1