[PATCH 1/4] arm64: dts: renesas: r8a7796: Add FCPF and FCPV instances

2016-10-17 Thread Laurent Pinchart
The FCPs handle the interface between various IP cores and memory. Add
the instances related to the FDPs and VSP2s.

Signed-off-by: Laurent Pinchart 
---
 arch/arm64/boot/dts/renesas/r8a7796.dtsi | 42 
 1 file changed, 42 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a7796.dtsi 
b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
index 9217da983525..39b6ec7a2068 100644
--- a/arch/arm64/boot/dts/renesas/r8a7796.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
@@ -251,5 +251,47 @@
power-domains = < R8A7796_PD_ALWAYS_ON>;
status = "disabled";
};
+
+   fcpf0: fcp@fe95 {
+   compatible = "renesas,fcpf";
+   reg = <0 0xfe95 0 0x200>;
+   clocks = < CPG_MOD 615>;
+   power-domains = < R8A7796_PD_A3VC>;
+   };
+
+   fcpvb0: fcp@fe96f000 {
+   compatible = "renesas,fcpv";
+   reg = <0 0xfe96f000 0 0x200>;
+   clocks = < CPG_MOD 607>;
+   power-domains = < R8A7796_PD_A3VC>;
+   };
+
+   fcpvi0: fcp@fe9af000 {
+   compatible = "renesas,fcpv";
+   reg = <0 0xfe9af000 0 0x200>;
+   clocks = < CPG_MOD 611>;
+   power-domains = < R8A7796_PD_A3VC>;
+   };
+
+   fcpvd0: fcp@fea27000 {
+   compatible = "renesas,fcpv";
+   reg = <0 0xfea27000 0 0x200>;
+   clocks = < CPG_MOD 603>;
+   power-domains = < R8A7796_PD_ALWAYS_ON>;
+   };
+
+   fcpvd1: fcp@fea2f000 {
+   compatible = "renesas,fcpv";
+   reg = <0 0xfea2f000 0 0x200>;
+   clocks = < CPG_MOD 602>;
+   power-domains = < R8A7796_PD_ALWAYS_ON>;
+   };
+
+   fcpvd2: fcp@fea37000 {
+   compatible = "renesas,fcpv";
+   reg = <0 0xfea37000 0 0x200>;
+   clocks = < CPG_MOD 601>;
+   power-domains = < R8A7796_PD_ALWAYS_ON>;
+   };
};
 };
-- 
Regards,

Laurent Pinchart



[PATCH 2/4] arm64: dts: renesas: r8a7796: Add VSP instances

2016-10-17 Thread Laurent Pinchart
The r8a7796 has 5 VSP instances.

Signed-off-by: Laurent Pinchart 
---
 arch/arm64/boot/dts/renesas/r8a7796.dtsi | 50 
 1 file changed, 50 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a7796.dtsi 
b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
index 39b6ec7a2068..15ab8f22b397 100644
--- a/arch/arm64/boot/dts/renesas/r8a7796.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
@@ -259,6 +259,16 @@
power-domains = < R8A7796_PD_A3VC>;
};
 
+   vspb: vsp@fe96 {
+   compatible = "renesas,vsp2";
+   reg = <0 0xfe96 0 0x8000>;
+   interrupts = ;
+   clocks = < CPG_MOD 626>;
+   power-domains = < R8A7796_PD_A3VC>;
+
+   renesas,fcp = <>;
+   };
+
fcpvb0: fcp@fe96f000 {
compatible = "renesas,fcpv";
reg = <0 0xfe96f000 0 0x200>;
@@ -266,6 +276,16 @@
power-domains = < R8A7796_PD_A3VC>;
};
 
+   vspi0: vsp@fe9a {
+   compatible = "renesas,vsp2";
+   reg = <0 0xfe9a 0 0x8000>;
+   interrupts = ;
+   clocks = < CPG_MOD 631>;
+   power-domains = < R8A7796_PD_A3VC>;
+
+   renesas,fcp = <>;
+   };
+
fcpvi0: fcp@fe9af000 {
compatible = "renesas,fcpv";
reg = <0 0xfe9af000 0 0x200>;
@@ -273,6 +293,16 @@
power-domains = < R8A7796_PD_A3VC>;
};
 
+   vspd0: vsp@fea2 {
+   compatible = "renesas,vsp2";
+   reg = <0 0xfea2 0 0x4000>;
+   interrupts = ;
+   clocks = < CPG_MOD 623>;
+   power-domains = < R8A7796_PD_ALWAYS_ON>;
+
+   renesas,fcp = <>;
+   };
+
fcpvd0: fcp@fea27000 {
compatible = "renesas,fcpv";
reg = <0 0xfea27000 0 0x200>;
@@ -280,6 +310,16 @@
power-domains = < R8A7796_PD_ALWAYS_ON>;
};
 
+   vspd1: vsp@fea28000 {
+   compatible = "renesas,vsp2";
+   reg = <0 0xfea28000 0 0x4000>;
+   interrupts = ;
+   clocks = < CPG_MOD 622>;
+   power-domains = < R8A7796_PD_ALWAYS_ON>;
+
+   renesas,fcp = <>;
+   };
+
fcpvd1: fcp@fea2f000 {
compatible = "renesas,fcpv";
reg = <0 0xfea2f000 0 0x200>;
@@ -287,6 +327,16 @@
power-domains = < R8A7796_PD_ALWAYS_ON>;
};
 
+   vspd2: vsp@fea3 {
+   compatible = "renesas,vsp2";
+   reg = <0 0xfea3 0 0x4000>;
+   interrupts = ;
+   clocks = < CPG_MOD 621>;
+   power-domains = < R8A7796_PD_ALWAYS_ON>;
+
+   renesas,fcp = <>;
+   };
+
fcpvd2: fcp@fea37000 {
compatible = "renesas,fcpv";
reg = <0 0xfea37000 0 0x200>;
-- 
Regards,

Laurent Pinchart



[PATCH 0/4] R-Car Salvator-X M3-W: Enable DU support

2016-10-17 Thread Laurent Pinchart
Hello,

This patch series enables DU support for the M3-W-based Salvator-X board. It
depends on the previously posted "[PATCH 0/3] R-Car M3-W: Add FCP, VSP and DU
clocks", "[PATCH] drm: rcar-du: Add R8A7796 device support" and "[PATCH 0/2]
R-Car FDP: Remove SoC-specific compatible strings" patch series.

For convenience I've pushed all patches to

git://linuxtv.org/pinchartl/media.git drm/r8a7796/next

Patch 4/4 enables the DU and should not be merged at this time as it would
block support of memory above the 32bit 4GB boundary. All other patches are
candidates for v4.10.

Laurent Pinchart (4):
  arm64: dts: renesas: r8a7796: Add FCPF and FCPV instances
  arm64: dts: renesas: r8a7796: Add VSP instances
  arm64: dts: renesas: r8a7796: Add DU device to DT
  arm64: dts: renesas: r8a7796-salvator-x: Enable DU

 arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts |  48 
 arch/arm64/boot/dts/renesas/r8a7796.dtsi   | 131 +
 2 files changed, 179 insertions(+)

-- 
Regards,

Laurent Pinchart



[PATCH 4/4] arm64: dts: renesas: r8a7796-salvator-x: Enable DU

2016-10-17 Thread Laurent Pinchart
Only the VGA output is supported for now.

Signed-off-by: Laurent Pinchart 
---
 arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts | 48 ++
 1 file changed, 48 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts 
b/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts
index 90e9a76c8b30..5bb25f2e3c51 100644
--- a/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts
+++ b/arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts
@@ -29,6 +29,38 @@
/* first 128MB is reserved for secure area. */
reg = <0x0 0x4800 0x0 0x7800>;
};
+
+   vga-encoder {
+   compatible = "adi,adv7123";
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+   adv7123_in: endpoint {
+   remote-endpoint = <_out_rgb>;
+   };
+   };
+   port@1 {
+   reg = <1>;
+   adv7123_out: endpoint {
+   remote-endpoint = <_in>;
+   };
+   };
+   };
+   };
+
+   vga {
+   compatible = "vga-connector";
+
+   port {
+   vga_in: endpoint {
+   remote-endpoint = <_out>;
+   };
+   };
+   };
 };
 
  {
@@ -45,6 +77,22 @@
};
 };
 
+ {
+   status = "okay";
+
+   ports {
+   port@0 {
+   endpoint {
+   remote-endpoint = <_in>;
+   };
+   };
+   port@2 {
+   lvds_connector: endpoint {
+   };
+   };
+   };
+};
+
 _clk {
clock-frequency = <1666>;
 };
-- 
Regards,

Laurent Pinchart



[PATCH 0/3] R-Car M3-W: Add FCP, VSP and DU clocks

2016-10-17 Thread Laurent Pinchart
Hello,

This patch series adds all the r8a7796 FCP, VSP and DU clocks. This includes
not only all the clocks required for display, but also the FCPC, FCPF, VSPB
and VSPI0 clocks to cover all the FCP and VSP instances.

The FCPC and DU parent clocks haven't been confirmed yet. I'm however quite
confident that at least the DU clocks are correct, as they both match the
corresponding VSPD clocks (the VSPD supplying frames to the DU, it makes sense
to have both IP cores clocked from the same source) and result in the right
display ouput timings (while setting the DU parent clocks to S0D1 results in
half the expected frame rate).

Laurent Pinchart (3):
  clk: renesas: r8a7796: Add FCP clocks
  clk: renesas: r8a7796: Add VSP clocks
  clk: renesas: r8a7796: Add DU and LVDS clocks

 drivers/clk/renesas/r8a7796-cpg-mssr.c | 17 +
 1 file changed, 17 insertions(+)

-- 
Regards,

Laurent Pinchart



[PATCH 1/3] clk: renesas: r8a7796: Add FCP clocks

2016-10-17 Thread Laurent Pinchart
Signed-off-by: Laurent Pinchart 
---
 drivers/clk/renesas/r8a7796-cpg-mssr.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/clk/renesas/r8a7796-cpg-mssr.c 
b/drivers/clk/renesas/r8a7796-cpg-mssr.c
index eb347ed265f2..41a3677a4b3a 100644
--- a/drivers/clk/renesas/r8a7796-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a7796-cpg-mssr.c
@@ -121,6 +121,14 @@ static const struct mssr_mod_clk r8a7796_mod_clks[] 
__initconst = {
DEF_MOD("rwdt0", 402,   R8A7796_CLK_R),
DEF_MOD("intc-ap",   408,   R8A7796_CLK_S3D1),
DEF_MOD("thermal",   522,   R8A7796_CLK_CP),
+   DEF_MOD("fcpvd2",601,   R8A7796_CLK_S0D2),
+   DEF_MOD("fcpvd1",602,   R8A7796_CLK_S0D2),
+   DEF_MOD("fcpvd0",603,   R8A7796_CLK_S0D2),
+   DEF_MOD("fcpvb0",607,   R8A7796_CLK_S0D1),
+   DEF_MOD("fcpvi0",611,   R8A7796_CLK_S0D1),
+   DEF_MOD("fcpf0", 615,   R8A7796_CLK_S0D1),
+   DEF_MOD("fcpci0",617,   R8A7796_CLK_S0D1),
+   DEF_MOD("fcpcs", 619,   R8A7796_CLK_S0D1),
DEF_MOD("etheravb",  812,   R8A7796_CLK_S0D6),
DEF_MOD("gpio7", 905,   R8A7796_CLK_S3D4),
DEF_MOD("gpio6", 906,   R8A7796_CLK_S3D4),
-- 
Regards,

Laurent Pinchart



[PATCH 3/3] clk: renesas: r8a7796: Add DU and LVDS clocks

2016-10-17 Thread Laurent Pinchart
Signed-off-by: Laurent Pinchart 
---
 drivers/clk/renesas/r8a7796-cpg-mssr.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/clk/renesas/r8a7796-cpg-mssr.c 
b/drivers/clk/renesas/r8a7796-cpg-mssr.c
index 679054658f99..20bd0643b238 100644
--- a/drivers/clk/renesas/r8a7796-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a7796-cpg-mssr.c
@@ -134,6 +134,10 @@ static const struct mssr_mod_clk r8a7796_mod_clks[] 
__initconst = {
DEF_MOD("vspd0", 623,   R8A7796_CLK_S0D2),
DEF_MOD("vspb",  626,   R8A7796_CLK_S0D1),
DEF_MOD("vspi0", 631,   R8A7796_CLK_S0D1),
+   DEF_MOD("du2",   722,   R8A7796_CLK_S0D2),
+   DEF_MOD("du1",   723,   R8A7796_CLK_S0D2),
+   DEF_MOD("du0",   724,   R8A7796_CLK_S0D2),
+   DEF_MOD("lvds",  727,   R8A7796_CLK_S0D4),
DEF_MOD("etheravb",  812,   R8A7796_CLK_S0D6),
DEF_MOD("gpio7", 905,   R8A7796_CLK_S3D4),
DEF_MOD("gpio6", 906,   R8A7796_CLK_S3D4),
-- 
Regards,

Laurent Pinchart



[PATCH 0/2] R-Car FDP: Remove SoC-specific compatible strings

2016-10-17 Thread Laurent Pinchart
Hello,

Now that the Gen3 documentation mentions the FCP version register, it's clear
that the SoC instance in which the FCP is integrated can be identified at
runtime without requiring SoC-specific compatible strings.

I've tested R-Car H3 ES1.x and R-Car M3 and the results match the
documentation, so it should be safe to use the generic compatible strings
only.

Laurent Pinchart (2):
  dt-bindings: media: renesas-fcp: Remove SoC-specific compatible
strings
  arm64: dts: r8a7795: Remove FCP SoC-specific compatible strings

 .../devicetree/bindings/media/renesas,fcp.txt  |  8 +---
 arch/arm64/boot/dts/renesas/r8a7795.dtsi   | 24 +++---
 2 files changed, 13 insertions(+), 19 deletions(-)

-- 
Regards,

Laurent Pinchart



Re: [PATCH 2/5] [media] v4l: rcar-fcp: Fix module autoload for OF registration

2016-10-17 Thread Laurent Pinchart
Hi Javier,

Thank you for the patch.

On Monday 17 Oct 2016 12:44:09 Javier Martinez Canillas wrote:
> If the driver is built as a module, autoload won't work because the module
> alias information is not filled. So user-space can't match the registered
> device with the corresponding module.
> 
> Export the module alias information using the MODULE_DEVICE_TABLE() macro.
> 
> Before this patch:
> 
> $ modinfo drivers/media/platform/rcar-fcp.ko | grep alias
> alias:  rcar-fcp
> 
> After this patch:
> 
> $ modinfo drivers/media/platform/rcar-fcp.ko | grep alias
> alias:  rcar-fcp
> alias:  of:N*T*Crenesas,fcpvC*
> alias:  of:N*T*Crenesas,fcpv
> alias:  of:N*T*Crenesas,fcpfC*
> alias:  of:N*T*Crenesas,fcpf
> 
> Signed-off-by: Javier Martinez Canillas 

Reviewed-by: Laurent Pinchart 

> ---
> 
>  drivers/media/platform/rcar-fcp.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/platform/rcar-fcp.c
> b/drivers/media/platform/rcar-fcp.c index f3a3f31cdfa9..7146fc5ef168 100644
> --- a/drivers/media/platform/rcar-fcp.c
> +++ b/drivers/media/platform/rcar-fcp.c
> @@ -169,6 +169,7 @@ static const struct of_device_id rcar_fcp_of_match[] = {
> { .compatible = "renesas,fcpv" },
>   { },
>  };
> +MODULE_DEVICE_TABLE(of, rcar_fcp_of_match);
> 
>  static struct platform_driver rcar_fcp_platform_driver = {
>   .probe  = rcar_fcp_probe,

-- 
Regards,

Laurent Pinchart



Re: [PATCH 1/5] [media] v4l: vsp1: Fix module autoload for OF registration

2016-10-17 Thread Laurent Pinchart
Hi Javier,

Thank you for the patch.

On Monday 17 Oct 2016 12:44:08 Javier Martinez Canillas wrote:
> If the driver is built as a module, autoload won't work because the module
> alias information is not filled. So user-space can't match the registered
> device with the corresponding module.
> 
> Export the module alias information using the MODULE_DEVICE_TABLE() macro.
> 
> Before this patch:
> 
> $ modinfo drivers/media/platform/vsp1/vsp1.ko | grep alias
> alias:  vsp1
> 
> After this patch:
> 
> $ modinfo drivers/media/platform/vsp1/vsp1.ko | grep alias
> alias:  vsp1
> alias:  of:N*T*Crenesas,vsp2C*
> alias:  of:N*T*Crenesas,vsp2
> alias:  of:N*T*Crenesas,vsp1C*
> alias:  of:N*T*Crenesas,vsp1
> 
> Signed-off-by: Javier Martinez Canillas 

Reviewed-by: Laurent Pinchart 

> ---
> 
>  drivers/media/platform/vsp1/vsp1_drv.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/platform/vsp1/vsp1_drv.c
> b/drivers/media/platform/vsp1/vsp1_drv.c index 57c713a4e1df..aa237b48ad55
> 100644
> --- a/drivers/media/platform/vsp1/vsp1_drv.c
> +++ b/drivers/media/platform/vsp1/vsp1_drv.c
> @@ -770,6 +770,7 @@ static const struct of_device_id vsp1_of_match[] = {
>   { .compatible = "renesas,vsp2" },
>   { },
>  };
> +MODULE_DEVICE_TABLE(of, vsp1_of_match);
> 
>  static struct platform_driver vsp1_platform_driver = {
>   .probe  = vsp1_probe,

-- 
Regards,

Laurent Pinchart



[PATCH 2/5] [media] v4l: rcar-fcp: Fix module autoload for OF registration

2016-10-17 Thread Javier Martinez Canillas
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/media/platform/rcar-fcp.ko | grep alias
alias:  rcar-fcp

After this patch:

$ modinfo drivers/media/platform/rcar-fcp.ko | grep alias
alias:  rcar-fcp
alias:  of:N*T*Crenesas,fcpvC*
alias:  of:N*T*Crenesas,fcpv
alias:  of:N*T*Crenesas,fcpfC*
alias:  of:N*T*Crenesas,fcpf

Signed-off-by: Javier Martinez Canillas 
---

 drivers/media/platform/rcar-fcp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/rcar-fcp.c 
b/drivers/media/platform/rcar-fcp.c
index f3a3f31cdfa9..7146fc5ef168 100644
--- a/drivers/media/platform/rcar-fcp.c
+++ b/drivers/media/platform/rcar-fcp.c
@@ -169,6 +169,7 @@ static const struct of_device_id rcar_fcp_of_match[] = {
{ .compatible = "renesas,fcpv" },
{ },
 };
+MODULE_DEVICE_TABLE(of, rcar_fcp_of_match);
 
 static struct platform_driver rcar_fcp_platform_driver = {
.probe  = rcar_fcp_probe,
-- 
2.7.4



[PATCH 0/5] [media] Fix module autoload for media platform drivers

2016-10-17 Thread Javier Martinez Canillas
Hello Mauro,

I noticed that module autoload won't be working in a bunch of media
platform drivers because the module alias information is not filled
in the modules. This patch series contains the fixes for them.

Best regards,
Javier


Javier Martinez Canillas (5):
  [media] v4l: vsp1: Fix module autoload for OF registration
  [media] v4l: rcar-fcp: Fix module autoload for OF registration
  [media] rc: meson-ir: Fix module autoload
  [media] s5p-cec: Fix module autoload
  [media] st-cec: Fix module autoload

 drivers/media/platform/rcar-fcp.c   | 1 +
 drivers/media/platform/vsp1/vsp1_drv.c  | 1 +
 drivers/media/rc/meson-ir.c | 1 +
 drivers/staging/media/s5p-cec/s5p_cec.c | 1 +
 drivers/staging/media/st-cec/stih-cec.c | 1 +
 5 files changed, 5 insertions(+)

-- 
2.7.4



[PATCH 1/5] [media] v4l: vsp1: Fix module autoload for OF registration

2016-10-17 Thread Javier Martinez Canillas
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/media/platform/vsp1/vsp1.ko | grep alias
alias:  vsp1

After this patch:

$ modinfo drivers/media/platform/vsp1/vsp1.ko | grep alias
alias:  vsp1
alias:  of:N*T*Crenesas,vsp2C*
alias:  of:N*T*Crenesas,vsp2
alias:  of:N*T*Crenesas,vsp1C*
alias:  of:N*T*Crenesas,vsp1

Signed-off-by: Javier Martinez Canillas 
---

 drivers/media/platform/vsp1/vsp1_drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/vsp1/vsp1_drv.c 
b/drivers/media/platform/vsp1/vsp1_drv.c
index 57c713a4e1df..aa237b48ad55 100644
--- a/drivers/media/platform/vsp1/vsp1_drv.c
+++ b/drivers/media/platform/vsp1/vsp1_drv.c
@@ -770,6 +770,7 @@ static const struct of_device_id vsp1_of_match[] = {
{ .compatible = "renesas,vsp2" },
{ },
 };
+MODULE_DEVICE_TABLE(of, vsp1_of_match);
 
 static struct platform_driver vsp1_platform_driver = {
.probe  = vsp1_probe,
-- 
2.7.4



Re: [PATCH v3 07/11] ARM: dts: r8a7743: add Ether support

2016-10-17 Thread Geert Uytterhoeven
On Wed, Oct 5, 2016 at 11:42 PM, Sergei Shtylyov
 wrote:
> Define the generic R8A7743 part of the Ether device node.
>
> Based on the original (and large) patch by Dmitry Shifrin
> .
>
> Signed-off-by: Sergei Shtylyov 

Reviewed-by: Geert Uytterhoeven 

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 v2] ARM: shmobile: Consolidate R8A7743 and R8A779[234] machine definitions

2016-10-17 Thread Laurent Pinchart
The four SoCs use identical machine operations, consolidate them into
two machine definitions in a single file.

Signed-off-by: Laurent Pinchart 
Tested-by: Simon Horman 
Reviewed-by: Geert Uytterhoeven 
---
Changes since v1:

- Rebased on top of Simon's latest devel branch, thus including R8A7743
  consolidation

 arch/arm/mach-shmobile/Makefile  |  4 
 arch/arm/mach-shmobile/setup-r8a7743.c   | 34 ---
 arch/arm/mach-shmobile/setup-r8a7792.c   | 35 
 arch/arm/mach-shmobile/setup-r8a7793.c   | 33 --
 arch/arm/mach-shmobile/setup-r8a7794.c   | 33 --
 arch/arm/mach-shmobile/setup-rcar-gen2.c | 33 ++
 6 files changed, 33 insertions(+), 139 deletions(-)
 delete mode 100644 arch/arm/mach-shmobile/setup-r8a7743.c
 delete mode 100644 arch/arm/mach-shmobile/setup-r8a7792.c
 delete mode 100644 arch/arm/mach-shmobile/setup-r8a7793.c
 delete mode 100644 arch/arm/mach-shmobile/setup-r8a7794.c

diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 332b84f8261f..64611a1b4276 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -9,14 +9,10 @@ obj-y := timer.o
 obj-$(CONFIG_ARCH_SH73A0)  += setup-sh73a0.o
 obj-$(CONFIG_ARCH_R8A73A4) += setup-r8a73a4.o
 obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o
-obj-$(CONFIG_ARCH_R8A7743) += setup-r8a7743.o
 obj-$(CONFIG_ARCH_R8A7778) += setup-r8a7778.o
 obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o pm-r8a7779.o
 obj-$(CONFIG_ARCH_R8A7790) += setup-r8a7790.o
 obj-$(CONFIG_ARCH_R8A7791) += setup-r8a7791.o
-obj-$(CONFIG_ARCH_R8A7792) += setup-r8a7792.o
-obj-$(CONFIG_ARCH_R8A7793) += setup-r8a7793.o
-obj-$(CONFIG_ARCH_R8A7794) += setup-r8a7794.o
 obj-$(CONFIG_ARCH_EMEV2)   += setup-emev2.o
 obj-$(CONFIG_ARCH_R7S72100)+= setup-r7s72100.o
 
diff --git a/arch/arm/mach-shmobile/setup-r8a7743.c 
b/arch/arm/mach-shmobile/setup-r8a7743.c
deleted file mode 100644
index a7ecb82d219f..
--- a/arch/arm/mach-shmobile/setup-r8a7743.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * r8a7743 processor support
- *
- * Copyright (C) 2016 Cogent Embedded, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- *  published by the Free Software Foundation; of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include 
-
-#include 
-
-#include "common.h"
-#include "rcar-gen2.h"
-
-static const char * const r8a7743_boards_compat_dt[] __initconst = {
-   "renesas,r8a7743",
-   NULL,
-};
-
-DT_MACHINE_START(R8A7743_DT, "Generic R8A7743 (Flattened Device Tree)")
-   .init_early = shmobile_init_delay,
-   .init_time  = rcar_gen2_timer_init,
-   .init_late  = shmobile_init_late,
-   .reserve= rcar_gen2_reserve,
-   .dt_compat  = r8a7743_boards_compat_dt,
-MACHINE_END
diff --git a/arch/arm/mach-shmobile/setup-r8a7792.c 
b/arch/arm/mach-shmobile/setup-r8a7792.c
deleted file mode 100644
index a0910395da09..
--- a/arch/arm/mach-shmobile/setup-r8a7792.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * r8a7792 processor support
- *
- * Copyright (C) 2014 Renesas Electronics Corporation
- * Copyright (C) 2016 Cogent  Embedded, Inc.
- *
- * 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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include 
-
-#include 
-
-#include "common.h"
-#include "rcar-gen2.h"
-
-static const char * const r8a7792_boards_compat_dt[] __initconst = {
-   "renesas,r8a7792",
-   NULL,
-};
-
-DT_MACHINE_START(R8A7792_DT, "Generic R8A7792 (Flattened Device Tree)")
-   .init_early = shmobile_init_delay,
-   .init_late  = shmobile_init_late,
-   .init_time  = rcar_gen2_timer_init,
-   .reserve= rcar_gen2_reserve,
-   .dt_compat  = r8a7792_boards_compat_dt,
-MACHINE_END
diff --git a/arch/arm/mach-shmobile/setup-r8a7793.c 
b/arch/arm/mach-shmobile/setup-r8a7793.c
deleted file mode 100644
index 5fce87f7f254..
--- a/arch/arm/mach-shmobile/setup-r8a7793.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * r8a7793 processor support
- *
- * 

Re: [PATCH v3 2/3] mmc: tmio-mmc: add support for 32bit data port

2016-10-17 Thread Ulf Hansson
On 14 October 2016 at 15:18, Chris Brandt  wrote:
> On 9/22/2016, Ulf Hansson wrote:
>> To: Chris Brandt 
>> Cc: Wolfram Sang ; Sergei Shtylyov
>> ; Geert Uytterhoeven > m68k.org>; Simon Horman ; linux-mmc > m...@vger.kernel.org>; Linux-Renesas ;
>> Lee Jones 
>> Subject: Re: [PATCH v3 2/3] mmc: tmio-mmc: add support for 32bit data port
>>
>> + Lee
>>
>> On 12 September 2016 at 16:15, Chris Brandt 
>> wrote:
>> > For the r7s72100 SOC, the DATA_PORT register was changed to 32-bits wide.
>> > Therefore a new flag has been created that will allow 32-bit
>> > reads/writes to the DATA_PORT register instead of 16-bit (because
>> > 16-bits accesses are not supported).
>> >
>> > Signed-off-by: Chris Brandt 
>> > ---
>> > v3:
>> > * changed loops to memcpy
>> > v2:
>> > * changed 'data * 0xFF' to 'data & 0xFF'
>> > * added 'const' for sd_ctrl_write32_rep
>> > ---
>> >  drivers/mmc/host/tmio_mmc.h | 12 
>> >  drivers/mmc/host/tmio_mmc_pio.c | 30 ++
>> >  include/linux/mfd/tmio.h|  5 +
>>
>> This header file needs to be split up. The mmc specific bits, should be
>> moved to a local header file under driver/mmc/host/*.
>>
>> Sure, we don't need to do that as part of $subject patch, but then I need
>> an ack from Lee Jones, the mfd maintainer. I have added him on cc.
>
>
> Is this still waiting on an ACK from Lee Jones because it touches the tmio.h 
> file under include/linux/mfd/ ?
>

Yes, but more important is Wolfram's ack as he maintains
drivers/mmc/host/tmio_mmc*

Kind regards
Uffe


Re: [PATCH] phy: rcar-gen3-usb2: add sysfs for usb role swap

2016-10-17 Thread Geert Uytterhoeven
Hi Shimoda-san,

On Mon, Oct 17, 2016 at 9:10 AM, Yoshihiro Shimoda
 wrote:
> This patch adds sysfs "otg_inputs" for usb role swap. This parameter
> is write-only and if you use them as the following, you can swap
> the usb role.

Thank you for your patch!

> For example:
>  1) connect a usb cable using 2 salvator-x boards
>  2) On A-device (as host), you input the following command:
># echo a_bus_req/ > /sys/devices/platform/soc/ee080200.usb-phy/otg_inputs
>  3) On B-device (as peripheral), you input the following command:
># echo b_bus_req > /sys/devices/platform/soc/ee080200.usb-phy/otg_inputs

At first, I thought the trailing "/" was a typo...

> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-platform-phy-rcar-gen3-usb2
> @@ -0,0 +1,11 @@
> +What:  /sys/devices/platform//otg-inputs
> +Date:  October 2016
> +KernelVersion: 4.10
> +Contact:   Yoshihiro Shimoda 
> +Description:
> +   This write-only file changes the phy mode for role swap of 
> usb.
> +   This file accepts the following strings:
> +"a_bus_req/" - switching from A-Host to A-Peripheral
> +"a_bus_drop" - switching from A-Peripheral to A-Host
> +"b_bus_req"  - switching from B-Peripheral to B-Host
> +"b_bus_req/" - switching from B-Host to B-Peripheral

... until I read the above.

What's the rationale of doing it like this? I.e.
  1. Why differentiate by trailing "/"?
  2. Why the asymmetry ("a_bus_drop" vs. "a_bus_req")?

I do not really follow USB development, so I please accepty my apologies if
I missed the discussion and valid arguments that lead to this.

I did find Documentation/ABI/testing/sysfs-platform-chipidea-usb-otg,
which uses similar naming, but a slightly different mechanism (multiple
sysfs virtual files with 0/1 states).

Thanks!

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 v2][resend v2] drm: bridge: add DesignWare HDMI I2S audio support

2016-10-17 Thread Kuninori Morimoto

From: Kuninori Morimoto 

Current dw-hdmi is supporting sound via AHB bus, but it has
I2S audio feature too. This patch adds I2S audio support to dw-hdmi.
This HDMI I2S is supported by using ALSA SoC common HDMI encoder
driver.

Tested-by: Jose Abreu 
Signed-off-by: Kuninori Morimoto 
---
v1 -> v2

 - tidyup return value of snd_dw_hdmi_probe()

 drivers/gpu/drm/bridge/Kconfig |   8 ++
 drivers/gpu/drm/bridge/Makefile|   1 +
 drivers/gpu/drm/bridge/dw-hdmi-audio.h |   7 ++
 drivers/gpu/drm/bridge/dw-hdmi-i2s-audio.c | 130 +
 drivers/gpu/drm/bridge/dw-hdmi.c   |  22 -
 drivers/gpu/drm/bridge/dw-hdmi.h   |  21 +
 6 files changed, 187 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gpu/drm/bridge/dw-hdmi-i2s-audio.c

diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
index 8f7423f..8e2a22d 100644
--- a/drivers/gpu/drm/bridge/Kconfig
+++ b/drivers/gpu/drm/bridge/Kconfig
@@ -32,6 +32,14 @@ config DRM_DW_HDMI_AHB_AUDIO
  Designware HDMI block.  This is used in conjunction with
  the i.MX6 HDMI driver.
 
+config DRM_DW_HDMI_I2S_AUDIO
+   tristate "Synopsis Designware I2S Audio interface"
+   depends on DRM_DW_HDMI
+   select SND_SOC_HDMI_CODEC
+   help
+ Support the I2S Audio interface which is part of the Synopsis
+ Designware HDMI block.
+
 config DRM_NXP_PTN3460
tristate "NXP PTN3460 DP/LVDS bridge"
depends on OF
diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
index 96b13b3..1af92ad 100644
--- a/drivers/gpu/drm/bridge/Makefile
+++ b/drivers/gpu/drm/bridge/Makefile
@@ -3,6 +3,7 @@ ccflags-y := -Iinclude/drm
 obj-$(CONFIG_DRM_ANALOGIX_ANX78XX) += analogix-anx78xx.o
 obj-$(CONFIG_DRM_DW_HDMI) += dw-hdmi.o
 obj-$(CONFIG_DRM_DW_HDMI_AHB_AUDIO) += dw-hdmi-ahb-audio.o
+obj-$(CONFIG_DRM_DW_HDMI_I2S_AUDIO) += dw-hdmi-i2s-audio.o
 obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o
 obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o
 obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix/
diff --git a/drivers/gpu/drm/bridge/dw-hdmi-audio.h 
b/drivers/gpu/drm/bridge/dw-hdmi-audio.h
index 91f631b..fd1f745 100644
--- a/drivers/gpu/drm/bridge/dw-hdmi-audio.h
+++ b/drivers/gpu/drm/bridge/dw-hdmi-audio.h
@@ -11,4 +11,11 @@ struct dw_hdmi_audio_data {
u8 *eld;
 };
 
+struct dw_hdmi_i2s_audio_data {
+   struct dw_hdmi *hdmi;
+
+   void (*write)(struct dw_hdmi *hdmi, u8 val, int offset);
+   u8 (*read)(struct dw_hdmi *hdmi, int offset);
+};
+
 #endif
diff --git a/drivers/gpu/drm/bridge/dw-hdmi-i2s-audio.c 
b/drivers/gpu/drm/bridge/dw-hdmi-i2s-audio.c
new file mode 100644
index 000..7dd2091
--- /dev/null
+++ b/drivers/gpu/drm/bridge/dw-hdmi-i2s-audio.c
@@ -0,0 +1,130 @@
+/*
+ * dw-hdmi-i2s-audio.c
+ *
+ * Copyright (c) 2016 Kuninori Morimoto 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include 
+
+#include 
+
+#include "dw-hdmi.h"
+#include "dw-hdmi-audio.h"
+
+#define DRIVER_NAME "dw-hdmi-i2s-audio"
+
+static inline void hdmi_write(struct dw_hdmi_i2s_audio_data *audio,
+ u8 val, int offset)
+{
+   struct dw_hdmi *hdmi = audio->hdmi;
+
+   audio->write(hdmi, val, offset);
+}
+
+static inline u8 hdmi_read(struct dw_hdmi_i2s_audio_data *audio, int offset)
+{
+   struct dw_hdmi *hdmi = audio->hdmi;
+
+   return audio->read(hdmi, offset);
+}
+
+static int dw_hdmi_i2s_hw_params(struct device *dev, void *data,
+struct hdmi_codec_daifmt *fmt,
+struct hdmi_codec_params *hparms)
+{
+   struct dw_hdmi_i2s_audio_data *audio = data;
+   struct dw_hdmi *hdmi = audio->hdmi;
+   u8 conf0 = 0;
+   u8 conf1 = 0;
+   u8 inputclkfs = 0;
+
+   /* it cares I2S only */
+   if ((fmt->fmt != HDMI_I2S) ||
+   (fmt->bit_clk_master | fmt->frame_clk_master)) {
+   dev_err(dev, "unsupported format/settings\n");
+   return -EINVAL;
+   }
+
+   inputclkfs  = HDMI_AUD_INPUTCLKFS_64FS;
+   conf0   = HDMI_AUD_CONF0_I2S_ALL_ENABLE;
+
+   switch (hparms->sample_width) {
+   case 16:
+   conf1 = HDMI_AUD_CONF1_WIDTH_16;
+   break;
+   case 24:
+   case 32:
+   conf1 = HDMI_AUD_CONF1_WIDTH_24;
+   break;
+   }
+
+   dw_hdmi_set_sample_rate(hdmi, hparms->sample_rate);
+
+   hdmi_write(audio, inputclkfs, HDMI_AUD_INPUTCLKFS);
+   hdmi_write(audio, conf0, HDMI_AUD_CONF0);
+   hdmi_write(audio, conf1, HDMI_AUD_CONF1);
+
+   dw_hdmi_audio_enable(hdmi);
+
+   return 0;
+}
+
+static void 

[PATCH] phy: rcar-gen3-usb2: add sysfs for usb role swap

2016-10-17 Thread Yoshihiro Shimoda
This patch adds sysfs "otg_inputs" for usb role swap. This parameter
is write-only and if you use them as the following, you can swap
the usb role.

For example:
 1) connect a usb cable using 2 salvator-x boards
 2) On A-device (as host), you input the following command:
   # echo a_bus_req/ > /sys/devices/platform/soc/ee080200.usb-phy/otg_inputs
 3) On B-device (as peripheral), you input the following command:
   # echo b_bus_req > /sys/devices/platform/soc/ee080200.usb-phy/otg_inputs

Then, the A-device acts as a peripheral (A-peripheral) and the B-device
acts as a host (B-host).
Please note that A-device must input the following command if you
want the board to act as a host again. (even if you disconnect the usb
cable, since id state may be the same, the condition keeps "A-peripheral".)
 # echo a_bus_drop > /sys/devices/platform/soc/ee080200.usb-phy/otg_inputs

Also you can use the following command if you want the B-device board to
act as a peripheral again.
 # echo b_bus_req/ > /sys/devices/platform/soc/ee080200.usb-phy/otg_inputs

Signed-off-by: Yoshihiro Shimoda 
---
 This patch is based on the linux-phy.git / phy-for-4.9-resolved_v3 tag.
 (commit id = c4b0bf82f705747ed7de90c5736b07248cbb29cd)

 .../ABI/testing/sysfs-platform-phy-rcar-gen3-usb2  |  11 ++
 drivers/phy/phy-rcar-gen3-usb2.c   | 124 -
 2 files changed, 134 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/ABI/testing/sysfs-platform-phy-rcar-gen3-usb2

diff --git a/Documentation/ABI/testing/sysfs-platform-phy-rcar-gen3-usb2 
b/Documentation/ABI/testing/sysfs-platform-phy-rcar-gen3-usb2
new file mode 100644
index 000..c7e715af
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-platform-phy-rcar-gen3-usb2
@@ -0,0 +1,11 @@
+What:  /sys/devices/platform//otg-inputs
+Date:  October 2016
+KernelVersion: 4.10
+Contact:   Yoshihiro Shimoda 
+Description:
+   This write-only file changes the phy mode for role swap of usb.
+   This file accepts the following strings:
+"a_bus_req/" - switching from A-Host to A-Peripheral
+"a_bus_drop" - switching from A-Peripheral to A-Host
+"b_bus_req"  - switching from B-Peripheral to B-Host
+"b_bus_req/" - switching from B-Host to B-Peripheral
diff --git a/drivers/phy/phy-rcar-gen3-usb2.c b/drivers/phy/phy-rcar-gen3-usb2.c
index 3d97ead..80f5bcc 100644
--- a/drivers/phy/phy-rcar-gen3-usb2.c
+++ b/drivers/phy/phy-rcar-gen3-usb2.c
@@ -70,6 +70,7 @@
 #define USB2_LINECTRL1_DP_RPD  BIT(18)
 #define USB2_LINECTRL1_DMRPD_ENBIT(17)
 #define USB2_LINECTRL1_DM_RPD  BIT(16)
+#define USB2_LINECTRL1_OPMODE_NODRVBIT(6)
 
 /* ADPCTRL */
 #define USB2_ADPCTRL_OTGSESSVLDBIT(20)
@@ -161,6 +162,43 @@ static void rcar_gen3_init_for_peri(struct rcar_gen3_chan 
*ch)
schedule_work(>work);
 }
 
+static void rcar_gen3_init_for_b_host(struct rcar_gen3_chan *ch)
+{
+   void __iomem *usb2_base = ch->base;
+   u32 val;
+
+   val = readl(usb2_base + USB2_LINECTRL1);
+   writel(val | USB2_LINECTRL1_OPMODE_NODRV, usb2_base + USB2_LINECTRL1);
+
+   rcar_gen3_set_linectrl(ch, 1, 1);
+   rcar_gen3_set_host_mode(ch, 1);
+   rcar_gen3_enable_vbus_ctrl(ch, 0);
+
+   val = readl(usb2_base + USB2_LINECTRL1);
+   writel(val & ~USB2_LINECTRL1_OPMODE_NODRV, usb2_base + USB2_LINECTRL1);
+}
+
+static void rcar_gen3_init_for_a_peri(struct rcar_gen3_chan *ch)
+{
+   rcar_gen3_set_linectrl(ch, 0, 1);
+   rcar_gen3_set_host_mode(ch, 0);
+   rcar_gen3_enable_vbus_ctrl(ch, 1);
+}
+
+static void rcar_gen3_init_from_a_peri_to_a_host(struct rcar_gen3_chan *ch)
+{
+   void __iomem *usb2_base = ch->base;
+   u32 val;
+
+   val = readl(usb2_base + USB2_OBINTEN);
+   writel(val & ~USB2_OBINT_BITS, usb2_base + USB2_OBINTEN);
+
+   rcar_gen3_enable_vbus_ctrl(ch, 0);
+   rcar_gen3_init_for_host(ch);
+
+   writel(val | USB2_OBINT_BITS, usb2_base + USB2_OBINTEN);
+}
+
 static bool rcar_gen3_check_id(struct rcar_gen3_chan *ch)
 {
return !!(readl(ch->base + USB2_ADPCTRL) & USB2_ADPCTRL_IDDIG);
@@ -174,6 +212,71 @@ static void rcar_gen3_device_recognition(struct 
rcar_gen3_chan *ch)
rcar_gen3_init_for_peri(ch);
 }
 
+/*
+ * The following table is a state transition for usb phy mode:
+ * State   Event   Next state
+ * disconnected:   E1  a_host
+ * E2  b_peripheral
+ * A-Device - a_host:  E2  b_peripheral
+ * E3  disconnected
+ * E4  a_suspend
+ * A-Device - a_suspend:   E2  b_peripheral
+ * E3  disconnected
+ * E5  a_host
+ * E6  a_peripheral
+ *