[PATCH] v4l: vsp1: Disable VYUY on Gen3

2016-09-15 Thread Laurent Pinchart
The VYUY format isn't supported on Gen3 hardware, disable it.

Gen2 hardware supports VYUY in practice even though the documentation
doesn't advertise it, so keep it for Gen2 devices.

Signed-off-by: Laurent Pinchart 
---
 drivers/media/platform/vsp1/vsp1_drm.c   | 2 +-
 drivers/media/platform/vsp1/vsp1_pipe.c  | 8 +++-
 drivers/media/platform/vsp1/vsp1_pipe.h  | 3 ++-
 drivers/media/platform/vsp1/vsp1_video.c | 4 ++--
 4 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/media/platform/vsp1/vsp1_drm.c 
b/drivers/media/platform/vsp1/vsp1_drm.c
index 832286975e71..54795b5e5a8a 100644
--- a/drivers/media/platform/vsp1/vsp1_drm.c
+++ b/drivers/media/platform/vsp1/vsp1_drm.c
@@ -286,7 +286,7 @@ int vsp1_du_atomic_update(struct device *dev, unsigned int 
rpf_index,
/* Store the format, stride, memory buffer address, crop and compose
 * rectangles and Z-order position and for the input.
 */
-   fmtinfo = vsp1_get_format_info(cfg->pixelformat);
+   fmtinfo = vsp1_get_format_info(vsp1, cfg->pixelformat);
if (!fmtinfo) {
dev_dbg(vsp1->dev, "Unsupport pixel format %08x for RPF\n",
cfg->pixelformat);
diff --git a/drivers/media/platform/vsp1/vsp1_pipe.c 
b/drivers/media/platform/vsp1/vsp1_pipe.c
index 474de82165d8..78b6184f91ce 100644
--- a/drivers/media/platform/vsp1/vsp1_pipe.c
+++ b/drivers/media/platform/vsp1/vsp1_pipe.c
@@ -138,15 +138,21 @@ static const struct vsp1_format_info vsp1_video_formats[] 
= {
 
 /*
  * vsp1_get_format_info - Retrieve format information for a 4CC
+ * @vsp1: the VSP1 device
  * @fourcc: the format 4CC
  *
  * Return a pointer to the format information structure corresponding to the
  * given V4L2 format 4CC, or NULL if no corresponding format can be found.
  */
-const struct vsp1_format_info *vsp1_get_format_info(u32 fourcc)
+const struct vsp1_format_info *vsp1_get_format_info(struct vsp1_device *vsp1,
+   u32 fourcc)
 {
unsigned int i;
 
+   /* Special case, the VYUY format is supported on Gen2 only. */
+   if (vsp1->info->gen != 2 && fourcc == V4L2_PIX_FMT_VYUY)
+   return NULL;
+
for (i = 0; i < ARRAY_SIZE(vsp1_video_formats); ++i) {
const struct vsp1_format_info *info = _video_formats[i];
 
diff --git a/drivers/media/platform/vsp1/vsp1_pipe.h 
b/drivers/media/platform/vsp1/vsp1_pipe.h
index f15b697ad999..ac4ad261 100644
--- a/drivers/media/platform/vsp1/vsp1_pipe.h
+++ b/drivers/media/platform/vsp1/vsp1_pipe.h
@@ -130,6 +130,7 @@ void vsp1_pipeline_propagate_alpha(struct vsp1_pipeline 
*pipe,
 void vsp1_pipelines_suspend(struct vsp1_device *vsp1);
 void vsp1_pipelines_resume(struct vsp1_device *vsp1);
 
-const struct vsp1_format_info *vsp1_get_format_info(u32 fourcc);
+const struct vsp1_format_info *vsp1_get_format_info(struct vsp1_device *vsp1,
+   u32 fourcc);
 
 #endif /* __VSP1_PIPE_H__ */
diff --git a/drivers/media/platform/vsp1/vsp1_video.c 
b/drivers/media/platform/vsp1/vsp1_video.c
index 15d08cb50bd1..e773d3d30df2 100644
--- a/drivers/media/platform/vsp1/vsp1_video.c
+++ b/drivers/media/platform/vsp1/vsp1_video.c
@@ -117,9 +117,9 @@ static int __vsp1_video_try_format(struct vsp1_video *video,
/* Retrieve format information and select the default format if the
 * requested format isn't supported.
 */
-   info = vsp1_get_format_info(pix->pixelformat);
+   info = vsp1_get_format_info(video->vsp1, pix->pixelformat);
if (info == NULL)
-   info = vsp1_get_format_info(VSP1_VIDEO_DEF_FORMAT);
+   info = vsp1_get_format_info(video->vsp1, VSP1_VIDEO_DEF_FORMAT);
 
pix->pixelformat = info->fourcc;
pix->colorspace = V4L2_COLORSPACE_SRGB;
-- 
Regards,

Laurent Pinchart



[PATCH 3/4] mmc: sh_mmcif: Document r7s72100 DT bindings

2016-09-15 Thread Chris Brandt
Signed-off-by: Chris Brandt 
---
 Documentation/devicetree/bindings/mmc/renesas,mmcif.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/mmc/renesas,mmcif.txt 
b/Documentation/devicetree/bindings/mmc/renesas,mmcif.txt
index ff611fa..bf50a00 100644
--- a/Documentation/devicetree/bindings/mmc/renesas,mmcif.txt
+++ b/Documentation/devicetree/bindings/mmc/renesas,mmcif.txt
@@ -8,6 +8,7 @@ Required properties:
 
 - compatible: should be "renesas,mmcif-", "renesas,sh-mmcif" as a
   fallback. Examples with  are:
+   - "renesas,mmcif-r7s72100" for the MMCIF found in r7s72100 SoCs
- "renesas,mmcif-r8a7740" for the MMCIF found in r8a7740 SoCs
- "renesas,mmcif-r8a7790" for the MMCIF found in r8a7790 SoCs
- "renesas,mmcif-r8a7791" for the MMCIF found in r8a7791 SoCs
-- 
2.9.2




[PATCH 0/4] r7s72100: dts: enable mmcif

2016-09-15 Thread Chris Brandt
This series enables the mmc driver for the RZ/A1.
Nothing needed to be changed with the actual sh_mmcif driver.
It worked fine as-is.

As you can see, the status in the rskrza1 dst was left
as disabled because I wanted to leave that code in there
for refernce for someone later that actually has a board with
an actaul eMMC chip. I tested with an MMC Plus card.


Chris Brandt (4):
  ARM: dts: r7s72100: add mmcif clock to device tree
  ARM: dts: r7s72100: add mmcif to device tree
  mmc: sh_mmcif: Document r7s72100 DT bindings
  ARM: dts: rskrza1: add mmc DT support

 .../devicetree/bindings/mmc/renesas,mmcif.txt|  1 +
 arch/arm/boot/dts/r7s72100-rskrza1.dts   | 17 +
 arch/arm/boot/dts/r7s72100.dtsi  | 20 
 include/dt-bindings/clock/r7s72100-clock.h   |  3 +++
 4 files changed, 41 insertions(+)

-- 
2.9.2




[PATCH 1/4] ARM: dts: r7s72100: add mmcif clock to device tree

2016-09-15 Thread Chris Brandt
Signed-off-by: Chris Brandt 
---
 arch/arm/boot/dts/r7s72100.dtsi| 9 +
 include/dt-bindings/clock/r7s72100-clock.h | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
index fb9ef9c..e18d4e6 100644
--- a/arch/arm/boot/dts/r7s72100.dtsi
+++ b/arch/arm/boot/dts/r7s72100.dtsi
@@ -117,6 +117,15 @@
clock-output-names = "ether";
};
 
+   mstp8_clks: mstp8_clks@fcfe0434 {
+   #clock-cells = <1>;
+   compatible = "renesas,r7s72100-mstp-clocks", 
"renesas,cpg-mstp-clocks";
+   reg = <0xfcfe0434 4>;
+   clocks = <_clk>;
+   clock-indices = ;
+   clock-output-names = "mmcif";
+   };
+
mstp9_clks: mstp9_clks@fcfe0438 {
#clock-cells = <1>;
compatible = "renesas,r7s72100-mstp-clocks", 
"renesas,cpg-mstp-clocks";
diff --git a/include/dt-bindings/clock/r7s72100-clock.h 
b/include/dt-bindings/clock/r7s72100-clock.h
index 3cd8138..5eaf0fb 100644
--- a/include/dt-bindings/clock/r7s72100-clock.h
+++ b/include/dt-bindings/clock/r7s72100-clock.h
@@ -28,6 +28,9 @@
 /* MSTP7 */
 #define R7S72100_CLK_ETHER 4
 
+/* MSTP8 */
+#define R7S72100_CLK_MMCIF 4
+
 /* MSTP9 */
 #define R7S72100_CLK_I2C0  7
 #define R7S72100_CLK_I2C1  6
-- 
2.9.2




Re: [PATCH 4/4] arm64: renesas: r8a7796: Enable HSCIF DMA

2016-09-15 Thread Geert Uytterhoeven
On Wed, Sep 14, 2016 at 6:47 PM, Ulrich Hecht
 wrote:
> Signed-off-by: Ulrich Hecht 

Reviewed-by: Geert Uytterhoeven 

> ---
>  arch/arm64/boot/dts/renesas/r8a7796.dtsi | 10 ++
>  1 file changed, 10 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/renesas/r8a7796.dtsi 
> b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
> index df3b7df..085a6fa9b 100644
> --- a/arch/arm64/boot/dts/renesas/r8a7796.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
> @@ -357,6 +357,8 @@
>  < CPG_CORE R8A7796_CLK_S3D1>,
>  <_clk>;
> clock-names = "fck", "brg_int", "scif_clk";
> +   dmas = < 0x31>, < 0x30>;

Same comment as for I2C and HSCIF: dmac2, if it works.

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 3/4] arm64: renesas: r8a7796 dtsi: Add all HSCIF nodes

2016-09-15 Thread Geert Uytterhoeven
On Wed, Sep 14, 2016 at 6:47 PM, Ulrich Hecht
 wrote:
> Add the device nodes for all HSCIF serial ports, incl. clocks, and
> clock domain.
>
> Signed-off-by: Ulrich Hecht 

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


Re: [PATCH 2/4] pinctrl: sh-pfc: r8a7796: Add HSCIF pins, groups, and functions

2016-09-15 Thread Geert Uytterhoeven
Hi Ulrich,

On Wed, Sep 14, 2016 at 6:47 PM, Ulrich Hecht
 wrote:
> Signed-off-by: Ulrich Hecht 
> ---
>  drivers/pinctrl/sh-pfc/pfc-r8a7796.c | 255 
> +++
>  1 file changed, 255 insertions(+)
>
> diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7796.c 
> b/drivers/pinctrl/sh-pfc/pfc-r8a7796.c
> index 42db745..607adf7 100644
> --- a/drivers/pinctrl/sh-pfc/pfc-r8a7796.c
> +++ b/drivers/pinctrl/sh-pfc/pfc-r8a7796.c
> @@ -1490,6 +1490,191 @@ static const struct sh_pfc_pin pinmux_pins[] = {

> +/* - HSCIF2 
> - */
> +static const unsigned int hscif2_data_a_pins[] = {
> +   /* RX, TX */
> +   RCAR_GP_PIN(6, 8), RCAR_GP_PIN(6, 9),
> +};
> +static const unsigned int hscif2_data_a_mux[] = {
> +   HRX2_A_MARK, HTX2_A_MARK,
> +};
> +static const unsigned int hscif2_clk_a_pins[] = {
> +   /* SCK */
> +   RCAR_GP_PIN(6, 10),
> +};
> +static const unsigned int hscif2_clk_a_mux[] = {
> +   HSCK2_A_MARK,
> +};
> +static const unsigned int hscif2_ctrl_a_pins[] = {
> +   /* RTS, CTS */
> +   RCAR_GP_PIN(6, 7), RCAR_GP_PIN(6, 6),
> +};
> +static const unsigned int hscif2_ctrl_a_mux[] = {
> +   HRTS2_N_A_MARK, HCTS2_N_A_MARK,
> +};
> +
> +static const unsigned int hscif2_data_b_pins[] = {
> +   /* RX, TX */
> +   RCAR_GP_PIN(6, 17), RCAR_GP_PIN(6, 18),
> +};
> +static const unsigned int hscif2_data_b_mux[] = {
> +   HRX2_B_MARK, HTX2_B_MARK,
> +};
> +static const unsigned int hscif2_clk_b_pins[] = {
> +   /* SCK */
> +   RCAR_GP_PIN(6, 21),
> +};
> +static const unsigned int hscif2_clk_b_mux[] = {
> +   HSCK1_B_MARK,
> +};
> +static const unsigned int hscif2_ctrl_b_pins[] = {
> +   /* RTS, CTS */
> +   RCAR_GP_PIN(6, 20), RCAR_GP_PIN(6, 19),
> +};
> +static const unsigned int hscif2_ctrl_b_mux[] = {
> +   HRTS2_N_B_MARK, HCTS2_N_B_MARK,
> +};

You forgot to add group C for HSCIF2, which does not exist on H3.

The rest looks OK to me.

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 1/4] clk: shmobile: r8a7796: Add HSCIF clocks

2016-09-15 Thread Geert Uytterhoeven
On Wed, Sep 14, 2016 at 6:47 PM, Ulrich Hecht
 wrote:
> Signed-off-by: Ulrich Hecht 

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


Re: [PATCH 3/3] arm64: renesas: r8a7796: Enable SCIF DMA

2016-09-15 Thread Geert Uytterhoeven
On Wed, Sep 14, 2016 at 6:46 PM, Ulrich Hecht
 wrote:
> Signed-off-by: Ulrich Hecht 

Reviewed-by: Geert Uytterhoeven 

> ---
>  arch/arm64/boot/dts/renesas/r8a7796.dtsi | 12 
>  1 file changed, 12 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/renesas/r8a7796.dtsi 
> b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
> index e59ded4..d2bbf92 100644
> --- a/arch/arm64/boot/dts/renesas/r8a7796.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
> @@ -356,6 +356,8 @@
>  < CPG_CORE R8A7796_CLK_S3D1>,
>  <_clk>;
> clock-names = "fck", "brg_int", "scif_clk";
> +   dmas = < 0x51>, < 0x50>;

Same question as for i2c: please add the dmas pointing to dmac2 where
appropriate, if that works.

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 2/3] arm64: renesas: r8a7796: Add all SCIF nodes

2016-09-15 Thread Geert Uytterhoeven
On Wed, Sep 14, 2016 at 6:46 PM, Ulrich Hecht
 wrote:
> Add the device nodes for all R-Car H3 SCIF serial ports, incl. clocks
> and clock domain.
>
> Signed-off-by: Ulrich Hecht 

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


Re: [PATCH 1/3] clk: shmobile: r8a7796: Add SCIF clocks

2016-09-15 Thread Geert Uytterhoeven
On Wed, Sep 14, 2016 at 6:46 PM, Ulrich Hecht
 wrote:
> Signed-off-by: Ulrich Hecht 

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


Re: [PATCH v9 2/2] media: rcar-vin: use sink pad index for DV timings

2016-09-15 Thread Laurent Pinchart
Hi Ulrich,

Thank you for the patch.

On Thursday 15 Sep 2016 19:33:24 Ulrich Hecht wrote:
> Signed-off-by: Ulrich Hecht 

With a commit message explaining why this is needed,

Acked-by: Laurent Pinchart 

> ---
>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> b/drivers/media/platform/rcar-vin/rcar-v4l2.c index f35005c..2bbe6d4 100644
> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> @@ -550,7 +550,7 @@ static int rvin_enum_dv_timings(struct file *file, void
> *priv_fh, int pad, ret;
> 
>   pad = timings->pad;
> - timings->pad = vin->src_pad_idx;
> + timings->pad = vin->sink_pad_idx;
> 
>   ret = v4l2_subdev_call(sd, pad, enum_dv_timings, timings);
> 
> @@ -604,7 +604,7 @@ static int rvin_dv_timings_cap(struct file *file, void
> *priv_fh, int pad, ret;
> 
>   pad = cap->pad;
> - cap->pad = vin->src_pad_idx;
> + cap->pad = vin->sink_pad_idx;
> 
>   ret = v4l2_subdev_call(sd, pad, dv_timings_cap, cap);

-- 
Regards,

Laurent Pinchart



Re: [PATCH v9 1/2] rcar-vin: implement EDID control ioctls

2016-09-15 Thread Laurent Pinchart
Hi Ulrich,

Thank you for the patch.

On Thursday 15 Sep 2016 19:33:23 Ulrich Hecht wrote:
> Adds G_EDID and S_EDID.
> 
> Signed-off-by: Ulrich Hecht 
> Acked-by: Niklas Söderlund 

Acked-by: Laurent Pinchart 

> ---
>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 48 ++
>  drivers/media/platform/rcar-vin/rcar-vin.h  |  2 ++
>  2 files changed, 50 insertions(+)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> b/drivers/media/platform/rcar-vin/rcar-v4l2.c index 61e9b59..f35005c 100644
> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> @@ -613,6 +613,44 @@ static int rvin_dv_timings_cap(struct file *file, void
> *priv_fh, return ret;
>  }
> 
> +static int rvin_g_edid(struct file *file, void *fh, struct v4l2_edid *edid)
> +{
> + struct rvin_dev *vin = video_drvdata(file);
> + struct v4l2_subdev *sd = vin_to_source(vin);
> + int input, ret;
> +
> + if (edid->pad)
> + return -EINVAL;
> +
> + input = edid->pad;
> + edid->pad = vin->sink_pad_idx;
> +
> + ret = v4l2_subdev_call(sd, pad, get_edid, edid);
> +
> + edid->pad = input;
> +
> + return ret;
> +}
> +
> +static int rvin_s_edid(struct file *file, void *fh, struct v4l2_edid *edid)
> +{
> + struct rvin_dev *vin = video_drvdata(file);
> + struct v4l2_subdev *sd = vin_to_source(vin);
> + int input, ret;
> +
> + if (edid->pad)
> + return -EINVAL;
> +
> + input = edid->pad;
> + edid->pad = vin->sink_pad_idx;
> +
> + ret = v4l2_subdev_call(sd, pad, set_edid, edid);
> +
> + edid->pad = input;
> +
> + return ret;
> +}
> +
>  static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
>   .vidioc_querycap= rvin_querycap,
>   .vidioc_try_fmt_vid_cap = rvin_try_fmt_vid_cap,
> @@ -635,6 +673,9 @@ static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
>   .vidioc_s_dv_timings= rvin_s_dv_timings,
>   .vidioc_query_dv_timings= rvin_query_dv_timings,
> 
> + .vidioc_g_edid  = rvin_g_edid,
> + .vidioc_s_edid  = rvin_s_edid,
> +
>   .vidioc_querystd= rvin_querystd,
>   .vidioc_g_std   = rvin_g_std,
>   .vidioc_s_std   = rvin_s_std,
> @@ -883,6 +924,13 @@ int rvin_v4l2_probe(struct rvin_dev *vin)
> 
>   vin->src_pad_idx = pad_idx;
> 
> + vin->sink_pad_idx = 0;
> + for (pad_idx = 0; pad_idx < sd->entity.num_pads; pad_idx++)
> + if (sd->entity.pads[pad_idx].flags == MEDIA_PAD_FL_SINK) {
> + vin->sink_pad_idx = pad_idx;
> + break;
> + }
> +
>   vin->format.pixelformat = RVIN_DEFAULT_FORMAT;
>   rvin_reset_format(vin);
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h
> b/drivers/media/platform/rcar-vin/rcar-vin.h index 793184d..727e215 100644
> --- a/drivers/media/platform/rcar-vin/rcar-vin.h
> +++ b/drivers/media/platform/rcar-vin/rcar-vin.h
> @@ -92,6 +92,7 @@ struct rvin_graph_entity {
>   * @vdev:V4L2 video device associated with VIN
>   * @v4l2_dev:V4L2 device
>   * @src_pad_idx: source pad index for media controller drivers
> + * @sink_pad_idx:sink pad index for media controller drivers
>   * @ctrl_handler:V4L2 control handler
>   * @notifier:V4L2 asynchronous subdevs notifier
>   * @digital: entity in the DT for local digital subdevice
> @@ -121,6 +122,7 @@ struct rvin_dev {
>   struct video_device vdev;
>   struct v4l2_device v4l2_dev;
>   int src_pad_idx;
> + int sink_pad_idx;
>   struct v4l2_ctrl_handler ctrl_handler;
>   struct v4l2_async_notifier notifier;
>   struct rvin_graph_entity digital;

-- 
Regards,

Laurent Pinchart



Re: [PATCH v9 0/2] rcar-vin EDID control ioctls

2016-09-15 Thread Hans Verkuil


On 09/15/2016 07:33 PM, Ulrich Hecht wrote:
> Hi!
> 
> This revision sits on top of Hans's rcar branch and adds pad sanity checks
> for g_edid and s_edid, the sink pad fix for the DV timings suggested by
> Niklas, and documents sink_pad_idx. Good night!
> 
> CU
> Uli
> 
> 
> Changes since v8:
> - dumped merged default-input patch

I've 'unmerged' this due to a comment from Laurent.

Can you look at Laurent's reply?

Hans

> - added pad sanity check
> - added DV timings sink pad fix
> - documented sink_pad_idx
> - added Acked-By
> 
> Changes since v7:
> - do not fail if there is no sink pad
> 
> Changes since v6:
> - work without subdev abstraction layer
> - split off DT parts, to be handled separately
> 
> Changes since v5:
> - implement vin/subdev pad translation
> - move i2c devices
> 
> Changes since v4:
> - drop merged patches
> - adv7604: always fall back to input 0 if nothing else is specified
> - rcar-vin: implement G_EDID, S_EDID in place of hard-coded EDID blob
> 
> Changes since v3:
> - rvin_enum_dv_timings(): use vin->src_pad_idx
> - rvin_dv_timings_cap(): likewise
> - rvin_s_dv_timings(): update vin->format
> - add Koelsch support
> 
> Changes since v2:
> - rebased on top of rcar-vin driver v4
> - removed "adv7604: fix SPA register location for ADV7612" (picked up)
> - changed prefix of dts patch to "ARM: dts: lager: "
> 
> 
> Ulrich Hecht (2):
>   rcar-vin: implement EDID control ioctls
>   media: rcar-vin: use sink pad index for DV timings
> 
>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 52 
> +++--
>  drivers/media/platform/rcar-vin/rcar-vin.h  |  2 ++
>  2 files changed, 52 insertions(+), 2 deletions(-)
> 


[PATCH v9 2/2] media: rcar-vin: use sink pad index for DV timings

2016-09-15 Thread Ulrich Hecht
Signed-off-by: Ulrich Hecht 
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index f35005c..2bbe6d4 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -550,7 +550,7 @@ static int rvin_enum_dv_timings(struct file *file, void 
*priv_fh,
int pad, ret;
 
pad = timings->pad;
-   timings->pad = vin->src_pad_idx;
+   timings->pad = vin->sink_pad_idx;
 
ret = v4l2_subdev_call(sd, pad, enum_dv_timings, timings);
 
@@ -604,7 +604,7 @@ static int rvin_dv_timings_cap(struct file *file, void 
*priv_fh,
int pad, ret;
 
pad = cap->pad;
-   cap->pad = vin->src_pad_idx;
+   cap->pad = vin->sink_pad_idx;
 
ret = v4l2_subdev_call(sd, pad, dv_timings_cap, cap);
 
-- 
2.9.3



[PATCH v9 1/2] rcar-vin: implement EDID control ioctls

2016-09-15 Thread Ulrich Hecht
Adds G_EDID and S_EDID.

Signed-off-by: Ulrich Hecht 
Acked-by: Niklas Söderlund 
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 48 +
 drivers/media/platform/rcar-vin/rcar-vin.h  |  2 ++
 2 files changed, 50 insertions(+)

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 61e9b59..f35005c 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -613,6 +613,44 @@ static int rvin_dv_timings_cap(struct file *file, void 
*priv_fh,
return ret;
 }
 
+static int rvin_g_edid(struct file *file, void *fh, struct v4l2_edid *edid)
+{
+   struct rvin_dev *vin = video_drvdata(file);
+   struct v4l2_subdev *sd = vin_to_source(vin);
+   int input, ret;
+
+   if (edid->pad)
+   return -EINVAL;
+
+   input = edid->pad;
+   edid->pad = vin->sink_pad_idx;
+
+   ret = v4l2_subdev_call(sd, pad, get_edid, edid);
+
+   edid->pad = input;
+
+   return ret;
+}
+
+static int rvin_s_edid(struct file *file, void *fh, struct v4l2_edid *edid)
+{
+   struct rvin_dev *vin = video_drvdata(file);
+   struct v4l2_subdev *sd = vin_to_source(vin);
+   int input, ret;
+
+   if (edid->pad)
+   return -EINVAL;
+
+   input = edid->pad;
+   edid->pad = vin->sink_pad_idx;
+
+   ret = v4l2_subdev_call(sd, pad, set_edid, edid);
+
+   edid->pad = input;
+
+   return ret;
+}
+
 static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
.vidioc_querycap= rvin_querycap,
.vidioc_try_fmt_vid_cap = rvin_try_fmt_vid_cap,
@@ -635,6 +673,9 @@ static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
.vidioc_s_dv_timings= rvin_s_dv_timings,
.vidioc_query_dv_timings= rvin_query_dv_timings,
 
+   .vidioc_g_edid  = rvin_g_edid,
+   .vidioc_s_edid  = rvin_s_edid,
+
.vidioc_querystd= rvin_querystd,
.vidioc_g_std   = rvin_g_std,
.vidioc_s_std   = rvin_s_std,
@@ -883,6 +924,13 @@ int rvin_v4l2_probe(struct rvin_dev *vin)
 
vin->src_pad_idx = pad_idx;
 
+   vin->sink_pad_idx = 0;
+   for (pad_idx = 0; pad_idx < sd->entity.num_pads; pad_idx++)
+   if (sd->entity.pads[pad_idx].flags == MEDIA_PAD_FL_SINK) {
+   vin->sink_pad_idx = pad_idx;
+   break;
+   }
+
vin->format.pixelformat = RVIN_DEFAULT_FORMAT;
rvin_reset_format(vin);
 
diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h 
b/drivers/media/platform/rcar-vin/rcar-vin.h
index 793184d..727e215 100644
--- a/drivers/media/platform/rcar-vin/rcar-vin.h
+++ b/drivers/media/platform/rcar-vin/rcar-vin.h
@@ -92,6 +92,7 @@ struct rvin_graph_entity {
  * @vdev:  V4L2 video device associated with VIN
  * @v4l2_dev:  V4L2 device
  * @src_pad_idx:   source pad index for media controller drivers
+ * @sink_pad_idx:  sink pad index for media controller drivers
  * @ctrl_handler:  V4L2 control handler
  * @notifier:  V4L2 asynchronous subdevs notifier
  * @digital:   entity in the DT for local digital subdevice
@@ -121,6 +122,7 @@ struct rvin_dev {
struct video_device vdev;
struct v4l2_device v4l2_dev;
int src_pad_idx;
+   int sink_pad_idx;
struct v4l2_ctrl_handler ctrl_handler;
struct v4l2_async_notifier notifier;
struct rvin_graph_entity digital;
-- 
2.9.3



Re: [PATCH v8 2/2] rcar-vin: implement EDID control ioctls

2016-09-15 Thread Laurent Pinchart
Hi Hans,

On Thursday 15 Sep 2016 19:01:06 Hans Verkuil wrote:
> On 09/15/2016 06:47 PM, Laurent Pinchart wrote:
> > On Thursday 15 Sep 2016 15:24:08 Ulrich Hecht wrote:
> >> Adds G_EDID and S_EDID.
> >> 
> >> Signed-off-by: Ulrich Hecht 
> >> ---
> >> 
> >>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 42 +++
> >>  drivers/media/platform/rcar-vin/rcar-vin.h  |  1 +
> >>  2 files changed, 43 insertions(+)
> >> 
> >> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> >> b/drivers/media/platform/rcar-vin/rcar-v4l2.c index 62ca7e3..f679182
> >> 100644
> >> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> >> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> >> @@ -557,6 +557,38 @@ static int rvin_dv_timings_cap(struct file *file,
> >> void *priv_fh, return ret;
> >>  }
> >> 
> >> +static int rvin_g_edid(struct file *file, void *fh, struct v4l2_edid
> >> *edid) +{
> >> +  struct rvin_dev *vin = video_drvdata(file);
> >> +  struct v4l2_subdev *sd = vin_to_source(vin);
> >> +  int input, ret;
> >> +
> >> +  input = edid->pad;
> >> +  edid->pad = vin->sink_pad_idx;
> >> +
> >> +  ret = v4l2_subdev_call(sd, pad, get_edid, edid);
> >> +
> >> +  edid->pad = input;
> >> +
> >> +  return ret;
> >> +}
> >> +
> >> +static int rvin_s_edid(struct file *file, void *fh, struct v4l2_edid
> >> *edid) +{
> >> +  struct rvin_dev *vin = video_drvdata(file);
> >> +  struct v4l2_subdev *sd = vin_to_source(vin);
> >> +  int input, ret;
> >> +
> >> +  input = edid->pad;
> >> +  edid->pad = vin->sink_pad_idx;
> >> +
> >> +  ret = v4l2_subdev_call(sd, pad, set_edid, edid);
> >> +
> >> +  edid->pad = input;
> >> +
> >> +  return ret;
> >> +}
> >> +
> >>  static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
> >>.vidioc_querycap= rvin_querycap,
> >>.vidioc_try_fmt_vid_cap = rvin_try_fmt_vid_cap,
> >> @@ -579,6 +611,9 @@ static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
> >>.vidioc_s_dv_timings= rvin_s_dv_timings,
> >>.vidioc_query_dv_timings= rvin_query_dv_timings,
> >> 
> >> +  .vidioc_g_edid  = rvin_g_edid,
> >> +  .vidioc_s_edid  = rvin_s_edid,
> >> +
> >>.vidioc_querystd= rvin_querystd,
> >>.vidioc_g_std   = rvin_g_std,
> >>.vidioc_s_std   = rvin_s_std,
> >> @@ -832,6 +867,13 @@ int rvin_v4l2_probe(struct rvin_dev *vin)
> >>vin->src_pad_idx = pad_idx;
> >>fmt.pad = vin->src_pad_idx;
> >> 
> >> +  vin->sink_pad_idx = 0;
> >> +  for (pad_idx = 0; pad_idx < sd->entity.num_pads; pad_idx++)
> >> +  if (sd->entity.pads[pad_idx].flags == MEDIA_PAD_FL_SINK) {
> >> +  vin->sink_pad_idx = pad_idx;
> >> +  break;
> >> +  }
> >> +
> > 
> > What if the subdev has multiple sink pads ? Shouldn't the pad number be
> > instead computed in the get and set EDID handlers based on the input
> > number passed in the struct v4l2_edid::pad field ?
> 
> But there is only one input (VIDIOC_ENUM_INPUT), so this would not make
> sense.

Indeed, my bad. We'll address that when implementing input selection support 
then.

> What is wrong is that g/s_edid should check the pad and return -EINVAL if it
> is non-zero. Odd that I missed that in the earlier reviews...

-- 
Regards,

Laurent Pinchart



[PATCH v9 0/2] rcar-vin EDID control ioctls

2016-09-15 Thread Ulrich Hecht
Hi!

This revision sits on top of Hans's rcar branch and adds pad sanity checks
for g_edid and s_edid, the sink pad fix for the DV timings suggested by
Niklas, and documents sink_pad_idx. Good night!

CU
Uli


Changes since v8:
- dumped merged default-input patch
- added pad sanity check
- added DV timings sink pad fix
- documented sink_pad_idx
- added Acked-By

Changes since v7:
- do not fail if there is no sink pad

Changes since v6:
- work without subdev abstraction layer
- split off DT parts, to be handled separately

Changes since v5:
- implement vin/subdev pad translation
- move i2c devices

Changes since v4:
- drop merged patches
- adv7604: always fall back to input 0 if nothing else is specified
- rcar-vin: implement G_EDID, S_EDID in place of hard-coded EDID blob

Changes since v3:
- rvin_enum_dv_timings(): use vin->src_pad_idx
- rvin_dv_timings_cap(): likewise
- rvin_s_dv_timings(): update vin->format
- add Koelsch support

Changes since v2:
- rebased on top of rcar-vin driver v4
- removed "adv7604: fix SPA register location for ADV7612" (picked up)
- changed prefix of dts patch to "ARM: dts: lager: "


Ulrich Hecht (2):
  rcar-vin: implement EDID control ioctls
  media: rcar-vin: use sink pad index for DV timings

 drivers/media/platform/rcar-vin/rcar-v4l2.c | 52 +++--
 drivers/media/platform/rcar-vin/rcar-vin.h  |  2 ++
 2 files changed, 52 insertions(+), 2 deletions(-)

-- 
2.9.3



Re: [PATCH v8 2/2] rcar-vin: implement EDID control ioctls

2016-09-15 Thread Niklas Söderlund
On 2016-09-15 19:01:06 +0200, Hans Verkuil wrote:
> 
> 
> On 09/15/2016 06:47 PM, Laurent Pinchart wrote:
> > Hi Ulrich,
> > 
> > Thank you for the patch.
> > 
> > On Thursday 15 Sep 2016 15:24:08 Ulrich Hecht wrote:
> >> Adds G_EDID and S_EDID.
> >>
> >> Signed-off-by: Ulrich Hecht 
> >> ---
> >>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 42 
> >> ++
> >>  drivers/media/platform/rcar-vin/rcar-vin.h  |  1 +
> >>  2 files changed, 43 insertions(+)
> >>
> >> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> >> b/drivers/media/platform/rcar-vin/rcar-v4l2.c index 62ca7e3..f679182 100644
> >> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> >> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> >> @@ -557,6 +557,38 @@ static int rvin_dv_timings_cap(struct file *file, void
> >> *priv_fh, return ret;
> >>  }
> >>
> >> +static int rvin_g_edid(struct file *file, void *fh, struct v4l2_edid 
> >> *edid)
> >> +{
> >> +  struct rvin_dev *vin = video_drvdata(file);
> >> +  struct v4l2_subdev *sd = vin_to_source(vin);
> >> +  int input, ret;
> >> +
> >> +  input = edid->pad;
> >> +  edid->pad = vin->sink_pad_idx;
> >> +
> >> +  ret = v4l2_subdev_call(sd, pad, get_edid, edid);
> >> +
> >> +  edid->pad = input;
> >> +
> >> +  return ret;
> >> +}
> >> +
> >> +static int rvin_s_edid(struct file *file, void *fh, struct v4l2_edid 
> >> *edid)
> >> +{
> >> +  struct rvin_dev *vin = video_drvdata(file);
> >> +  struct v4l2_subdev *sd = vin_to_source(vin);
> >> +  int input, ret;
> >> +
> >> +  input = edid->pad;
> >> +  edid->pad = vin->sink_pad_idx;
> >> +
> >> +  ret = v4l2_subdev_call(sd, pad, set_edid, edid);
> >> +
> >> +  edid->pad = input;
> >> +
> >> +  return ret;
> >> +}
> >> +
> >>  static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
> >>.vidioc_querycap= rvin_querycap,
> >>.vidioc_try_fmt_vid_cap = rvin_try_fmt_vid_cap,
> >> @@ -579,6 +611,9 @@ static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
> >>.vidioc_s_dv_timings= rvin_s_dv_timings,
> >>.vidioc_query_dv_timings= rvin_query_dv_timings,
> >>
> >> +  .vidioc_g_edid  = rvin_g_edid,
> >> +  .vidioc_s_edid  = rvin_s_edid,
> >> +
> >>.vidioc_querystd= rvin_querystd,
> >>.vidioc_g_std   = rvin_g_std,
> >>.vidioc_s_std   = rvin_s_std,
> >> @@ -832,6 +867,13 @@ int rvin_v4l2_probe(struct rvin_dev *vin)
> >>vin->src_pad_idx = pad_idx;
> >>fmt.pad = vin->src_pad_idx;
> >>
> >> +  vin->sink_pad_idx = 0;
> >> +  for (pad_idx = 0; pad_idx < sd->entity.num_pads; pad_idx++)
> >> +  if (sd->entity.pads[pad_idx].flags == MEDIA_PAD_FL_SINK) {
> >> +  vin->sink_pad_idx = pad_idx;
> >> +  break;
> >> +  }
> >> +
> > 
> > What if the subdev has multiple sink pads ? Shouldn't the pad number be 
> > instead computed in the get and set EDID handlers based on the input number 
> > passed in the struct v4l2_edid::pad field ?
> 
> But there is only one input (VIDIOC_ENUM_INPUT), so this would not make sense.
> 
> What is wrong is that g/s_edid should check the pad and return -EINVAL if it
> is non-zero. Odd that I missed that in the earlier reviews...

Both Hans and Laurents comments are correct in this case I think.

The original patches was based on top of the Gen3 work where just as 
Laurent states the input number passed in the v4l2_edid::pad needs to be 
translated to a sink pad number of the subdevice. But since this is for 
Gen2 only there are only one input so no mapping is needed. All that is 
required is as Hans state to check that v4l2_edid::pad is a valid input 
number (equal to zero) from the rcar-vin perspective.

I do however still think there are value to find the subdevice sink pad 
id in rvin_v4l2_probe() and then use it in EDID handlers. The driver 
still need to use a sink pad number which is correct from the subdevice 
point of view.

> 
> Regards,
> 
>   Hans
> 
> > 
> >>/* Try to improve our guess of a reasonable window format */
> >>ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, );
> >>if (ret) {
> >> diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h
> >> b/drivers/media/platform/rcar-vin/rcar-vin.h index 793184d..af815cc 100644
> >> --- a/drivers/media/platform/rcar-vin/rcar-vin.h
> >> +++ b/drivers/media/platform/rcar-vin/rcar-vin.h
> >> @@ -121,6 +121,7 @@ struct rvin_dev {
> >>struct video_device vdev;
> >>struct v4l2_device v4l2_dev;
> >>int src_pad_idx;
> >> +  int sink_pad_idx;
> >>struct v4l2_ctrl_handler ctrl_handler;
> >>struct v4l2_async_notifier notifier;
> >>struct rvin_graph_entity digital;
> > 

-- 
Regards,
Niklas Söderlund


Re: [PATCH v8 2/2] rcar-vin: implement EDID control ioctls

2016-09-15 Thread Hans Verkuil


On 09/15/2016 06:47 PM, Laurent Pinchart wrote:
> Hi Ulrich,
> 
> Thank you for the patch.
> 
> On Thursday 15 Sep 2016 15:24:08 Ulrich Hecht wrote:
>> Adds G_EDID and S_EDID.
>>
>> Signed-off-by: Ulrich Hecht 
>> ---
>>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 42 ++
>>  drivers/media/platform/rcar-vin/rcar-vin.h  |  1 +
>>  2 files changed, 43 insertions(+)
>>
>> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c
>> b/drivers/media/platform/rcar-vin/rcar-v4l2.c index 62ca7e3..f679182 100644
>> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
>> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
>> @@ -557,6 +557,38 @@ static int rvin_dv_timings_cap(struct file *file, void
>> *priv_fh, return ret;
>>  }
>>
>> +static int rvin_g_edid(struct file *file, void *fh, struct v4l2_edid *edid)
>> +{
>> +struct rvin_dev *vin = video_drvdata(file);
>> +struct v4l2_subdev *sd = vin_to_source(vin);
>> +int input, ret;
>> +
>> +input = edid->pad;
>> +edid->pad = vin->sink_pad_idx;
>> +
>> +ret = v4l2_subdev_call(sd, pad, get_edid, edid);
>> +
>> +edid->pad = input;
>> +
>> +return ret;
>> +}
>> +
>> +static int rvin_s_edid(struct file *file, void *fh, struct v4l2_edid *edid)
>> +{
>> +struct rvin_dev *vin = video_drvdata(file);
>> +struct v4l2_subdev *sd = vin_to_source(vin);
>> +int input, ret;
>> +
>> +input = edid->pad;
>> +edid->pad = vin->sink_pad_idx;
>> +
>> +ret = v4l2_subdev_call(sd, pad, set_edid, edid);
>> +
>> +edid->pad = input;
>> +
>> +return ret;
>> +}
>> +
>>  static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
>>  .vidioc_querycap= rvin_querycap,
>>  .vidioc_try_fmt_vid_cap = rvin_try_fmt_vid_cap,
>> @@ -579,6 +611,9 @@ static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
>>  .vidioc_s_dv_timings= rvin_s_dv_timings,
>>  .vidioc_query_dv_timings= rvin_query_dv_timings,
>>
>> +.vidioc_g_edid  = rvin_g_edid,
>> +.vidioc_s_edid  = rvin_s_edid,
>> +
>>  .vidioc_querystd= rvin_querystd,
>>  .vidioc_g_std   = rvin_g_std,
>>  .vidioc_s_std   = rvin_s_std,
>> @@ -832,6 +867,13 @@ int rvin_v4l2_probe(struct rvin_dev *vin)
>>  vin->src_pad_idx = pad_idx;
>>  fmt.pad = vin->src_pad_idx;
>>
>> +vin->sink_pad_idx = 0;
>> +for (pad_idx = 0; pad_idx < sd->entity.num_pads; pad_idx++)
>> +if (sd->entity.pads[pad_idx].flags == MEDIA_PAD_FL_SINK) {
>> +vin->sink_pad_idx = pad_idx;
>> +break;
>> +}
>> +
> 
> What if the subdev has multiple sink pads ? Shouldn't the pad number be 
> instead computed in the get and set EDID handlers based on the input number 
> passed in the struct v4l2_edid::pad field ?

But there is only one input (VIDIOC_ENUM_INPUT), so this would not make sense.

What is wrong is that g/s_edid should check the pad and return -EINVAL if it
is non-zero. Odd that I missed that in the earlier reviews...

Regards,

Hans

> 
>>  /* Try to improve our guess of a reasonable window format */
>>  ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, );
>>  if (ret) {
>> diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h
>> b/drivers/media/platform/rcar-vin/rcar-vin.h index 793184d..af815cc 100644
>> --- a/drivers/media/platform/rcar-vin/rcar-vin.h
>> +++ b/drivers/media/platform/rcar-vin/rcar-vin.h
>> @@ -121,6 +121,7 @@ struct rvin_dev {
>>  struct video_device vdev;
>>  struct v4l2_device v4l2_dev;
>>  int src_pad_idx;
>> +int sink_pad_idx;
>>  struct v4l2_ctrl_handler ctrl_handler;
>>  struct v4l2_async_notifier notifier;
>>  struct rvin_graph_entity digital;
> 


Re: [PATCH v8 1/2] media: adv7604: automatic "default-input" selection

2016-09-15 Thread Laurent Pinchart
Hi Ulrich,

Thank you for the patch.

On Thursday 15 Sep 2016 15:24:07 Ulrich Hecht wrote:
> Fall back to input 0 if "default-input" property is not present.
> 
> Additionally, documentation in commit bf9c82278c34 ("[media]
> media: adv7604: ability to read default input port from DT") states
> that the "default-input" property should reside directly in the node
> for adv7612.

Actually it doesn't. The DT bindings specifies "default-input" as an endpoint 
property, even though the example sets it in the device node. That's 
inconsistent so the DT bindings document should be fixed. I believe the 
property should be set in the device node, it doesn't make much sense to have 
different default inputs per port.

> Hence, also adjust the parsing to make the implementation
> consistent with this.
> 
> Based on patch by William Towle .
> 
> Signed-off-by: Ulrich Hecht 
> ---
>  drivers/media/i2c/adv7604.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
> index 4003831..055c9df 100644
> --- a/drivers/media/i2c/adv7604.c
> +++ b/drivers/media/i2c/adv7604.c
> @@ -3077,10 +3077,13 @@ static int adv76xx_parse_dt(struct adv76xx_state
> *state) if (!of_property_read_u32(endpoint, "default-input", ))
>   state->pdata.default_input = v;
>   else
> - state->pdata.default_input = -1;
> + state->pdata.default_input = 0;
> 
>   of_node_put(endpoint);
> 
> + if (!of_property_read_u32(np, "default-input", ))
> + state->pdata.default_input = v;
> +
>   flags = bus_cfg.bus.parallel.flags;
> 
>   if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)

-- 
Regards,

Laurent Pinchart



Re: [PATCH v8 2/2] rcar-vin: implement EDID control ioctls

2016-09-15 Thread Laurent Pinchart
Hi Ulrich,

Thank you for the patch.

On Thursday 15 Sep 2016 15:24:08 Ulrich Hecht wrote:
> Adds G_EDID and S_EDID.
> 
> Signed-off-by: Ulrich Hecht 
> ---
>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 42 ++
>  drivers/media/platform/rcar-vin/rcar-vin.h  |  1 +
>  2 files changed, 43 insertions(+)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> b/drivers/media/platform/rcar-vin/rcar-v4l2.c index 62ca7e3..f679182 100644
> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> @@ -557,6 +557,38 @@ static int rvin_dv_timings_cap(struct file *file, void
> *priv_fh, return ret;
>  }
> 
> +static int rvin_g_edid(struct file *file, void *fh, struct v4l2_edid *edid)
> +{
> + struct rvin_dev *vin = video_drvdata(file);
> + struct v4l2_subdev *sd = vin_to_source(vin);
> + int input, ret;
> +
> + input = edid->pad;
> + edid->pad = vin->sink_pad_idx;
> +
> + ret = v4l2_subdev_call(sd, pad, get_edid, edid);
> +
> + edid->pad = input;
> +
> + return ret;
> +}
> +
> +static int rvin_s_edid(struct file *file, void *fh, struct v4l2_edid *edid)
> +{
> + struct rvin_dev *vin = video_drvdata(file);
> + struct v4l2_subdev *sd = vin_to_source(vin);
> + int input, ret;
> +
> + input = edid->pad;
> + edid->pad = vin->sink_pad_idx;
> +
> + ret = v4l2_subdev_call(sd, pad, set_edid, edid);
> +
> + edid->pad = input;
> +
> + return ret;
> +}
> +
>  static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
>   .vidioc_querycap= rvin_querycap,
>   .vidioc_try_fmt_vid_cap = rvin_try_fmt_vid_cap,
> @@ -579,6 +611,9 @@ static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
>   .vidioc_s_dv_timings= rvin_s_dv_timings,
>   .vidioc_query_dv_timings= rvin_query_dv_timings,
> 
> + .vidioc_g_edid  = rvin_g_edid,
> + .vidioc_s_edid  = rvin_s_edid,
> +
>   .vidioc_querystd= rvin_querystd,
>   .vidioc_g_std   = rvin_g_std,
>   .vidioc_s_std   = rvin_s_std,
> @@ -832,6 +867,13 @@ int rvin_v4l2_probe(struct rvin_dev *vin)
>   vin->src_pad_idx = pad_idx;
>   fmt.pad = vin->src_pad_idx;
> 
> + vin->sink_pad_idx = 0;
> + for (pad_idx = 0; pad_idx < sd->entity.num_pads; pad_idx++)
> + if (sd->entity.pads[pad_idx].flags == MEDIA_PAD_FL_SINK) {
> + vin->sink_pad_idx = pad_idx;
> + break;
> + }
> +

What if the subdev has multiple sink pads ? Shouldn't the pad number be 
instead computed in the get and set EDID handlers based on the input number 
passed in the struct v4l2_edid::pad field ?

>   /* Try to improve our guess of a reasonable window format */
>   ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, );
>   if (ret) {
> diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h
> b/drivers/media/platform/rcar-vin/rcar-vin.h index 793184d..af815cc 100644
> --- a/drivers/media/platform/rcar-vin/rcar-vin.h
> +++ b/drivers/media/platform/rcar-vin/rcar-vin.h
> @@ -121,6 +121,7 @@ struct rvin_dev {
>   struct video_device vdev;
>   struct v4l2_device v4l2_dev;
>   int src_pad_idx;
> + int sink_pad_idx;
>   struct v4l2_ctrl_handler ctrl_handler;
>   struct v4l2_async_notifier notifier;
>   struct rvin_graph_entity digital;

-- 
Regards,

Laurent Pinchart



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

2016-09-15 Thread Vinod Koul
On Wed, Aug 10, 2016 at 11:07:10PM +0530, Vinod Koul wrote:
> On Wed, Aug 10, 2016 at 01:22:13PM +0200, Niklas Söderlund wrote:
> > 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.8-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.
> 
> As I said in last one, the dmaengine parts look fine to me. But to go thru
> dmaengine tree I would need ACK on non dmaengine patches.

I havent heard back from this one and I am inclined to merge this one now.
If anyone has any objects, please speak up now...

Also ACKs welcome...

-- 
~Vinod


Re: [PATCH v8 2/2] rcar-vin: implement EDID control ioctls

2016-09-15 Thread Hans Verkuil
I've added patch v8 1/2 here as well. All I need is a correct patch 2/2 on top 
of
this. If you can do this tomorrow morning, then it will get into 4.9.

Hans

On 09/15/2016 04:02 PM, Hans Verkuil wrote:
> Hi Ulrich,
> 
> A patch series on top of my tree with Niklas' patches already merged:
> 
> https://git.linuxtv.org/hverkuil/media_tree.git/log/?h=rcar
> 
> would be ideal. Since otherwise I have to resolve a conflict.
> 
> Regards,
> 
>   Hans
> 
> On 09/15/2016 03:59 PM, Niklas Söderlund wrote:
>> Hi Ulrich,
>>
>> Thanks for your patch.
>>
>> Can you append another patch ontop of this one whit the following 
>> change:
>>
>> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
>> b/drivers/media/platform/rcar-vin/rcar-v4l2.c
>> index ac26738..7ba728d 100644
>> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
>> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
>> @@ -494,7 +494,7 @@ static int rvin_enum_dv_timings(struct file *file, void 
>> *priv_fh,
>> int pad, ret;
>>  
>> pad = timings->pad;
>> -   timings->pad = vin->src_pad_idx;
>> +   timings->pad = vin->sink_pad_idx;
>>  
>> ret = v4l2_subdev_call(sd, pad, enum_dv_timings, timings);
>>  
>> @@ -548,7 +548,7 @@ static int rvin_dv_timings_cap(struct file *file, void 
>> *priv_fh,
>> int pad, ret;
>>  
>> pad = cap->pad;
>> -   cap->pad = vin->src_pad_idx;
>> +   cap->pad = vin->sink_pad_idx;
>>  
>> ret = v4l2_subdev_call(sd, pad, dv_timings_cap, cap);
>>
>>
>> Whit that change the driver pass v4l2-compliance check for the HDMI 
>> input on Koelsch for me.
>>
>> On 2016-09-15 15:24:08 +0200, Ulrich Hecht wrote:
>>> Adds G_EDID and S_EDID.
>>>
>>> Signed-off-by: Ulrich Hecht 
>>> ---
>>>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 42 
>>> +
>>>  drivers/media/platform/rcar-vin/rcar-vin.h  |  1 +
>>>  2 files changed, 43 insertions(+)
>>>
>>> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
>>> b/drivers/media/platform/rcar-vin/rcar-v4l2.c
>>> index 62ca7e3..f679182 100644
>>> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
>>> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
>>> @@ -557,6 +557,38 @@ static int rvin_dv_timings_cap(struct file *file, void 
>>> *priv_fh,
>>> return ret;
>>>  }
>>>  
>>> +static int rvin_g_edid(struct file *file, void *fh, struct v4l2_edid *edid)
>>> +{
>>> +   struct rvin_dev *vin = video_drvdata(file);
>>> +   struct v4l2_subdev *sd = vin_to_source(vin);
>>> +   int input, ret;
>>> +
>>> +   input = edid->pad;
>>> +   edid->pad = vin->sink_pad_idx;
>>> +
>>> +   ret = v4l2_subdev_call(sd, pad, get_edid, edid);
>>> +
>>> +   edid->pad = input;
>>> +
>>> +   return ret;
>>> +}
>>> +
>>> +static int rvin_s_edid(struct file *file, void *fh, struct v4l2_edid *edid)
>>> +{
>>> +   struct rvin_dev *vin = video_drvdata(file);
>>> +   struct v4l2_subdev *sd = vin_to_source(vin);
>>> +   int input, ret;
>>> +
>>> +   input = edid->pad;
>>> +   edid->pad = vin->sink_pad_idx;
>>> +
>>> +   ret = v4l2_subdev_call(sd, pad, set_edid, edid);
>>> +
>>> +   edid->pad = input;
>>> +
>>> +   return ret;
>>> +}
>>> +
>>>  static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
>>> .vidioc_querycap= rvin_querycap,
>>> .vidioc_try_fmt_vid_cap = rvin_try_fmt_vid_cap,
>>> @@ -579,6 +611,9 @@ static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
>>> .vidioc_s_dv_timings= rvin_s_dv_timings,
>>> .vidioc_query_dv_timings= rvin_query_dv_timings,
>>>  
>>> +   .vidioc_g_edid  = rvin_g_edid,
>>> +   .vidioc_s_edid  = rvin_s_edid,
>>> +
>>> .vidioc_querystd= rvin_querystd,
>>> .vidioc_g_std   = rvin_g_std,
>>> .vidioc_s_std   = rvin_s_std,
>>> @@ -832,6 +867,13 @@ int rvin_v4l2_probe(struct rvin_dev *vin)
>>> vin->src_pad_idx = pad_idx;
>>> fmt.pad = vin->src_pad_idx;
>>>  
>>> +   vin->sink_pad_idx = 0;
>>> +   for (pad_idx = 0; pad_idx < sd->entity.num_pads; pad_idx++)
>>> +   if (sd->entity.pads[pad_idx].flags == MEDIA_PAD_FL_SINK) {
>>> +   vin->sink_pad_idx = pad_idx;
>>> +   break;
>>> +   }
>>> +
>>> /* Try to improve our guess of a reasonable window format */
>>> ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, );
>>> if (ret) {
>>> diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h 
>>> b/drivers/media/platform/rcar-vin/rcar-vin.h
>>> index 793184d..af815cc 100644
>>> --- a/drivers/media/platform/rcar-vin/rcar-vin.h
>>> +++ b/drivers/media/platform/rcar-vin/rcar-vin.h
>>> @@ -121,6 +121,7 @@ struct rvin_dev {
>>> struct video_device vdev;
>>> struct v4l2_device v4l2_dev;
>>> int src_pad_idx;
>>> +   int sink_pad_idx;
>>
>> sink_pad_idx should be documented in the comment above the struct. If 
>> you fix that feel free to add my:
>>
>> Acked-by: Niklas 

Re: [PATCH v8 2/2] rcar-vin: implement EDID control ioctls

2016-09-15 Thread Hans Verkuil
Hi Ulrich,

A patch series on top of my tree with Niklas' patches already merged:

https://git.linuxtv.org/hverkuil/media_tree.git/log/?h=rcar

would be ideal. Since otherwise I have to resolve a conflict.

Regards,

Hans

On 09/15/2016 03:59 PM, Niklas Söderlund wrote:
> Hi Ulrich,
> 
> Thanks for your patch.
> 
> Can you append another patch ontop of this one whit the following 
> change:
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
> b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> index ac26738..7ba728d 100644
> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> @@ -494,7 +494,7 @@ static int rvin_enum_dv_timings(struct file *file, void 
> *priv_fh,
> int pad, ret;
>  
> pad = timings->pad;
> -   timings->pad = vin->src_pad_idx;
> +   timings->pad = vin->sink_pad_idx;
>  
> ret = v4l2_subdev_call(sd, pad, enum_dv_timings, timings);
>  
> @@ -548,7 +548,7 @@ static int rvin_dv_timings_cap(struct file *file, void 
> *priv_fh,
> int pad, ret;
>  
> pad = cap->pad;
> -   cap->pad = vin->src_pad_idx;
> +   cap->pad = vin->sink_pad_idx;
>  
> ret = v4l2_subdev_call(sd, pad, dv_timings_cap, cap);
> 
> 
> Whit that change the driver pass v4l2-compliance check for the HDMI 
> input on Koelsch for me.
> 
> On 2016-09-15 15:24:08 +0200, Ulrich Hecht wrote:
>> Adds G_EDID and S_EDID.
>>
>> Signed-off-by: Ulrich Hecht 
>> ---
>>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 42 
>> +
>>  drivers/media/platform/rcar-vin/rcar-vin.h  |  1 +
>>  2 files changed, 43 insertions(+)
>>
>> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
>> b/drivers/media/platform/rcar-vin/rcar-v4l2.c
>> index 62ca7e3..f679182 100644
>> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
>> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
>> @@ -557,6 +557,38 @@ static int rvin_dv_timings_cap(struct file *file, void 
>> *priv_fh,
>>  return ret;
>>  }
>>  
>> +static int rvin_g_edid(struct file *file, void *fh, struct v4l2_edid *edid)
>> +{
>> +struct rvin_dev *vin = video_drvdata(file);
>> +struct v4l2_subdev *sd = vin_to_source(vin);
>> +int input, ret;
>> +
>> +input = edid->pad;
>> +edid->pad = vin->sink_pad_idx;
>> +
>> +ret = v4l2_subdev_call(sd, pad, get_edid, edid);
>> +
>> +edid->pad = input;
>> +
>> +return ret;
>> +}
>> +
>> +static int rvin_s_edid(struct file *file, void *fh, struct v4l2_edid *edid)
>> +{
>> +struct rvin_dev *vin = video_drvdata(file);
>> +struct v4l2_subdev *sd = vin_to_source(vin);
>> +int input, ret;
>> +
>> +input = edid->pad;
>> +edid->pad = vin->sink_pad_idx;
>> +
>> +ret = v4l2_subdev_call(sd, pad, set_edid, edid);
>> +
>> +edid->pad = input;
>> +
>> +return ret;
>> +}
>> +
>>  static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
>>  .vidioc_querycap= rvin_querycap,
>>  .vidioc_try_fmt_vid_cap = rvin_try_fmt_vid_cap,
>> @@ -579,6 +611,9 @@ static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
>>  .vidioc_s_dv_timings= rvin_s_dv_timings,
>>  .vidioc_query_dv_timings= rvin_query_dv_timings,
>>  
>> +.vidioc_g_edid  = rvin_g_edid,
>> +.vidioc_s_edid  = rvin_s_edid,
>> +
>>  .vidioc_querystd= rvin_querystd,
>>  .vidioc_g_std   = rvin_g_std,
>>  .vidioc_s_std   = rvin_s_std,
>> @@ -832,6 +867,13 @@ int rvin_v4l2_probe(struct rvin_dev *vin)
>>  vin->src_pad_idx = pad_idx;
>>  fmt.pad = vin->src_pad_idx;
>>  
>> +vin->sink_pad_idx = 0;
>> +for (pad_idx = 0; pad_idx < sd->entity.num_pads; pad_idx++)
>> +if (sd->entity.pads[pad_idx].flags == MEDIA_PAD_FL_SINK) {
>> +vin->sink_pad_idx = pad_idx;
>> +break;
>> +}
>> +
>>  /* Try to improve our guess of a reasonable window format */
>>  ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, );
>>  if (ret) {
>> diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h 
>> b/drivers/media/platform/rcar-vin/rcar-vin.h
>> index 793184d..af815cc 100644
>> --- a/drivers/media/platform/rcar-vin/rcar-vin.h
>> +++ b/drivers/media/platform/rcar-vin/rcar-vin.h
>> @@ -121,6 +121,7 @@ struct rvin_dev {
>>  struct video_device vdev;
>>  struct v4l2_device v4l2_dev;
>>  int src_pad_idx;
>> +int sink_pad_idx;
> 
> sink_pad_idx should be documented in the comment above the struct. If 
> you fix that feel free to add my:
> 
> Acked-by: Niklas Söderlund 
> 
>>  struct v4l2_ctrl_handler ctrl_handler;
>>  struct v4l2_async_notifier notifier;
>>  struct rvin_graph_entity digital;
>> -- 
>> 2.9.3
>>
> 


Re: [PATCH v8 2/2] rcar-vin: implement EDID control ioctls

2016-09-15 Thread Niklas Söderlund
Hi Ulrich,

Thanks for your patch.

Can you append another patch ontop of this one whit the following 
change:

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index ac26738..7ba728d 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -494,7 +494,7 @@ static int rvin_enum_dv_timings(struct file *file, void 
*priv_fh,
int pad, ret;
 
pad = timings->pad;
-   timings->pad = vin->src_pad_idx;
+   timings->pad = vin->sink_pad_idx;
 
ret = v4l2_subdev_call(sd, pad, enum_dv_timings, timings);
 
@@ -548,7 +548,7 @@ static int rvin_dv_timings_cap(struct file *file, void 
*priv_fh,
int pad, ret;
 
pad = cap->pad;
-   cap->pad = vin->src_pad_idx;
+   cap->pad = vin->sink_pad_idx;
 
ret = v4l2_subdev_call(sd, pad, dv_timings_cap, cap);


Whit that change the driver pass v4l2-compliance check for the HDMI 
input on Koelsch for me.

On 2016-09-15 15:24:08 +0200, Ulrich Hecht wrote:
> Adds G_EDID and S_EDID.
> 
> Signed-off-by: Ulrich Hecht 
> ---
>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 42 
> +
>  drivers/media/platform/rcar-vin/rcar-vin.h  |  1 +
>  2 files changed, 43 insertions(+)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
> b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> index 62ca7e3..f679182 100644
> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> @@ -557,6 +557,38 @@ static int rvin_dv_timings_cap(struct file *file, void 
> *priv_fh,
>   return ret;
>  }
>  
> +static int rvin_g_edid(struct file *file, void *fh, struct v4l2_edid *edid)
> +{
> + struct rvin_dev *vin = video_drvdata(file);
> + struct v4l2_subdev *sd = vin_to_source(vin);
> + int input, ret;
> +
> + input = edid->pad;
> + edid->pad = vin->sink_pad_idx;
> +
> + ret = v4l2_subdev_call(sd, pad, get_edid, edid);
> +
> + edid->pad = input;
> +
> + return ret;
> +}
> +
> +static int rvin_s_edid(struct file *file, void *fh, struct v4l2_edid *edid)
> +{
> + struct rvin_dev *vin = video_drvdata(file);
> + struct v4l2_subdev *sd = vin_to_source(vin);
> + int input, ret;
> +
> + input = edid->pad;
> + edid->pad = vin->sink_pad_idx;
> +
> + ret = v4l2_subdev_call(sd, pad, set_edid, edid);
> +
> + edid->pad = input;
> +
> + return ret;
> +}
> +
>  static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
>   .vidioc_querycap= rvin_querycap,
>   .vidioc_try_fmt_vid_cap = rvin_try_fmt_vid_cap,
> @@ -579,6 +611,9 @@ static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
>   .vidioc_s_dv_timings= rvin_s_dv_timings,
>   .vidioc_query_dv_timings= rvin_query_dv_timings,
>  
> + .vidioc_g_edid  = rvin_g_edid,
> + .vidioc_s_edid  = rvin_s_edid,
> +
>   .vidioc_querystd= rvin_querystd,
>   .vidioc_g_std   = rvin_g_std,
>   .vidioc_s_std   = rvin_s_std,
> @@ -832,6 +867,13 @@ int rvin_v4l2_probe(struct rvin_dev *vin)
>   vin->src_pad_idx = pad_idx;
>   fmt.pad = vin->src_pad_idx;
>  
> + vin->sink_pad_idx = 0;
> + for (pad_idx = 0; pad_idx < sd->entity.num_pads; pad_idx++)
> + if (sd->entity.pads[pad_idx].flags == MEDIA_PAD_FL_SINK) {
> + vin->sink_pad_idx = pad_idx;
> + break;
> + }
> +
>   /* Try to improve our guess of a reasonable window format */
>   ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, );
>   if (ret) {
> diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h 
> b/drivers/media/platform/rcar-vin/rcar-vin.h
> index 793184d..af815cc 100644
> --- a/drivers/media/platform/rcar-vin/rcar-vin.h
> +++ b/drivers/media/platform/rcar-vin/rcar-vin.h
> @@ -121,6 +121,7 @@ struct rvin_dev {
>   struct video_device vdev;
>   struct v4l2_device v4l2_dev;
>   int src_pad_idx;
> + int sink_pad_idx;

sink_pad_idx should be documented in the comment above the struct. If 
you fix that feel free to add my:

Acked-by: Niklas Söderlund 

>   struct v4l2_ctrl_handler ctrl_handler;
>   struct v4l2_async_notifier notifier;
>   struct rvin_graph_entity digital;
> -- 
> 2.9.3
> 

-- 
Regards,
Niklas Söderlund


Re: [PATCH v8 0/2] rcar-vin EDID control ioctls

2016-09-15 Thread Ulrich Hecht
On Thu, Sep 15, 2016 at 3:25 PM, Hans Verkuil  wrote:
> On 09/15/2016 03:24 PM, Ulrich Hecht wrote:
>>
>> Hi!
>>
>> This is a spinoff of "Lager/Koelsch board HDMI input support" that
>> excludes
>> the DT portions, and that works without the unmerged subdevice abstraction
>> layer.
>
>
> Are you going to post another patch series for the DT portions?

Yes, but not today.

CU
Uli


Re: [PATCH v8 0/2] rcar-vin EDID control ioctls

2016-09-15 Thread Hans Verkuil

On 09/15/2016 03:24 PM, Ulrich Hecht wrote:

Hi!

This is a spinoff of "Lager/Koelsch board HDMI input support" that excludes
the DT portions, and that works without the unmerged subdevice abstraction
layer.


Are you going to post another patch series for the DT portions?

Regards,

Hans



This revision improves over v7 from earlier today in that it does not break
analog input devices...

CU
Uli


Changes since v7:
- do not fail if there is no sink pad

Changes since v6:
- work without subdev abstraction layer
- split off DT parts, to be handled separately

Changes since v5:
- implement vin/subdev pad translation
- move i2c devices

Changes since v4:
- drop merged patches
- adv7604: always fall back to input 0 if nothing else is specified
- rcar-vin: implement G_EDID, S_EDID in place of hard-coded EDID blob

Changes since v3:
- rvin_enum_dv_timings(): use vin->src_pad_idx
- rvin_dv_timings_cap(): likewise
- rvin_s_dv_timings(): update vin->format
- add Koelsch support

Changes since v2:
- rebased on top of rcar-vin driver v4
- removed "adv7604: fix SPA register location for ADV7612" (picked up)
- changed prefix of dts patch to "ARM: dts: lager: "


Ulrich Hecht (2):
  media: adv7604: automatic "default-input" selection
  rcar-vin: implement EDID control ioctls

 drivers/media/i2c/adv7604.c |  5 +++-
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 42 +
 drivers/media/platform/rcar-vin/rcar-vin.h  |  1 +
 3 files changed, 47 insertions(+), 1 deletion(-)





[PATCH v8 2/2] rcar-vin: implement EDID control ioctls

2016-09-15 Thread Ulrich Hecht
Adds G_EDID and S_EDID.

Signed-off-by: Ulrich Hecht 
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 42 +
 drivers/media/platform/rcar-vin/rcar-vin.h  |  1 +
 2 files changed, 43 insertions(+)

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 62ca7e3..f679182 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -557,6 +557,38 @@ static int rvin_dv_timings_cap(struct file *file, void 
*priv_fh,
return ret;
 }
 
+static int rvin_g_edid(struct file *file, void *fh, struct v4l2_edid *edid)
+{
+   struct rvin_dev *vin = video_drvdata(file);
+   struct v4l2_subdev *sd = vin_to_source(vin);
+   int input, ret;
+
+   input = edid->pad;
+   edid->pad = vin->sink_pad_idx;
+
+   ret = v4l2_subdev_call(sd, pad, get_edid, edid);
+
+   edid->pad = input;
+
+   return ret;
+}
+
+static int rvin_s_edid(struct file *file, void *fh, struct v4l2_edid *edid)
+{
+   struct rvin_dev *vin = video_drvdata(file);
+   struct v4l2_subdev *sd = vin_to_source(vin);
+   int input, ret;
+
+   input = edid->pad;
+   edid->pad = vin->sink_pad_idx;
+
+   ret = v4l2_subdev_call(sd, pad, set_edid, edid);
+
+   edid->pad = input;
+
+   return ret;
+}
+
 static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
.vidioc_querycap= rvin_querycap,
.vidioc_try_fmt_vid_cap = rvin_try_fmt_vid_cap,
@@ -579,6 +611,9 @@ static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
.vidioc_s_dv_timings= rvin_s_dv_timings,
.vidioc_query_dv_timings= rvin_query_dv_timings,
 
+   .vidioc_g_edid  = rvin_g_edid,
+   .vidioc_s_edid  = rvin_s_edid,
+
.vidioc_querystd= rvin_querystd,
.vidioc_g_std   = rvin_g_std,
.vidioc_s_std   = rvin_s_std,
@@ -832,6 +867,13 @@ int rvin_v4l2_probe(struct rvin_dev *vin)
vin->src_pad_idx = pad_idx;
fmt.pad = vin->src_pad_idx;
 
+   vin->sink_pad_idx = 0;
+   for (pad_idx = 0; pad_idx < sd->entity.num_pads; pad_idx++)
+   if (sd->entity.pads[pad_idx].flags == MEDIA_PAD_FL_SINK) {
+   vin->sink_pad_idx = pad_idx;
+   break;
+   }
+
/* Try to improve our guess of a reasonable window format */
ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, );
if (ret) {
diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h 
b/drivers/media/platform/rcar-vin/rcar-vin.h
index 793184d..af815cc 100644
--- a/drivers/media/platform/rcar-vin/rcar-vin.h
+++ b/drivers/media/platform/rcar-vin/rcar-vin.h
@@ -121,6 +121,7 @@ struct rvin_dev {
struct video_device vdev;
struct v4l2_device v4l2_dev;
int src_pad_idx;
+   int sink_pad_idx;
struct v4l2_ctrl_handler ctrl_handler;
struct v4l2_async_notifier notifier;
struct rvin_graph_entity digital;
-- 
2.9.3



[PATCH v8 1/2] media: adv7604: automatic "default-input" selection

2016-09-15 Thread Ulrich Hecht
Fall back to input 0 if "default-input" property is not present.

Additionally, documentation in commit bf9c82278c34 ("[media]
media: adv7604: ability to read default input port from DT") states
that the "default-input" property should reside directly in the node
for adv7612. Hence, also adjust the parsing to make the implementation
consistent with this.

Based on patch by William Towle .

Signed-off-by: Ulrich Hecht 
---
 drivers/media/i2c/adv7604.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index 4003831..055c9df 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -3077,10 +3077,13 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
if (!of_property_read_u32(endpoint, "default-input", ))
state->pdata.default_input = v;
else
-   state->pdata.default_input = -1;
+   state->pdata.default_input = 0;
 
of_node_put(endpoint);
 
+   if (!of_property_read_u32(np, "default-input", ))
+   state->pdata.default_input = v;
+
flags = bus_cfg.bus.parallel.flags;
 
if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)
-- 
2.9.3



[PATCH v8 0/2] rcar-vin EDID control ioctls

2016-09-15 Thread Ulrich Hecht
Hi!

This is a spinoff of "Lager/Koelsch board HDMI input support" that excludes
the DT portions, and that works without the unmerged subdevice abstraction
layer.

This revision improves over v7 from earlier today in that it does not break
analog input devices...

CU
Uli


Changes since v7:
- do not fail if there is no sink pad

Changes since v6:
- work without subdev abstraction layer
- split off DT parts, to be handled separately

Changes since v5:
- implement vin/subdev pad translation
- move i2c devices

Changes since v4:
- drop merged patches
- adv7604: always fall back to input 0 if nothing else is specified
- rcar-vin: implement G_EDID, S_EDID in place of hard-coded EDID blob

Changes since v3:
- rvin_enum_dv_timings(): use vin->src_pad_idx
- rvin_dv_timings_cap(): likewise
- rvin_s_dv_timings(): update vin->format
- add Koelsch support

Changes since v2:
- rebased on top of rcar-vin driver v4
- removed "adv7604: fix SPA register location for ADV7612" (picked up)
- changed prefix of dts patch to "ARM: dts: lager: "


Ulrich Hecht (2):
  media: adv7604: automatic "default-input" selection
  rcar-vin: implement EDID control ioctls

 drivers/media/i2c/adv7604.c |  5 +++-
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 42 +
 drivers/media/platform/rcar-vin/rcar-vin.h  |  1 +
 3 files changed, 47 insertions(+), 1 deletion(-)

-- 
2.9.3



Re: [PATCH] [media] MAINTAINERS: Add entry for the Renesas VIN driver

2016-09-15 Thread Simon Horman
On Thu, Sep 15, 2016 at 03:22:38PM +0300, Laurent Pinchart wrote:
> Hi Niklas,
> 
> Thank you for the patch.
> 
> On Thursday 15 Sep 2016 14:18:36 Niklas Söderlund wrote:
> > The driver is maintained and supported, document it as such.
> > 
> > Signed-off-by: Niklas Söderlund 
> 
> Acked-by: Laurent Pinchart 

I like this a lot:

Acked-by: Simon Horman 


Re: [PATCH] [media] MAINTAINERS: Add entry for the Renesas VIN driver

2016-09-15 Thread Laurent Pinchart
Hi Niklas,

Thank you for the patch.

On Thursday 15 Sep 2016 14:18:36 Niklas Söderlund wrote:
> The driver is maintained and supported, document it as such.
> 
> Signed-off-by: Niklas Söderlund 

Acked-by: Laurent Pinchart 

> ---
>  MAINTAINERS | 9 +
>  1 file changed, 9 insertions(+)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index a12cd60..a4b5283 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -7523,6 +7523,15 @@
> F:Documentation/devicetree/bindings/media/renesas,fcp.txt
> F:drivers/media/platform/rcar-fcp.c
>  F:   include/media/rcar-fcp.h
> 
> +MEDIA DRIVERS FOR RENESAS - VIN
> +M:   Niklas Söderlund 
> +L:   linux-me...@vger.kernel.org
> +L:   linux-renesas-soc@vger.kernel.org
> +T:   git git://linuxtv.org/media_tree.git
> +S:   Supported
> +F:   Documentation/devicetree/bindings/media/rcar_vin.txt
> +F:   drivers/media/platform/rcar-vin/
> +
>  MEDIA DRIVERS FOR RENESAS - VSP1
>  M:   Laurent Pinchart 
>  L:   linux-me...@vger.kernel.org

-- 
Regards,

Laurent Pinchart



[PATCH v7 0/2] rcar-vin EDID control ioctls

2016-09-15 Thread Ulrich Hecht
Hi!

This is a spinoff of "Lager/Koelsch board HDMI input support" that excludes
the DT portions, and that works without the unmerged subdevice abstraction
layer.

CU
Uli


Changes since v6:
- work without subdev abstraction layer
- split off DT parts, to be handled separately

Changes since v5:
- implement vin/subdev pad translation
- move i2c devices

Changes since v4:
- drop merged patches
- adv7604: always fall back to input 0 if nothing else is specified
- rcar-vin: implement G_EDID, S_EDID in place of hard-coded EDID blob

Changes since v3:
- rvin_enum_dv_timings(): use vin->src_pad_idx
- rvin_dv_timings_cap(): likewise
- rvin_s_dv_timings(): update vin->format
- add Koelsch support

Changes since v2:
- rebased on top of rcar-vin driver v4
- removed "adv7604: fix SPA register location for ADV7612" (picked up)
- changed prefix of dts patch to "ARM: dts: lager: "


Ulrich Hecht (2):
  media: adv7604: automatic "default-input" selection
  rcar-vin: implement EDID control ioctls

 drivers/media/i2c/adv7604.c |  5 +++-
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 44 +
 drivers/media/platform/rcar-vin/rcar-vin.h  |  1 +
 3 files changed, 49 insertions(+), 1 deletion(-)

-- 
2.9.3



[PATCH v7 2/2] rcar-vin: implement EDID control ioctls

2016-09-15 Thread Ulrich Hecht
Adds G_EDID and S_EDID.

Signed-off-by: Ulrich Hecht 
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 44 +
 drivers/media/platform/rcar-vin/rcar-vin.h  |  1 +
 2 files changed, 45 insertions(+)

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 62ca7e3..ac26738 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -557,6 +557,38 @@ static int rvin_dv_timings_cap(struct file *file, void 
*priv_fh,
return ret;
 }
 
+static int rvin_g_edid(struct file *file, void *fh, struct v4l2_edid *edid)
+{
+   struct rvin_dev *vin = video_drvdata(file);
+   struct v4l2_subdev *sd = vin_to_source(vin);
+   int input, ret;
+
+   input = edid->pad;
+   edid->pad = vin->sink_pad_idx;
+
+   ret = v4l2_subdev_call(sd, pad, get_edid, edid);
+
+   edid->pad = input;
+
+   return ret;
+}
+
+static int rvin_s_edid(struct file *file, void *fh, struct v4l2_edid *edid)
+{
+   struct rvin_dev *vin = video_drvdata(file);
+   struct v4l2_subdev *sd = vin_to_source(vin);
+   int input, ret;
+
+   input = edid->pad;
+   edid->pad = vin->sink_pad_idx;
+
+   ret = v4l2_subdev_call(sd, pad, set_edid, edid);
+
+   edid->pad = input;
+
+   return ret;
+}
+
 static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
.vidioc_querycap= rvin_querycap,
.vidioc_try_fmt_vid_cap = rvin_try_fmt_vid_cap,
@@ -579,6 +611,9 @@ static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
.vidioc_s_dv_timings= rvin_s_dv_timings,
.vidioc_query_dv_timings= rvin_query_dv_timings,
 
+   .vidioc_g_edid  = rvin_g_edid,
+   .vidioc_s_edid  = rvin_s_edid,
+
.vidioc_querystd= rvin_querystd,
.vidioc_g_std   = rvin_g_std,
.vidioc_s_std   = rvin_s_std,
@@ -832,6 +867,15 @@ int rvin_v4l2_probe(struct rvin_dev *vin)
vin->src_pad_idx = pad_idx;
fmt.pad = vin->src_pad_idx;
 
+   vin->sink_pad_idx = 0;
+   for (pad_idx = 0; pad_idx < sd->entity.num_pads; pad_idx++)
+   if (sd->entity.pads[pad_idx].flags == MEDIA_PAD_FL_SINK)
+   break;
+   if (pad_idx >= sd->entity.num_pads)
+   return -EINVAL;
+
+   vin->sink_pad_idx = pad_idx;
+
/* Try to improve our guess of a reasonable window format */
ret = v4l2_subdev_call(sd, pad, get_fmt, NULL, );
if (ret) {
diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h 
b/drivers/media/platform/rcar-vin/rcar-vin.h
index 793184d..af815cc 100644
--- a/drivers/media/platform/rcar-vin/rcar-vin.h
+++ b/drivers/media/platform/rcar-vin/rcar-vin.h
@@ -121,6 +121,7 @@ struct rvin_dev {
struct video_device vdev;
struct v4l2_device v4l2_dev;
int src_pad_idx;
+   int sink_pad_idx;
struct v4l2_ctrl_handler ctrl_handler;
struct v4l2_async_notifier notifier;
struct rvin_graph_entity digital;
-- 
2.9.3



[PATCH v7 1/2] media: adv7604: automatic "default-input" selection

2016-09-15 Thread Ulrich Hecht
Fall back to input 0 if "default-input" property is not present.

Additionally, documentation in commit bf9c82278c34 ("[media]
media: adv7604: ability to read default input port from DT") states
that the "default-input" property should reside directly in the node
for adv7612. Hence, also adjust the parsing to make the implementation
consistent with this.

Based on patch by William Towle .

Signed-off-by: Ulrich Hecht 
---
 drivers/media/i2c/adv7604.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index 4003831..055c9df 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -3077,10 +3077,13 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
if (!of_property_read_u32(endpoint, "default-input", ))
state->pdata.default_input = v;
else
-   state->pdata.default_input = -1;
+   state->pdata.default_input = 0;
 
of_node_put(endpoint);
 
+   if (!of_property_read_u32(np, "default-input", ))
+   state->pdata.default_input = v;
+
flags = bus_cfg.bus.parallel.flags;
 
if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)
-- 
2.9.3



[PATCH] [media] MAINTAINERS: Add entry for the Renesas VIN driver

2016-09-15 Thread Niklas Söderlund
The driver is maintained and supported, document it as such.

Signed-off-by: Niklas Söderlund 
---
 MAINTAINERS | 9 +
 1 file changed, 9 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index a12cd60..a4b5283 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7523,6 +7523,15 @@ F:   
Documentation/devicetree/bindings/media/renesas,fcp.txt
 F: drivers/media/platform/rcar-fcp.c
 F: include/media/rcar-fcp.h
 
+MEDIA DRIVERS FOR RENESAS - VIN
+M: Niklas Söderlund 
+L: linux-me...@vger.kernel.org
+L: linux-renesas-soc@vger.kernel.org
+T: git git://linuxtv.org/media_tree.git
+S: Supported
+F: Documentation/devicetree/bindings/media/rcar_vin.txt
+F: drivers/media/platform/rcar-vin/
+
 MEDIA DRIVERS FOR RENESAS - VSP1
 M: Laurent Pinchart 
 L: linux-me...@vger.kernel.org
-- 
2.9.3



Re: [PATCH 0/4] tmio: add support for eMMC with 8 bit bus width

2016-09-15 Thread Geert Uytterhoeven
Hi Wolfram,

On Wed, Sep 14, 2016 at 7:05 PM, Wolfram Sang
 wrote:
> The DTS changes for R-Car Gen3 will come via a seperate series. Note that
> 'non-removable' is not supported yet because of Runtime PM issues. It seems we
> need to overhaul Runtime PM handling for other reasons as well, so I suggest
> the basic support goes in like this and DTS do not use 'non-removable' for 
> now.

DT describes the hardware, not current limitations of the software.
Hence IMHO you should add the "non-removable" property to the DTS, and
work around its non-functioning in software.

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 6/6] arm64: renesas: r8a7796: salvator-x: enable I2C

2016-09-15 Thread Geert Uytterhoeven
On Wed, Sep 14, 2016 at 6:46 PM, Ulrich Hecht
 wrote:
> Signed-off-by: Ulrich Hecht 

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


Re: [PATCH 5/6] arm64: renesas: r8a7796: Enable I2C DMA

2016-09-15 Thread Geert Uytterhoeven
Hi Ulrich,

On Wed, Sep 14, 2016 at 6:46 PM, Ulrich Hecht
 wrote:
> Signed-off-by: Ulrich Hecht 

Reviewed-by: Geert Uytterhoeven 

> ---
>  arch/arm64/boot/dts/renesas/r8a7796.dtsi | 14 ++
>  1 file changed, 14 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/renesas/r8a7796.dtsi 
> b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
> index a4d8b76..7c4d11c 100644
> --- a/arch/arm64/boot/dts/renesas/r8a7796.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
> @@ -257,6 +257,8 @@
> interrupts = ;
> clocks = < CPG_MOD 931>;
> power-domains = < R8A7796_PD_ALWAYS_ON>;
> +   dmas = < 0x91>, < 0x90>;
> +   dma-names = "tx", "rx";

Does the firmware on your r8a7796/salvator-x support using SYS-DMAC2?
(the one we have on r8a7795/salvator-x doesn't)
If yes, you may want to add those dmas, too.

> i2c-scl-internal-delay-ns = <110>;
> status = "disabled";
> };
> @@ -269,6 +271,8 @@
> interrupts = ;
> clocks = < CPG_MOD 930>;
> power-domains = < R8A7796_PD_ALWAYS_ON>;
> +   dmas = < 0x93>, < 0x92>;
> +   dma-names = "tx", "rx";

Likewise.

> i2c-scl-internal-delay-ns = <6>;
> status = "disabled";
> };
> @@ -281,6 +285,8 @@
> interrupts = ;
> clocks = < CPG_MOD 929>;
> power-domains = < R8A7796_PD_ALWAYS_ON>;
> +   dmas = < 0x95>, < 0x94>;
> +   dma-names = "tx", "rx";

Likewise.

> i2c-scl-internal-delay-ns = <6>;
> status = "disabled";
> };

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 3/6] pinctrl: sh-pfc: r8a7796: add I2C pin support

2016-09-15 Thread Geert Uytterhoeven
On Wed, Sep 14, 2016 at 6:46 PM, Ulrich Hecht
 wrote:
> Signed-off-by: Ulrich Hecht 

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


Re: [PATCH 2/6] clk: renesas: r8a7796: Add I2C clocks

2016-09-15 Thread Geert Uytterhoeven
On Wed, Sep 14, 2016 at 6:46 PM, Ulrich Hecht
 wrote:
> Signed-off-by: Ulrich Hecht 

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


Re: [PATCH 1/6] i2c: rcar: add support for r8a7796 (R-Car M3-W)

2016-09-15 Thread Geert Uytterhoeven
On Wed, Sep 14, 2016 at 6:46 PM, Ulrich Hecht
 wrote:
> Same as r8a7795.
>
> Signed-off-by: Ulrich Hecht 

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


Re: [PATCH 3/3] dmaengine: rcar-dmac: Document R-Car M3-W bindings

2016-09-15 Thread Geert Uytterhoeven
On Wed, Sep 14, 2016 at 6:45 PM, Ulrich Hecht
 wrote:
> Signed-off-by: Ulrich Hecht 

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


Re: [PATCH 2/3] arm64: renesas: r8a7796: add SYS-DMAC controller nodes

2016-09-15 Thread Geert Uytterhoeven
On Wed, Sep 14, 2016 at 6:45 PM, Ulrich Hecht
 wrote:
> Signed-off-by: Ulrich Hecht 

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


Re: [PATCH 1/3] clk: renesas: r8a7796: Add SYS-DMAC clocks

2016-09-15 Thread Geert Uytterhoeven
On Wed, Sep 14, 2016 at 6:45 PM, Ulrich Hecht
 wrote:
> Signed-off-by: Ulrich Hecht 
> ---
>  drivers/clk/renesas/r8a7796-cpg-mssr.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/clk/renesas/r8a7796-cpg-mssr.c 
> b/drivers/clk/renesas/r8a7796-cpg-mssr.c
> index eb347ed..c02fe34 100644
> --- a/drivers/clk/renesas/r8a7796-cpg-mssr.c
> +++ b/drivers/clk/renesas/r8a7796-cpg-mssr.c
> @@ -109,6 +109,9 @@ static const struct cpg_core_clk r8a7796_core_clks[] 
> __initconst = {
>  };
>
>  static const struct mssr_mod_clk r8a7796_mod_clks[] __initconst = {
> +   DEF_MOD("sys-dmac2", 217,   R8A7796_CLK_S3D1),
> +   DEF_MOD("sys-dmac1", 218,   R8A7796_CLK_S3D1),
> +   DEF_MOD("sys-dmac0", 219,   R8A7796_CLK_S3D1),

It's not clear from the documentation what the actual parent clock is.
The datasheet says "ZS", which we know is S3D1 on H3.
However, Table 50.2 says ZS is S0D3 on M3-W (and H3 ES2.0)

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